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.duration}}{{itemDurationUnitName(item.durationUnit)}}] {{itemName(item.item)}} - + + + 成功 + 失败 + + [{{group.name}}   ] @@ -389,12 +408,17 @@ Vue.component("node-ip-address-thresholds-box", {
- + [{{item.duration}}{{itemDurationUnitName(item.durationUnit)}}] {{itemName(item.item)}} - + + + 成功 + 失败 + + [{{group.name}}   ] [{{itemOperatorName(item.operator)}}] {{item.value}}{{itemUnitName(item.item)}} @@ -413,10 +437,10 @@ Vue.component("node-ip-address-thresholds-box", { -

{{item.description}}

+

{{item.description}}

- + 统计周期
@@ -425,7 +449,7 @@ Vue.component("node-ip-address-thresholds-box", {
- + 操作符 - + 对比值
@@ -442,6 +466,16 @@ Vue.component("node-ip-address-thresholds-box", {
+ + 检查结果 + + +

只有状态发生改变的时候才会触发。

+ + diff --git a/web/public/js/components/node/node-ip-address-thresholds-view.js b/web/public/js/components/node/node-ip-address-thresholds-view.js index 5844a1af..c84b3318 100644 --- a/web/public/js/components/node/node-ip-address-thresholds-view.js +++ b/web/public/js/components/node/node-ip-address-thresholds-view.js @@ -101,12 +101,17 @@ Vue.component("node-ip-address-thresholds-view", {
- + [{{item.duration}}{{itemDurationUnitName(item.durationUnit)}}] {{itemName(item.item)}} - + + + 成功 + 失败 + + [{{group.name}}   ]