Skip to content

Commit

Permalink
Add option to hide the cluster manager for deployments in which id (#219
Browse files Browse the repository at this point in the history
)

doesn't make sense.
  • Loading branch information
ian-r-rose authored Jan 5, 2022
1 parent 6b68852 commit 9467567
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
12 changes: 9 additions & 3 deletions schema/plugin.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"jupyter.lab.setting-icon-class": "dask-DaskLogo",
"jupyter.lab.setting-icon-label": "Dask Dashboard",
"title": "Dask Dashboard",
"description": "Settings for the Dask Dashboard plugin.",
"jupyter.lab.setting-icon-label": "Dask",
"title": "Dask",
"description": "Settings for the Dask plugin.",
"properties": {
"defaultURL": {
"type": "string",
Expand All @@ -14,6 +14,12 @@
"title": "Auto-Start Client",
"description": "If set to true, every notebook and console will automatically have a dask client for the active cluster injected into the kernel under the name 'client'",
"default": false
},
"hideClusterManager": {
"type": "boolean",
"title": "Hide Cluster Manager",
"description": "Some deployments don't want to or are unable to use the cluster manager feature. Toggle to hide it from the user interface (note: this does not disable the underlying functionality).",
"default": false
}
},
"type": "object"
Expand Down
9 changes: 9 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ async function activate(
// into the current session.
let autoStartClient: boolean = false;

// Whether to hide the cluster manager for deployments that don't want to
// or are unable to use it.
let hideClusterManager: boolean = false;

// Update the existing trackers and signals in light of a change to the
// settings system. In particular, this reacts to a change in the setting
// for auto-starting cluster client.
Expand Down Expand Up @@ -343,6 +347,11 @@ async function activate(
// Determine whether to use the auto-starting client.
autoStartClient = settings.get('autoStartClient').composite as boolean;
updateTrackers();

//Determine whether to hide the cluster manager
hideClusterManager = settings.get('hideClusterManager')
.composite as boolean;
sidebar.clusterManager.setHidden(hideClusterManager);
};
onSettingsChanged();
// React to a change in the settings.
Expand Down

0 comments on commit 9467567

Please sign in to comment.