reverting dashboard rendering to webview, part 3

This commit is contained in:
Roman committed 2020-06-17 17:39:30 +03:00
1 parent 50ab4905dc
commit 4e18c992d8
8 files changed
+32 -60

No files matched your search

+8 -9
View File
@@ -180,15 +180,14 @@ export class Cluster implements ClusterInfo {
}
}
protected async k8sRequest(path: string, opts: request.RequestPromiseOptions = {}) {
const prefix = apiPrefix.KUBE_BASE;
const url = `http://127.0.0.1:${this.port}${prefix}${path}`;
opts.json = true;
opts.timeout = 10000;
opts.headers = Object.assign({}, opts.headers, {
host: `${this.id}.localhost:${this.port}`,
});
return request(url, opts);
protected async k8sRequest(path: string, opts?: request.RequestPromiseOptions) {
const options = Object.assign({
json: true,
timeout: 10000
}, (opts || {}))
if (!options.headers) { options.headers = {} }
options.headers.host = `${this.id}.localhost:${this.port}`
return request(`http://127.0.0.1:${this.port}${apiPrefix.KUBE_BASE}${path}`, options)
}
protected async getConnectionStatus() {
+2 -7
View File
@@ -19,7 +19,7 @@ import { getFreePort } from "./port"
import { mangleProxyEnv } from "./proxy-env"
import { findMainWebContents } from "./webcontents"
import { registerStaticProtocol } from "../common/register-static";
import { isMac } from "../common/vars";
import { isMac, vueAppName } from "../common/vars";
mangleProxyEnv()
if (app.commandLine.getSwitchValue("proxy-server") !== "") {
@@ -31,7 +31,7 @@ let windowManager: WindowManager = null;
let clusterManager: ClusterManager = null;
const vmURL = formatUrl({
pathname: path.join(__dirname, "index.html"),
pathname: path.join(__dirname, `${vueAppName}.html`),
protocol: "file",
slashes: true,
})
@@ -132,8 +132,3 @@ app.on("will-quit", async (event) => {
if (clusterManager) clusterManager.stop()
app.exit(0);
})
// todo: auto-restart app in dev-mode
// if (isDevelopment) {
// require('electron-reloader')(module);
// }
-2
View File
@@ -2,7 +2,6 @@ import { BrowserWindow, shell } from "electron"
import { PromiseIpc } from "electron-promise-ipc"
import windowStateKeeper from "electron-window-state"
import { tracker } from "./tracker";
import { isDevelopment } from "../common/vars";
import { getStaticUrl } from "../common/register-static";
export class WindowManager {
@@ -45,7 +44,6 @@ export class WindowManager {
backgroundColor: "#1e2124",
titleBarStyle: "hidden",
webPreferences: {
devTools: isDevelopment,
nodeIntegration: true,
webviewTag: true
},