@jupyterlab/running 4.0.0-alpha.19 → 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/package.json +11 -10
- package/src/index.tsx +522 -0
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": "^2.0.0-
|
|
43
|
-
"@lumino/disposable": "^2.0.0-
|
|
44
|
-
"@lumino/signaling": "^2.0.0-
|
|
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",
|
|
45
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
|
+
}
|