Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

UI update: Fix for dashboard gateway hostname (#1381)

Rich Turnere0d8fb12e96e
diff --git a/ui/component/or-dashboard-builder/src/widgets/gateway-widget.ts b/ui/component/or-dashboard-builder/src/widgets/gateway-widget.ts
index d0c47ebe0..5627df528 100644
--- a/ui/component/or-dashboard-builder/src/widgets/gateway-widget.ts
+++ b/ui/component/or-dashboard-builder/src/widgets/gateway-widget.ts
@@ -341,9 +341,9 @@ export class GatewayWidget extends OrWidget {
switch (info.type) {
case GatewayTunnelInfoType.HTTPS:
case GatewayTunnelInfoType.HTTP:
- return "//" + info.id + "." + window.location.host;
+ return "//" + info.id + "." + (info.hostname ? info.hostname : window.location.hostname);
case GatewayTunnelInfoType.TCP:
- return info.id + "." + window.location.hostname + ":" + info.assignedPort;
+ return (info.hostname ? info.hostname : window.location.hostname) + ":" + info.assignedPort;
}
}