feat: mark offline nodes in sdwan mapping
This commit is contained in:
@@ -144,7 +144,8 @@
|
||||
<div v-for="(n,i) in sd.nodes" :key="i" class="grid grid-cols-1 md:grid-cols-5 gap-2">
|
||||
<select class="ipt" v-model="n.node">
|
||||
<option value="">选择节点</option>
|
||||
<option v-for="x in nodes" :key="x.name" :value="x.name">{{ x.name }}</option>
|
||||
<option v-for="x in nodes" :key="x.name" :value="x.name">{{ (x.alias || x.name) }}(在线)</option>
|
||||
<option v-for="x in (sd.nodes||[])" :key="'off'+x.node" v-if="x.node && !onlineMap.has(x.node)" :value="x.node">{{ x.node }}(离线)</option>
|
||||
</select>
|
||||
<input class="ipt md:col-span-2" v-model="n.ip" placeholder="10.10.0.X">
|
||||
<button class="btn2" @click="removeSDWANNode(i)">删除</button>
|
||||
@@ -370,6 +371,8 @@ createApp({
|
||||
if (!k) return nodes.value;
|
||||
return nodes.value.filter(n => (n.name||'').toLowerCase().includes(k) || (n.publicIP||'').toLowerCase().includes(k));
|
||||
});
|
||||
const onlineMap = computed(() => new Set((nodes.value || []).map(n => n.name)));
|
||||
const nodeStatus = (name) => (name && onlineMap.value.has(name)) ? '在线' : '离线';
|
||||
|
||||
const toast = (text, t='ok') => { msg.value = text; msgType.value = t; setTimeout(() => { if (msg.value === text) msg.value = ''; }, 2500); };
|
||||
const bearer = () => ({ Authorization: 'Bearer ' + (localStorage.getItem('t') || '') });
|
||||
@@ -668,6 +671,7 @@ createApp({
|
||||
health, stats, nodes, nodeKeyword, filteredNodes, sd, connectForm,
|
||||
tenants, activeTenant, keys, users, enrolls, tenantForm, keyForm, userForm,
|
||||
settings, audit, auditTenant,
|
||||
onlineMap, nodeStatus,
|
||||
natText, uptime, fmtTime,
|
||||
login, logout, refreshAll, saveSDWAN, addSDWANNode, removeSDWANNode, addSubnetProxy, removeSubnetProxy, autoAssignIPs,
|
||||
kickNode, renameNode, changeNodeIP, openAppManager, pushAppConfigs, openConnect, doConnect,
|
||||
|
||||
Reference in New Issue
Block a user