@difizen/libro-jupyter 0.2.44 → 0.3.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/es/components/cell-execution-tip.d.ts.map +1 -1
- package/es/components/cell-execution-tip.js +4 -3
- package/es/toolbar/kernel-selector-dropdown.d.ts.map +1 -1
- package/es/toolbar/kernel-selector-dropdown.js +8 -17
- package/es/toolbar/kernel-status-and-selector.js +1 -1
- package/package.json +17 -17
- package/src/components/cell-execution-tip.tsx +11 -9
- package/src/toolbar/kernel-selector-dropdown.tsx +10 -19
- package/src/toolbar/kernel-status-and-selector.tsx +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell-execution-tip.d.ts","sourceRoot":"","sources":["../../src/components/cell-execution-tip.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"cell-execution-tip.d.ts","sourceRoot":"","sources":["../../src/components/cell-execution-tip.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAqBpD,OAAO,cAAc,CAAC;AAEtB,wBAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,kDA0F5D"}
|
|
@@ -7,6 +7,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
7
7
|
import { LoadingOutlined } from '@ant-design/icons';
|
|
8
8
|
import { ExecutableCellView, CheckCircleOutlined, ExecutableCellModel } from '@difizen/libro-core';
|
|
9
9
|
import { useObserve } from '@difizen/mana-app';
|
|
10
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
10
11
|
import classnames from 'classnames';
|
|
11
12
|
import moment from 'moment';
|
|
12
13
|
import { useState } from 'react';
|
|
@@ -49,7 +50,7 @@ export function CellExecutionTip(_ref) {
|
|
|
49
50
|
children: [/*#__PURE__*/_jsx("div", {
|
|
50
51
|
className: "libro-cell-execution-tip-border"
|
|
51
52
|
}), /*#__PURE__*/_jsx(CheckCircleOutlined, {}), /*#__PURE__*/_jsx("p", {
|
|
52
|
-
children: '
|
|
53
|
+
children: l10n.t('执行耗时 {0},结束于 {1}', formatTime(Number(new Date(executeFinishTime).getTime()) - Number(new Date(executeStartTime).getTime())), moment(new Date(executeFinishTime).getTime()).format('hh:mm a'))
|
|
53
54
|
})]
|
|
54
55
|
});
|
|
55
56
|
} else if (kernelExecuting) {
|
|
@@ -65,7 +66,7 @@ export function CellExecutionTip(_ref) {
|
|
|
65
66
|
color: 'rgba(24,144,255,1)'
|
|
66
67
|
}
|
|
67
68
|
}), /*#__PURE__*/_jsx("p", {
|
|
68
|
-
children: '
|
|
69
|
+
children: l10n.t('已过去 {0}', formatTime(Date.now() - Number(new Date(executeStartTime).getTime())))
|
|
69
70
|
})]
|
|
70
71
|
});
|
|
71
72
|
} else if (waitingExecute) {
|
|
@@ -74,7 +75,7 @@ export function CellExecutionTip(_ref) {
|
|
|
74
75
|
children: [/*#__PURE__*/_jsx("div", {
|
|
75
76
|
className: "libro-cell-execution-tip-border"
|
|
76
77
|
}), /*#__PURE__*/_jsx(InfoCircle, {}), /*#__PURE__*/_jsx("p", {
|
|
77
|
-
children:
|
|
78
|
+
children: l10n.t('待执行')
|
|
78
79
|
})]
|
|
79
80
|
});
|
|
80
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kernel-selector-dropdown.d.ts","sourceRoot":"","sources":["../../src/toolbar/kernel-selector-dropdown.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"kernel-selector-dropdown.d.ts","sourceRoot":"","sources":["../../src/toolbar/kernel-selector-dropdown.tsx"],"names":[],"mappings":";AAWA,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;AA2FD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EA2HlC,CAAC"}
|
|
@@ -8,6 +8,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
8
8
|
import { CaretDownOutlined } from '@ant-design/icons';
|
|
9
9
|
import { LibroKernelConnectionManager, KernelSpecManager } from '@difizen/libro-kernel';
|
|
10
10
|
import { ConfigurationService, useInject, ViewInstance } from '@difizen/mana-app';
|
|
11
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
11
12
|
import { Dropdown, Space } from 'antd';
|
|
12
13
|
import { useCallback, useEffect, useState } from 'react';
|
|
13
14
|
import { LibroJupyterConfiguration } from "../config/index.js";
|
|
@@ -52,7 +53,7 @@ function getKernelListItems(preferredSessionKernelList, otherKernelList, allowPr
|
|
|
52
53
|
var array = [{
|
|
53
54
|
key: 'StartPreferredKernel',
|
|
54
55
|
type: 'group',
|
|
55
|
-
label: '
|
|
56
|
+
label: l10n.t('启动新的 Kernel'),
|
|
56
57
|
children: otherKernelList.map(function (item) {
|
|
57
58
|
return {
|
|
58
59
|
key: item.name,
|
|
@@ -62,36 +63,26 @@ function getKernelListItems(preferredSessionKernelList, otherKernelList, allowPr
|
|
|
62
63
|
}, {
|
|
63
64
|
key: 'UseNoKernel',
|
|
64
65
|
type: 'group',
|
|
65
|
-
label: '
|
|
66
|
+
label: l10n.t('不使用 Kernel'),
|
|
66
67
|
children: [{
|
|
67
68
|
key: 'No Kernel',
|
|
68
|
-
label: '
|
|
69
|
+
label: l10n.t('无 Kernel')
|
|
69
70
|
}]
|
|
70
|
-
}, {
|
|
71
|
-
key: 'UseKernelFromPreferredSession',
|
|
72
|
-
type: 'group',
|
|
73
|
-
label: 'Use Kernel from Preferred Session',
|
|
74
|
-
children: preferredSessionKernelList.map(function (item) {
|
|
75
|
-
return {
|
|
76
|
-
key: item.fileName,
|
|
77
|
-
label: item.fileName
|
|
78
|
-
};
|
|
79
|
-
})
|
|
80
71
|
}, {
|
|
81
72
|
key: 'divider1',
|
|
82
73
|
type: 'divider' // Must have
|
|
83
74
|
}, {
|
|
84
75
|
key: 'RestartKernel',
|
|
85
|
-
label: '
|
|
76
|
+
label: l10n.t('重启 Kernel')
|
|
86
77
|
}, {
|
|
87
78
|
key: 'ShutDownKernel',
|
|
88
|
-
label: '
|
|
79
|
+
label: l10n.t('关闭 Kernel')
|
|
89
80
|
}];
|
|
90
81
|
if (allowPreferredSession) {
|
|
91
82
|
array.splice(2, 0, {
|
|
92
83
|
key: 'UseKernelFromPreferredSession',
|
|
93
84
|
type: 'group',
|
|
94
|
-
label: '
|
|
85
|
+
label: l10n.t('使用运行中的 Kernel'),
|
|
95
86
|
children: preferredSessionKernelList.map(function (item) {
|
|
96
87
|
return {
|
|
97
88
|
key: item.fileName,
|
|
@@ -192,7 +183,7 @@ export var KernelSelector = function KernelSelector() {
|
|
|
192
183
|
},
|
|
193
184
|
trigger: ['click'],
|
|
194
185
|
children: /*#__PURE__*/_jsxs(Space, {
|
|
195
|
-
children: [libroModel !== null && libroModel !== void 0 && (_kernelConnection = libroModel.kernelConnection) !== null && _kernelConnection !== void 0 && _kernelConnection.isDisposed ? '
|
|
186
|
+
children: [libroModel !== null && libroModel !== void 0 && (_kernelConnection = libroModel.kernelConnection) !== null && _kernelConnection !== void 0 && _kernelConnection.isDisposed ? l10n.t('无 Kernel') : (libroModel === null || libroModel === void 0 || (_kernelConnection2 = libroModel.kernelConnection) === null || _kernelConnection2 === void 0 ? void 0 : _kernelConnection2.name) || l10n.t('无 Kernel'), /*#__PURE__*/_jsx(CaretDownOutlined, {})]
|
|
196
187
|
})
|
|
197
188
|
});
|
|
198
189
|
};
|
|
@@ -28,7 +28,7 @@ export var KernelStatusSelector = function KernelStatusSelector() {
|
|
|
28
28
|
className: "libro-kernel-status-and-selector",
|
|
29
29
|
children: [/*#__PURE__*/_jsx("span", {
|
|
30
30
|
className: "kernel",
|
|
31
|
-
children: l10n.t('
|
|
31
|
+
children: l10n.t('Kernel:')
|
|
32
32
|
}), /*#__PURE__*/_jsx(KernelSelector, {}), showBadge && (isKernelBusy ? /*#__PURE__*/_jsx(Badge, {
|
|
33
33
|
className: "libro-kernel-badge",
|
|
34
34
|
color: kernelStatus['busy'].color,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@difizen/libro-jupyter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"libro"
|
|
@@ -37,22 +37,22 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@ant-design/colors": "^7.0.0",
|
|
39
39
|
"@ant-design/icons": "^5.1.0",
|
|
40
|
-
"@difizen/libro-code-cell": "^0.
|
|
41
|
-
"@difizen/libro-code-editor": "^0.
|
|
42
|
-
"@difizen/libro-codemirror": "^0.
|
|
43
|
-
"@difizen/libro-cofine-editor": "^0.
|
|
44
|
-
"@difizen/libro-common": "^0.
|
|
45
|
-
"@difizen/libro-core": "^0.
|
|
46
|
-
"@difizen/libro-kernel": "^0.
|
|
47
|
-
"@difizen/libro-l10n": "^0.
|
|
48
|
-
"@difizen/libro-language-client": "^0.
|
|
49
|
-
"@difizen/libro-lsp": "^0.
|
|
50
|
-
"@difizen/libro-markdown-cell": "^0.
|
|
51
|
-
"@difizen/libro-output": "^0.
|
|
52
|
-
"@difizen/libro-raw-cell": "^0.
|
|
53
|
-
"@difizen/libro-rendermime": "^0.
|
|
54
|
-
"@difizen/libro-search": "^0.
|
|
55
|
-
"@difizen/libro-search-code-cell": "^0.
|
|
40
|
+
"@difizen/libro-code-cell": "^0.3.0",
|
|
41
|
+
"@difizen/libro-code-editor": "^0.3.0",
|
|
42
|
+
"@difizen/libro-codemirror": "^0.3.0",
|
|
43
|
+
"@difizen/libro-cofine-editor": "^0.3.0",
|
|
44
|
+
"@difizen/libro-common": "^0.3.0",
|
|
45
|
+
"@difizen/libro-core": "^0.3.0",
|
|
46
|
+
"@difizen/libro-kernel": "^0.3.0",
|
|
47
|
+
"@difizen/libro-l10n": "^0.3.0",
|
|
48
|
+
"@difizen/libro-language-client": "^0.3.0",
|
|
49
|
+
"@difizen/libro-lsp": "^0.3.0",
|
|
50
|
+
"@difizen/libro-markdown-cell": "^0.3.0",
|
|
51
|
+
"@difizen/libro-output": "^0.3.0",
|
|
52
|
+
"@difizen/libro-raw-cell": "^0.3.0",
|
|
53
|
+
"@difizen/libro-rendermime": "^0.3.0",
|
|
54
|
+
"@difizen/libro-search": "^0.3.0",
|
|
55
|
+
"@difizen/libro-search-code-cell": "^0.3.0",
|
|
56
56
|
"@difizen/mana-app": "latest",
|
|
57
57
|
"@difizen/mana-l10n": "latest",
|
|
58
58
|
"classnames": "^2.3.2",
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
ExecutableCellModel,
|
|
7
7
|
} from '@difizen/libro-core';
|
|
8
8
|
import { useObserve } from '@difizen/mana-app';
|
|
9
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
9
10
|
import classnames from 'classnames';
|
|
10
11
|
import moment from 'moment';
|
|
11
12
|
import { useState } from 'react';
|
|
@@ -64,14 +65,14 @@ export function CellExecutionTip({ cell }: { cell: CellView }) {
|
|
|
64
65
|
<div className="libro-cell-execution-tip-border" />
|
|
65
66
|
<CheckCircleOutlined />
|
|
66
67
|
<p>
|
|
67
|
-
{
|
|
68
|
+
{l10n.t(
|
|
69
|
+
'执行耗时 {0},结束于 {1}',
|
|
68
70
|
formatTime(
|
|
69
71
|
Number(new Date(executeFinishTime).getTime()) -
|
|
70
72
|
Number(new Date(executeStartTime).getTime()),
|
|
71
|
-
)
|
|
72
|
-
'
|
|
73
|
-
|
|
74
|
-
'.'}
|
|
73
|
+
),
|
|
74
|
+
moment(new Date(executeFinishTime).getTime()).format('hh:mm a'),
|
|
75
|
+
)}
|
|
75
76
|
</p>
|
|
76
77
|
</div>
|
|
77
78
|
);
|
|
@@ -89,9 +90,10 @@ export function CellExecutionTip({ cell }: { cell: CellView }) {
|
|
|
89
90
|
<div className="libro-cell-execution-tip-border" />
|
|
90
91
|
<LoadingOutlined style={{ color: 'rgba(24,144,255,1)' }} />
|
|
91
92
|
<p>
|
|
92
|
-
{
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
{l10n.t(
|
|
94
|
+
'已过去 {0}',
|
|
95
|
+
formatTime(Date.now() - Number(new Date(executeStartTime).getTime())),
|
|
96
|
+
)}
|
|
95
97
|
</p>
|
|
96
98
|
</div>
|
|
97
99
|
);
|
|
@@ -105,7 +107,7 @@ export function CellExecutionTip({ cell }: { cell: CellView }) {
|
|
|
105
107
|
>
|
|
106
108
|
<div className="libro-cell-execution-tip-border" />
|
|
107
109
|
<InfoCircle />
|
|
108
|
-
<p>{
|
|
110
|
+
<p>{l10n.t('待执行')}</p>
|
|
109
111
|
</div>
|
|
110
112
|
);
|
|
111
113
|
}
|
|
@@ -2,6 +2,7 @@ import { CaretDownOutlined } from '@ant-design/icons';
|
|
|
2
2
|
import type { LibroView } from '@difizen/libro-core';
|
|
3
3
|
import { LibroKernelConnectionManager, KernelSpecManager } from '@difizen/libro-kernel';
|
|
4
4
|
import { ConfigurationService, useInject, ViewInstance } from '@difizen/mana-app';
|
|
5
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
5
6
|
import { Dropdown, Space } from 'antd';
|
|
6
7
|
import type { MenuProps } from 'antd';
|
|
7
8
|
import { useCallback, useEffect, useState } from 'react';
|
|
@@ -62,7 +63,7 @@ function getKernelListItems(
|
|
|
62
63
|
{
|
|
63
64
|
key: 'StartPreferredKernel',
|
|
64
65
|
type: 'group',
|
|
65
|
-
label: '
|
|
66
|
+
label: l10n.t('启动新的 Kernel'),
|
|
66
67
|
children: otherKernelList.map((item) => {
|
|
67
68
|
return {
|
|
68
69
|
key: item.name,
|
|
@@ -73,43 +74,32 @@ function getKernelListItems(
|
|
|
73
74
|
{
|
|
74
75
|
key: 'UseNoKernel',
|
|
75
76
|
type: 'group',
|
|
76
|
-
label: '
|
|
77
|
+
label: l10n.t('不使用 Kernel'),
|
|
77
78
|
children: [
|
|
78
79
|
{
|
|
79
80
|
key: 'No Kernel',
|
|
80
|
-
label: '
|
|
81
|
+
label: l10n.t('无 Kernel'),
|
|
81
82
|
},
|
|
82
83
|
],
|
|
83
84
|
},
|
|
84
|
-
{
|
|
85
|
-
key: 'UseKernelFromPreferredSession',
|
|
86
|
-
type: 'group',
|
|
87
|
-
label: 'Use Kernel from Preferred Session',
|
|
88
|
-
children: preferredSessionKernelList.map((item) => {
|
|
89
|
-
return {
|
|
90
|
-
key: item.fileName,
|
|
91
|
-
label: item.fileName,
|
|
92
|
-
};
|
|
93
|
-
}),
|
|
94
|
-
},
|
|
95
85
|
{
|
|
96
86
|
key: 'divider1',
|
|
97
87
|
type: 'divider', // Must have
|
|
98
88
|
},
|
|
99
89
|
{
|
|
100
90
|
key: 'RestartKernel',
|
|
101
|
-
label: '
|
|
91
|
+
label: l10n.t('重启 Kernel'),
|
|
102
92
|
},
|
|
103
93
|
{
|
|
104
94
|
key: 'ShutDownKernel',
|
|
105
|
-
label: '
|
|
95
|
+
label: l10n.t('关闭 Kernel'),
|
|
106
96
|
},
|
|
107
97
|
];
|
|
108
98
|
if (allowPreferredSession) {
|
|
109
99
|
array.splice(2, 0, {
|
|
110
100
|
key: 'UseKernelFromPreferredSession',
|
|
111
101
|
type: 'group',
|
|
112
|
-
label: '
|
|
102
|
+
label: l10n.t('使用运行中的 Kernel'),
|
|
113
103
|
children: preferredSessionKernelList.map((item) => {
|
|
114
104
|
return {
|
|
115
105
|
key: item.fileName,
|
|
@@ -237,8 +227,9 @@ export const KernelSelector: React.FC = () => {
|
|
|
237
227
|
>
|
|
238
228
|
<Space>
|
|
239
229
|
{(libroModel as LibroJupyterModel)?.kernelConnection?.isDisposed
|
|
240
|
-
? '
|
|
241
|
-
: (libroModel as LibroJupyterModel)?.kernelConnection?.name ||
|
|
230
|
+
? l10n.t('无 Kernel')
|
|
231
|
+
: (libroModel as LibroJupyterModel)?.kernelConnection?.name ||
|
|
232
|
+
l10n.t('无 Kernel')}
|
|
242
233
|
<CaretDownOutlined />
|
|
243
234
|
</Space>
|
|
244
235
|
</Dropdown>
|
|
@@ -30,7 +30,7 @@ export const KernelStatusSelector: React.FC = () => {
|
|
|
30
30
|
return (
|
|
31
31
|
<div className="libro-kernel-and-container-status">
|
|
32
32
|
<div className="libro-kernel-status-and-selector">
|
|
33
|
-
<span className="kernel">{l10n.t('
|
|
33
|
+
<span className="kernel">{l10n.t('Kernel:')}</span>
|
|
34
34
|
<KernelSelector />
|
|
35
35
|
{showBadge &&
|
|
36
36
|
(isKernelBusy ? (
|