From d44a65c6a65d9209e7687a7fed38e62b66312bb9 Mon Sep 17 00:00:00 2001 From: Aditya Ranshinge Date: Thu, 2 Dec 2021 17:43:35 +0530 Subject: [PATCH 1/3] updated apiml path pattern Signed-off-by: Aditya Ranshinge --- bootstrap/src/uri/mvd-uri.ts | 2 +- .../templates/iframe/Basic/web/html/index.html | 6 +++--- system-apps/app-generator/webClient/src/index.html | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bootstrap/src/uri/mvd-uri.ts b/bootstrap/src/uri/mvd-uri.ts index aaa44165b..15b3b33ef 100644 --- a/bootstrap/src/uri/mvd-uri.ts +++ b/bootstrap/src/uri/mvd-uri.ts @@ -36,7 +36,7 @@ export class MvdUri implements ZLUX.UriBroker { if (agentConfig.mediationLayer && agentConfig.mediationLayer.enabled && agentConfig.mediationLayer.serviceName) { let version = agentConfig.mediationLayer.serviceVersion || 'v1'; let name = agentConfig.mediationLayer.serviceName; - this.agentPrefix = `/api/${version}/${name}/` + this.agentPrefix = `/${name}/api/${version}/` } } resolve(this.agentPrefix); diff --git a/system-apps/app-generator/templates/iframe/Basic/web/html/index.html b/system-apps/app-generator/templates/iframe/Basic/web/html/index.html index 161302939..1fcbfa456 100644 --- a/system-apps/app-generator/templates/iframe/Basic/web/html/index.html +++ b/system-apps/app-generator/templates/iframe/Basic/web/html/index.html @@ -6,11 +6,11 @@ - + - + - + diff --git a/system-apps/app-generator/webClient/src/index.html b/system-apps/app-generator/webClient/src/index.html index 66559cb48..af8710967 100644 --- a/system-apps/app-generator/webClient/src/index.html +++ b/system-apps/app-generator/webClient/src/index.html @@ -15,11 +15,11 @@ Zowe App Generator - + - + - + From 39a4ab2d37957ac2f529f83c6a227d49fbf66223 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Mon, 13 Dec 2021 13:48:46 -0500 Subject: [PATCH 2/3] Fix ws path in v2 apiml urls Signed-off-by: 1000TurquoisePogs --- bootstrap/src/uri/mvd-uri.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bootstrap/src/uri/mvd-uri.ts b/bootstrap/src/uri/mvd-uri.ts index 15b3b33ef..1731d7f8f 100644 --- a/bootstrap/src/uri/mvd-uri.ts +++ b/bootstrap/src/uri/mvd-uri.ts @@ -15,6 +15,8 @@ import { Environment } from 'zlux-base/environment/environment' const uri_prefix = window.location.pathname.split('ZLUX/plugins/')[0]; const proxy_mode = (uri_prefix !== '/') ? true : false; // Tells whether we're behind API layer (true) or not (false) +const proxy_version = "v1"; +const proxy_name = "zlux"; export class MvdUri implements ZLUX.UriBroker { private agentPrefix: string; @@ -212,10 +214,14 @@ export class MvdUri implements ZLUX.UriBroker { // This is a workaround for the mediation layer not having a dynamic way to get the websocket uri for zlux // Since we know our uri is /ui/v1/zlux/ behind the api-layer we replace the ui with ws to get /ws/v1/zlux/ if (proxy_mode) { - if (uri.startsWith('/api/')) { - return uri.replace('/api/', '/ws/'); - } else { + let apiIndex = uri.indexOf('/api/'); + let uiIndex = uri.indexOf('/ui/'); + if (apiIndex == -1 && uiIndex == -1) { + return uri; + } else if (apiIndex == -1 || (uiIndex != -1 && (uiIndex < apiIndex))) { return uri.replace('/ui/', '/ws/'); + } else { + return uri.replace('/api/', '/ws/'); } } else { return uri; From 77fae99a5e2ed4c5309830b4c78e98c6f3e7f555 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Mon, 13 Dec 2021 15:44:59 -0500 Subject: [PATCH 3/3] Fix compile issue Signed-off-by: 1000TurquoisePogs --- bootstrap/src/uri/mvd-uri.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/bootstrap/src/uri/mvd-uri.ts b/bootstrap/src/uri/mvd-uri.ts index 1731d7f8f..b6a8e6c92 100644 --- a/bootstrap/src/uri/mvd-uri.ts +++ b/bootstrap/src/uri/mvd-uri.ts @@ -15,8 +15,6 @@ import { Environment } from 'zlux-base/environment/environment' const uri_prefix = window.location.pathname.split('ZLUX/plugins/')[0]; const proxy_mode = (uri_prefix !== '/') ? true : false; // Tells whether we're behind API layer (true) or not (false) -const proxy_version = "v1"; -const proxy_name = "zlux"; export class MvdUri implements ZLUX.UriBroker { private agentPrefix: string;