diff --git a/package.json b/package.json index 26c328c..8028276 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,10 @@ }, "dependencies": { "@quasar/extras": "^1.0.0", + "@types/element-resize-detector": "^1.1.3", "axios": "^0.21.1", "core-js": "^3.6.5", + "element-resize-detector": "^1.2.3", "quasar": "^2.0.0", "vue-i18n": "^9.0.0-beta.0", "vuex": "^4.0.1" diff --git a/src/common/ClientConnection.ts b/src/common/ClientConnection.ts index 8ae5169..c4046d0 100644 --- a/src/common/ClientConnection.ts +++ b/src/common/ClientConnection.ts @@ -191,8 +191,8 @@ export default class ClientConnection { } } - public async doRpc<_RequestType extends Protocol.PacketEntity, _ResponseType>( - RequestType: new () => _RequestType + public async doRpc<_ResponseType>( + request: Protocol.PacketEntity ): Promise<_ResponseType | null> { return new Promise((resolve, reject) => { const rpc_id = ++this._rpc_id_counter; @@ -203,7 +203,6 @@ export default class ClientConnection { this.rpc_map.delete(rpc_id); } } - let request: _RequestType = new RequestType(); request.rpc_id = rpc_id; this.ws?.send(JSON.stringify(request)); this.rpc_map.set( @@ -230,10 +229,9 @@ export default class ClientConnection { public async getSignalSources() { try { - return await this.doRpc< - Protocol.GetSignalSourcesRequest, - Protocol.GetSignalSourcesResponse - >(Protocol.GetSignalSourcesRequest); + return await this.doRpc( + new Protocol.GetSignalSourcesRequest() + ); } catch (e) { console.error(e); } @@ -241,10 +239,9 @@ export default class ClientConnection { public async getApplicationSettins() { try { - return await this.doRpc< - Protocol.GetApplicationConfigRequestEntity, - Protocol.GetApplicationConfigResponseEntity - >(Protocol.GetApplicationConfigRequestEntity); + return await this.doRpc( + new Protocol.GetApplicationConfigRequestEntity() + ); } catch (e) { console.error(e); } @@ -252,10 +249,9 @@ export default class ClientConnection { public async getWindows() { try { - return await this.doRpc< - Protocol.GetWindowsRequestEntity, - Protocol.GetWindowsResponseEntity - >(Protocol.GetWindowsRequestEntity); + return await this.doRpc( + new Protocol.GetWindowsRequestEntity() + ); } catch (e) { console.error(e); } @@ -296,6 +292,16 @@ export default class ClientConnection { ); } + public async addSignalSourceGroup(parent_uuid: string, name: string) { + try { + return await this.doRpc( + new Protocol.AddSignalSourcesGroupRequestEntity(0, parent_uuid, name) + ); + } catch (e) { + console.error(e); + } + } + private _destoryed = false; public destory() { this._destoryed = true; diff --git a/src/common/EventBus.ts b/src/common/EventBus.ts index 90668a2..7538a1c 100644 --- a/src/common/EventBus.ts +++ b/src/common/EventBus.ts @@ -18,6 +18,7 @@ export default class EventBus extends EventEmitter { export namespace EventNamesDefine { export const UnSelectAllWindows = "onUnSelectAllWindows"; + export const UnFocusAllWindows = "onUnFocusAllWindows"; export const WindowResize = "onWindowResize"; export const ResponseMessage = "onResponseData"; export const WebSocketClose = "onWebSocketClose"; diff --git a/src/components/GroupDialog.vue b/src/components/GroupDialog.vue new file mode 100644 index 0000000..0155137 --- /dev/null +++ b/src/components/GroupDialog.vue @@ -0,0 +1,214 @@ + + + + + diff --git a/src/components/SignalSourceDialog.vue b/src/components/SignalSourceDialog.vue new file mode 100644 index 0000000..4f78966 --- /dev/null +++ b/src/components/SignalSourceDialog.vue @@ -0,0 +1,18 @@ + + + diff --git a/src/components/Window.vue b/src/components/Window.vue index b03f9ff..45d5e39 100644 --- a/src/components/Window.vue +++ b/src/components/Window.vue @@ -1,7 +1,11 @@ +