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; } + +