From 6e975fa4b688eb462a47533773fe9bb6b1e05071 Mon Sep 17 00:00:00 2001 From: Roman Date: Tue, 6 Oct 2020 16:31:14 +0300 Subject: [PATCH] add checkbox indication, setActive workspace on cluster select Signed-off-by: Roman --- src/main/tray.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/tray.ts b/src/main/tray.ts index b2cf99a819..707f45366a 100644 --- a/src/main/tray.ts +++ b/src/main/tray.ts @@ -85,11 +85,14 @@ export function createTrayMenu(windowManager: WindowManager): Menu { return { label: workspace.name, toolTip: workspace.description, - submenu: clusters.map(({ id: clusterId, preferences: { clusterName: label }, online }) => { + submenu: clusters.map(cluster => { + const { id: clusterId, preferences: { clusterName: label }, online, workspace } = cluster; return { - label: `${label}${online ? " (online)" : ""}`, + label: `${online ? '✓' : '\x20'.repeat(3)/*offset*/}${label}`, toolTip: clusterId, click() { + workspaceStore.setActive(workspace); + clusterStore.setActive(clusterId); windowManager.bringToTop(); windowManager.navigate(clusterViewURL({ params: { clusterId } })); }