From 5f0581e194b682de1ca8d73d76ab8997206bd699 Mon Sep 17 00:00:00 2001 From: Jari Kolehmainen Date: Thu, 18 Jun 2020 09:03:20 +0300 Subject: [PATCH] load react app from filesystem Signed-off-by: Jari Kolehmainen --- src/main/context-handler.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/context-handler.ts b/src/main/context-handler.ts index 137d45cb0f..b85a537603 100644 --- a/src/main/context-handler.ts +++ b/src/main/context-handler.ts @@ -8,6 +8,9 @@ import { KubeAuthProxy } from "./kube-auth-proxy" import { Cluster, ClusterPreferences } from "./cluster" import { prometheusProviders } from "../common/prometheus-providers" import { PrometheusProvider, PrometheusService } from "./prometheus/provider-registry" +import { reactAppName } from "../common/vars" +import path from "path" +import { format as formatUrl } from "url" export class ContextHandler { public contextName: string @@ -56,7 +59,12 @@ export class ContextHandler { this.clusterUrl = url.parse(kc.getCurrentCluster().server) this.contextName = kc.currentContext; this.defaultNamespace = kc.getContextObject(kc.currentContext).namespace - this.url = `http://${this.id}.localhost:${cluster.port}/` + //this.url = `http://${this.id}.localhost:${cluster.port}/` + this.url = formatUrl({ + pathname: path.join(__dirname, `${reactAppName}.html`), + protocol: "file", + slashes: true, + }) this.kubernetesApi = `http://127.0.0.1:${cluster.port}/${this.id}` this.kc.clusters = [ {