|
@@ -1,9 +1,11 @@
|
|
|
// Copyright (c) Jupyter Development Team.
|
|
|
// Distributed under the terms of the Modified BSD License.
|
|
|
|
|
|
+import React from 'react';
|
|
|
import {
|
|
|
FilenameSearcher,
|
|
|
IScore,
|
|
|
+ MainAreaWidget,
|
|
|
ReactWidget,
|
|
|
showErrorMessage,
|
|
|
Toolbar
|
|
@@ -22,6 +24,10 @@ import { DirListing } from './listing';
|
|
|
import { FilterFileBrowserModel } from './model';
|
|
|
import DirectorySwitcher from './directoryswitcher';
|
|
|
import DataManagerWidget from './datamanagerwidget';
|
|
|
+import { cliIcon } from './icons';
|
|
|
+import { DagDataView } from './dataview';
|
|
|
+
|
|
|
+import { JupyterFrontEnd } from '@jupyterlab/application';
|
|
|
|
|
|
/**
|
|
|
* The class name added to file browsers.
|
|
@@ -115,6 +121,20 @@ export class FileBrowser extends Widget {
|
|
|
// 数据管理界面
|
|
|
const dataManagerWidget = new DataManagerWidget();
|
|
|
|
|
|
+ dataManagerWidget.id = 'dag-data';
|
|
|
+ dataManagerWidget.title.icon = cliIcon;
|
|
|
+ dataManagerWidget.title.caption = '数据管理';
|
|
|
+ dataManagerWidget.title.label = '数据管理';
|
|
|
+ dataManagerWidget.dataOpened.connect(() => {
|
|
|
+ const widget = new MainAreaWidget({
|
|
|
+ content: ReactWidget.create(<DagDataView />)
|
|
|
+ });
|
|
|
+ widget.title.label = '数据管理';
|
|
|
+ widget.title.icon = cliIcon;
|
|
|
+ const app: JupyterFrontEnd = (window as any).jupyterlab;
|
|
|
+ app.shell.add(widget, 'main');
|
|
|
+ });
|
|
|
+
|
|
|
const header = new Widget();
|
|
|
header.node.textContent = '编程列表';
|
|
|
header.addClass('jp-FileBrowser-header');
|
|
@@ -136,9 +156,12 @@ export class FileBrowser extends Widget {
|
|
|
// 监听点击切换界面
|
|
|
switchButton.switchButtonClick.connect((_sender, { type }) => {
|
|
|
this.layout.removeWidget(currentList);
|
|
|
+ this.layout.removeWidget(this.crumbs);
|
|
|
+ this.layout.addWidget(switchButton);
|
|
|
switch (type) {
|
|
|
case '开发目录':
|
|
|
currentList = this.listing;
|
|
|
+ this.layout.addWidget(this.crumbs);
|
|
|
break;
|
|
|
case '数据管理':
|
|
|
currentList = dataManagerWidget;
|