mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-13 11:53:34 +08:00
修复IP地址不能修改在线状态的Bug
This commit is contained in:
@@ -95,6 +95,7 @@ func (this *CreateBatchAction) RunPost(params struct {
|
||||
Name: "IP地址",
|
||||
Ip: ip,
|
||||
CanAccess: true,
|
||||
IsUp: true,
|
||||
})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
|
||||
@@ -185,6 +185,7 @@ func (this *CreateNodeAction) RunPost(params struct {
|
||||
Name: addr.GetString("name"),
|
||||
Ip: addr.GetString("ip"),
|
||||
CanAccess: addr.GetBool("canAccess"),
|
||||
IsUp: addr.GetBool("isUp"),
|
||||
})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
|
||||
@@ -31,6 +31,7 @@ func UpdateNodeIPAddresses(parentAction *actionutils.ParentAction, nodeId int64,
|
||||
Name: addr.GetString("name"),
|
||||
CanAccess: addr.GetBool("canAccess"),
|
||||
IsOn: isOn,
|
||||
IsUp: addr.GetBool("isUp"),
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -42,6 +43,7 @@ func UpdateNodeIPAddresses(parentAction *actionutils.ParentAction, nodeId int64,
|
||||
Name: addr.GetString("name"),
|
||||
Ip: addr.GetString("ip"),
|
||||
CanAccess: addr.GetBool("canAccess"),
|
||||
IsUp: addr.GetBool("isUp"),
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -55,7 +55,6 @@ func (this *UpdatePopupAction) RunPost(params struct {
|
||||
if address == nil {
|
||||
this.Fail("找不到要修改的地址")
|
||||
}
|
||||
isUp = address.IsUp
|
||||
}
|
||||
|
||||
ip := net.ParseIP(params.IP)
|
||||
|
||||
@@ -79,8 +79,8 @@ func (this *CreateNodeAction) RunPost(params struct {
|
||||
nodeId := createResp.NsNodeId
|
||||
|
||||
// IP地址
|
||||
for _, address := range ipAddresses {
|
||||
addressId := address.GetInt64("id")
|
||||
for _, addrMap := range ipAddresses {
|
||||
addressId := addrMap.GetInt64("id")
|
||||
if addressId > 0 {
|
||||
_, err = this.RPC().NodeIPAddressRPC().UpdateNodeIPAddressNodeId(this.AdminContext(), &pb.UpdateNodeIPAddressNodeIdRequest{
|
||||
NodeIPAddressId: addressId,
|
||||
@@ -90,9 +90,10 @@ func (this *CreateNodeAction) RunPost(params struct {
|
||||
_, err = this.RPC().NodeIPAddressRPC().CreateNodeIPAddress(this.AdminContext(), &pb.CreateNodeIPAddressRequest{
|
||||
NodeId: nodeId,
|
||||
Role: nodeconfigs.NodeRoleDNS,
|
||||
Name: address.GetString("name"),
|
||||
Ip: address.GetString("ip"),
|
||||
CanAccess: address.GetBool("canAccess"),
|
||||
Name: addrMap.GetString("name"),
|
||||
Ip: addrMap.GetString("ip"),
|
||||
CanAccess: addrMap.GetBool("canAccess"),
|
||||
IsUp: addrMap.GetBool("isUp"),
|
||||
})
|
||||
}
|
||||
if err != nil {
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
<div style="margin-top: 0.5em" v-if="node.group != null">
|
||||
<span class="ui label tiny grey basic">分组:{{node.group.name}}</span>
|
||||
</div>
|
||||
<div style="margin-top: 0.5em">
|
||||
<div style="margin-top: 0.5em" v-if="node.secondaryClusters != null && node.secondaryClusters.length > 0">
|
||||
<node-clusters-labels :v-primary-cluster="node.cluster" :v-secondary-clusters="node.secondaryClusters" size="tiny"></node-clusters-labels>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>阈值</td>
|
||||
<td>阈值设置</td>
|
||||
<td>
|
||||
<div v-if="addr.thresholds.length > 0">
|
||||
<node-ip-address-thresholds-view :v-thresholds="addr.thresholds"></node-ip-address-thresholds-view>
|
||||
|
||||
@@ -37,8 +37,17 @@
|
||||
<input type="text" name="name" maxlength="50" v-model="addr.name"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>在线状态</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="isUp" v-model="addr.isUp">
|
||||
<option value="1">在线</option>
|
||||
<option value="0">离线</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="teaIsPlus && supportThresholds">
|
||||
<td>上线阈值</td>
|
||||
<td>阈值设置</td>
|
||||
<td>
|
||||
<node-ip-address-thresholds-box :v-thresholds="addr.thresholds"></node-ip-address-thresholds-box>
|
||||
</td>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifySuccess("保存成功", Tea.url(".", {addrId: this.addr.id}))
|
||||
|
||||
this.addr.isUp = this.addr.isUp ? 1 : 0
|
||||
})
|
||||
@@ -19,7 +19,9 @@
|
||||
<div>
|
||||
<div v-for="(address, index) in node.ipAddresses" class="ui label tiny basic">
|
||||
{{address.ip}}
|
||||
<span class="small" v-if="address.name.length > 0">({{address.name}}<span v-if="!address.canAccess">,不可访问</span>)</span>
|
||||
<span class="small" v-if="address.name.length > 0">({{address.name}}<span v-if="!address.canAccess">,不可访问</span>)</span>
|
||||
<span class="small red" v-if="!address.isOn">[off]</span>
|
||||
<span class="small red" v-if="!address.isUp">[down]</span>
|
||||
<span class="small" v-if="address.name.length == 0 && !address.canAccess">(不可访问)</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user