mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
improved singleton types inferring
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
1 parent
0dbb47a398
commit
a3edb75fea
9 files changed
+17
-16
No files matched your search
+1
-1
@@ -66,7 +66,7 @@ async function main() {
|
||||
|
||||
// run proxy
|
||||
try {
|
||||
proxyServer = LensProxy.create(clusterManager);
|
||||
proxyServer = LensProxy.create(proxyPort, clusterManager);
|
||||
} catch (error) {
|
||||
logger.error(`Could not start proxy (127.0.0:${proxyPort}): ${error.message}`)
|
||||
await dialog.showErrorBox("Lens Error", `Could not start proxy (127.0.0:${proxyPort}): ${error.message || "unknown error"}`)
|
||||
|
||||
@@ -11,22 +11,20 @@ import { apiKubePrefix } from "../common/vars";
|
||||
import logger from "./logger"
|
||||
|
||||
export class LensProxy {
|
||||
protected clusterManager: ClusterManager
|
||||
protected proxyServer: http.Server
|
||||
protected router: Router
|
||||
protected closed = false
|
||||
protected retryCounters = new Map<string, number>()
|
||||
|
||||
static create(clusterManager: ClusterManager) {
|
||||
return new LensProxy(clusterManager).listen();
|
||||
static create(port: number, clusterManager: ClusterManager) {
|
||||
return new LensProxy(port, clusterManager).listen();
|
||||
}
|
||||
|
||||
private constructor(clusterManager: ClusterManager) {
|
||||
this.clusterManager = clusterManager;
|
||||
private constructor(protected port: number, protected clusterManager: ClusterManager) {
|
||||
this.router = new Router();
|
||||
}
|
||||
|
||||
listen(port = this.clusterManager.port): this {
|
||||
listen(port = this.port): this {
|
||||
this.proxyServer = this.buildCustomProxy().listen(port);
|
||||
logger.info(`LensProxy server has started http://localhost:${port}`);
|
||||
return this;
|
||||
|
||||
@@ -5,6 +5,7 @@ import type { ClusterId } from "../common/cluster-store";
|
||||
import { clusterStore } from "../common/cluster-store";
|
||||
import logger from "./logger";
|
||||
|
||||
// fixme: error when removing active cluster (can't activate next view => empty window)
|
||||
// fixme: remove switching view delay on first load
|
||||
|
||||
export class WindowManager {
|
||||
|
||||
Reference in new issue
Block a user