mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-20 16:20:27 +08:00
调整部分命名
This commit is contained in:
@@ -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 {
|
if teaconst.IsPlus && len(params.ThresholdsJSON) > 0 {
|
||||||
_ = json.Unmarshal(params.ThresholdsJSON, &thresholds)
|
_ = json.Unmarshal(params.ThresholdsJSON, &thresholds)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,18 +69,18 @@ func UpdateNodeIPAddresses(parentAction *actionutils.ParentAction, nodeId int64,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// InitNodeIPAddressThresholds 初始化IP阈值
|
// 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})
|
thresholdsResp, err := parentAction.RPC().NodeIPAddressThresholdRPC().FindAllEnabledNodeIPAddressThresholds(parentAction.AdminContext(), &pb.FindAllEnabledNodeIPAddressThresholdsRequest{NodeIPAddressId: addrId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
var thresholds = []*nodeconfigs.NodeValueThresholdConfig{}
|
var thresholds = []*nodeconfigs.IPAddressThresholdConfig{}
|
||||||
if len(thresholdsResp.NodeIPAddressThresholds) > 0 {
|
if len(thresholdsResp.NodeIPAddressThresholds) > 0 {
|
||||||
for _, pbThreshold := range thresholdsResp.NodeIPAddressThresholds {
|
for _, pbThreshold := range thresholdsResp.NodeIPAddressThresholds {
|
||||||
var threshold = &nodeconfigs.NodeValueThresholdConfig{
|
var threshold = &nodeconfigs.IPAddressThresholdConfig{
|
||||||
Id: pbThreshold.Id,
|
Id: pbThreshold.Id,
|
||||||
Items: []*nodeconfigs.NodeValueThresholdItemConfig{},
|
Items: []*nodeconfigs.IPAddressThresholdItemConfig{},
|
||||||
Actions: []*nodeconfigs.NodeValueThresholdActionConfig{},
|
Actions: []*nodeconfigs.IPAddressThresholdActionConfig{},
|
||||||
}
|
}
|
||||||
if len(pbThreshold.ItemsJSON) > 0 {
|
if len(pbThreshold.ItemsJSON) > 0 {
|
||||||
err = json.Unmarshal(pbThreshold.ItemsJSON, &threshold.Items)
|
err = json.Unmarshal(pbThreshold.ItemsJSON, &threshold.Items)
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ func (this *UpdatePopupAction) RunPost(params struct {
|
|||||||
this.Fail("请输入正确的IP")
|
this.Fail("请输入正确的IP")
|
||||||
}
|
}
|
||||||
|
|
||||||
var thresholds = []*nodeconfigs.NodeValueThresholdConfig{}
|
var thresholds = []*nodeconfigs.IPAddressThresholdConfig{}
|
||||||
if teaconst.IsPlus && len(params.ThresholdsJSON) > 0 {
|
if teaconst.IsPlus && len(params.ThresholdsJSON) > 0 {
|
||||||
_ = json.Unmarshal(params.ThresholdsJSON, &thresholds)
|
_ = json.Unmarshal(params.ThresholdsJSON, &thresholds)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user