mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-04 05:00:25 +08:00
健康检查支持UserAgent和是否基础请求设置
This commit is contained in:
@@ -18,7 +18,9 @@ Vue.component("health-check-config-box", {
|
|||||||
tryDelay: {count: 100, unit: "ms"},
|
tryDelay: {count: 100, unit: "ms"},
|
||||||
autoDown: true,
|
autoDown: true,
|
||||||
countUp: 1,
|
countUp: 1,
|
||||||
countDown: 3
|
countDown: 3,
|
||||||
|
userAgent: "",
|
||||||
|
onlyBasicRequest: false
|
||||||
}
|
}
|
||||||
let that = this
|
let that = this
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
@@ -72,7 +74,8 @@ Vue.component("health-check-config-box", {
|
|||||||
urlProtocol: urlProtocol,
|
urlProtocol: urlProtocol,
|
||||||
urlHost: urlHost,
|
urlHost: urlHost,
|
||||||
urlPort: urlPort,
|
urlPort: urlPort,
|
||||||
urlRequestURI: urlRequestURI
|
urlRequestURI: urlRequestURI,
|
||||||
|
urlIsEditing: healthCheckConfig.url.length == 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -142,6 +145,9 @@ Vue.component("health-check-config-box", {
|
|||||||
return status
|
return status
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
editURL: function () {
|
||||||
|
this.urlIsEditing = !this.urlIsEditing
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
template: `<div>
|
template: `<div>
|
||||||
@@ -162,41 +168,41 @@ Vue.component("health-check-config-box", {
|
|||||||
<tr>
|
<tr>
|
||||||
<td>URL *</td>
|
<td>URL *</td>
|
||||||
<td>
|
<td>
|
||||||
<table class="ui table">
|
<div v-if="healthCheck.url.length > 0" style="margin-bottom: 1em"><code-label>{{healthCheck.url}}</code-label> <a href="" @click.prevent="editURL"><span class="small">修改 <i class="icon angle" :class="{down: !urlIsEditing, up: urlIsEditing}"></i></span></a> </div>
|
||||||
<tr>
|
<div v-show="urlIsEditing">
|
||||||
<td class="title">协议</td>
|
<table class="ui table">
|
||||||
<td>
|
<tr>
|
||||||
<select class="ui dropdown auto-width" v-model="urlProtocol">
|
<td class="title">协议</td>
|
||||||
<option value="http">http://</option>
|
<td>
|
||||||
<option value="https">https://</option>
|
<select class="ui dropdown auto-width" v-model="urlProtocol">
|
||||||
</select>
|
<option value="http">http://</option>
|
||||||
</td>
|
<option value="https">https://</option>
|
||||||
</tr>
|
</select>
|
||||||
<tr>
|
</td>
|
||||||
<td>域名</td>
|
</tr>
|
||||||
<td>
|
<tr>
|
||||||
<input type="text" v-model="urlHost"/>
|
<td>域名</td>
|
||||||
<p class="comment">在此集群上可以访问到的一个域名。</p>
|
<td>
|
||||||
</td>
|
<input type="text" v-model="urlHost"/>
|
||||||
</tr>
|
<p class="comment">在此集群上可以访问到的一个域名。</p>
|
||||||
<tr>
|
</td>
|
||||||
<td>端口</td>
|
</tr>
|
||||||
<td>
|
<tr>
|
||||||
<input type="text" maxlength="5" style="width:5.4em" placeholder="端口" v-model="urlPort"/>
|
<td>端口</td>
|
||||||
</td>
|
<td>
|
||||||
</tr>
|
<input type="text" maxlength="5" style="width:5.4em" placeholder="端口" v-model="urlPort"/>
|
||||||
<tr>
|
</td>
|
||||||
<td>RequestURI</td>
|
</tr>
|
||||||
<td><input type="text" v-model="urlRequestURI" placeholder="/" style="width:20em"/></td>
|
<tr>
|
||||||
</tr>
|
<td>RequestURI</td>
|
||||||
</table>
|
<td><input type="text" v-model="urlRequestURI" placeholder="/" style="width:20em"/></td>
|
||||||
<div class="ui divider"></div>
|
</tr>
|
||||||
<p class="comment" v-if="healthCheck.url.length > 0">拼接后的URL:<code-label>{{healthCheck.url}}</code-label>,其中\${host}指的是域名。</p>
|
</table>
|
||||||
|
<div class="ui divider"></div>
|
||||||
|
<p class="comment" v-if="healthCheck.url.length > 0">拼接后的URL:<code-label>{{healthCheck.url}}</code-label>,其中\${host}指的是域名。</p>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>检测时间间隔</td>
|
<td>检测时间间隔</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -258,6 +264,20 @@ Vue.component("health-check-config-box", {
|
|||||||
<time-duration-box :v-value="healthCheck.tryDelay"></time-duration-box>
|
<time-duration-box :v-value="healthCheck.tryDelay"></time-duration-box>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>终端信息<em>(User-Agent)</em></td>
|
||||||
|
<td>
|
||||||
|
<input type="text" v-model="healthCheck.userAgent" maxlength="200"/>
|
||||||
|
<p class="comment">发送到服务器的User-Agent值,不填写表示使用默认值。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>只基础请求</td>
|
||||||
|
<td>
|
||||||
|
<checkbox v-model="healthCheck.onlyBasicRequest"></checkbox>
|
||||||
|
<p class="comment">只做基础的请求,不处理反向代理(不检查源站)、WAF等。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class="margin"></div>
|
<div class="margin"></div>
|
||||||
|
|||||||
Reference in New Issue
Block a user