From 04a6792dbf5cf627dde0502b6cab59dc3e1b7cf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Fri, 3 Nov 2023 11:00:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=8D=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E7=9A=84=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cluster/node/settings/thresholds/index.go | 62 ------------------- .../node/settings/thresholds/index.html | 41 ------------ .../cluster/node/settings/thresholds/index.js | 41 ------------ 3 files changed, 144 deletions(-) delete mode 100644 internal/web/actions/default/clusters/cluster/node/settings/thresholds/index.go delete mode 100644 web/views/@default/clusters/cluster/node/settings/thresholds/index.html delete mode 100644 web/views/@default/clusters/cluster/node/settings/thresholds/index.js diff --git a/internal/web/actions/default/clusters/cluster/node/settings/thresholds/index.go b/internal/web/actions/default/clusters/cluster/node/settings/thresholds/index.go deleted file mode 100644 index 1578394e..00000000 --- a/internal/web/actions/default/clusters/cluster/node/settings/thresholds/index.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved. - -package thresholds - -import ( - "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" - "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/node/nodeutils" - "github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs" - "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" - "github.com/iwind/TeaGo/maps" -) - -type IndexAction struct { - actionutils.ParentAction -} - -func (this *IndexAction) Init() { - this.Nav("", "node", "update") - this.SecondMenu("threshold") -} - -func (this *IndexAction) RunGet(params struct { - ClusterId int64 - NodeId int64 -}) { - _, err := nodeutils.InitNodeInfo(this.Parent(), params.NodeId) - if err != nil { - this.ErrorPage(err) - return - } - - this.Data["nodeId"] = params.NodeId - - // 列出所有阈值 - thresholdsResp, err := this.RPC().NodeThresholdRPC().FindAllEnabledNodeThresholds(this.AdminContext(), &pb.FindAllEnabledNodeThresholdsRequest{ - Role: "node", - NodeClusterId: params.ClusterId, - NodeId: params.NodeId, - }) - if err != nil { - this.ErrorPage(err) - return - } - - thresholdMaps := []maps.Map{} - for _, threshold := range thresholdsResp.NodeThresholds { - thresholdMaps = append(thresholdMaps, maps.Map{ - "id": threshold.Id, - "itemName": nodeconfigs.FindNodeValueItemName(threshold.Item), - "paramName": nodeconfigs.FindNodeValueItemParamName(threshold.Item, threshold.Param), - "operatorName": nodeconfigs.FindNodeValueOperatorName(threshold.Operator), - "value": nodeconfigs.UnmarshalNodeValue(threshold.ValueJSON), - "sumMethodName": nodeconfigs.FindNodeValueSumMethodName(threshold.SumMethod), - "duration": threshold.Duration, - "durationUnitName": nodeconfigs.FindNodeValueDurationUnitName(threshold.DurationUnit), - "isOn": threshold.IsOn, - }) - } - this.Data["thresholds"] = thresholdMaps - - this.Show() -} diff --git a/web/views/@default/clusters/cluster/node/settings/thresholds/index.html b/web/views/@default/clusters/cluster/node/settings/thresholds/index.html deleted file mode 100644 index 29a32290..00000000 --- a/web/views/@default/clusters/cluster/node/settings/thresholds/index.html +++ /dev/null @@ -1,41 +0,0 @@ -{$layout} -{$template "/clusters/cluster/node/node_menu"} -{$template "/left_menu_with_menu"} - -
- -
- - [添加阈值] - -
- -

暂时还没有设置阈值。

- - - - - - - - - - - - - - - - - - - - - -
监控项参数操作符对比值统计时间段状态操作
{{threshold.itemName}}{{threshold.paramName}}{{threshold.operatorName}}{{threshold.value}}{{threshold.duration}}{{threshold.durationUnitName}} - - - 修改   - 删除 -
-
\ No newline at end of file diff --git a/web/views/@default/clusters/cluster/node/settings/thresholds/index.js b/web/views/@default/clusters/cluster/node/settings/thresholds/index.js deleted file mode 100644 index 2260af76..00000000 --- a/web/views/@default/clusters/cluster/node/settings/thresholds/index.js +++ /dev/null @@ -1,41 +0,0 @@ -Tea.context(function () { - this.createThreshold = function () { - teaweb.popup(Tea.url("/clusters/cluster/settings/thresholds/createPopup", { - clusterId: this.clusterId, - nodeId: this.nodeId - }), { - callback: function () { - teaweb.success("保存成功", function () { - teaweb.reload() - }) - } - }) - } - - this.updateThreshold = function (thresholdId) { - teaweb.popup(Tea.url("/clusters/cluster/settings/thresholds/updatePopup", { - thresholdId: thresholdId - }), { - callback: function () { - teaweb.success("保存成功", function () { - teaweb.reload() - }) - } - }) - } - - this.deleteThreshold = function (thresholdId) { - let that = this - teaweb.confirm("确定要删除这个阈值吗?", function () { - that.$post("/clusters/cluster/settings/thresholds/delete") - .params({ - thresholdId: thresholdId - }) - .success(function () { - teaweb.success("删除成功", function () { - teaweb.reload() - }) - }) - }) - } -}) \ No newline at end of file