From f133eae00e1e9a31e0ec2e0a255dace5cd9ab212 Mon Sep 17 00:00:00 2001 From: fangxiang Date: Fri, 2 Dec 2022 18:01:20 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=AD=97=E8=8A=82=E8=BD=AC=E6=8D=A2=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FileManageDialog.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/FileManageDialog.vue b/src/components/FileManageDialog.vue index 7e7e625..5b198bb 100644 --- a/src/components/FileManageDialog.vue +++ b/src/components/FileManageDialog.vue @@ -578,7 +578,7 @@ export default defineComponent({ align: "center", label: $t.t("file size"), field: (val: FileEntity) => - val.is_directory ? null : Math.ceil((val ? val.file_size : 0) / 1000), + val.is_directory ? null : Math.ceil((val ? val.file_size : 0) / 1024), format: (val: any) => (val != null ? `${val} KB` : ""), sortable: true, }, From 3a44fb1fbf52ccc97a2245ed7ee1ded6ef7fea72 Mon Sep 17 00:00:00 2001 From: fangxiang Date: Tue, 6 Dec 2022 17:00:24 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=81=94=E5=8A=A8=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=9B=E6=98=BE=E5=A4=96=E6=8B=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EditJointActionEquipmentDialog.vue | 19 ++++++++++++++++--- src/i18n/en-US/index.ts | 3 +++ src/i18n/zh-CN/index.ts | 3 +++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/components/EditJointActionEquipmentDialog.vue b/src/components/EditJointActionEquipmentDialog.vue index 41c5b12..f8d9466 100644 --- a/src/components/EditJointActionEquipmentDialog.vue +++ b/src/components/EditJointActionEquipmentDialog.vue @@ -92,7 +92,10 @@ (val) => (val && val.length > 0) || $t('Please type something'), (val) => - isIpAddress(val) || $t('Please input vaild ip address'), + isHost(val) || + $t( + 'Please input vaild host. example: 192.168.1.1 or 192.168.1.1:8080' + ), ]" lazy-rules /> @@ -182,6 +185,15 @@ export default defineComponent({ connect_type: "network", }, }, + { + key: "CX_MISP3000", + label: $t.t("CX_MISP3000"), + value: { + protocol: "CX_MISP3000", + protocol_version: "Normal", + connect_type: "network", + }, + }, // { // key: "VTRON2", // label: $t.t("VTRON2"), @@ -305,7 +317,8 @@ export default defineComponent({ message: (is_add.value ? $t.t("add") : $t.t("edit")) + $t.t(" ") + - $t.t(" equipment data") + + $t.t(" ") + + $t.t("equipment data") + (success ? $t.t("success") : $t.t("fail")) + "!", position: "top", @@ -316,7 +329,7 @@ export default defineComponent({ show_dialog.value = false; } }, - isIpAddress(str: string) { + isHost(str: string) { return ( str == "localhost" || /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test( diff --git a/src/i18n/en-US/index.ts b/src/i18n/en-US/index.ts index 8d9e02c..e2194b3 100644 --- a/src/i18n/en-US/index.ts +++ b/src/i18n/en-US/index.ts @@ -398,4 +398,7 @@ export default { "server commit hash": "Server Commit Hash", "edit user or password": "Edit User Or Password", "old password error": "Old Password Error", + "Please input vaild host. example: 192.168.1.1 or 192.168.1.1:8080": + "Please Input Vaild Host. Example: 192.168.1.1 or 192.168.1.1:8080", + "equipment data": "Equipment Data", }; diff --git a/src/i18n/zh-CN/index.ts b/src/i18n/zh-CN/index.ts index c090c28..94c433b 100644 --- a/src/i18n/zh-CN/index.ts +++ b/src/i18n/zh-CN/index.ts @@ -668,4 +668,7 @@ export default { "new password": "新密码", "edit user or password": "修改用户名和密码", "old password error": "旧密码不匹配", + "Please input vaild host. example: 192.168.1.1 or 192.168.1.1:8080": + "请输入合法地址. 例: 192.168.1.1 或 192.168.1.1:8080", + "equipment data": "联动设备", }; From 35c6baba37db0da677cc85a9f16dcd59e545f171 Mon Sep 17 00:00:00 2001 From: fangxiang Date: Fri, 9 Dec 2022 14:30:14 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0MagicWall=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/ClientConnection.ts | 21 +++++++++++++ src/entities/MagicWallConfig.ts | 8 +++++ src/entities/RectF.ts | 14 +++++++++ src/entities/WSProtocol.ts | 52 +++++++++++++++++++++++++++++++++ 4 files changed, 95 insertions(+) create mode 100644 src/entities/MagicWallConfig.ts create mode 100644 src/entities/RectF.ts diff --git a/src/common/ClientConnection.ts b/src/common/ClientConnection.ts index a512d2d..ef3e41e 100644 --- a/src/common/ClientConnection.ts +++ b/src/common/ClientConnection.ts @@ -15,6 +15,7 @@ import TimingTaskEntity from "src/entities/TimingTaskEntity"; import JointActionEquipmentTableEntity from "src/entities/JointActionEquipmentTableEntity"; import { CustomProtocol } from "src/entities/WSProtocolCustom"; import ClientConnectionCustom from "./ClientConnectionCustom"; +import MagicWallConfig from "src/entities/MagicWallConfig"; class _RpcInfo { send_timestamp: number; @@ -1232,6 +1233,26 @@ export default class ClientConnection { } } + public async getMagicWallConfig() { + try { + return await this.doRpc( + new Protocol.RpcGetMagicWallConfigRequestEntity() + ); + } catch (e) { + console.error(e); + } + } + + public async setMagicWallConfig(config: MagicWallConfig) { + try { + return await this.doRpc( + new Protocol.RpcSetMagicWallConfigRequestEntity(config) + ); + } catch (e) { + console.error(e); + } + } + public async setHdmiInDecodeType(index: number, type: string) { try { return await this.doRpc( diff --git a/src/entities/MagicWallConfig.ts b/src/entities/MagicWallConfig.ts new file mode 100644 index 0000000..5950e39 --- /dev/null +++ b/src/entities/MagicWallConfig.ts @@ -0,0 +1,8 @@ +import RectF from "./RectF"; + +export default class MagicWallConfig { + magic_wall_enable = false; + row = 0; + col = 0; + windows: RectF[] = []; +} diff --git a/src/entities/RectF.ts b/src/entities/RectF.ts new file mode 100644 index 0000000..09048f5 --- /dev/null +++ b/src/entities/RectF.ts @@ -0,0 +1,14 @@ +export default class RectF { + lt: PointF = new PointF(0, 0); + w: number = 0; + h: number = 0; +} + +export class PointF { + constructor(x: number, y: number) { + this.x = x; + this.y = y; + } + x: number = 0; + y: number = 0; +} diff --git a/src/entities/WSProtocol.ts b/src/entities/WSProtocol.ts index ade9141..f0b8f1a 100644 --- a/src/entities/WSProtocol.ts +++ b/src/entities/WSProtocol.ts @@ -12,6 +12,7 @@ import { SerialPortConfigEntity } from "./SerialPortConfigEntity"; import { ConnectTableEntity } from "./ConnectTableEntity"; import TimingTaskEntity from "./TimingTaskEntity"; import JointActionEquipmentTableEntity from "./JointActionEquipmentTableEntity"; +import MagicWallConfig from "./MagicWallConfig"; export namespace Protocol { export class Commands { @@ -474,6 +475,14 @@ export namespace Protocol { return Commands.PROTOCOL_PREFIX + "SetHDMIRotation"; } + public static get kRpcSetMagicWallConfig() { + return Commands.PROTOCOL_PREFIX + "RpcSetMagicWallConfig"; + } + + public static get kRpcGetMagicWallConfig() { + return Commands.PROTOCOL_PREFIX + "RpcGetMagicWallConfig"; + } + static _all_commands = new Set([ Commands.kUnKnowCommand, Commands.kSearchDevice, @@ -590,6 +599,8 @@ export namespace Protocol { Commands.kRpcDeleteJointActionEquipment, Commands.kCleanBrowserCache, Commands.kSetHDMIRotation, + Commands.kRpcGetMagicWallConfig, + Commands.kRpcSetMagicWallConfig, ]); public static get AllCommands() { return this._all_commands; @@ -3036,4 +3047,45 @@ export namespace Protocol { this.rotation = rotation; } } + + export class RpcGetMagicWallConfigRequestEntity extends PacketEntity { + constructor(rpc_id = 0) { + super(); + super.command = Commands.kRpcGetMagicWallConfig; + super.flag = PacketEntity.FLAG_REQUEST; + super.rpc_id = rpc_id; + } + timestamp = Date.now(); + } + + export class RpcGetMagicWallConfigResponseEntity extends PacketEntity { + constructor() { + super(); + super.flag = PacketEntity.FLAG_RESPONSE; + } + + config: MagicWallConfig = new MagicWallConfig(); + success = false; + } + + export class RpcSetMagicWallConfigRequestEntity extends PacketEntity { + constructor(config: MagicWallConfig, rpc_id = 0) { + super(); + super.command = Commands.kRpcSetMagicWallConfig; + super.flag = PacketEntity.FLAG_REQUEST; + super.rpc_id = rpc_id; + + this.config = config ?? new MagicWallConfig(); + } + config: MagicWallConfig = new MagicWallConfig(); + } + + export class RpcSetMagicWallConfigResponseEntity extends PacketEntity { + constructor() { + super(); + super.flag = PacketEntity.FLAG_RESPONSE; + } + config: MagicWallConfig = new MagicWallConfig(); + success = false; + } } From 2ea3d579ff3f00fe03973d22202b7589eb41339d Mon Sep 17 00:00:00 2001 From: fangxiang Date: Mon, 12 Dec 2022 10:17:13 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE->?= =?UTF-8?q?=E5=85=B3=E4=BA=8E=E7=82=B9=E5=87=BB=E6=AC=A1=E6=95=B0=E6=94=B9?= =?UTF-8?q?=E4=B8=BA20.=20=E9=AD=94=E5=A2=99=E5=A2=9E=E5=8A=A0=E6=97=8B?= =?UTF-8?q?=E8=BD=AC=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/ClientConnection.ts | 10 +++++++++ src/components/SystemSettingDialog.vue | 10 +++------ src/entities/MagicWallConfig.ts | 4 ++-- src/entities/RectF.ts | 22 ++++++++++++++++++- src/entities/WSProtocol.ts | 30 ++++++++++++++++++++++++++ 5 files changed, 66 insertions(+), 10 deletions(-) diff --git a/src/common/ClientConnection.ts b/src/common/ClientConnection.ts index ef3e41e..91e6af8 100644 --- a/src/common/ClientConnection.ts +++ b/src/common/ClientConnection.ts @@ -1253,6 +1253,16 @@ export default class ClientConnection { } } + public async testA() { + try { + return await this.doRpc( + new Protocol.RpcTestARequestEntity() + ); + } catch (e) { + console.error(e); + } + } + public async setHdmiInDecodeType(index: number, type: string) { try { return await this.doRpc( diff --git a/src/components/SystemSettingDialog.vue b/src/components/SystemSettingDialog.vue index 07ad765..8a51d81 100644 --- a/src/components/SystemSettingDialog.vue +++ b/src/components/SystemSettingDialog.vue @@ -1166,9 +1166,7 @@
@@ -1361,8 +1359,6 @@ import { EWeekDays } from "src/entities/EWeekDays"; import SystenSettingAdvancedNetworkDialog from "src/components/SystenSettingAdvancedNetworkDialog.vue"; import { AdvancedIpAddressEntity } from "src/entities/AdvancedIpAddressEntity"; -import { EDeviceAttribute } from "src/entities/EDeviceAttribute"; - import version from "../../package.json"; import { Md5 } from "ts-md5"; @@ -1521,7 +1517,7 @@ export default defineComponent({ const timing_tasks: Ref = ref([]); let click_count = ref(0); - const target_click_count = ref(30); + const target_click_count = ref(20); let client_version = ref(version); let server_version = ref("unknow"); let server_commit_hash = ref("unknow"); @@ -1990,7 +1986,7 @@ export default defineComponent({ Cookies.remove("auto_login"); SessionStorage.clear(); try { - $q.fullscreen.exit(); + $q.fullscreen.exit(); } catch {} window.location.reload(); } diff --git a/src/entities/MagicWallConfig.ts b/src/entities/MagicWallConfig.ts index 5950e39..8917983 100644 --- a/src/entities/MagicWallConfig.ts +++ b/src/entities/MagicWallConfig.ts @@ -1,8 +1,8 @@ -import RectF from "./RectF"; +import RotatedRectF from "./RectF"; export default class MagicWallConfig { magic_wall_enable = false; row = 0; col = 0; - windows: RectF[] = []; + windows: RotatedRectF[] = []; } diff --git a/src/entities/RectF.ts b/src/entities/RectF.ts index 09048f5..d84612e 100644 --- a/src/entities/RectF.ts +++ b/src/entities/RectF.ts @@ -2,13 +2,33 @@ export default class RectF { lt: PointF = new PointF(0, 0); w: number = 0; h: number = 0; + + constructor(lt: PointF = new PointF(0, 0), h: number = 0, w: number = 0) { + this.lt = lt; + this.h = h; + this.w = w; + } } export class PointF { - constructor(x: number, y: number) { + constructor(x: number = 0, y: number = 0) { this.x = x; this.y = y; } x: number = 0; y: number = 0; } + +export class RotatedRectF extends RectF { + angle: number = 0; + + constructor( + lt: PointF = new PointF(0, 0), + h: number = 0, + w: number = 0, + angle: number = 0 + ) { + super(lt, h, w); + this.angle = angle; + } +} diff --git a/src/entities/WSProtocol.ts b/src/entities/WSProtocol.ts index f0b8f1a..db26a97 100644 --- a/src/entities/WSProtocol.ts +++ b/src/entities/WSProtocol.ts @@ -483,6 +483,10 @@ export namespace Protocol { return Commands.PROTOCOL_PREFIX + "RpcGetMagicWallConfig"; } + public static get kRpcTestA() { + return Commands.PROTOCOL_PREFIX + "RpcTestA"; + } + static _all_commands = new Set([ Commands.kUnKnowCommand, Commands.kSearchDevice, @@ -601,6 +605,7 @@ export namespace Protocol { Commands.kSetHDMIRotation, Commands.kRpcGetMagicWallConfig, Commands.kRpcSetMagicWallConfig, + Commands.kRpcTestA, ]); public static get AllCommands() { return this._all_commands; @@ -3088,4 +3093,29 @@ export namespace Protocol { config: MagicWallConfig = new MagicWallConfig(); success = false; } + + export class RpcTestARequestEntity extends PacketEntity { + constructor(rpc_id = 0) { + super(); + super.command = Commands.kRpcTestA; + super.flag = PacketEntity.FLAG_REQUEST; + super.rpc_id = rpc_id; + } + timestamp = 0; + } + + export class RpcTestAResponseEntity extends PacketEntity { + constructor() { + super(); + super.flag = PacketEntity.FLAG_RESPONSE; + } + lt_t = 0; + lt_l = 0; + rt_t = 0; + rt_r = 0; + rb_b = 0; + rb_r = 0; + lb_b = 0; + lb_l = 0; + } }