From eef2306a1ca6ee2894c7968f5b3c88fb584a41ec Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Tue, 14 Sep 2021 19:39:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=83=A8=E5=88=86=E5=91=BD?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/default/nodes/ipAddresses/createPopup.go | 2 +- .../default/nodes/ipAddresses/ipaddressutils/utils.go | 10 +++++----- .../actions/default/nodes/ipAddresses/updatePopup.go | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/web/actions/default/nodes/ipAddresses/createPopup.go b/internal/web/actions/default/nodes/ipAddresses/createPopup.go index 54644dee..c58bfa4f 100644 --- a/internal/web/actions/default/nodes/ipAddresses/createPopup.go +++ b/internal/web/actions/default/nodes/ipAddresses/createPopup.go @@ -45,7 +45,7 @@ func (this *CreatePopupAction) RunPost(params struct { } // 阈值设置 - var thresholds = []*nodeconfigs.NodeValueThresholdConfig{} + var thresholds = []*nodeconfigs.IPAddressThresholdConfig{} if teaconst.IsPlus && len(params.ThresholdsJSON) > 0 { _ = json.Unmarshal(params.ThresholdsJSON, &thresholds) } diff --git a/internal/web/actions/default/nodes/ipAddresses/ipaddressutils/utils.go b/internal/web/actions/default/nodes/ipAddresses/ipaddressutils/utils.go index b76b96d9..063b7b19 100644 --- a/internal/web/actions/default/nodes/ipAddresses/ipaddressutils/utils.go +++ b/internal/web/actions/default/nodes/ipAddresses/ipaddressutils/utils.go @@ -69,18 +69,18 @@ func UpdateNodeIPAddresses(parentAction *actionutils.ParentAction, nodeId int64, } // InitNodeIPAddressThresholds 初始化IP阈值 -func InitNodeIPAddressThresholds(parentAction *actionutils.ParentAction, addrId int64) ([]*nodeconfigs.NodeValueThresholdConfig, error) { +func InitNodeIPAddressThresholds(parentAction *actionutils.ParentAction, addrId int64) ([]*nodeconfigs.IPAddressThresholdConfig, error) { thresholdsResp, err := parentAction.RPC().NodeIPAddressThresholdRPC().FindAllEnabledNodeIPAddressThresholds(parentAction.AdminContext(), &pb.FindAllEnabledNodeIPAddressThresholdsRequest{NodeIPAddressId: addrId}) if err != nil { return nil, err } - var thresholds = []*nodeconfigs.NodeValueThresholdConfig{} + var thresholds = []*nodeconfigs.IPAddressThresholdConfig{} if len(thresholdsResp.NodeIPAddressThresholds) > 0 { for _, pbThreshold := range thresholdsResp.NodeIPAddressThresholds { - var threshold = &nodeconfigs.NodeValueThresholdConfig{ + var threshold = &nodeconfigs.IPAddressThresholdConfig{ Id: pbThreshold.Id, - Items: []*nodeconfigs.NodeValueThresholdItemConfig{}, - Actions: []*nodeconfigs.NodeValueThresholdActionConfig{}, + Items: []*nodeconfigs.IPAddressThresholdItemConfig{}, + Actions: []*nodeconfigs.IPAddressThresholdActionConfig{}, } if len(pbThreshold.ItemsJSON) > 0 { err = json.Unmarshal(pbThreshold.ItemsJSON, &threshold.Items) diff --git a/internal/web/actions/default/nodes/ipAddresses/updatePopup.go b/internal/web/actions/default/nodes/ipAddresses/updatePopup.go index 66f6ac0a..648075ff 100644 --- a/internal/web/actions/default/nodes/ipAddresses/updatePopup.go +++ b/internal/web/actions/default/nodes/ipAddresses/updatePopup.go @@ -63,7 +63,7 @@ func (this *UpdatePopupAction) RunPost(params struct { this.Fail("请输入正确的IP") } - var thresholds = []*nodeconfigs.NodeValueThresholdConfig{} + var thresholds = []*nodeconfigs.IPAddressThresholdConfig{} if teaconst.IsPlus && len(params.ThresholdsJSON) > 0 { _ = json.Unmarshal(params.ThresholdsJSON, &thresholds) }