Browse Source

Modernize RunningSessions plugin and add to lab application.

Afshin Darian 8 năm trước cách đây
mục cha
commit
917f7884f1
3 tập tin đã thay đổi với 10 bổ sung9 xóa
  1. 1 1
      jupyterlab/index.js
  2. 8 8
      src/running/plugin.ts
  3. 1 0
      src/tsconfig.json

+ 1 - 1
jupyterlab/index.js

@@ -32,7 +32,7 @@ lab.registerPlugins([
   // require('jupyterlab/lib/markdownwidget/plugin').markdownHandlerExtension,
   require('jupyterlab/lib/notebook/plugin').notebookTrackerProvider,
   require('jupyterlab/lib/rendermime/plugin').renderMimeProvider,
-  // require('jupyterlab/lib/running/plugin').runningSessionsExtension,
+  require('jupyterlab/lib/running/plugin').runningSessionsExtension,
   require('jupyterlab/lib/services/plugin').servicesProvider,
   require('jupyterlab/lib/shortcuts/plugin').shortcutsExtension,
   require('jupyterlab/lib/terminal/plugin').terminalExtension

+ 8 - 8
src/running/plugin.ts

@@ -2,12 +2,12 @@
 // Distributed under the terms of the Modified BSD License.
 
 import {
-  ServiceManager
-} from 'jupyter-js-services';
+  JupyterLab, JupyterLabPlugin
+} from '../application';
 
 import {
-  Application
-} from 'phosphide/lib/core/application';
+  IServiceManager
+} from '../services/plugin';
 
 import {
   RunningSessions
@@ -18,18 +18,18 @@ import {
  * The default running sessions extension.
  */
 export
-const runningSessionsExtension = {
+const runningSessionsExtension: JupyterLabPlugin<void> = {
   id: 'jupyter.extensions.running-sessions',
-  requires: [ServiceManager],
+  requires: [IServiceManager],
   activate: activateRunningSessions
 };
 
 
 
-function activateRunningSessions(app: Application, services: ServiceManager): void {
+function activateRunningSessions(app: JupyterLab, services: IServiceManager): void {
   let running = new RunningSessions({ manager: services });
   running.id = 'jp-running-sessions';
-  running.title.text = 'Running';
+  running.title.label = 'Running';
 
   // TODO: replace these with execute calls in new phosphor.
   running.sessionOpenRequested.connect((sender, model) => {

+ 1 - 0
src/tsconfig.json

@@ -33,6 +33,7 @@
     "notebook/plugin",
     "notebook/typings.d.ts",
     "rendermime/plugin",
+    "running/plugin",
     "services/plugin",
     "shortcuts/plugin",
     "terminal/plugin",