added tracking cluster-manager's ipc events

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman committed 2020-07-07 21:13:23 +03:00
1 parent f474a20904
commit cf00debb33
2 files changed
+20 -5

No files matched your search

+7
View File
@@ -5,6 +5,7 @@ import { clusterStore } from "./cluster-store"
export type WorkspaceId = string;
export interface WorkspaceStoreModel {
currentWorkspace?: WorkspaceId; // last visited/activated
workspaces: Workspace[]
}
@@ -18,6 +19,7 @@ export class WorkspaceStore extends BaseStore<WorkspaceStoreModel> {
static readonly defaultId: WorkspaceId = "default"
protected data: WorkspaceStoreModel = {
currentWorkspace: WorkspaceStore.defaultId,
workspaces: [{
id: WorkspaceStore.defaultId,
name: "default"
@@ -42,6 +44,11 @@ export class WorkspaceStore extends BaseStore<WorkspaceStoreModel> {
return this.workspaces.findIndex(workspace => workspace.id === id);
}
@action
setCurrent(id: WorkspaceId) {
this.data.currentWorkspace = id;
}
@action
public saveWorkspace(newWorkspace: Workspace) {
const workspace = this.getById(newWorkspace.id);