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:
parent
1fd6b77357
commit
5f0581e194
@ -8,6 +8,9 @@ import { KubeAuthProxy } from "./kube-auth-proxy"
|
|||||||
import { Cluster, ClusterPreferences } from "./cluster"
|
import { Cluster, ClusterPreferences } from "./cluster"
|
||||||
import { prometheusProviders } from "../common/prometheus-providers"
|
import { prometheusProviders } from "../common/prometheus-providers"
|
||||||
import { PrometheusProvider, PrometheusService } from "./prometheus/provider-registry"
|
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 {
|
export class ContextHandler {
|
||||||
public contextName: string
|
public contextName: string
|
||||||
@ -56,7 +59,12 @@ export class ContextHandler {
|
|||||||
this.clusterUrl = url.parse(kc.getCurrentCluster().server)
|
this.clusterUrl = url.parse(kc.getCurrentCluster().server)
|
||||||
this.contextName = kc.currentContext;
|
this.contextName = kc.currentContext;
|
||||||
this.defaultNamespace = kc.getContextObject(kc.currentContext).namespace
|
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.kubernetesApi = `http://127.0.0.1:${cluster.port}/${this.id}`
|
||||||
this.kc.clusters = [
|
this.kc.clusters = [
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user