Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to hide the cluster manager #219

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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