diff --git a/web/public/js/components/node/node-ip-address-thresholds-box.js b/web/public/js/components/node/node-ip-address-thresholds-box.js index 99e8d418..f32ce50d 100644 --- a/web/public/js/components/node/node-ip-address-thresholds-box.js +++ b/web/public/js/components/node/node-ip-address-thresholds-box.js @@ -128,12 +128,26 @@ Vue.component("node-ip-address-thresholds-box", { }, confirmItem: function () { // 特殊阈值快速添加 - if (["nodeHealthCheckFailed"].$contains(this.itemCode)) { + if (["nodeHealthCheck"].$contains(this.itemCode)) { + if (this.itemValue.toString().length == 0) { + teaweb.warn("请选择检查结果") + return + } + + let value = parseInt(this.itemValue) + if (isNaN(value)) { + value = 0 + } else if (value < 0) { + value = 0 + } else if (value > 1) { + value = 1 + } + // 添加 this.addingThreshold.items.push({ item: this.itemCode, operator: this.itemOperator, - value: 0, + value: value, duration: 0, durationUnit: "minute", options: {} @@ -307,7 +321,7 @@ Vue.component("node-ip-address-thresholds-box", { } break case "webHook": - if (this.actionWebHookURL.length ==0) { + if (this.actionWebHookURL.length == 0) { teaweb.warn("请输入WebHook URL", function () { that.$refs.webHookURL.focus() }) @@ -351,12 +365,17 @@ Vue.component("node-ip-address-thresholds-box", {
{{item.description}}
+{{item.description}}
-只有状态发生改变的时候才会触发。
+