fix: infinite spinner with no-clusters view

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman committed 2020-07-28 11:42:57 +03:00
1 parent be52b4ad93
commit 4087cf025e
5 files changed
+15 -6

No files matched your search

+2 -2
View File
@@ -7,7 +7,7 @@ import { openShell } from "./node-shell-session";
import { Router } from "./router"
import { ClusterManager } from "./cluster-manager"
import { ContextHandler } from "./context-handler";
import { apiKubePrefix } from "../common/vars";
import { apiKubePrefix, noClustersHost } from "../common/vars";
import logger from "./logger"
export class LensProxy {
@@ -117,7 +117,7 @@ export class LensProxy {
}
protected async handleRequest(proxy: httpProxy, req: http.IncomingMessage, res: http.ServerResponse) {
if (req.headers.host.split(":")[0] === "no-clusters.localhost") {
if (req.headers.host.split(":")[0] === noClustersHost) {
this.router.handleStaticFile(req.url, res);
return;
}
+2 -1
View File
@@ -3,6 +3,7 @@ import { BrowserWindow, shell } from "electron"
import windowStateKeeper from "electron-window-state"
import type { ClusterId } from "../common/cluster-store";
import { clusterStore } from "../common/cluster-store";
import { noClustersHost } from "../common/vars";
import logger from "./logger";
export class WindowManager {
@@ -53,7 +54,7 @@ export class WindowManager {
protected handleNoClustersView = async ({ activate = false } = {}) => {
if (!this.noClustersWindow) {
this.noClustersWindow = this.initClusterView(null);
await this.noClustersWindow.loadURL(`http://no-clusters.localhost:${this.proxyPort}`);
await this.noClustersWindow.loadURL(`http://${noClustersHost}:${this.proxyPort}`);
}
if (activate) {
this.activeView = this.noClustersWindow;