fix web bugs
This commit is contained in:
@@ -27,7 +27,7 @@ const loadDevices = async () => {
|
|||||||
public_ip: device.client_url,
|
public_ip: device.client_url,
|
||||||
running_network_instances: device.info?.running_network_instances.map((instance: any) => Utils.UuidToStr(instance)),
|
running_network_instances: device.info?.running_network_instances.map((instance: any) => Utils.UuidToStr(instance)),
|
||||||
running_network_count: device.info?.running_network_instances.length,
|
running_network_count: device.info?.running_network_instances.length,
|
||||||
report_time: device.info?.report_time,
|
report_time: new Date(device.info?.report_time).toLocaleString(),
|
||||||
easytier_version: device.info?.easytier_version,
|
easytier_version: device.info?.easytier_version,
|
||||||
machine_id: Utils.UuidToStr(device.info?.machine_id),
|
machine_id: Utils.UuidToStr(device.info?.machine_id),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -210,9 +210,20 @@ const loadDeviceInfo = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const exportConfig = async () => {
|
const exportConfig = async () => {
|
||||||
let ret = await props.api?.get_network_config(deviceId.value, instanceId.value);
|
if (!deviceId.value || !instanceId.value) {
|
||||||
delete ret.instance_id;
|
toast.add({ severity: 'error', summary: 'Error', detail: 'No network instance selected', life: 2000 });
|
||||||
exportJsonFile(JSON.stringify(ret, null, 2),instanceId.value +'.json');
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
let ret = await props.api?.get_network_config(deviceId.value, instanceId.value);
|
||||||
|
delete ret.instance_id;
|
||||||
|
exportJsonFile(JSON.stringify(ret, null, 2),instanceId.value +'.json');
|
||||||
|
} catch (e: any) {
|
||||||
|
console.error(e);
|
||||||
|
toast.add({ severity: 'error', summary: 'Error', detail: 'Failed to export network config, error: ' + JSON.stringify(e.response.data), life: 2000 });
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const importConfig = () => {
|
const importConfig = () => {
|
||||||
@@ -316,9 +327,9 @@ onUnmounted(() => {
|
|||||||
<Status v-bind:cur-network-inst="curNetworkInfo" v-if="needShowNetworkStatus">
|
<Status v-bind:cur-network-inst="curNetworkInfo" v-if="needShowNetworkStatus">
|
||||||
</Status>
|
</Status>
|
||||||
<Divider />
|
<Divider />
|
||||||
<center>
|
<div class="text-center">
|
||||||
<Button @click="updateNetworkState(true)" label="Disable Network" severity="warn" />
|
<Button @click="updateNetworkState(true)" label="Disable Network" severity="warn" />
|
||||||
</center>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- For disabled network, show the config -->
|
<!-- For disabled network, show the config -->
|
||||||
|
|||||||
Reference in New Issue
Block a user