Skip to content

Commit 55711ee

Browse files
authored
Merge pull request #7 from huntdatacenter/dev
update control panel btn
2 parents 3e5f823 + 39f19e7 commit 55711ee

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jupyterlab-logout",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "JupyterLab Logout Button",
55
"keywords": [
66
"jupyter",

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ classifiers = [
2020
"Programming Language :: Python :: 3.9",
2121
"Programming Language :: Python :: 3.10",
2222
"Programming Language :: Python :: 3.11",
23+
"Programming Language :: Python :: 3.12",
24+
"Programming Language :: Python :: 3.13",
2325
]
2426
dependencies = [
2527
"jupyterlab>=4.0.0,<5",

src/index.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,21 @@ const extension: JupyterFrontEndPlugin<void> = {
2929
router: IRouter,
3030
toolbarRegistry: IToolbarWidgetRegistry,
3131
): Promise<void> => {
32-
console.log('jupyterlab-logout extension is activated!');
3332
console.log(
3433
'%cWelcome to HUNT Workbench!',
3534
'margin: 12px; color: #00509e; font-weight: bold; font-size: 20px',
3635
);
3736
if (window && window.location && window.location.origin) {
3837
const hubUrl = `${window.location.origin}/hub/home`;
3938
console.log(
40-
`%cHub: ${hubUrl}`,
39+
`%cHub control panel: ${hubUrl}`,
4140
'margin: 24px 12px 24px 12px; font-size: 14px',
4241
);
4342
}
43+
console.log(
44+
'%cGetting started: https://docs.hdc.ntnu.no/do-science/hunt-workbench/getting-started/',
45+
'margin: 24px 12px 24px 12px; font-size: 14px',
46+
);
4447
console.log(
4548
'%cAre you looking for troubleshooting guides?',
4649
'margin: 12px; color: #00509e; font-weight: bold; font-size: 20px',
@@ -49,6 +52,7 @@ const extension: JupyterFrontEndPlugin<void> = {
4952
'%chttps://docs.hdc.ntnu.no/do-science/hunt-workbench/troubleshooting/',
5053
'margin: 24px 12px 24px 12px; font-size: 14px',
5154
);
55+
console.log('activating jupyterlab-logout extension');
5256

5357
app.commands.addCommand(CommandIds.hdcdocs, {
5458
label: 'Documentation',
@@ -102,7 +106,15 @@ const extension: JupyterFrontEndPlugin<void> = {
102106
label: 'Control Panel',
103107
isVisible: () => false,
104108
execute: (args: any) => {
105-
router.navigate('/hub/home', { hard: true });
109+
let hubUrl = '/hub/home';
110+
if (window && window.location && window.location.origin) {
111+
hubUrl = `${window.location.origin}/hub/home`;
112+
// Redirect without router since redirecting to external URL
113+
console.log(`Redirecting to ${hubUrl}`);
114+
window.open(hubUrl, '_blank');
115+
} else {
116+
router.navigate(hubUrl, { hard: true });
117+
}
106118
},
107119
});
108120

@@ -179,6 +191,8 @@ const extension: JupyterFrontEndPlugin<void> = {
179191
});
180192
return lougoutDivWidget;
181193
});
194+
195+
console.log('jupyterlab-logout extension is activated!');
182196
},
183197
};
184198

0 commit comments

Comments
 (0)