1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2020-11-27 15:58:33 +02:00
parent 804c1175f6
commit 2672d09202
2 changed files with 21 additions and 12 deletions

View File

@ -2,6 +2,7 @@ import { clusterStore as internalClusterStore, ClusterId } from "../../common/cl
import type { ClusterModel } from "../../common/cluster-store";
import { Cluster } from "../../main/cluster";
import { Singleton } from "../core-api/utils";
import { ObservableMap } from "mobx";
export { Cluster } from "../../main/cluster";
export type { ClusterModel, ClusterId } from "../../common/cluster-store";
@ -14,12 +15,23 @@ export class ClusterStore extends Singleton {
/**
* Active cluster id
*/
activeClusterId = internalClusterStore.activeCluster;
get activeClusterId(): string {
return internalClusterStore.activeCluster;
}
/**
* Set active cluster id
*/
set activeClusterId(id : ClusterId) {
internalClusterStore.activeCluster = id;
}
/**
* Map of all clusters
*/
clusters = internalClusterStore.clusters;
get clusters(): ObservableMap<string, Cluster> {
return internalClusterStore.clusters;
}
/**
* Get active cluster (a cluster which is currently visible)
@ -52,14 +64,6 @@ export class ClusterStore extends Singleton {
return internalClusterStore.connectedClustersList;
}
isActive(id: ClusterId) {
return internalClusterStore.isActive(id);
}
setActive(id: ClusterId) {
return internalClusterStore.setActive(id);
}
/**
* Get cluster object by cluster id
* @param id cluster id

View File

@ -1,5 +1,6 @@
import { Singleton } from "../core-api/utils";
import { workspaceStore as internalWorkspaceStore, WorkspaceStore as InternalWorkspaceStore, Workspace, WorkspaceId } from "../../common/workspace-store";
import { ObservableMap } from "mobx";
export { Workspace } from "../../common/workspace-store";
export type { WorkspaceId, WorkspaceModel } from "../../common/workspace-store";
@ -16,12 +17,16 @@ export class WorkspaceStore extends Singleton {
/**
* Currently active workspace id
*/
currentWorkspaceId = internalWorkspaceStore.currentWorkspaceId;
get currentWorkspaceId(): string {
return internalWorkspaceStore.currentWorkspaceId;
}
/**
* Map of all workspaces
*/
workspaces = internalWorkspaceStore.workspaces;
get workspaces(): ObservableMap<string, Workspace> {
return internalWorkspaceStore.workspaces;
}
/**
* Currently active workspace