mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-09 03:50:45 +08:00
Add ILabStatus
This commit is contained in:
parent
752e21fde9
commit
7f643d6ae5
@ -91,6 +91,9 @@ async function main() {
|
||||
require('@retrolab/terminal-extension'),
|
||||
|
||||
// @jupyterlab plugins
|
||||
require('@jupyterlab/application-extension').default.filter(({ id }) =>
|
||||
['@jupyterlab/application-extension:faviconbusy'].includes(id)
|
||||
),
|
||||
require('@jupyterlab/apputils-extension').default.filter(({ id }) =>
|
||||
[
|
||||
'@jupyterlab/apputils-extension:palette',
|
||||
|
@ -19,6 +19,7 @@
|
||||
},
|
||||
"resolutions": {
|
||||
"@jupyterlab/application": "~3.1.0-alpha.8",
|
||||
"@jupyterlab/application-extension": "~3.1.0-alpha.8",
|
||||
"@jupyterlab/apputils": "~3.1.0-alpha.8",
|
||||
"@jupyterlab/apputils-extension": "~3.1.0-alpha.8",
|
||||
"@jupyterlab/celltags": "~3.1.0-alpha.8",
|
||||
@ -86,6 +87,7 @@
|
||||
"react-dom": "~17.0.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@jupyterlab/application-extension": "^3.1.0-alpha.8",
|
||||
"@jupyterlab/apputils-extension": "^3.1.0-alpha.8",
|
||||
"@jupyterlab/celltags": "^3.1.0-alpha.8",
|
||||
"@jupyterlab/codemirror-extension": "^3.1.0-alpha.8",
|
||||
@ -154,6 +156,7 @@
|
||||
"@retrolab/notebook-extension",
|
||||
"@retrolab/terminal-extension",
|
||||
"@retrolab/tree-extension",
|
||||
"@jupyterlab/application-extension",
|
||||
"@jupyterlab/apputils-extension",
|
||||
"@jupyterlab/codemirror-extension",
|
||||
"@jupyterlab/completer-extension",
|
||||
|
@ -2,6 +2,7 @@
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
import {
|
||||
ILabStatus,
|
||||
IRouter,
|
||||
JupyterFrontEnd,
|
||||
JupyterFrontEndPlugin,
|
||||
@ -283,6 +284,21 @@ const spacer: JupyterFrontEndPlugin<void> = {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* The default JupyterLab application status provider.
|
||||
*/
|
||||
const status: JupyterFrontEndPlugin<ILabStatus> = {
|
||||
id: '@jupyterlab/application-extension:status',
|
||||
autoStart: true,
|
||||
provides: ILabStatus,
|
||||
activate: (app: JupyterFrontEnd) => {
|
||||
if (!(app instanceof RetroApp)) {
|
||||
throw new Error(`${status.id} must be activated in RetroLab.`);
|
||||
}
|
||||
return app.status;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* A plugin to display the document title in the browser tab title
|
||||
*/
|
||||
@ -501,6 +517,7 @@ const plugins: JupyterFrontEndPlugin<any>[] = [
|
||||
sessionDialogs,
|
||||
shell,
|
||||
spacer,
|
||||
status,
|
||||
tabTitle,
|
||||
title,
|
||||
topVisibility,
|
||||
|
@ -8,6 +8,8 @@ import {
|
||||
|
||||
import { createRendermimePlugins } from '@jupyterlab/application/lib/mimerenderers';
|
||||
|
||||
import { LabStatus } from '@jupyterlab/application/lib/status';
|
||||
|
||||
import { PageConfig } from '@jupyterlab/coreutils';
|
||||
|
||||
import { IRenderMime } from '@jupyterlab/rendermime-interfaces';
|
||||
@ -48,6 +50,11 @@ export class RetroApp extends JupyterFrontEnd<IRetroShell> {
|
||||
*/
|
||||
readonly namespace = this.name;
|
||||
|
||||
/**
|
||||
* The application busy and dirty status signals and flags.
|
||||
*/
|
||||
readonly status = new LabStatus(this);
|
||||
|
||||
/**
|
||||
* The version of the application.
|
||||
*/
|
||||
|
19
yarn.lock
19
yarn.lock
@ -1230,6 +1230,25 @@
|
||||
"@types/yargs" "^15.0.0"
|
||||
chalk "^4.0.0"
|
||||
|
||||
"@jupyterlab/application-extension@^3.1.0-alpha.8":
|
||||
version "3.1.0-alpha.8"
|
||||
resolved "https://registry.yarnpkg.com/@jupyterlab/application-extension/-/application-extension-3.1.0-alpha.8.tgz#00fced24a2751e80e1d17466ed035dfa9be68b4b"
|
||||
integrity sha512-UAmzq05iSACzz2KNEawrfl2S7/ahMPYEIrK1qpgg2rcRIGENaw3lfruJl9GMKxPJ/ZLtMI4/y97yNoOoRWQVhQ==
|
||||
dependencies:
|
||||
"@jupyterlab/application" "^3.1.0-alpha.8"
|
||||
"@jupyterlab/apputils" "^3.1.0-alpha.8"
|
||||
"@jupyterlab/coreutils" "^5.1.0-alpha.8"
|
||||
"@jupyterlab/property-inspector" "^3.1.0-alpha.8"
|
||||
"@jupyterlab/settingregistry" "^3.1.0-alpha.8"
|
||||
"@jupyterlab/statedb" "^3.1.0-alpha.8"
|
||||
"@jupyterlab/translation" "^3.1.0-alpha.8"
|
||||
"@jupyterlab/ui-components" "^3.1.0-alpha.8"
|
||||
"@lumino/algorithm" "^1.3.3"
|
||||
"@lumino/coreutils" "^1.5.3"
|
||||
"@lumino/disposable" "^1.4.3"
|
||||
"@lumino/widgets" "^1.19.0"
|
||||
react "^17.0.1"
|
||||
|
||||
"@jupyterlab/application@^3.1.0-alpha.8":
|
||||
version "3.1.0-alpha.8"
|
||||
resolved "https://registry.yarnpkg.com/@jupyterlab/application/-/application-3.1.0-alpha.8.tgz#25c427e79f09fbf9b36816a47bedd2c4bf394d80"
|
||||
|
Loading…
Reference in New Issue
Block a user