1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

load react app from filesystem

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2020-06-18 09:03:20 +03:00
parent 1fd6b77357
commit 5f0581e194

View File

@ -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 = [
{