@jupyterlab/running 4.0.0-alpha.2 → 4.0.0-alpha.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +86 -7
- package/lib/index.js +142 -64
- package/lib/index.js.map +1 -1
- package/package.json +12 -11
- package/src/index.tsx +522 -0
- package/style/base.css +32 -48
package/lib/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @module running
|
|
4
4
|
*/
|
|
5
5
|
import { ITranslator } from '@jupyterlab/translation';
|
|
6
|
-
import { LabIcon,
|
|
6
|
+
import { LabIcon, SidePanel } from '@jupyterlab/ui-components';
|
|
7
7
|
import { Token } from '@lumino/coreutils';
|
|
8
8
|
import { IDisposable } from '@lumino/disposable';
|
|
9
9
|
import { ISignal } from '@lumino/signaling';
|
|
@@ -22,12 +22,20 @@ export interface IRunningSessionManagers {
|
|
|
22
22
|
*
|
|
23
23
|
*/
|
|
24
24
|
add(manager: IRunningSessions.IManager): IDisposable;
|
|
25
|
+
/**
|
|
26
|
+
* Signal emitted when a new manager is added.
|
|
27
|
+
*/
|
|
28
|
+
added: ISignal<IRunningSessionManagers, IRunningSessions.IManager>;
|
|
25
29
|
/**
|
|
26
30
|
* Return an array of managers.
|
|
27
31
|
*/
|
|
28
32
|
items(): ReadonlyArray<IRunningSessions.IManager>;
|
|
29
33
|
}
|
|
30
34
|
export declare class RunningSessionManagers implements IRunningSessionManagers {
|
|
35
|
+
/**
|
|
36
|
+
* Signal emitted when a new manager is added.
|
|
37
|
+
*/
|
|
38
|
+
get added(): ISignal<this, IRunningSessions.IManager>;
|
|
31
39
|
/**
|
|
32
40
|
* Add a running item manager.
|
|
33
41
|
*
|
|
@@ -39,18 +47,29 @@ export declare class RunningSessionManagers implements IRunningSessionManagers {
|
|
|
39
47
|
* Return an iterator of launcher items.
|
|
40
48
|
*/
|
|
41
49
|
items(): ReadonlyArray<IRunningSessions.IManager>;
|
|
50
|
+
private _added;
|
|
42
51
|
private _managers;
|
|
43
52
|
}
|
|
44
53
|
/**
|
|
45
54
|
* A class that exposes the running terminal and kernel sessions.
|
|
46
55
|
*/
|
|
47
|
-
export declare class RunningSessions extends
|
|
56
|
+
export declare class RunningSessions extends SidePanel {
|
|
48
57
|
/**
|
|
49
58
|
* Construct a new running widget.
|
|
50
59
|
*/
|
|
51
60
|
constructor(managers: IRunningSessionManagers, translator?: ITranslator);
|
|
52
|
-
|
|
53
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Dispose the resources held by the widget
|
|
63
|
+
*/
|
|
64
|
+
dispose(): void;
|
|
65
|
+
/**
|
|
66
|
+
* Add a section for a new manager.
|
|
67
|
+
*
|
|
68
|
+
* @param managers Managers
|
|
69
|
+
* @param manager New manager
|
|
70
|
+
*/
|
|
71
|
+
protected addSection(_: unknown, manager: IRunningSessions.IManager): void;
|
|
72
|
+
protected managers: IRunningSessionManagers;
|
|
54
73
|
protected translator: ITranslator;
|
|
55
74
|
}
|
|
56
75
|
/**
|
|
@@ -61,25 +80,85 @@ export declare namespace IRunningSessions {
|
|
|
61
80
|
* A manager of running items grouped under a single section.
|
|
62
81
|
*/
|
|
63
82
|
interface IManager {
|
|
83
|
+
/**
|
|
84
|
+
* Name that is shown to the user in plural.
|
|
85
|
+
*/
|
|
64
86
|
name: string;
|
|
87
|
+
/**
|
|
88
|
+
* Called when the shutdown all button is pressed.
|
|
89
|
+
*/
|
|
65
90
|
shutdownAll(): void;
|
|
91
|
+
/**
|
|
92
|
+
* List the running models.
|
|
93
|
+
*/
|
|
66
94
|
running(): IRunningItem[];
|
|
95
|
+
/**
|
|
96
|
+
* Force a refresh of the running models.
|
|
97
|
+
*/
|
|
67
98
|
refreshRunning(): void;
|
|
99
|
+
/**
|
|
100
|
+
* A signal that should be emitted when the item list has changed.
|
|
101
|
+
*/
|
|
68
102
|
runningChanged: ISignal<any, any>;
|
|
103
|
+
/**
|
|
104
|
+
* A string used to describe the shutdown action.
|
|
105
|
+
*/
|
|
69
106
|
shutdownLabel?: string;
|
|
107
|
+
/**
|
|
108
|
+
* A string used to describe the shutdown all action.
|
|
109
|
+
*/
|
|
70
110
|
shutdownAllLabel?: string;
|
|
111
|
+
/**
|
|
112
|
+
* A string used as the body text in the shutdown all confirmation dialog.
|
|
113
|
+
*/
|
|
71
114
|
shutdownAllConfirmationText?: string;
|
|
115
|
+
/**
|
|
116
|
+
* The icon to show for shutting down an individual item in this section.
|
|
117
|
+
*/
|
|
72
118
|
shutdownItemIcon?: LabIcon;
|
|
73
119
|
}
|
|
74
120
|
/**
|
|
75
121
|
* A running item.
|
|
76
122
|
*/
|
|
77
123
|
interface IRunningItem {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
124
|
+
/**
|
|
125
|
+
* Optional child nodes that belong to a top-level running item.
|
|
126
|
+
*/
|
|
127
|
+
children?: IRunningItem[];
|
|
128
|
+
/**
|
|
129
|
+
* Optional CSS class name to add to the running item.
|
|
130
|
+
*/
|
|
131
|
+
className?: string;
|
|
132
|
+
/**
|
|
133
|
+
* Optional context hint to add to the `data-context` attribute of an item.
|
|
134
|
+
*/
|
|
135
|
+
context?: string;
|
|
136
|
+
/**
|
|
137
|
+
* Called when the running item is clicked.
|
|
138
|
+
*/
|
|
139
|
+
open?: () => void;
|
|
140
|
+
/**
|
|
141
|
+
* Called when the shutdown button is pressed on a particular item.
|
|
142
|
+
*/
|
|
143
|
+
shutdown?: () => void;
|
|
144
|
+
/**
|
|
145
|
+
* The `LabIcon` to use as the icon for the running item or the string
|
|
146
|
+
* `src` URL.
|
|
147
|
+
*/
|
|
148
|
+
icon: () => LabIcon | string;
|
|
149
|
+
/**
|
|
150
|
+
* Called to determine the label for each item.
|
|
151
|
+
*/
|
|
81
152
|
label: () => string;
|
|
153
|
+
/**
|
|
154
|
+
* Called to determine the `title` attribute for each item, which is
|
|
155
|
+
* revealed on hover.
|
|
156
|
+
*/
|
|
82
157
|
labelTitle?: () => string;
|
|
158
|
+
/**
|
|
159
|
+
* Called to determine the `detail` attribute, which is shown optionally in
|
|
160
|
+
* a column after the label.
|
|
161
|
+
*/
|
|
83
162
|
detail?: () => string;
|
|
84
163
|
}
|
|
85
164
|
}
|
package/lib/index.js
CHANGED
|
@@ -6,26 +6,19 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { Dialog, showDialog } from '@jupyterlab/apputils';
|
|
8
8
|
import { nullTranslator } from '@jupyterlab/translation';
|
|
9
|
-
import { closeIcon, ReactWidget, refreshIcon, ToolbarButtonComponent, UseSignal } from '@jupyterlab/ui-components';
|
|
9
|
+
import { caretDownIcon, caretRightIcon, closeIcon, PanelWithToolbar, ReactWidget, refreshIcon, SidePanel, ToolbarButton, ToolbarButtonComponent, UseSignal } from '@jupyterlab/ui-components';
|
|
10
10
|
import { Token } from '@lumino/coreutils';
|
|
11
11
|
import { DisposableDelegate } from '@lumino/disposable';
|
|
12
|
+
import { Signal } from '@lumino/signaling';
|
|
12
13
|
import * as React from 'react';
|
|
13
14
|
/**
|
|
14
15
|
* The class name added to a running widget.
|
|
15
16
|
*/
|
|
16
17
|
const RUNNING_CLASS = 'jp-RunningSessions';
|
|
17
|
-
/**
|
|
18
|
-
* The class name added to a running widget header.
|
|
19
|
-
*/
|
|
20
|
-
const HEADER_CLASS = 'jp-RunningSessions-header';
|
|
21
18
|
/**
|
|
22
19
|
* The class name added to the running terminal sessions section.
|
|
23
20
|
*/
|
|
24
21
|
const SECTION_CLASS = 'jp-RunningSessions-section';
|
|
25
|
-
/**
|
|
26
|
-
* The class name added to the running sessions section header.
|
|
27
|
-
*/
|
|
28
|
-
const SECTION_HEADER_CLASS = 'jp-RunningSessions-sectionHeader';
|
|
29
22
|
/**
|
|
30
23
|
* The class name added to a section container.
|
|
31
24
|
*/
|
|
@@ -54,15 +47,21 @@ const SHUTDOWN_BUTTON_CLASS = 'jp-RunningSessions-itemShutdown';
|
|
|
54
47
|
* The class name added to a running session item shutdown button.
|
|
55
48
|
*/
|
|
56
49
|
const SHUTDOWN_ALL_BUTTON_CLASS = 'jp-RunningSessions-shutdownAll';
|
|
57
|
-
/* tslint:disable */
|
|
58
50
|
/**
|
|
59
51
|
* The running sessions token.
|
|
60
52
|
*/
|
|
61
53
|
export const IRunningSessionManagers = new Token('@jupyterlab/running:IRunningSessionManagers');
|
|
62
54
|
export class RunningSessionManagers {
|
|
63
55
|
constructor() {
|
|
56
|
+
this._added = new Signal(this);
|
|
64
57
|
this._managers = [];
|
|
65
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Signal emitted when a new manager is added.
|
|
61
|
+
*/
|
|
62
|
+
get added() {
|
|
63
|
+
return this._added;
|
|
64
|
+
}
|
|
66
65
|
/**
|
|
67
66
|
* Add a running item manager.
|
|
68
67
|
*
|
|
@@ -71,6 +70,7 @@ export class RunningSessionManagers {
|
|
|
71
70
|
*/
|
|
72
71
|
add(manager) {
|
|
73
72
|
this._managers.push(manager);
|
|
73
|
+
this._added.emit(manager);
|
|
74
74
|
return new DisposableDelegate(() => {
|
|
75
75
|
const i = this._managers.indexOf(manager);
|
|
76
76
|
if (i > -1) {
|
|
@@ -86,25 +86,48 @@ export class RunningSessionManagers {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
function Item(props) {
|
|
89
|
-
var _a;
|
|
89
|
+
var _a, _b;
|
|
90
90
|
const { runningItem } = props;
|
|
91
|
-
const
|
|
91
|
+
const classList = [ITEM_CLASS];
|
|
92
92
|
const detail = (_a = runningItem.detail) === null || _a === void 0 ? void 0 : _a.call(runningItem);
|
|
93
|
+
const icon = runningItem.icon();
|
|
94
|
+
const title = runningItem.labelTitle ? runningItem.labelTitle() : '';
|
|
93
95
|
const translator = props.translator || nullTranslator;
|
|
94
96
|
const trans = translator.load('jupyterlab');
|
|
95
|
-
|
|
97
|
+
// Handle shutdown requests.
|
|
98
|
+
let stopPropagation = false;
|
|
96
99
|
const shutdownItemIcon = props.shutdownItemIcon || closeIcon;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
100
|
+
const shutdownLabel = props.shutdownLabel || trans.__('Shut Down');
|
|
101
|
+
const shutdown = () => {
|
|
102
|
+
var _a;
|
|
103
|
+
stopPropagation = true;
|
|
104
|
+
(_a = runningItem.shutdown) === null || _a === void 0 ? void 0 : _a.call(runningItem);
|
|
105
|
+
};
|
|
106
|
+
// Manage collapsed state. Use the shutdown flag in lieu of `stopPropagation`.
|
|
107
|
+
const [collapsed, collapse] = React.useState(false);
|
|
108
|
+
const collapsible = !!((_b = runningItem.children) === null || _b === void 0 ? void 0 : _b.length);
|
|
109
|
+
const onClick = collapsible
|
|
110
|
+
? () => !stopPropagation && collapse(!collapsed)
|
|
111
|
+
: undefined;
|
|
112
|
+
if (runningItem.className) {
|
|
113
|
+
classList.push(runningItem.className);
|
|
114
|
+
}
|
|
115
|
+
if (props.child) {
|
|
116
|
+
classList.push('jp-mod-running-child');
|
|
117
|
+
}
|
|
118
|
+
return (React.createElement(React.Fragment, null,
|
|
119
|
+
React.createElement("li", null,
|
|
120
|
+
React.createElement("div", { className: classList.join(' '), onClick: onClick, "data-context": runningItem.context || '' },
|
|
121
|
+
collapsible &&
|
|
122
|
+
(collapsed ? (React.createElement(caretRightIcon.react, { tag: "span", stylesheet: "runningItem" })) : (React.createElement(caretDownIcon.react, { tag: "span", stylesheet: "runningItem" }))),
|
|
123
|
+
typeof icon === 'string' ? (icon ? (React.createElement("img", { src: icon })) : undefined) : (React.createElement(icon.react, { tag: "span", stylesheet: "runningItem" })),
|
|
124
|
+
React.createElement("span", { className: ITEM_LABEL_CLASS, title: title, onClick: runningItem.open && (() => runningItem.open()) }, runningItem.label()),
|
|
125
|
+
detail && React.createElement("span", { className: ITEM_DETAIL_CLASS }, detail),
|
|
126
|
+
runningItem.shutdown && (React.createElement(ToolbarButtonComponent, { className: SHUTDOWN_BUTTON_CLASS, icon: shutdownItemIcon, onClick: shutdown, tooltip: shutdownLabel }))),
|
|
127
|
+
collapsible && !collapsed && (React.createElement(List, { child: true, runningItems: runningItem.children, shutdownItemIcon: shutdownItemIcon, translator: translator })))));
|
|
105
128
|
}
|
|
106
129
|
function List(props) {
|
|
107
|
-
return (React.createElement(
|
|
130
|
+
return (React.createElement("ul", { className: LIST_CLASS }, props.runningItems.map((item, i) => (React.createElement(Item, { child: props.child, key: i, runningItem: item, shutdownLabel: props.shutdownLabel, shutdownItemIcon: props.shutdownItemIcon, translator: props.translator })))));
|
|
108
131
|
}
|
|
109
132
|
/**
|
|
110
133
|
* The Section component contains the shared look and feel for an interactive
|
|
@@ -112,62 +135,117 @@ function List(props) {
|
|
|
112
135
|
*
|
|
113
136
|
* It is specialized for each based on its props.
|
|
114
137
|
*/
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
138
|
+
class Section extends PanelWithToolbar {
|
|
139
|
+
constructor(options) {
|
|
140
|
+
super();
|
|
141
|
+
this._manager = options.manager;
|
|
142
|
+
const translator = options.translator || nullTranslator;
|
|
143
|
+
const trans = translator.load('jupyterlab');
|
|
144
|
+
const shutdownAllLabel = options.manager.shutdownAllLabel || trans.__('Shut Down All');
|
|
145
|
+
const shutdownTitle = `${shutdownAllLabel}?`;
|
|
146
|
+
const shutdownAllConfirmationText = options.manager.shutdownAllConfirmationText ||
|
|
147
|
+
`${shutdownAllLabel} ${options.manager.name}`;
|
|
148
|
+
this.addClass(SECTION_CLASS);
|
|
149
|
+
this.title.label = options.manager.name;
|
|
150
|
+
function onShutdown() {
|
|
151
|
+
void showDialog({
|
|
152
|
+
title: shutdownTitle,
|
|
153
|
+
body: shutdownAllConfirmationText,
|
|
154
|
+
buttons: [
|
|
155
|
+
Dialog.cancelButton(),
|
|
156
|
+
Dialog.warnButton({ label: shutdownAllLabel })
|
|
157
|
+
]
|
|
158
|
+
}).then(result => {
|
|
159
|
+
if (result.button.accept) {
|
|
160
|
+
options.manager.shutdownAll();
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
let runningItems = options.manager.running();
|
|
165
|
+
let cached = true;
|
|
166
|
+
const enabled = runningItems.length > 0;
|
|
167
|
+
this._button = new ToolbarButton({
|
|
168
|
+
label: shutdownAllLabel,
|
|
169
|
+
className: `${SHUTDOWN_ALL_BUTTON_CLASS} jp-mod-styled ${!enabled && 'jp-mod-disabled'}`,
|
|
170
|
+
enabled,
|
|
171
|
+
onClick: onShutdown
|
|
134
172
|
});
|
|
173
|
+
this._manager.runningChanged.connect(this._updateButton, this);
|
|
174
|
+
this.toolbar.addItem('shutdown-all', this._button);
|
|
175
|
+
this.addWidget(ReactWidget.create(React.createElement(UseSignal, { signal: options.manager.runningChanged }, () => {
|
|
176
|
+
// Cache the running items for the intial load and request from
|
|
177
|
+
// the service every subsequent load.
|
|
178
|
+
if (cached) {
|
|
179
|
+
cached = false;
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
runningItems = options.manager.running();
|
|
183
|
+
}
|
|
184
|
+
return (React.createElement("div", { className: CONTAINER_CLASS },
|
|
185
|
+
React.createElement(List, { runningItems: runningItems, shutdownLabel: options.manager.shutdownLabel, shutdownAllLabel: shutdownAllLabel, shutdownItemIcon: options.manager.shutdownItemIcon, translator: options.translator })));
|
|
186
|
+
})));
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Dispose the resources held by the widget
|
|
190
|
+
*/
|
|
191
|
+
dispose() {
|
|
192
|
+
if (this.isDisposed) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
this._manager.runningChanged.disconnect(this._updateButton, this);
|
|
196
|
+
super.dispose();
|
|
197
|
+
}
|
|
198
|
+
_updateButton() {
|
|
199
|
+
var _a, _b;
|
|
200
|
+
const button = this._button;
|
|
201
|
+
button.enabled = this._manager.running().length > 0;
|
|
202
|
+
if (button.enabled) {
|
|
203
|
+
(_a = button.node.querySelector('button')) === null || _a === void 0 ? void 0 : _a.classList.remove('jp-mod-disabled');
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
(_b = button.node.querySelector('button')) === null || _b === void 0 ? void 0 : _b.classList.add('jp-mod-disabled');
|
|
207
|
+
}
|
|
135
208
|
}
|
|
136
|
-
return (React.createElement("div", { className: SECTION_CLASS },
|
|
137
|
-
React.createElement(React.Fragment, null,
|
|
138
|
-
React.createElement("div", { className: `${SECTION_HEADER_CLASS} jp-stack-panel-header` },
|
|
139
|
-
React.createElement("h2", null, props.manager.name),
|
|
140
|
-
React.createElement(UseSignal, { signal: props.manager.runningChanged }, () => {
|
|
141
|
-
const disabled = props.manager.running().length === 0;
|
|
142
|
-
return (React.createElement("button", { className: `${SHUTDOWN_ALL_BUTTON_CLASS} jp-mod-styled ${disabled && 'jp-mod-disabled'}`, disabled: disabled, onClick: onShutdown }, shutdownAllLabel));
|
|
143
|
-
})),
|
|
144
|
-
React.createElement("div", { className: CONTAINER_CLASS },
|
|
145
|
-
React.createElement(List, { manager: props.manager, shutdownLabel: props.manager.shutdownLabel, shutdownAllLabel: shutdownAllLabel, translator: props.translator })))));
|
|
146
|
-
}
|
|
147
|
-
function RunningSessionsComponent(props) {
|
|
148
|
-
const translator = props.translator || nullTranslator;
|
|
149
|
-
const trans = translator.load('jupyterlab');
|
|
150
|
-
return (React.createElement(React.Fragment, null,
|
|
151
|
-
React.createElement("div", { className: HEADER_CLASS },
|
|
152
|
-
React.createElement(ToolbarButtonComponent, { tooltip: trans.__('Refresh List'), icon: refreshIcon, onClick: () => props.managers.items().forEach(manager => manager.refreshRunning()) })),
|
|
153
|
-
props.managers.items().map(manager => (React.createElement(Section, { key: manager.name, manager: manager, translator: props.translator })))));
|
|
154
209
|
}
|
|
155
210
|
/**
|
|
156
211
|
* A class that exposes the running terminal and kernel sessions.
|
|
157
212
|
*/
|
|
158
|
-
export class RunningSessions extends
|
|
213
|
+
export class RunningSessions extends SidePanel {
|
|
159
214
|
/**
|
|
160
215
|
* Construct a new running widget.
|
|
161
216
|
*/
|
|
162
217
|
constructor(managers, translator) {
|
|
163
218
|
super();
|
|
164
219
|
this.managers = managers;
|
|
165
|
-
this.translator = translator
|
|
166
|
-
|
|
220
|
+
this.translator = translator !== null && translator !== void 0 ? translator : nullTranslator;
|
|
221
|
+
const trans = this.translator.load('jupyterlab');
|
|
167
222
|
this.addClass(RUNNING_CLASS);
|
|
223
|
+
this.toolbar.addItem('refresh', new ToolbarButton({
|
|
224
|
+
tooltip: trans.__('Refresh List'),
|
|
225
|
+
icon: refreshIcon,
|
|
226
|
+
onClick: () => managers.items().forEach(manager => manager.refreshRunning())
|
|
227
|
+
}));
|
|
228
|
+
managers.items().forEach(manager => this.addSection(managers, manager));
|
|
229
|
+
managers.added.connect(this.addSection, this);
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Dispose the resources held by the widget
|
|
233
|
+
*/
|
|
234
|
+
dispose() {
|
|
235
|
+
if (this.isDisposed) {
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
this.managers.added.disconnect(this.addSection, this);
|
|
239
|
+
super.dispose();
|
|
168
240
|
}
|
|
169
|
-
|
|
170
|
-
|
|
241
|
+
/**
|
|
242
|
+
* Add a section for a new manager.
|
|
243
|
+
*
|
|
244
|
+
* @param managers Managers
|
|
245
|
+
* @param manager New manager
|
|
246
|
+
*/
|
|
247
|
+
addSection(_, manager) {
|
|
248
|
+
this.addWidget(new Section({ manager, translator: this.translator }));
|
|
171
249
|
}
|
|
172
250
|
}
|
|
173
251
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],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a,CAAC,CAAC;QAE7B,IAAI,CAAC,OAAO,CAAC,OAAO,CAClB,SAAS,EACT,IAAI,aAAa,CAAC;YAChB,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC;YACjC,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,GAAG,EAAE,CACZ,QAAQ,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;SAChE,CAAC,CACH,CAAC;QAEF,QAAQ,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;QAExE,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,OAAO;QACL,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,OAAO;SACR;QACD,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QACtD,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC;IAED;;;;;OAKG;IACO,UAAU,CAAC,CAAU,EAAE,OAAkC;QACjE,IAAI,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IACxE,CAAC;CAIF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyterlab/running",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.20",
|
|
4
4
|
"description": "JupyterLab - Running Sessions Panel",
|
|
5
5
|
"homepage": "https://github.com/jupyterlab/jupyterlab",
|
|
6
6
|
"bugs": {
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"lib/*.js.map",
|
|
28
28
|
"lib/*.js",
|
|
29
29
|
"style/*.css",
|
|
30
|
-
"style/index.js"
|
|
30
|
+
"style/index.js",
|
|
31
|
+
"src/**/*.{ts,tsx}"
|
|
31
32
|
],
|
|
32
33
|
"scripts": {
|
|
33
34
|
"build": "tsc -b",
|
|
@@ -36,18 +37,18 @@
|
|
|
36
37
|
"watch": "tsc -b --watch"
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"@jupyterlab/apputils": "^4.0.0-alpha.
|
|
40
|
-
"@jupyterlab/translation": "^4.0.0-alpha.
|
|
41
|
-
"@jupyterlab/ui-components": "^4.0.0-alpha.
|
|
42
|
-
"@lumino/coreutils": "^
|
|
43
|
-
"@lumino/disposable": "^
|
|
44
|
-
"@lumino/signaling": "^
|
|
45
|
-
"react": "^
|
|
40
|
+
"@jupyterlab/apputils": "^4.0.0-alpha.20",
|
|
41
|
+
"@jupyterlab/translation": "^4.0.0-alpha.20",
|
|
42
|
+
"@jupyterlab/ui-components": "^4.0.0-alpha.35",
|
|
43
|
+
"@lumino/coreutils": "^2.0.0-rc.0",
|
|
44
|
+
"@lumino/disposable": "^2.0.0-rc.0",
|
|
45
|
+
"@lumino/signaling": "^2.0.0-rc.0",
|
|
46
|
+
"react": "^18.2.0"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
49
|
"rimraf": "~3.0.0",
|
|
49
|
-
"typedoc": "~0.
|
|
50
|
-
"typescript": "~
|
|
50
|
+
"typedoc": "~0.23.25",
|
|
51
|
+
"typescript": "~5.0.0-beta"
|
|
51
52
|
},
|
|
52
53
|
"publishConfig": {
|
|
53
54
|
"access": "public"
|
package/src/index.tsx
ADDED
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
// Copyright (c) Jupyter Development Team.
|
|
2
|
+
// Distributed under the terms of the Modified BSD License.
|
|
3
|
+
/**
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
* @module running
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { Dialog, showDialog } from '@jupyterlab/apputils';
|
|
9
|
+
import { ITranslator, nullTranslator } from '@jupyterlab/translation';
|
|
10
|
+
import {
|
|
11
|
+
caretDownIcon,
|
|
12
|
+
caretRightIcon,
|
|
13
|
+
closeIcon,
|
|
14
|
+
LabIcon,
|
|
15
|
+
PanelWithToolbar,
|
|
16
|
+
ReactWidget,
|
|
17
|
+
refreshIcon,
|
|
18
|
+
SidePanel,
|
|
19
|
+
ToolbarButton,
|
|
20
|
+
ToolbarButtonComponent,
|
|
21
|
+
UseSignal
|
|
22
|
+
} from '@jupyterlab/ui-components';
|
|
23
|
+
import { Token } from '@lumino/coreutils';
|
|
24
|
+
import { DisposableDelegate, IDisposable } from '@lumino/disposable';
|
|
25
|
+
import { ISignal, Signal } from '@lumino/signaling';
|
|
26
|
+
import * as React from 'react';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The class name added to a running widget.
|
|
30
|
+
*/
|
|
31
|
+
const RUNNING_CLASS = 'jp-RunningSessions';
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The class name added to the running terminal sessions section.
|
|
35
|
+
*/
|
|
36
|
+
const SECTION_CLASS = 'jp-RunningSessions-section';
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The class name added to a section container.
|
|
40
|
+
*/
|
|
41
|
+
const CONTAINER_CLASS = 'jp-RunningSessions-sectionContainer';
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The class name added to the running kernel sessions section list.
|
|
45
|
+
*/
|
|
46
|
+
const LIST_CLASS = 'jp-RunningSessions-sectionList';
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The class name added to the running sessions items.
|
|
50
|
+
*/
|
|
51
|
+
const ITEM_CLASS = 'jp-RunningSessions-item';
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The class name added to a running session item label.
|
|
55
|
+
*/
|
|
56
|
+
const ITEM_LABEL_CLASS = 'jp-RunningSessions-itemLabel';
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The class name added to a running session item detail.
|
|
60
|
+
*/
|
|
61
|
+
const ITEM_DETAIL_CLASS = 'jp-RunningSessions-itemDetail';
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The class name added to a running session item shutdown button.
|
|
65
|
+
*/
|
|
66
|
+
const SHUTDOWN_BUTTON_CLASS = 'jp-RunningSessions-itemShutdown';
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The class name added to a running session item shutdown button.
|
|
70
|
+
*/
|
|
71
|
+
const SHUTDOWN_ALL_BUTTON_CLASS = 'jp-RunningSessions-shutdownAll';
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* The running sessions token.
|
|
75
|
+
*/
|
|
76
|
+
export const IRunningSessionManagers = new Token<IRunningSessionManagers>(
|
|
77
|
+
'@jupyterlab/running:IRunningSessionManagers'
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The running interface.
|
|
82
|
+
*/
|
|
83
|
+
export interface IRunningSessionManagers {
|
|
84
|
+
/**
|
|
85
|
+
* Add a running item manager.
|
|
86
|
+
*
|
|
87
|
+
* @param manager - The running item manager.
|
|
88
|
+
*
|
|
89
|
+
*/
|
|
90
|
+
add(manager: IRunningSessions.IManager): IDisposable;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Signal emitted when a new manager is added.
|
|
94
|
+
*/
|
|
95
|
+
added: ISignal<IRunningSessionManagers, IRunningSessions.IManager>;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Return an array of managers.
|
|
99
|
+
*/
|
|
100
|
+
items(): ReadonlyArray<IRunningSessions.IManager>;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export class RunningSessionManagers implements IRunningSessionManagers {
|
|
104
|
+
/**
|
|
105
|
+
* Signal emitted when a new manager is added.
|
|
106
|
+
*/
|
|
107
|
+
get added(): ISignal<this, IRunningSessions.IManager> {
|
|
108
|
+
return this._added;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Add a running item manager.
|
|
113
|
+
*
|
|
114
|
+
* @param manager - The running item manager.
|
|
115
|
+
*
|
|
116
|
+
*/
|
|
117
|
+
add(manager: IRunningSessions.IManager): IDisposable {
|
|
118
|
+
this._managers.push(manager);
|
|
119
|
+
this._added.emit(manager);
|
|
120
|
+
return new DisposableDelegate(() => {
|
|
121
|
+
const i = this._managers.indexOf(manager);
|
|
122
|
+
|
|
123
|
+
if (i > -1) {
|
|
124
|
+
this._managers.splice(i, 1);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Return an iterator of launcher items.
|
|
131
|
+
*/
|
|
132
|
+
items(): ReadonlyArray<IRunningSessions.IManager> {
|
|
133
|
+
return this._managers;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
private _added = new Signal<this, IRunningSessions.IManager>(this);
|
|
137
|
+
private _managers: IRunningSessions.IManager[] = [];
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function Item(props: {
|
|
141
|
+
child?: boolean;
|
|
142
|
+
runningItem: IRunningSessions.IRunningItem;
|
|
143
|
+
shutdownLabel?: string;
|
|
144
|
+
shutdownItemIcon?: LabIcon;
|
|
145
|
+
translator?: ITranslator;
|
|
146
|
+
}) {
|
|
147
|
+
const { runningItem } = props;
|
|
148
|
+
const classList = [ITEM_CLASS];
|
|
149
|
+
const detail = runningItem.detail?.();
|
|
150
|
+
const icon = runningItem.icon();
|
|
151
|
+
const title = runningItem.labelTitle ? runningItem.labelTitle() : '';
|
|
152
|
+
const translator = props.translator || nullTranslator;
|
|
153
|
+
const trans = translator.load('jupyterlab');
|
|
154
|
+
|
|
155
|
+
// Handle shutdown requests.
|
|
156
|
+
let stopPropagation = false;
|
|
157
|
+
const shutdownItemIcon = props.shutdownItemIcon || closeIcon;
|
|
158
|
+
const shutdownLabel = props.shutdownLabel || trans.__('Shut Down');
|
|
159
|
+
const shutdown = () => {
|
|
160
|
+
stopPropagation = true;
|
|
161
|
+
runningItem.shutdown?.();
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
// Manage collapsed state. Use the shutdown flag in lieu of `stopPropagation`.
|
|
165
|
+
const [collapsed, collapse] = React.useState(false);
|
|
166
|
+
const collapsible = !!runningItem.children?.length;
|
|
167
|
+
const onClick = collapsible
|
|
168
|
+
? () => !stopPropagation && collapse(!collapsed)
|
|
169
|
+
: undefined;
|
|
170
|
+
|
|
171
|
+
if (runningItem.className) {
|
|
172
|
+
classList.push(runningItem.className);
|
|
173
|
+
}
|
|
174
|
+
if (props.child) {
|
|
175
|
+
classList.push('jp-mod-running-child');
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return (
|
|
179
|
+
<>
|
|
180
|
+
<li>
|
|
181
|
+
<div
|
|
182
|
+
className={classList.join(' ')}
|
|
183
|
+
onClick={onClick}
|
|
184
|
+
data-context={runningItem.context || ''}
|
|
185
|
+
>
|
|
186
|
+
{collapsible &&
|
|
187
|
+
(collapsed ? (
|
|
188
|
+
<caretRightIcon.react tag="span" stylesheet="runningItem" />
|
|
189
|
+
) : (
|
|
190
|
+
<caretDownIcon.react tag="span" stylesheet="runningItem" />
|
|
191
|
+
))}
|
|
192
|
+
{typeof icon === 'string' ? (
|
|
193
|
+
icon ? (
|
|
194
|
+
<img src={icon} />
|
|
195
|
+
) : undefined
|
|
196
|
+
) : (
|
|
197
|
+
<icon.react tag="span" stylesheet="runningItem" />
|
|
198
|
+
)}
|
|
199
|
+
<span
|
|
200
|
+
className={ITEM_LABEL_CLASS}
|
|
201
|
+
title={title}
|
|
202
|
+
onClick={runningItem.open && (() => runningItem.open!())}
|
|
203
|
+
>
|
|
204
|
+
{runningItem.label()}
|
|
205
|
+
</span>
|
|
206
|
+
{detail && <span className={ITEM_DETAIL_CLASS}>{detail}</span>}
|
|
207
|
+
{runningItem.shutdown && (
|
|
208
|
+
<ToolbarButtonComponent
|
|
209
|
+
className={SHUTDOWN_BUTTON_CLASS}
|
|
210
|
+
icon={shutdownItemIcon}
|
|
211
|
+
onClick={shutdown}
|
|
212
|
+
tooltip={shutdownLabel}
|
|
213
|
+
/>
|
|
214
|
+
)}
|
|
215
|
+
</div>
|
|
216
|
+
{collapsible && !collapsed && (
|
|
217
|
+
<List
|
|
218
|
+
child={true}
|
|
219
|
+
runningItems={runningItem.children!}
|
|
220
|
+
shutdownItemIcon={shutdownItemIcon}
|
|
221
|
+
translator={translator}
|
|
222
|
+
/>
|
|
223
|
+
)}
|
|
224
|
+
</li>
|
|
225
|
+
</>
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function List(props: {
|
|
230
|
+
child?: boolean;
|
|
231
|
+
runningItems: IRunningSessions.IRunningItem[];
|
|
232
|
+
shutdownLabel?: string;
|
|
233
|
+
shutdownAllLabel?: string;
|
|
234
|
+
shutdownItemIcon?: LabIcon;
|
|
235
|
+
translator?: ITranslator;
|
|
236
|
+
}) {
|
|
237
|
+
return (
|
|
238
|
+
<ul className={LIST_CLASS}>
|
|
239
|
+
{props.runningItems.map((item, i) => (
|
|
240
|
+
<Item
|
|
241
|
+
child={props.child}
|
|
242
|
+
key={i}
|
|
243
|
+
runningItem={item}
|
|
244
|
+
shutdownLabel={props.shutdownLabel}
|
|
245
|
+
shutdownItemIcon={props.shutdownItemIcon}
|
|
246
|
+
translator={props.translator}
|
|
247
|
+
/>
|
|
248
|
+
))}
|
|
249
|
+
</ul>
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* The Section component contains the shared look and feel for an interactive
|
|
255
|
+
* list of kernels and sessions.
|
|
256
|
+
*
|
|
257
|
+
* It is specialized for each based on its props.
|
|
258
|
+
*/
|
|
259
|
+
class Section extends PanelWithToolbar {
|
|
260
|
+
constructor(options: {
|
|
261
|
+
manager: IRunningSessions.IManager;
|
|
262
|
+
translator?: ITranslator;
|
|
263
|
+
}) {
|
|
264
|
+
super();
|
|
265
|
+
this._manager = options.manager;
|
|
266
|
+
const translator = options.translator || nullTranslator;
|
|
267
|
+
const trans = translator.load('jupyterlab');
|
|
268
|
+
const shutdownAllLabel =
|
|
269
|
+
options.manager.shutdownAllLabel || trans.__('Shut Down All');
|
|
270
|
+
const shutdownTitle = `${shutdownAllLabel}?`;
|
|
271
|
+
const shutdownAllConfirmationText =
|
|
272
|
+
options.manager.shutdownAllConfirmationText ||
|
|
273
|
+
`${shutdownAllLabel} ${options.manager.name}`;
|
|
274
|
+
|
|
275
|
+
this.addClass(SECTION_CLASS);
|
|
276
|
+
this.title.label = options.manager.name;
|
|
277
|
+
|
|
278
|
+
function onShutdown() {
|
|
279
|
+
void showDialog({
|
|
280
|
+
title: shutdownTitle,
|
|
281
|
+
body: shutdownAllConfirmationText,
|
|
282
|
+
buttons: [
|
|
283
|
+
Dialog.cancelButton(),
|
|
284
|
+
Dialog.warnButton({ label: shutdownAllLabel })
|
|
285
|
+
]
|
|
286
|
+
}).then(result => {
|
|
287
|
+
if (result.button.accept) {
|
|
288
|
+
options.manager.shutdownAll();
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
let runningItems = options.manager.running();
|
|
294
|
+
let cached = true;
|
|
295
|
+
const enabled = runningItems.length > 0;
|
|
296
|
+
this._button = new ToolbarButton({
|
|
297
|
+
label: shutdownAllLabel,
|
|
298
|
+
className: `${SHUTDOWN_ALL_BUTTON_CLASS} jp-mod-styled ${
|
|
299
|
+
!enabled && 'jp-mod-disabled'
|
|
300
|
+
}`,
|
|
301
|
+
enabled,
|
|
302
|
+
onClick: onShutdown
|
|
303
|
+
});
|
|
304
|
+
this._manager.runningChanged.connect(this._updateButton, this);
|
|
305
|
+
|
|
306
|
+
this.toolbar.addItem('shutdown-all', this._button);
|
|
307
|
+
|
|
308
|
+
this.addWidget(
|
|
309
|
+
ReactWidget.create(
|
|
310
|
+
<UseSignal signal={options.manager.runningChanged}>
|
|
311
|
+
{() => {
|
|
312
|
+
// Cache the running items for the intial load and request from
|
|
313
|
+
// the service every subsequent load.
|
|
314
|
+
if (cached) {
|
|
315
|
+
cached = false;
|
|
316
|
+
} else {
|
|
317
|
+
runningItems = options.manager.running();
|
|
318
|
+
}
|
|
319
|
+
return (
|
|
320
|
+
<div className={CONTAINER_CLASS}>
|
|
321
|
+
<List
|
|
322
|
+
runningItems={runningItems}
|
|
323
|
+
shutdownLabel={options.manager.shutdownLabel}
|
|
324
|
+
shutdownAllLabel={shutdownAllLabel}
|
|
325
|
+
shutdownItemIcon={options.manager.shutdownItemIcon}
|
|
326
|
+
translator={options.translator}
|
|
327
|
+
/>
|
|
328
|
+
</div>
|
|
329
|
+
);
|
|
330
|
+
}}
|
|
331
|
+
</UseSignal>
|
|
332
|
+
)
|
|
333
|
+
);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Dispose the resources held by the widget
|
|
338
|
+
*/
|
|
339
|
+
dispose(): void {
|
|
340
|
+
if (this.isDisposed) {
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
this._manager.runningChanged.disconnect(this._updateButton, this);
|
|
344
|
+
super.dispose();
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
private _updateButton(): void {
|
|
348
|
+
const button = this._button;
|
|
349
|
+
button.enabled = this._manager.running().length > 0;
|
|
350
|
+
if (button.enabled) {
|
|
351
|
+
button.node.querySelector('button')?.classList.remove('jp-mod-disabled');
|
|
352
|
+
} else {
|
|
353
|
+
button.node.querySelector('button')?.classList.add('jp-mod-disabled');
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
private _button: ToolbarButton;
|
|
358
|
+
private _manager: IRunningSessions.IManager;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* A class that exposes the running terminal and kernel sessions.
|
|
363
|
+
*/
|
|
364
|
+
export class RunningSessions extends SidePanel {
|
|
365
|
+
/**
|
|
366
|
+
* Construct a new running widget.
|
|
367
|
+
*/
|
|
368
|
+
constructor(managers: IRunningSessionManagers, translator?: ITranslator) {
|
|
369
|
+
super();
|
|
370
|
+
this.managers = managers;
|
|
371
|
+
this.translator = translator ?? nullTranslator;
|
|
372
|
+
const trans = this.translator.load('jupyterlab');
|
|
373
|
+
|
|
374
|
+
this.addClass(RUNNING_CLASS);
|
|
375
|
+
|
|
376
|
+
this.toolbar.addItem(
|
|
377
|
+
'refresh',
|
|
378
|
+
new ToolbarButton({
|
|
379
|
+
tooltip: trans.__('Refresh List'),
|
|
380
|
+
icon: refreshIcon,
|
|
381
|
+
onClick: () =>
|
|
382
|
+
managers.items().forEach(manager => manager.refreshRunning())
|
|
383
|
+
})
|
|
384
|
+
);
|
|
385
|
+
|
|
386
|
+
managers.items().forEach(manager => this.addSection(managers, manager));
|
|
387
|
+
|
|
388
|
+
managers.added.connect(this.addSection, this);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Dispose the resources held by the widget
|
|
393
|
+
*/
|
|
394
|
+
dispose(): void {
|
|
395
|
+
if (this.isDisposed) {
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
this.managers.added.disconnect(this.addSection, this);
|
|
399
|
+
super.dispose();
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Add a section for a new manager.
|
|
404
|
+
*
|
|
405
|
+
* @param managers Managers
|
|
406
|
+
* @param manager New manager
|
|
407
|
+
*/
|
|
408
|
+
protected addSection(_: unknown, manager: IRunningSessions.IManager) {
|
|
409
|
+
this.addWidget(new Section({ manager, translator: this.translator }));
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
protected managers: IRunningSessionManagers;
|
|
413
|
+
protected translator: ITranslator;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* The namespace for the `IRunningSessions` class statics.
|
|
418
|
+
*/
|
|
419
|
+
export namespace IRunningSessions {
|
|
420
|
+
/**
|
|
421
|
+
* A manager of running items grouped under a single section.
|
|
422
|
+
*/
|
|
423
|
+
export interface IManager {
|
|
424
|
+
/**
|
|
425
|
+
* Name that is shown to the user in plural.
|
|
426
|
+
*/
|
|
427
|
+
name: string;
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Called when the shutdown all button is pressed.
|
|
431
|
+
*/
|
|
432
|
+
shutdownAll(): void;
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* List the running models.
|
|
436
|
+
*/
|
|
437
|
+
running(): IRunningItem[];
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Force a refresh of the running models.
|
|
441
|
+
*/
|
|
442
|
+
refreshRunning(): void;
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* A signal that should be emitted when the item list has changed.
|
|
446
|
+
*/
|
|
447
|
+
runningChanged: ISignal<any, any>;
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* A string used to describe the shutdown action.
|
|
451
|
+
*/
|
|
452
|
+
shutdownLabel?: string;
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* A string used to describe the shutdown all action.
|
|
456
|
+
*/
|
|
457
|
+
shutdownAllLabel?: string;
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* A string used as the body text in the shutdown all confirmation dialog.
|
|
461
|
+
*/
|
|
462
|
+
shutdownAllConfirmationText?: string;
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* The icon to show for shutting down an individual item in this section.
|
|
466
|
+
*/
|
|
467
|
+
shutdownItemIcon?: LabIcon;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* A running item.
|
|
472
|
+
*/
|
|
473
|
+
export interface IRunningItem {
|
|
474
|
+
/**
|
|
475
|
+
* Optional child nodes that belong to a top-level running item.
|
|
476
|
+
*/
|
|
477
|
+
children?: IRunningItem[];
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Optional CSS class name to add to the running item.
|
|
481
|
+
*/
|
|
482
|
+
className?: string;
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Optional context hint to add to the `data-context` attribute of an item.
|
|
486
|
+
*/
|
|
487
|
+
context?: string;
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* Called when the running item is clicked.
|
|
491
|
+
*/
|
|
492
|
+
open?: () => void;
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* Called when the shutdown button is pressed on a particular item.
|
|
496
|
+
*/
|
|
497
|
+
shutdown?: () => void;
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* The `LabIcon` to use as the icon for the running item or the string
|
|
501
|
+
* `src` URL.
|
|
502
|
+
*/
|
|
503
|
+
icon: () => LabIcon | string;
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* Called to determine the label for each item.
|
|
507
|
+
*/
|
|
508
|
+
label: () => string;
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Called to determine the `title` attribute for each item, which is
|
|
512
|
+
* revealed on hover.
|
|
513
|
+
*/
|
|
514
|
+
labelTitle?: () => string;
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Called to determine the `detail` attribute, which is shown optionally in
|
|
518
|
+
* a column after the label.
|
|
519
|
+
*/
|
|
520
|
+
detail?: () => string;
|
|
521
|
+
}
|
|
522
|
+
}
|
package/style/base.css
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Jupyter Development Team.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
/*-----------------------------------------------------------------------------
|
|
2
7
|
| Variables
|
|
3
8
|
|----------------------------------------------------------------------------*/
|
|
4
9
|
|
|
5
10
|
:root {
|
|
6
|
-
--jp-private-running-button-height: 28px;
|
|
7
|
-
--jp-private-running-button-width: 48px;
|
|
8
11
|
--jp-private-running-item-height: 24px;
|
|
9
|
-
--jp-private-running-shutdown-button-height: 24px;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
/*-----------------------------------------------------------------------------
|
|
@@ -20,57 +22,29 @@
|
|
|
20
22
|
min-width: var(--jp-sidebar-min-width);
|
|
21
23
|
color: var(--jp-ui-font-color1);
|
|
22
24
|
background: var(--jp-layout-color1);
|
|
25
|
+
|
|
23
26
|
/* This is needed so that all font sizing of children done in ems is
|
|
24
27
|
* relative to this base size */
|
|
25
28
|
font-size: var(--jp-ui-font-size1);
|
|
26
29
|
}
|
|
27
30
|
|
|
28
|
-
.jp-RunningSessions-
|
|
29
|
-
flex: 0 0 auto;
|
|
30
|
-
display: flex;
|
|
31
|
-
flex-direction: row;
|
|
31
|
+
.jp-RunningSessions > .jp-SidePanel-toolbar {
|
|
32
32
|
justify-content: flex-end;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
.jp-RunningSessions-section {
|
|
36
|
-
|
|
37
|
-
flex: 0 1 auto;
|
|
38
|
-
flex-direction: column;
|
|
36
|
+
min-height: 50px;
|
|
39
37
|
overflow: auto;
|
|
40
38
|
}
|
|
41
39
|
|
|
42
|
-
.jp-RunningSessions-sectionHeader {
|
|
43
|
-
flex: 0 0 auto;
|
|
44
|
-
align-items: center;
|
|
45
|
-
justify-content: space-between;
|
|
46
|
-
height: 28px;
|
|
47
|
-
display: flex;
|
|
48
|
-
border-bottom: var(--jp-border-width) solid var(--jp-border-color2);
|
|
49
|
-
margin-top: 8px;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.jp-RunningSessions-sectionHeader h2 {
|
|
53
|
-
flex: 0 0 auto;
|
|
54
|
-
font-weight: 600;
|
|
55
|
-
text-transform: uppercase;
|
|
56
|
-
letter-spacing: 1px;
|
|
57
|
-
font-size: var(--jp-ui-font-size0);
|
|
58
|
-
padding: 8px 8px 8px 12px;
|
|
59
|
-
margin: 0px;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.jp-RunningSessions-sectionHeader .jp-ToolbarButtonComponent {
|
|
63
|
-
flex: 0 0 auto;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
40
|
.jp-RunningSessions-sectionContainer {
|
|
67
|
-
flex: 1 1 auto;
|
|
68
41
|
margin: 0;
|
|
69
42
|
padding: 0;
|
|
70
43
|
overflow: auto;
|
|
71
44
|
}
|
|
72
45
|
|
|
73
46
|
.jp-RunningSessions-sectionList {
|
|
47
|
+
display: block;
|
|
74
48
|
margin: 0;
|
|
75
49
|
padding: 0;
|
|
76
50
|
list-style-type: none;
|
|
@@ -82,17 +56,26 @@
|
|
|
82
56
|
color: var(--jp-ui-font-color1);
|
|
83
57
|
height: var(--jp-private-running-item-height);
|
|
84
58
|
line-height: var(--jp-private-running-item-height);
|
|
85
|
-
padding: 0 8px
|
|
59
|
+
padding: 0 8px;
|
|
86
60
|
}
|
|
87
61
|
|
|
88
62
|
.jp-RunningSessions-item:hover {
|
|
89
63
|
background-color: var(--jp-layout-color2);
|
|
90
64
|
}
|
|
91
65
|
|
|
66
|
+
.jp-RunningSessions-item.jp-mod-running-child {
|
|
67
|
+
padding-left: 40px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.jp-RunningSessions-item img {
|
|
71
|
+
height: 16px;
|
|
72
|
+
margin-top: 4px;
|
|
73
|
+
}
|
|
74
|
+
|
|
92
75
|
.jp-RunningSessions-itemLabel {
|
|
93
76
|
font-size: var(--jp-ui-font-size1);
|
|
94
77
|
flex: 1 1 55%;
|
|
95
|
-
padding: 0 4px
|
|
78
|
+
padding: 0 4px;
|
|
96
79
|
text-overflow: ellipsis;
|
|
97
80
|
overflow: hidden;
|
|
98
81
|
white-space: nowrap;
|
|
@@ -105,19 +88,18 @@
|
|
|
105
88
|
.jp-RunningSessions-itemDetail {
|
|
106
89
|
font-size: var(--jp-ui-font-size1);
|
|
107
90
|
flex: 1 1 45%;
|
|
108
|
-
padding: 0 4px
|
|
91
|
+
padding: 0 4px;
|
|
109
92
|
text-overflow: ellipsis;
|
|
110
93
|
overflow: hidden;
|
|
111
94
|
white-space: nowrap;
|
|
112
95
|
}
|
|
113
96
|
|
|
114
97
|
.jp-RunningSessions-item .jp-RunningSessions-itemShutdown {
|
|
115
|
-
border-radius:
|
|
98
|
+
border-radius: 0;
|
|
116
99
|
}
|
|
117
100
|
|
|
118
101
|
.jp-RunningSessions-item:not(:hover) .jp-RunningSessions-itemShutdown {
|
|
119
102
|
visibility: hidden;
|
|
120
|
-
/* display: none; */
|
|
121
103
|
}
|
|
122
104
|
|
|
123
105
|
.jp-RunningSessions-sectionList
|
|
@@ -126,32 +108,34 @@
|
|
|
126
108
|
background: var(--jp-layout-color3);
|
|
127
109
|
}
|
|
128
110
|
|
|
129
|
-
.jp-RunningSessions-shutdownAll.jp-mod-styled
|
|
130
|
-
|
|
111
|
+
.jp-RunningSessions-shutdownAll.jp-mod-styled
|
|
112
|
+
> .jp-ToolbarButtonComponent-label {
|
|
131
113
|
color: var(--jp-warn-color1);
|
|
132
114
|
background-color: transparent;
|
|
133
|
-
height: var(--jp-private-running-shutdown-button-height);
|
|
134
|
-
line-height: var(--jp-private-running-shutdown-button-height);
|
|
135
115
|
border-radius: 2px;
|
|
136
116
|
overflow: hidden;
|
|
137
117
|
white-space: nowrap;
|
|
138
118
|
text-overflow: ellipsis;
|
|
139
119
|
}
|
|
140
120
|
|
|
141
|
-
.jp-RunningSessions-shutdownAll.jp-mod-styled:hover
|
|
121
|
+
.jp-RunningSessions-shutdownAll.jp-mod-styled:hover
|
|
122
|
+
> .jp-ToolbarButtonComponent-label {
|
|
142
123
|
background-color: var(--jp-layout-color2);
|
|
143
124
|
}
|
|
144
125
|
|
|
145
|
-
.jp-RunningSessions-shutdownAll.jp-mod-styled:focus
|
|
126
|
+
.jp-RunningSessions-shutdownAll.jp-mod-styled:focus
|
|
127
|
+
> .jp-ToolbarButtonComponent-label {
|
|
146
128
|
border: none;
|
|
147
129
|
box-shadow: none;
|
|
148
130
|
background-color: var(--jp-layout-color2);
|
|
149
131
|
}
|
|
150
132
|
|
|
151
|
-
.jp-RunningSessions-shutdownAll.jp-mod-styled.jp-mod-disabled
|
|
133
|
+
.jp-RunningSessions-shutdownAll.jp-mod-styled.jp-mod-disabled
|
|
134
|
+
> .jp-ToolbarButtonComponent-label {
|
|
152
135
|
color: var(--jp-ui-font-color2);
|
|
153
136
|
}
|
|
154
137
|
|
|
155
|
-
.jp-RunningSessions-shutdownAll.jp-mod-styled.jp-mod-disabled:hover
|
|
138
|
+
.jp-RunningSessions-shutdownAll.jp-mod-styled.jp-mod-disabled:hover
|
|
139
|
+
> .jp-ToolbarButtonComponent-label {
|
|
156
140
|
background: none;
|
|
157
141
|
}
|