From cf7cf19c6b6a2095849c3c3e73a6495c47937b91 Mon Sep 17 00:00:00 2001 From: fangxiang Date: Wed, 29 Jun 2022 15:22:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BD=91=E7=BB=9C=E8=AE=BE=E7=BD=AE=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E4=B8=BB=E6=9C=BA=E5=90=8D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SystemSettingDialog.vue | 52 +++-- .../SystenSettingAdvancedNetworkDialog.vue | 195 ++++++++++++------ src/entities/WSProtocol.ts | 4 +- src/i18n/zh-CN/index.ts | 3 + 4 files changed, 176 insertions(+), 78 deletions(-) diff --git a/src/components/SystemSettingDialog.vue b/src/components/SystemSettingDialog.vue index 26b45ee..4fe5e5f 100644 --- a/src/components/SystemSettingDialog.vue +++ b/src/components/SystemSettingDialog.vue @@ -171,7 +171,10 @@ /> - + {{ $t("dns server") + "1:" }} @@ -191,7 +194,10 @@ /> - + {{ $t("dns server") + "2:" }} @@ -1125,6 +1131,7 @@ export default defineComponent({ let dns2 = ref(); let mac_address = ref("11:22:33:44:55:66"); let ip_address_list: AdvancedIpAddressEntity[] = []; + let host_name = "player"; let brightness = ref(0); let contrast = ref(0); @@ -1377,9 +1384,10 @@ export default defineComponent({ request.gateway = gateway.value; request.net_mask = netmask.value; request.mac_address = mac_address.value; - request.dns1 = dns1.value; - request.dns2 = dns2.value; - request.ip_address_list = ip_address_list; + request.dns1 = dns1.value ?? ""; + request.dns2 = dns2.value ?? ""; + request.ip_address_list = ip_address_list ?? []; + request.host_name = host_name ?? ""; let success = false; try { @@ -1678,6 +1686,15 @@ export default defineComponent({ showDialog() { show_dialog.value = true; + GlobalData.getInstance() + .getCurrentClient() + ?.getSystemNetworkInfo() + .then((response) => { + if (response) { + host_name = (response.host_name ?? "player").trim(); + } + }); + refresh_all(); }, resetData() { @@ -1793,8 +1810,10 @@ export default defineComponent({ if (info) { gateway.value = info.gateway || "192.168.1.1"; netmask.value = info.net_mask || "255.255.0.0"; - dns1.value = info.dns1 || ""; - dns2.value = info.dns2 || ""; + dns1.value = + GlobalData.getInstance()?.applicationConfig?.dns1 || ""; + dns2.value = + GlobalData.getInstance()?.applicationConfig?.dns2 || ""; mac_address.value = info.mac_address || "5A:30:C2:5A:54:Bf"; ip_address.value = info.ip_address || "192.168.1.168"; flag = true; @@ -1848,15 +1867,22 @@ export default defineComponent({ ); }, async onAdvanceNetwork() { - const _ip_address_list = + const result = await system_setting_advanced_network_dialog.value.showDialogAsync( GlobalData.getInstance()?.applicationConfig?.ip_list ); - if (Array.isArray(_ip_address_list)) { - ip_address_list = _ip_address_list; - } else { - ip_address_list = - GlobalData.getInstance()?.applicationConfig?.ip_list || []; + if (result) { + if (Array.isArray(result.ip_address_list)) { + ip_address_list = result.ip_address_list; + } else { + ip_address_list = + GlobalData.getInstance()?.applicationConfig?.ip_list || []; + } + if (typeof result.host_name == "string") { + host_name = result.host_name.trim(); + } else { + host_name = "player"; + } } }, }; diff --git a/src/components/SystenSettingAdvancedNetworkDialog.vue b/src/components/SystenSettingAdvancedNetworkDialog.vue index 8911b1f..c56de7b 100644 --- a/src/components/SystenSettingAdvancedNetworkDialog.vue +++ b/src/components/SystenSettingAdvancedNetworkDialog.vue @@ -33,70 +33,100 @@ class="scroll q-pa-xs q-ma-none" style="width: 60vw; height: 65vh" > - - - + + + + {{ + $t("host name") + ":" + }} + + + + + + + + + - + + @@ -125,11 +155,32 @@ width: 15%; } .header_label_2 { - width: 15%; + width: 20%; align-items: center; } + +