mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2026-01-06 12:05:48 +08:00
增加独立的IP地址管理功能
This commit is contained in:
@@ -18,7 +18,10 @@ func (this *CreatePopupAction) Init() {
|
||||
this.Nav("", "", "")
|
||||
}
|
||||
|
||||
func (this *CreatePopupAction) RunGet(params struct{}) {
|
||||
func (this *CreatePopupAction) RunGet(params struct {
|
||||
SupportThresholds bool
|
||||
}) {
|
||||
this.Data["supportThresholds"] = params.SupportThresholds
|
||||
|
||||
this.Show()
|
||||
}
|
||||
|
||||
@@ -32,12 +32,12 @@ func UpdateNodeIPAddresses(parentAction *actionutils.ParentAction, nodeId int64,
|
||||
}
|
||||
|
||||
_, err = parentAction.RPC().NodeIPAddressRPC().UpdateNodeIPAddress(parentAction.AdminContext(), &pb.UpdateNodeIPAddressRequest{
|
||||
AddressId: addrId,
|
||||
Ip: addr.GetString("ip"),
|
||||
Name: addr.GetString("name"),
|
||||
CanAccess: addr.GetBool("canAccess"),
|
||||
IsOn: isOn,
|
||||
ThresholdsJSON: thresholdsJSON,
|
||||
NodeIPAddressId: addrId,
|
||||
Ip: addr.GetString("ip"),
|
||||
Name: addr.GetString("name"),
|
||||
CanAccess: addr.GetBool("canAccess"),
|
||||
IsOn: isOn,
|
||||
ThresholdsJSON: thresholdsJSON,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -20,8 +20,11 @@ func (this *UpdatePopupAction) Init() {
|
||||
}
|
||||
|
||||
func (this *UpdatePopupAction) RunGet(params struct {
|
||||
AddressId int64
|
||||
AddressId int64
|
||||
SupportThresholds bool
|
||||
}) {
|
||||
this.Data["supportThresholds"] = params.SupportThresholds
|
||||
|
||||
this.Show()
|
||||
}
|
||||
|
||||
@@ -42,12 +45,12 @@ func (this *UpdatePopupAction) RunPost(params struct {
|
||||
// 获取IP地址信息
|
||||
var isUp = true
|
||||
if params.AddressId > 0 {
|
||||
addressResp, err := this.RPC().NodeIPAddressRPC().FindEnabledNodeIPAddress(this.AdminContext(), &pb.FindEnabledNodeIPAddressRequest{AddressId: params.AddressId})
|
||||
addressResp, err := this.RPC().NodeIPAddressRPC().FindEnabledNodeIPAddress(this.AdminContext(), &pb.FindEnabledNodeIPAddressRequest{NodeIPAddressId: params.AddressId})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
var address = addressResp.IpAddress
|
||||
var address = addressResp.NodeIPAddress
|
||||
if address == nil {
|
||||
this.Fail("找不到要修改的地址")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user