From 877a964430f8c5a4211f43ae67af07baa0e99aeb Mon Sep 17 00:00:00 2001 From: fangxiang Date: Sat, 18 Dec 2021 16:41:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=B3=BB=E7=BB=9F=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/ClientConnection.ts | 37 ++++++ src/common/GlobalData.ts | 4 + src/common/Initializer.ts | 1 + src/components/SystemSettingDialog.vue | 160 ++++++++++++++++++++++-- src/entities/ApplicationConfigEntity.ts | 6 +- src/entities/WSProtocol.ts | 108 ++++++++++++++++ src/i18n/zh-CN/index.ts | 3 + src/pages/Index.vue | 5 + src/pages/TopToolBar.vue | 22 ++-- src/store/index.ts | 5 +- 10 files changed, 327 insertions(+), 24 deletions(-) diff --git a/src/common/ClientConnection.ts b/src/common/ClientConnection.ts index 5ba6cc6..4bbe8c4 100644 --- a/src/common/ClientConnection.ts +++ b/src/common/ClientConnection.ts @@ -594,6 +594,43 @@ export default class ClientConnection { } } + public async setSystemNetwork( + request: Protocol.SetSystemNetworkRequestEntity + ) { + try { + return await this.doRpc(request); + } catch (e) { + console.error(e); + } + } + public async setSystemGraphics( + request: Protocol.SetSystemGraphicsRequestEntity + ) { + try { + return await this.doRpc( + request + ); + } catch (e) { + console.error(e); + } + } + public async setSystemOther(request: Protocol.SetSystemOtherRequestEntity) { + try { + return await this.doRpc(request); + } catch (e) { + console.error(e); + } + } + public async getSupportResolutions() { + try { + return await this.doRpc( + new Protocol.GetSupportResolutionsRequestEntity(0) + ); + } catch (e) { + console.error(e); + } + } + public restartDevice() { this.ws?.send(JSON.stringify(new Protocol.RestartDeviceRequestEntity())); } diff --git a/src/common/GlobalData.ts b/src/common/GlobalData.ts index 1316af2..2e9fe29 100644 --- a/src/common/GlobalData.ts +++ b/src/common/GlobalData.ts @@ -138,6 +138,10 @@ export default class GlobalData { } } + public getCurrentClientName() { + return this._current_client_name; + } + public setCurrentClientName(name: string) { this._current_client_name = name; } diff --git a/src/common/Initializer.ts b/src/common/Initializer.ts index 5567bbd..2812887 100644 --- a/src/common/Initializer.ts +++ b/src/common/Initializer.ts @@ -85,6 +85,7 @@ export default class Initializer { global_data.applicationConfig = ( await global_data.getCurrentClient()?.getApplicationSettins() )?.config; + console.log(global_data.applicationConfig); const options = this.options; let $store = options.$store; diff --git a/src/components/SystemSettingDialog.vue b/src/components/SystemSettingDialog.vue index 8e55318..33d911b 100644 --- a/src/components/SystemSettingDialog.vue +++ b/src/components/SystemSettingDialog.vue @@ -146,7 +146,7 @@ (val) => isMacAddress(val) || $t('Please input vaild mac address') + - ' (04:XX:XX:XX:XX:XX)', + ' (XX:XX:XX:XX:XX:XX)', ]" lazy-rules /> @@ -365,11 +365,12 @@