mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-28 06:40:33 +08:00
IP地址支持手动上线和从备用IP中恢复
This commit is contained in:
@@ -14,10 +14,12 @@
|
||||
<span v-if="!addr.canAccess" class="red">不可访问</span>
|
||||
<span v-else-if="!addr.isOn" class="red">禁用</span>
|
||||
<span v-else-if="addr.isUp && addr.backupIP.length > 0" class="orange">备用
|
||||
<a href="" @click.prevent="restoreBackup(addr.id)"><span class="small">[恢复]</span></a>
|
||||
<br/><span class="grey small">{{addr.backupIP}}</span>
|
||||
</span>
|
||||
<span v-else-if="addr.isUp" class="green">在线</span>
|
||||
<span v-else class="red">离线</span>
|
||||
<span v-else-if="addr.isUp" class="green">在线 <a href="" @click.prevent="updateUp(addr.id, false)"><span class="small">[下线]</span></a></span>
|
||||
<span v-else class="red">离线 <a href="" @click.prevent="updateUp(addr.id, true)"><span class="small">[上线]</span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
23
web/views/@default/clusters/ip-addrs/addr/index.js
Normal file
23
web/views/@default/clusters/ip-addrs/addr/index.js
Normal file
@@ -0,0 +1,23 @@
|
||||
Tea.context(function () {
|
||||
this.updateUp = function (addrId, isUp) {
|
||||
let status = isUp ? "在线" : "离线"
|
||||
teaweb.confirm("确定要手动将节点设置为" + status + "吗?", function () {
|
||||
this.$post(".up")
|
||||
.params({
|
||||
addrId: addrId,
|
||||
isUp: isUp ? 1 : 0
|
||||
})
|
||||
.refresh()
|
||||
})
|
||||
}
|
||||
|
||||
this.restoreBackup = function (addrId) {
|
||||
teaweb.confirm("确定要恢复IP地址吗?", function () {
|
||||
this.$post(".restoreBackup")
|
||||
.params({
|
||||
addrId: addrId
|
||||
})
|
||||
.refresh()
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user