From a36e99ef24d4663bfb21725530075024dccd600a Mon Sep 17 00:00:00 2001 From: Anna Manchenkova Date: Mon, 5 Jun 2023 12:46:44 +0300 Subject: [PATCH] fix: endpoint for group operations --- .../module-interactive-part.component.ts | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/web/libs/features/modules-interactivity/src/lib/components/module-interactive-part/module-interactive-part.component.ts b/web/libs/features/modules-interactivity/src/lib/components/module-interactive-part/module-interactive-part.component.ts index b3d94a9..4cf72ce 100644 --- a/web/libs/features/modules-interactivity/src/lib/components/module-interactive-part/module-interactive-part.component.ts +++ b/web/libs/features/modules-interactivity/src/lib/components/module-interactive-part/module-interactive-part.component.ts @@ -156,28 +156,20 @@ export class ModuleInteractivePartComponent implements OnInit, OnChanges, OnDest ); const subview = modulesAPI.getView(this.module.info.name); let protoAPI: VXAPI; - let vxHostPort: string; - if (window.location.protocol === 'https:') { - vxHostPort = `wss://${window.location.host}`; - } else { - vxHostPort = `ws://${window.location.host}`; - } - if (this.viewMode === ViewMode.Agents) { - protoAPI = new VXAPI({ - hash: this.entity.hash, - type: "browser", - moduleName: this.module.info.name, - hostPort: vxHostPort, - agentProto, - protocolProto - }); - } else if (this.viewMode === ViewMode.Groups) { + if (this.viewMode === ViewMode.Agents || this.viewMode === ViewMode.Groups) { + let vxHostPort: string; + if (window.location.protocol === 'https:') { + vxHostPort = `wss://${window.location.host}`; + } else { + vxHostPort = `ws://${window.location.host}`; + } + const type = this.viewMode === ViewMode.Agents ? 'browser' : 'aggregate'; protoAPI = new VXAPI({ hash: this.entity.hash, - type: "aggregate", moduleName: this.module.info.name, hostPort: vxHostPort, + type, agentProto, protocolProto });