@difizen/libro-jupyter 0.0.2-alpha.0
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/LICENSE +21 -0
- package/README.md +1 -0
- package/es/add-between-cell/add-between-cell-command-contribution.d.ts +14 -0
- package/es/add-between-cell/add-between-cell-command-contribution.d.ts.map +1 -0
- package/es/add-between-cell/add-between-cell-command-contribution.js +97 -0
- package/es/add-between-cell/add-between-cell.d.ts +5 -0
- package/es/add-between-cell/add-between-cell.d.ts.map +1 -0
- package/es/add-between-cell/add-between-cell.js +243 -0
- package/es/add-between-cell/index.d.ts +3 -0
- package/es/add-between-cell/index.d.ts.map +1 -0
- package/es/add-between-cell/index.js +2 -0
- package/es/add-between-cell/index.less +103 -0
- package/es/add-between-cell/module.d.ts +3 -0
- package/es/add-between-cell/module.d.ts.map +1 -0
- package/es/add-between-cell/module.js +8 -0
- package/es/cell/index.d.ts +3 -0
- package/es/cell/index.d.ts.map +1 -0
- package/es/cell/index.js +2 -0
- package/es/cell/jupyter-code-cell-model.d.ts +12 -0
- package/es/cell/jupyter-code-cell-model.d.ts.map +1 -0
- package/es/cell/jupyter-code-cell-model.js +56 -0
- package/es/cell/jupyter-code-cell-view.d.ts +18 -0
- package/es/cell/jupyter-code-cell-view.d.ts.map +1 -0
- package/es/cell/jupyter-code-cell-view.js +280 -0
- package/es/command/command-contribution.d.ts +10 -0
- package/es/command/command-contribution.d.ts.map +1 -0
- package/es/command/command-contribution.js +161 -0
- package/es/command/index.d.ts +3 -0
- package/es/command/index.d.ts.map +1 -0
- package/es/command/index.js +2 -0
- package/es/command/keybinding-contribution.d.ts +8 -0
- package/es/command/keybinding-contribution.d.ts.map +1 -0
- package/es/command/keybinding-contribution.js +37 -0
- package/es/components/cell-execution-tip.d.ts +6 -0
- package/es/components/cell-execution-tip.d.ts.map +1 -0
- package/es/components/cell-execution-tip.js +69 -0
- package/es/components/cell-input-bottom-blank.d.ts +5 -0
- package/es/components/cell-input-bottom-blank.d.ts.map +1 -0
- package/es/components/cell-input-bottom-blank.js +21 -0
- package/es/components/icons.d.ts +5 -0
- package/es/components/icons.d.ts.map +1 -0
- package/es/components/icons.js +154 -0
- package/es/components/index.d.ts +4 -0
- package/es/components/index.d.ts.map +1 -0
- package/es/components/index.js +3 -0
- package/es/components/index.less +82 -0
- package/es/config/config-contribution.d.ts +10 -0
- package/es/config/config-contribution.d.ts.map +1 -0
- package/es/config/config-contribution.js +50 -0
- package/es/config/config.d.ts +3 -0
- package/es/config/config.d.ts.map +1 -0
- package/es/config/config.js +11 -0
- package/es/config/index.d.ts +2 -0
- package/es/config/index.d.ts.map +1 -0
- package/es/config/index.js +1 -0
- package/es/configuration/index.d.ts +3 -0
- package/es/configuration/index.d.ts.map +1 -0
- package/es/configuration/index.js +2 -0
- package/es/configuration/libro-configuration-contribution.d.ts +5 -0
- package/es/configuration/libro-configuration-contribution.d.ts.map +1 -0
- package/es/configuration/libro-configuration-contribution.js +24 -0
- package/es/configuration/libro-configuration.d.ts +3 -0
- package/es/configuration/libro-configuration.d.ts.map +1 -0
- package/es/configuration/libro-configuration.js +12 -0
- package/es/contents/content-contribution.d.ts +7 -0
- package/es/contents/content-contribution.d.ts.map +1 -0
- package/es/contents/content-contribution.js +63 -0
- package/es/contents/index.d.ts +2 -0
- package/es/contents/index.d.ts.map +1 -0
- package/es/contents/index.js +1 -0
- package/es/file/file-name-alias.d.ts +7 -0
- package/es/file/file-name-alias.d.ts.map +1 -0
- package/es/file/file-name-alias.js +26 -0
- package/es/file/file-protocol.d.ts +8 -0
- package/es/file/file-protocol.d.ts.map +1 -0
- package/es/file/file-protocol.js +7 -0
- package/es/file/file-service.d.ts +31 -0
- package/es/file/file-service.d.ts.map +1 -0
- package/es/file/file-service.js +329 -0
- package/es/file/file-tree-label-provider.d.ts +13 -0
- package/es/file/file-tree-label-provider.d.ts.map +1 -0
- package/es/file/file-tree-label-provider.js +62 -0
- package/es/file/file-view/index.d.ts +14 -0
- package/es/file/file-view/index.d.ts.map +1 -0
- package/es/file/file-view/index.js +101 -0
- package/es/file/file-view/index.less +5 -0
- package/es/file/index.d.ts +7 -0
- package/es/file/index.d.ts.map +1 -0
- package/es/file/index.js +6 -0
- package/es/file/module.d.ts +3 -0
- package/es/file/module.d.ts.map +1 -0
- package/es/file/module.js +8 -0
- package/es/file/navigatable-view.d.ts +24 -0
- package/es/file/navigatable-view.d.ts.map +1 -0
- package/es/file/navigatable-view.js +151 -0
- package/es/file/open-handler-contribution.d.ts +11 -0
- package/es/file/open-handler-contribution.d.ts.map +1 -0
- package/es/file/open-handler-contribution.js +102 -0
- package/es/index.d.ts +32 -0
- package/es/index.d.ts.map +1 -0
- package/es/index.js +31 -0
- package/es/keybind-instructions/index.d.ts +6 -0
- package/es/keybind-instructions/index.d.ts.map +1 -0
- package/es/keybind-instructions/index.js +5 -0
- package/es/keybind-instructions/index.less +177 -0
- package/es/keybind-instructions/keybind-instructions-contribution.d.ts +11 -0
- package/es/keybind-instructions/keybind-instructions-contribution.d.ts.map +1 -0
- package/es/keybind-instructions/keybind-instructions-contribution.js +84 -0
- package/es/keybind-instructions/keybind-instructions-icon.d.ts +3 -0
- package/es/keybind-instructions/keybind-instructions-icon.d.ts.map +1 -0
- package/es/keybind-instructions/keybind-instructions-icon.js +23 -0
- package/es/keybind-instructions/keybind-instructions-items.d.ts +14 -0
- package/es/keybind-instructions/keybind-instructions-items.d.ts.map +1 -0
- package/es/keybind-instructions/keybind-instructions-items.js +589 -0
- package/es/keybind-instructions/keybind-instructions-view.d.ts +16 -0
- package/es/keybind-instructions/keybind-instructions-view.d.ts.map +1 -0
- package/es/keybind-instructions/keybind-instructions-view.js +224 -0
- package/es/keybind-instructions/module.d.ts +3 -0
- package/es/keybind-instructions/module.d.ts.map +1 -0
- package/es/keybind-instructions/module.js +5 -0
- package/es/libro-jupyter-file-service.d.ts +106 -0
- package/es/libro-jupyter-file-service.d.ts.map +1 -0
- package/es/libro-jupyter-file-service.js +127 -0
- package/es/libro-jupyter-model.d.ts +49 -0
- package/es/libro-jupyter-model.d.ts.map +1 -0
- package/es/libro-jupyter-model.js +505 -0
- package/es/libro-jupyter-protocol.d.ts +38 -0
- package/es/libro-jupyter-protocol.d.ts.map +1 -0
- package/es/libro-jupyter-protocol.js +9 -0
- package/es/libro-jupyter-server-launch-manager.d.ts +11 -0
- package/es/libro-jupyter-server-launch-manager.d.ts.map +1 -0
- package/es/libro-jupyter-server-launch-manager.js +59 -0
- package/es/libro-jupyter-view.d.ts +10 -0
- package/es/libro-jupyter-view.d.ts.map +1 -0
- package/es/libro-jupyter-view.js +42 -0
- package/es/module.d.ts +3 -0
- package/es/module.d.ts.map +1 -0
- package/es/module.js +48 -0
- package/es/output/index.d.ts +2 -0
- package/es/output/index.d.ts.map +1 -0
- package/es/output/index.js +1 -0
- package/es/output/libro-jupyter-outputarea.d.ts +8 -0
- package/es/output/libro-jupyter-outputarea.d.ts.map +1 -0
- package/es/output/libro-jupyter-outputarea.js +77 -0
- package/es/rendermime/assets/plotly.svg +31 -0
- package/es/rendermime/index.d.ts +5 -0
- package/es/rendermime/index.d.ts.map +1 -0
- package/es/rendermime/index.js +4 -0
- package/es/rendermime/index.less +22 -0
- package/es/rendermime/module.d.ts +3 -0
- package/es/rendermime/module.d.ts.map +1 -0
- package/es/rendermime/module.js +3 -0
- package/es/rendermime/plotly-render.d.ts +7 -0
- package/es/rendermime/plotly-render.d.ts.map +1 -0
- package/es/rendermime/plotly-render.js +30 -0
- package/es/rendermime/plotly-renderers.d.ts +58 -0
- package/es/rendermime/plotly-renderers.d.ts.map +1 -0
- package/es/rendermime/plotly-renderers.js +211 -0
- package/es/rendermime/plotly-rendermime-contribution.d.ts +12 -0
- package/es/rendermime/plotly-rendermime-contribution.d.ts.map +1 -0
- package/es/rendermime/plotly-rendermime-contribution.js +22 -0
- package/es/theme/color-registry.d.ts +6 -0
- package/es/theme/color-registry.d.ts.map +1 -0
- package/es/theme/color-registry.js +393 -0
- package/es/theme/index.d.ts +2 -0
- package/es/theme/index.d.ts.map +1 -0
- package/es/theme/index.js +1 -0
- package/es/toolbar/index.d.ts +6 -0
- package/es/toolbar/index.d.ts.map +1 -0
- package/es/toolbar/index.js +5 -0
- package/es/toolbar/index.less +194 -0
- package/es/toolbar/kernel-selector-dropdown.d.ts +13 -0
- package/es/toolbar/kernel-selector-dropdown.d.ts.map +1 -0
- package/es/toolbar/kernel-selector-dropdown.js +165 -0
- package/es/toolbar/kernel-status-and-selector.d.ts +18 -0
- package/es/toolbar/kernel-status-and-selector.d.ts.map +1 -0
- package/es/toolbar/kernel-status-and-selector.js +164 -0
- package/es/toolbar/run-selector.d.ts +3 -0
- package/es/toolbar/run-selector.d.ts.map +1 -0
- package/es/toolbar/run-selector.js +98 -0
- package/es/toolbar/save-file-error-contribution.d.ts +5 -0
- package/es/toolbar/save-file-error-contribution.d.ts.map +1 -0
- package/es/toolbar/save-file-error-contribution.js +23 -0
- package/es/toolbar/save-file-error.d.ts +5 -0
- package/es/toolbar/save-file-error.d.ts.map +1 -0
- package/es/toolbar/save-file-error.js +27 -0
- package/es/toolbar/side-toolbar-run-selector.d.ts +3 -0
- package/es/toolbar/side-toolbar-run-selector.d.ts.map +1 -0
- package/es/toolbar/side-toolbar-run-selector.js +67 -0
- package/es/toolbar/toolbar-contribution.d.ts +9 -0
- package/es/toolbar/toolbar-contribution.d.ts.map +1 -0
- package/es/toolbar/toolbar-contribution.js +67 -0
- package/es/typings/index.d.ts +31 -0
- package/es/utils/index.d.ts +11 -0
- package/es/utils/index.d.ts.map +1 -0
- package/es/utils/index.js +47 -0
- package/package.json +75 -0
- package/src/add-between-cell/add-between-cell-command-contribution.ts +63 -0
- package/src/add-between-cell/add-between-cell.tsx +201 -0
- package/src/add-between-cell/index.less +103 -0
- package/src/add-between-cell/index.ts +2 -0
- package/src/add-between-cell/module.ts +13 -0
- package/src/cell/index.ts +2 -0
- package/src/cell/jupyter-code-cell-model.ts +36 -0
- package/src/cell/jupyter-code-cell-view.tsx +221 -0
- package/src/command/command-contribution.ts +163 -0
- package/src/command/index.ts +2 -0
- package/src/command/keybinding-contribution.ts +25 -0
- package/src/components/cell-execution-tip.tsx +107 -0
- package/src/components/cell-input-bottom-blank.tsx +24 -0
- package/src/components/icons.tsx +117 -0
- package/src/components/index.less +82 -0
- package/src/components/index.ts +3 -0
- package/src/config/config-contribution.ts +21 -0
- package/src/config/config.ts +14 -0
- package/src/config/index.ts +1 -0
- package/src/configuration/index.ts +2 -0
- package/src/configuration/libro-configuration-contribution.ts +11 -0
- package/src/configuration/libro-configuration.ts +14 -0
- package/src/contents/content-contribution.ts +32 -0
- package/src/contents/index.ts +1 -0
- package/src/file/file-name-alias.ts +15 -0
- package/src/file/file-protocol.ts +7 -0
- package/src/file/file-service.ts +179 -0
- package/src/file/file-tree-label-provider.ts +42 -0
- package/src/file/file-view/index.less +5 -0
- package/src/file/file-view/index.tsx +90 -0
- package/src/file/index.ts +6 -0
- package/src/file/module.ts +19 -0
- package/src/file/navigatable-view.tsx +93 -0
- package/src/file/open-handler-contribution.ts +44 -0
- package/src/index.ts +32 -0
- package/src/keybind-instructions/index.less +177 -0
- package/src/keybind-instructions/index.ts +5 -0
- package/src/keybind-instructions/keybind-instructions-contribution.ts +47 -0
- package/src/keybind-instructions/keybind-instructions-icon.tsx +28 -0
- package/src/keybind-instructions/keybind-instructions-items.tsx +597 -0
- package/src/keybind-instructions/keybind-instructions-view.tsx +239 -0
- package/src/keybind-instructions/module.ts +11 -0
- package/src/libro-jupyter-file-service.ts +158 -0
- package/src/libro-jupyter-model.ts +289 -0
- package/src/libro-jupyter-protocol.ts +59 -0
- package/src/libro-jupyter-server-launch-manager.ts +36 -0
- package/src/libro-jupyter-view.tsx +24 -0
- package/src/module.ts +105 -0
- package/src/output/index.ts +1 -0
- package/src/output/libro-jupyter-outputarea.tsx +71 -0
- package/src/rendermime/assets/plotly.svg +31 -0
- package/src/rendermime/index.less +13 -0
- package/src/rendermime/index.ts +4 -0
- package/src/rendermime/module.ts +7 -0
- package/src/rendermime/plotly-render.tsx +35 -0
- package/src/rendermime/plotly-renderers.ts +191 -0
- package/src/rendermime/plotly-rendermime-contribution.ts +15 -0
- package/src/theme/color-registry.ts +301 -0
- package/src/theme/index.ts +1 -0
- package/src/toolbar/index.less +194 -0
- package/src/toolbar/index.ts +5 -0
- package/src/toolbar/kernel-selector-dropdown.tsx +204 -0
- package/src/toolbar/kernel-status-and-selector.tsx +195 -0
- package/src/toolbar/run-selector.tsx +110 -0
- package/src/toolbar/save-file-error-contribution.ts +10 -0
- package/src/toolbar/save-file-error.tsx +35 -0
- package/src/toolbar/side-toolbar-run-selector.tsx +77 -0
- package/src/toolbar/toolbar-contribution.tsx +62 -0
- package/src/typings/index.d.ts +31 -0
- package/src/utils/index.ts +65 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./color-registry.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './toolbar-contribution.js';
|
|
2
|
+
export * from './save-file-error-contribution.js';
|
|
3
|
+
export * from './kernel-selector-dropdown.js';
|
|
4
|
+
export * from './kernel-status-and-selector.js';
|
|
5
|
+
export * from './save-file-error.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/toolbar/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/* stylelint-disable declaration-property-value-disallowed-list */
|
|
2
|
+
/* stylelint-disable color-function-notation */
|
|
3
|
+
// The prefix to use on all css classes from ant.
|
|
4
|
+
@ant-prefix: ant;
|
|
5
|
+
|
|
6
|
+
.kernel-status {
|
|
7
|
+
width: 140px;
|
|
8
|
+
|
|
9
|
+
.ant-badge-status-dot {
|
|
10
|
+
width: 10px;
|
|
11
|
+
height: 10px;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.container-and-service-status-step {
|
|
16
|
+
> div:first-child {
|
|
17
|
+
height: 70px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.libro-kernel-badge :first-child {
|
|
21
|
+
width: 9px;
|
|
22
|
+
height: 9px;
|
|
23
|
+
border: 1px solid var(--mana-libro-kernel-badge-border-color);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.libro-tooltip-placement-bottom,
|
|
28
|
+
.libro-tooltip-placement-right {
|
|
29
|
+
opacity: 0.9;
|
|
30
|
+
|
|
31
|
+
> div {
|
|
32
|
+
> div:nth-child(2) {
|
|
33
|
+
padding: 8px 10px;
|
|
34
|
+
color: #fff;
|
|
35
|
+
text-align: left;
|
|
36
|
+
text-decoration: none;
|
|
37
|
+
background-color: #373737;
|
|
38
|
+
border-radius: 6px;
|
|
39
|
+
box-shadow: 0 0 4px rgb(0 0 0 / 17%);
|
|
40
|
+
min-height: 34px;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.libro-kernel-and-container-status {
|
|
46
|
+
font-family: PingFangSC, 'Helvetica Neue', helvetica, arial, sans-serif;
|
|
47
|
+
|
|
48
|
+
.libro-kernel-status-and-selector {
|
|
49
|
+
.kernel {
|
|
50
|
+
color: var(--mana-libro-kernel-text);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.@{ant-prefix}-space-item {
|
|
54
|
+
color: var(--mana-libro-kernel-select-text);
|
|
55
|
+
|
|
56
|
+
> span {
|
|
57
|
+
transform: translate(-5px, 2px);
|
|
58
|
+
color: var(--mana-libro-dropdown-icon-color);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.libro-kernel-badge {
|
|
63
|
+
:first-child {
|
|
64
|
+
width: 9px;
|
|
65
|
+
height: 9px;
|
|
66
|
+
border: 1px solid var(--mana-libro-kernel-badge-border-color);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
padding-left: 8px;
|
|
70
|
+
|
|
71
|
+
:nth-child(2) {
|
|
72
|
+
color: var(--mana-libro-kernel-status-text);
|
|
73
|
+
opacity: var(--mana-libro-kernel-text-opacity);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.libro-container-and-service-status {
|
|
79
|
+
.loading-icon {
|
|
80
|
+
color: rgba(24, 144, 255, 100%);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.failed-icon {
|
|
84
|
+
color: rgba(255, 77, 79, 100%);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.kernel-prepare-failed {
|
|
88
|
+
padding: 0 16px 0 10px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.container-log-view-slot {
|
|
92
|
+
display: inline;
|
|
93
|
+
|
|
94
|
+
> div:first-child {
|
|
95
|
+
display: inline;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.no-kernel {
|
|
100
|
+
padding: 0 16px 0 10px;
|
|
101
|
+
color: var(--mana-libro-kernel-text);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.status-category {
|
|
105
|
+
padding-right: 8px;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.libro-popover-kernel-status {
|
|
111
|
+
.@{ant-prefix}-popover-inner {
|
|
112
|
+
background-color: var(--mana-libro-jupyter-kernel-status-background-color);
|
|
113
|
+
}
|
|
114
|
+
.@{ant-prefix}-popover-arrow-content::before {
|
|
115
|
+
background: var(--mana-libro-jupyter-kernel-status-background-color);
|
|
116
|
+
}
|
|
117
|
+
.@{ant-prefix}-steps-item-title {
|
|
118
|
+
color: var(--mana-libro-jupyter-kernel-status-title-color) !important;
|
|
119
|
+
}
|
|
120
|
+
.@{ant-prefix}-steps-item-icon {
|
|
121
|
+
background-color: transparent !important;
|
|
122
|
+
}
|
|
123
|
+
.@{ant-prefix}-steps-item-description {
|
|
124
|
+
.@{ant-prefix}-badge-status-text {
|
|
125
|
+
color: var(--mana-libro-jupyter-kernel-status-step-description-color) !important;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.@{ant-prefix}-steps-item-active {
|
|
130
|
+
.@{ant-prefix}-steps-item-title {
|
|
131
|
+
color: var(--mana-libro-jupyter-kernel-status-active-step-title-color) !important;
|
|
132
|
+
}
|
|
133
|
+
.@{ant-prefix}-steps-item-icon {
|
|
134
|
+
background-color: var(
|
|
135
|
+
--mana-libro-jupyter-kernel-status-step-active-background-color
|
|
136
|
+
) !important;
|
|
137
|
+
|
|
138
|
+
span {
|
|
139
|
+
color: white !important;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.libro-run-menu-container {
|
|
146
|
+
width: 220px;
|
|
147
|
+
background-color: var(--mana-libro-popover-background-color) !important;
|
|
148
|
+
.@{ant-prefix}-dropdown-menu-item:hover {
|
|
149
|
+
background-color: var(--mana-libro-menu-hover-color) !important;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
> li {
|
|
153
|
+
> span {
|
|
154
|
+
display: flex;
|
|
155
|
+
justify-content: space-between;
|
|
156
|
+
align-items: center;
|
|
157
|
+
|
|
158
|
+
.libro-run-menu-label {
|
|
159
|
+
font-family: PingFangSC;
|
|
160
|
+
font-weight: 400;
|
|
161
|
+
font-size: 14px;
|
|
162
|
+
color: var(--mana-libro-toolbar-menu-label-color);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.libro-run-menu-keybind {
|
|
166
|
+
margin-left: auto;
|
|
167
|
+
font-family: PingFangSC;
|
|
168
|
+
font-weight: 400;
|
|
169
|
+
font-size: 12px;
|
|
170
|
+
color: var(--mana-libro-toolbar-menu-keybind-color);
|
|
171
|
+
text-align: right;
|
|
172
|
+
line-height: 18px;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.libro-kernel-dropdown {
|
|
179
|
+
.@{ant-prefix}-dropdown-menu {
|
|
180
|
+
background-color: var(--mana-libro-popover-background-color);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.@{ant-prefix}-dropdown-menu-item-group-title {
|
|
184
|
+
color: var(--mana-libro-jupyter-kernel-status-title-color) !important;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.@{ant-prefix}-dropdown-menu-title-content {
|
|
188
|
+
color: var(--mana-libro-jupyter-kernel-status-menu-color);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.@{ant-prefix}-dropdown-menu-item:hover {
|
|
192
|
+
background-color: var(--mana-libro-menu-hover-color);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" resolution-mode="require"/>
|
|
2
|
+
import './index.less';
|
|
3
|
+
export interface PreferredSessionKernelListElem {
|
|
4
|
+
name: string;
|
|
5
|
+
id: string;
|
|
6
|
+
fileName: string;
|
|
7
|
+
}
|
|
8
|
+
export interface OtherKernelListElem {
|
|
9
|
+
name: string;
|
|
10
|
+
display_name: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const KernelSelector: React.FC;
|
|
13
|
+
//# sourceMappingURL=kernel-selector-dropdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kernel-selector-dropdown.d.ts","sourceRoot":"","sources":["../../src/toolbar/kernel-selector-dropdown.tsx"],"names":[],"mappings":";AAQA,OAAO,cAAc,CAAC;AAEtB,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACtB;AAmFD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAqGlC,CAAC"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
4
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
5
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
6
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
7
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
8
|
+
import { CaretDownOutlined } from '@ant-design/icons';
|
|
9
|
+
import { LibroKernelConnectionManager, KernelSpecManager } from '@difizen/libro-kernel';
|
|
10
|
+
import { useInject, ViewInstance } from '@difizen/mana-app';
|
|
11
|
+
import { Dropdown, Space } from 'antd';
|
|
12
|
+
import { useCallback } from 'react';
|
|
13
|
+
import { LibroJupyterModel } from "../libro-jupyter-model.js";
|
|
14
|
+
import "./index.less";
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
+
function getKernelList(kernelConnectionManager, kernelSpecManager) {
|
|
18
|
+
var preferredSessionKernelList = [];
|
|
19
|
+
var _iterator = _createForOfIteratorHelper(kernelConnectionManager.getAllKernelConnections()),
|
|
20
|
+
_step;
|
|
21
|
+
try {
|
|
22
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
23
|
+
var _step$value = _slicedToArray(_step.value, 2),
|
|
24
|
+
fileName = _step$value[0],
|
|
25
|
+
kc = _step$value[1];
|
|
26
|
+
preferredSessionKernelList.push({
|
|
27
|
+
fileName: fileName,
|
|
28
|
+
name: kc.name,
|
|
29
|
+
id: kc.id
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
} catch (err) {
|
|
33
|
+
_iterator.e(err);
|
|
34
|
+
} finally {
|
|
35
|
+
_iterator.f();
|
|
36
|
+
}
|
|
37
|
+
var otherKernelList = [];
|
|
38
|
+
if (kernelSpecManager.specs && kernelSpecManager.specs.kernelspecs && !(Object.keys(kernelSpecManager.specs.kernelspecs).length === 0)) {
|
|
39
|
+
var kernelspecs = kernelSpecManager.specs.kernelspecs;
|
|
40
|
+
for (var key in kernelspecs) {
|
|
41
|
+
var _kernelspecs$key$name, _kernelspecs$key, _kernelspecs$key$disp, _kernelspecs$key2;
|
|
42
|
+
otherKernelList.push({
|
|
43
|
+
name: (_kernelspecs$key$name = (_kernelspecs$key = kernelspecs[key]) === null || _kernelspecs$key === void 0 ? void 0 : _kernelspecs$key.name) !== null && _kernelspecs$key$name !== void 0 ? _kernelspecs$key$name : '',
|
|
44
|
+
display_name: (_kernelspecs$key$disp = (_kernelspecs$key2 = kernelspecs[key]) === null || _kernelspecs$key2 === void 0 ? void 0 : _kernelspecs$key2.display_name) !== null && _kernelspecs$key$disp !== void 0 ? _kernelspecs$key$disp : ''
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return [preferredSessionKernelList, otherKernelList];
|
|
49
|
+
}
|
|
50
|
+
function getKernelListItems(preferredSessionKernelList, otherKernelList) {
|
|
51
|
+
return [{
|
|
52
|
+
key: 'StartPreferredKernel',
|
|
53
|
+
type: 'group',
|
|
54
|
+
label: 'Start Preferred Kernel',
|
|
55
|
+
children: otherKernelList.map(function (item) {
|
|
56
|
+
return {
|
|
57
|
+
key: item.name,
|
|
58
|
+
label: item.display_name
|
|
59
|
+
};
|
|
60
|
+
})
|
|
61
|
+
}, {
|
|
62
|
+
key: 'UseNoKernel',
|
|
63
|
+
type: 'group',
|
|
64
|
+
label: 'Use No Kernel',
|
|
65
|
+
children: [{
|
|
66
|
+
key: 'No Kernel',
|
|
67
|
+
label: 'No Kernel'
|
|
68
|
+
}]
|
|
69
|
+
}, {
|
|
70
|
+
key: 'UseKernelFromPreferredSession',
|
|
71
|
+
type: 'group',
|
|
72
|
+
label: 'Use Kernel from Preferred Session',
|
|
73
|
+
children: preferredSessionKernelList.map(function (item) {
|
|
74
|
+
return {
|
|
75
|
+
key: item.fileName,
|
|
76
|
+
label: item.fileName
|
|
77
|
+
};
|
|
78
|
+
})
|
|
79
|
+
}, {
|
|
80
|
+
key: 'divider1',
|
|
81
|
+
type: 'divider' // Must have
|
|
82
|
+
}, {
|
|
83
|
+
key: 'ShutDownKernel',
|
|
84
|
+
label: 'Shut Down the Kernel'
|
|
85
|
+
}];
|
|
86
|
+
}
|
|
87
|
+
export var KernelSelector = function KernelSelector() {
|
|
88
|
+
var _kernelConnection, _kernelConnection2;
|
|
89
|
+
var libroView = useInject(ViewInstance);
|
|
90
|
+
var libroModel = libroView ? libroView.model : undefined;
|
|
91
|
+
var kernelConnectionManager = useInject(LibroKernelConnectionManager);
|
|
92
|
+
var kernelSpecManager = useInject(KernelSpecManager);
|
|
93
|
+
var _getKernelList = getKernelList(kernelConnectionManager, kernelSpecManager),
|
|
94
|
+
_getKernelList2 = _slicedToArray(_getKernelList, 2),
|
|
95
|
+
preferredSessionKernelList = _getKernelList2[0],
|
|
96
|
+
otherKernelList = _getKernelList2[1];
|
|
97
|
+
|
|
98
|
+
// 处理change kernel
|
|
99
|
+
var handleChange = useCallback(function (key) {
|
|
100
|
+
var selectValue = key;
|
|
101
|
+
if (!libroView || !(libroView.model instanceof LibroJupyterModel)) {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
libroView.model.kernelConnecting = true;
|
|
105
|
+
if (selectValue === 'No Kernel' || selectValue === 'ShutDownKernel') {
|
|
106
|
+
libroView.model.kernelConnecting = false;
|
|
107
|
+
if (libroView.model.shutdown) {
|
|
108
|
+
libroView.model.shutdown();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
var kernelInfoFromOtherKernelList = otherKernelList.filter(function (k) {
|
|
112
|
+
return k.name === selectValue;
|
|
113
|
+
});
|
|
114
|
+
if (kernelInfoFromOtherKernelList.length !== 0) {
|
|
115
|
+
libroView.model.currentFileContents.content.metadata.kernelspec = kernelInfoFromOtherKernelList[0];
|
|
116
|
+
kernelConnectionManager.changeKernel(libroView.model.currentFileContents, {
|
|
117
|
+
name: kernelInfoFromOtherKernelList[0].name
|
|
118
|
+
}).then(function (kernelConnection) {
|
|
119
|
+
if (!kernelConnection) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
libroView.model.kernelConnection = kernelConnection;
|
|
123
|
+
libroView.model.kernelConnecting = false;
|
|
124
|
+
return;
|
|
125
|
+
}).catch(function () {
|
|
126
|
+
//
|
|
127
|
+
});
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
var kernelInfoFromPreferredSessionKernelList = preferredSessionKernelList.filter(function (k) {
|
|
131
|
+
return k.fileName === selectValue;
|
|
132
|
+
});
|
|
133
|
+
if (kernelInfoFromPreferredSessionKernelList.length !== 0) {
|
|
134
|
+
kernelConnectionManager.changeKernel(libroView.model.currentFileContents, {
|
|
135
|
+
id: kernelInfoFromPreferredSessionKernelList[0].id,
|
|
136
|
+
name: kernelInfoFromPreferredSessionKernelList[0].name
|
|
137
|
+
}).then(function (kernelConnection) {
|
|
138
|
+
if (!kernelConnection) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
libroView.model.kernelConnection = kernelConnection;
|
|
142
|
+
libroView.model.kernelConnecting = false;
|
|
143
|
+
return;
|
|
144
|
+
}).catch(function () {
|
|
145
|
+
//
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
libroView.model.kernelConnecting = false;
|
|
149
|
+
return;
|
|
150
|
+
}, [libroView, otherKernelList, preferredSessionKernelList, kernelConnectionManager]);
|
|
151
|
+
return /*#__PURE__*/_jsx(Dropdown, {
|
|
152
|
+
overlayClassName: "libro-kernel-dropdown",
|
|
153
|
+
menu: {
|
|
154
|
+
items: getKernelListItems(preferredSessionKernelList, otherKernelList),
|
|
155
|
+
onClick: function onClick(_ref) {
|
|
156
|
+
var key = _ref.key;
|
|
157
|
+
return handleChange(key);
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
trigger: ['click'],
|
|
161
|
+
children: /*#__PURE__*/_jsxs(Space, {
|
|
162
|
+
children: [libroModel !== null && libroModel !== void 0 && (_kernelConnection = libroModel.kernelConnection) !== null && _kernelConnection !== void 0 && _kernelConnection.isDisposed ? 'no kernel' : (libroModel === null || libroModel === void 0 ? void 0 : (_kernelConnection2 = libroModel.kernelConnection) === null || _kernelConnection2 === void 0 ? void 0 : _kernelConnection2.name) || 'no kernel', /*#__PURE__*/_jsx(CaretDownOutlined, {})]
|
|
163
|
+
})
|
|
164
|
+
});
|
|
165
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" resolution-mode="require"/>
|
|
2
|
+
import './index.less';
|
|
3
|
+
export interface ServerStatus {
|
|
4
|
+
category: string;
|
|
5
|
+
color: string;
|
|
6
|
+
text: string;
|
|
7
|
+
text_zh: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const statusToColor: {
|
|
10
|
+
canRunImmediate: string;
|
|
11
|
+
canRun: string;
|
|
12
|
+
blocking: string;
|
|
13
|
+
error: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const jupyterServiceStatus: Record<string, ServerStatus>;
|
|
16
|
+
export declare const kernelStatus: Record<string, ServerStatus>;
|
|
17
|
+
export declare const KernelStatusSelector: React.FC;
|
|
18
|
+
//# sourceMappingURL=kernel-status-and-selector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kernel-status-and-selector.d.ts","sourceRoot":"","sources":["../../src/toolbar/kernel-status-and-selector.tsx"],"names":[],"mappings":";AAYA,OAAO,cAAc,CAAC;AAEtB,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,aAAa;;;;;CAKzB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAmB7D,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAuDrD,CAAC;AA+BF,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EA2DxC,CAAC"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { red, green, gold, blue } from '@ant-design/colors';
|
|
2
|
+
import { LoadingOutlined, StopOutlined } from '@ant-design/icons';
|
|
3
|
+
import { ServerManager } from '@difizen/libro-kernel';
|
|
4
|
+
import { useInject, ViewInstance } from '@difizen/mana-app';
|
|
5
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
6
|
+
import { Badge } from 'antd';
|
|
7
|
+
import { LibroJupyterModel } from "../libro-jupyter-model.js";
|
|
8
|
+
import { KernelSelector } from "./kernel-selector-dropdown.js";
|
|
9
|
+
import "./index.less";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
export var statusToColor = {
|
|
14
|
+
canRunImmediate: green[5],
|
|
15
|
+
canRun: blue[5],
|
|
16
|
+
blocking: gold[5],
|
|
17
|
+
error: red[4]
|
|
18
|
+
};
|
|
19
|
+
export var jupyterServiceStatus = {
|
|
20
|
+
loading: {
|
|
21
|
+
category: 'JupyterService',
|
|
22
|
+
color: statusToColor.blocking,
|
|
23
|
+
text: 'loading',
|
|
24
|
+
text_zh: l10n.t('加载中')
|
|
25
|
+
},
|
|
26
|
+
failed: {
|
|
27
|
+
category: 'JupyterService',
|
|
28
|
+
color: statusToColor.error,
|
|
29
|
+
text: 'failed',
|
|
30
|
+
text_zh: l10n.t('加载失败')
|
|
31
|
+
},
|
|
32
|
+
loaded: {
|
|
33
|
+
category: 'JupyterService',
|
|
34
|
+
color: statusToColor.canRunImmediate,
|
|
35
|
+
text: 'loaded',
|
|
36
|
+
text_zh: l10n.t('加载完成')
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
export var kernelStatus = {
|
|
40
|
+
connecting: {
|
|
41
|
+
category: 'Kernel',
|
|
42
|
+
color: statusToColor.blocking,
|
|
43
|
+
text: 'connecting',
|
|
44
|
+
text_zh: l10n.t('正在连接')
|
|
45
|
+
},
|
|
46
|
+
unknown: {
|
|
47
|
+
category: 'Kernel',
|
|
48
|
+
color: statusToColor.blocking,
|
|
49
|
+
text: 'unknown',
|
|
50
|
+
text_zh: l10n.t('未知')
|
|
51
|
+
},
|
|
52
|
+
starting: {
|
|
53
|
+
category: 'Kernel',
|
|
54
|
+
color: statusToColor.blocking,
|
|
55
|
+
text: 'starting',
|
|
56
|
+
text_zh: l10n.t('启动中')
|
|
57
|
+
},
|
|
58
|
+
idle: {
|
|
59
|
+
category: 'Kernel',
|
|
60
|
+
color: statusToColor.canRunImmediate,
|
|
61
|
+
text: 'idle',
|
|
62
|
+
text_zh: l10n.t('空闲')
|
|
63
|
+
},
|
|
64
|
+
busy: {
|
|
65
|
+
category: 'Kernel',
|
|
66
|
+
color: statusToColor.canRun,
|
|
67
|
+
text: 'busy',
|
|
68
|
+
text_zh: l10n.t('忙碌')
|
|
69
|
+
},
|
|
70
|
+
terminating: {
|
|
71
|
+
category: 'Kernel',
|
|
72
|
+
color: statusToColor.blocking,
|
|
73
|
+
text: 'terminating',
|
|
74
|
+
text_zh: l10n.t('终止中')
|
|
75
|
+
},
|
|
76
|
+
restarting: {
|
|
77
|
+
category: 'Kernel',
|
|
78
|
+
color: statusToColor.blocking,
|
|
79
|
+
text: 'restarting',
|
|
80
|
+
text_zh: l10n.t('重启中')
|
|
81
|
+
},
|
|
82
|
+
autorestarting: {
|
|
83
|
+
category: 'Kernel',
|
|
84
|
+
color: statusToColor.blocking,
|
|
85
|
+
text: 'autorestarting',
|
|
86
|
+
text_zh: l10n.t('自动重启中')
|
|
87
|
+
},
|
|
88
|
+
dead: {
|
|
89
|
+
category: 'Kernel',
|
|
90
|
+
color: statusToColor.error,
|
|
91
|
+
text: 'dead',
|
|
92
|
+
text_zh: l10n.t('死亡')
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
var getServiceStatusInfo = function getServiceStatusInfo(serverManager, libroModel) {
|
|
96
|
+
if (!serverManager || serverManager.launching) {
|
|
97
|
+
return jupyterServiceStatus['loading'];
|
|
98
|
+
}
|
|
99
|
+
if (!libroModel || !(libroModel instanceof LibroJupyterModel) || libroModel.kernelConnecting === true || libroModel.kernelConnecting === undefined) {
|
|
100
|
+
return kernelStatus['connecting'];
|
|
101
|
+
}
|
|
102
|
+
if (!libroModel.kernelConnection) {
|
|
103
|
+
return {
|
|
104
|
+
color: statusToColor.blocking,
|
|
105
|
+
text: 'no kernel',
|
|
106
|
+
category: 'Kernel',
|
|
107
|
+
text_zh: l10n.t('无内核')
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
return kernelStatus[libroModel.kernelConnection.status];
|
|
111
|
+
};
|
|
112
|
+
export var KernelStatusSelector = function KernelStatusSelector() {
|
|
113
|
+
var libroView = useInject(ViewInstance);
|
|
114
|
+
var serverManager = useInject(ServerManager);
|
|
115
|
+
var libroModel = libroView === null || libroView === void 0 ? void 0 : libroView.model;
|
|
116
|
+
var _getServiceStatusInfo = getServiceStatusInfo(serverManager, libroModel),
|
|
117
|
+
color = _getServiceStatusInfo.color,
|
|
118
|
+
text = _getServiceStatusInfo.text,
|
|
119
|
+
text_zh = _getServiceStatusInfo.text_zh,
|
|
120
|
+
category = _getServiceStatusInfo.category;
|
|
121
|
+
if (serverManager.loaded) {
|
|
122
|
+
var showBadge = libroModel.kernelConnection && !libroModel.kernelConnection.isDisposed || text === 'connecting';
|
|
123
|
+
var isKernelBusy = text === 'unknown' || text === 'busy';
|
|
124
|
+
return /*#__PURE__*/_jsx("div", {
|
|
125
|
+
className: "libro-kernel-and-container-status",
|
|
126
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
127
|
+
className: "libro-kernel-status-and-selector",
|
|
128
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
129
|
+
className: "kernel",
|
|
130
|
+
children: "kernel\uFF1A"
|
|
131
|
+
}), /*#__PURE__*/_jsx(KernelSelector, {}), showBadge && (isKernelBusy ? /*#__PURE__*/_jsx(Badge, {
|
|
132
|
+
className: "libro-kernel-badge",
|
|
133
|
+
color: kernelStatus['busy'].color,
|
|
134
|
+
text: kernelStatus['busy'].text_zh
|
|
135
|
+
}, "libro-kernel-badge") : /*#__PURE__*/_jsx(Badge, {
|
|
136
|
+
className: "libro-kernel-badge",
|
|
137
|
+
color: color,
|
|
138
|
+
text: text_zh
|
|
139
|
+
}, "libro-kernel-badge"))]
|
|
140
|
+
})
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
return /*#__PURE__*/_jsx("div", {
|
|
144
|
+
className: "libro-kernel-and-container-status",
|
|
145
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
146
|
+
className: "libro-container-and-service-status",
|
|
147
|
+
children: [text !== 'failed' && /*#__PURE__*/_jsxs(_Fragment, {
|
|
148
|
+
children: [/*#__PURE__*/_jsx(LoadingOutlined, {
|
|
149
|
+
className: "loading-icon"
|
|
150
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
151
|
+
className: "no-kernel",
|
|
152
|
+
children: l10n.t('Kernel 准备中...')
|
|
153
|
+
})]
|
|
154
|
+
}), text === 'failed' && category === 'JupyterService' && /*#__PURE__*/_jsxs(_Fragment, {
|
|
155
|
+
children: [/*#__PURE__*/_jsx(StopOutlined, {
|
|
156
|
+
className: "failed-icon"
|
|
157
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
158
|
+
className: "kernel-prepare-failed",
|
|
159
|
+
children: l10n.t('Kernel 准备失败')
|
|
160
|
+
})]
|
|
161
|
+
})]
|
|
162
|
+
})
|
|
163
|
+
});
|
|
164
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-selector.d.ts","sourceRoot":"","sources":["../../src/toolbar/run-selector.tsx"],"names":[],"mappings":";AAiBA,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EA4F/B,CAAC"}
|