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

Mega update #18

Merged
merged 36 commits into from
Aug 30, 2018
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a7cd344
Remove a bunch of outdated stuff.
ian-r-rose Aug 14, 2018
3b6be2f
Update package.json
ian-r-rose Aug 14, 2018
05938d9
Working skeleton.
ian-r-rose Aug 14, 2018
607c87a
Open the dashboard in an iframe.
ian-r-rose Aug 14, 2018
6c61dad
Initial work on launcher panel.
ian-r-rose Aug 15, 2018
c0cf83b
Open solo routes in iframes.
ian-r-rose Aug 15, 2018
6ca6d46
Get state restoration working.
ian-r-rose Aug 15, 2018
fee6e31
Don't add duplicate dashboards.
ian-r-rose Aug 15, 2018
af6f277
Add url input form.
ian-r-rose Aug 15, 2018
1a996fb
Bump versions for 0.34.
ian-r-rose Aug 28, 2018
b955cdf
Test for existence of a dask dashboard via an <img> tag hack.
ian-r-rose Aug 28, 2018
5c37557
Add some dask logo action.
ian-r-rose Aug 28, 2018
3ef41ec
Update solo-routes to individual-routes.
ian-r-rose Aug 28, 2018
8e68274
Make the buttons reactive to whether it is a valid url.
ian-r-rose Aug 28, 2018
f3813f1
Restore the current dashboard url from the state database.
ian-r-rose Aug 28, 2018
cb9584d
Minor style fixes.
ian-r-rose Aug 28, 2018
3d56658
Allow for setting of a default url via the settings system.
ian-r-rose Aug 29, 2018
3a6b464
Fail a bit more gracefully.
ian-r-rose Aug 29, 2018
07acd42
Fix layout restoration.
ian-r-rose Aug 29, 2018
d2f78de
remove schemaDir from package.json
mrocklin Aug 29, 2018
0e9eba3
Update developer installation notes
mrocklin Aug 29, 2018
d884c93
cleanup readme
mrocklin Aug 29, 2018
6844c24
Restore schema dir.
ian-r-rose Aug 29, 2018
5c4023e
Poll for changes to validity of dashboard URL.
ian-r-rose Aug 29, 2018
53f94b6
Fix error message.
ian-r-rose Aug 29, 2018
bd36968
Edit README.md
ian-r-rose Aug 29, 2018
d705aa3
Output warning to console instead of error message.
ian-r-rose Aug 29, 2018
2e53730
Use dask brand color for buttons.
ian-r-rose Aug 29, 2018
40092af
Initial work on auto-detecting link.
ian-r-rose Aug 29, 2018
053c481
Attempt to auto-detect link for active notebook.
ian-r-rose Aug 29, 2018
42c7969
Don't pop up error message.
ian-r-rose Aug 29, 2018
29323a2
Fix disabled styling.
ian-r-rose Aug 29, 2018
caefc0b
Only check for python kernel.
ian-r-rose Aug 29, 2018
83847d2
Also check code consoles when searching for the link.
ian-r-rose Aug 29, 2018
05a3896
Fix search icon coloring.
ian-r-rose Aug 29, 2018
867be4c
Update svg path and individual routes
mrocklin Aug 30, 2018
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
Prev Previous commit
Next Next commit
Don't add duplicate dashboards.
  • Loading branch information
ian-r-rose committed Aug 15, 2018
commit fee6e318fbcbd736940937d58672a810d2d6474a
17 changes: 15 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function activate(app: JupyterLab, restorer: ILayoutRestorer): void {
dashboardLauncher.id = 'dask-dashboard-launcher';
dashboardLauncher.title.label = 'Dask';

const tracker = new InstanceTracker<MainAreaWidget>({
const tracker = new InstanceTracker<MainAreaWidget<IFrame>>({
namespace: 'dask-dashboard'
});

Expand All @@ -73,9 +73,22 @@ function activate(app: JupyterLab, restorer: ILayoutRestorer): void {
label: args => `Launch Dask ${(args['label'] as string) || ''} Dashboard`,
caption: 'Launch a Dask dashboard',
execute: args => {
// Construct the url for the dashboard.
const route = (args['route'] as string) || '';
const baseUrl = 'http://localhost:8787';
const url = URLExt.join(baseUrl, route);

// If we already have a dashboard open to this url, activate it
// but don't create a duplicate.
const w = tracker.find(w => w.content.url === url);
if (w) {
app.shell.activateById(w.id);
return;
}

// Otherwise create the new dashboard widget.
const iframe = new IFrame();
iframe.url = `http://localhost:8787/${route}`;
iframe.url = url;
const widget = new MainAreaWidget({ content: iframe });
widget.id = `dask-dashboard-${Private.id++}`;
widget.title.label = `Dask ${(args['label'] as string) || ''}`;
Expand Down