@difizen/libro-jupyter 0.3.52 → 0.3.54
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/utils/index.d.ts.map +1 -1
- package/es/utils/index.js +11 -2
- package/package.json +17 -17
- package/src/utils/index.ts +14 -5
package/es/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAI3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAI3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAQjE,eAAO,MAAM,aAAa,eAAe,CAAC;AAC1C,eAAO,MAAM,mBAAmB,gCAAgC,CAAC;AACjE,eAAO,MAAM,mBAAmB,4BAA4B,CAAC;AAE7D,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,eAAO,MAAM,gBAAgB,UAAW,SAAS,YAIhD,CAAC;AAEF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAgBhD;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,SAAS,GACf,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAgBpC;AAED,wBAAgB,YAAY,CAAC,UAAU,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAMpE;AAED,eAAO,MAAM,oBAAoB,kBAChB,aAAa,GAAG,SAAS,cAC5B,iBAAiB,GAAG,SAAS,KACxC,YAmCF,CAAC;AAGF,eAAO,MAAM,cAAc,uBACL,aAAa,cACrB,iBAAiB,GAAG,SAAS,YAW1C,CAAC"}
|
package/es/utils/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { l10n } from '@difizen/mana-l10n';
|
|
2
2
|
import { duration } from 'moment';
|
|
3
3
|
import { LibroJupyterModel } from "../libro-jupyter-model.js";
|
|
4
|
-
import { jupyterServiceStatus, kernelStatus, statusToColor } from "../libro-jupyter-protocol.js";
|
|
4
|
+
import { jupyterServiceStatus, kernelStatus, statusToColor, ExecutedWithKernelCellModel } from "../libro-jupyter-protocol.js";
|
|
5
5
|
export var EXECUTE_INPUT = 'to_execute'; // 用户点击执行按钮的时间
|
|
6
6
|
export var EXECUTE_REPLY_START = 'shell.execute_reply.started'; // Kernel 开始执行任务时间在 metadata 中的 key
|
|
7
7
|
export var EXECUTE_REPLY_REPLY = 'shell.execute_reply.end'; // Kernel 结束执行任务时间在 metadata 中的 key
|
|
@@ -63,7 +63,16 @@ export var getServiceStatusInfo = function getServiceStatusInfo(serverManager, l
|
|
|
63
63
|
text_zh: l10n.t('无内核')
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
|
|
66
|
+
var status = libroModel.kernelConnection.status;
|
|
67
|
+
if (status === 'unknown') {
|
|
68
|
+
var hasRunningCell = libroModel.cells.some(function (cell) {
|
|
69
|
+
return ExecutedWithKernelCellModel.is(cell.model) && cell.model.kernelExecuting;
|
|
70
|
+
});
|
|
71
|
+
if (hasRunningCell) {
|
|
72
|
+
status = 'busy';
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return kernelStatus[status];
|
|
67
76
|
};
|
|
68
77
|
|
|
69
78
|
// 判断服务未启动、kernel正在连接 -> return false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@difizen/libro-jupyter",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.54",
|
|
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.3.
|
|
41
|
-
"@difizen/libro-code-editor": "^0.3.
|
|
42
|
-
"@difizen/libro-codemirror": "^0.3.
|
|
43
|
-
"@difizen/libro-cofine-editor": "^0.3.
|
|
44
|
-
"@difizen/libro-common": "^0.3.
|
|
45
|
-
"@difizen/libro-core": "^0.3.
|
|
46
|
-
"@difizen/libro-kernel": "^0.3.
|
|
47
|
-
"@difizen/libro-l10n": "^0.3.
|
|
48
|
-
"@difizen/libro-language-client": "^0.3.
|
|
49
|
-
"@difizen/libro-lsp": "^0.3.
|
|
50
|
-
"@difizen/libro-markdown-cell": "^0.3.
|
|
51
|
-
"@difizen/libro-output": "^0.3.
|
|
52
|
-
"@difizen/libro-raw-cell": "^0.3.
|
|
53
|
-
"@difizen/libro-rendermime": "^0.3.
|
|
54
|
-
"@difizen/libro-search": "^0.3.
|
|
55
|
-
"@difizen/libro-search-code-cell": "^0.3.
|
|
40
|
+
"@difizen/libro-code-cell": "^0.3.54",
|
|
41
|
+
"@difizen/libro-code-editor": "^0.3.54",
|
|
42
|
+
"@difizen/libro-codemirror": "^0.3.54",
|
|
43
|
+
"@difizen/libro-cofine-editor": "^0.3.54",
|
|
44
|
+
"@difizen/libro-common": "^0.3.54",
|
|
45
|
+
"@difizen/libro-core": "^0.3.54",
|
|
46
|
+
"@difizen/libro-kernel": "^0.3.54",
|
|
47
|
+
"@difizen/libro-l10n": "^0.3.54",
|
|
48
|
+
"@difizen/libro-language-client": "^0.3.54",
|
|
49
|
+
"@difizen/libro-lsp": "^0.3.54",
|
|
50
|
+
"@difizen/libro-markdown-cell": "^0.3.54",
|
|
51
|
+
"@difizen/libro-output": "^0.3.54",
|
|
52
|
+
"@difizen/libro-raw-cell": "^0.3.54",
|
|
53
|
+
"@difizen/libro-rendermime": "^0.3.54",
|
|
54
|
+
"@difizen/libro-search": "^0.3.54",
|
|
55
|
+
"@difizen/libro-search-code-cell": "^0.3.54",
|
|
56
56
|
"@difizen/mana-app": "latest",
|
|
57
57
|
"@difizen/mana-l10n": "latest",
|
|
58
58
|
"classnames": "^2.3.2",
|
package/src/utils/index.ts
CHANGED
|
@@ -4,14 +4,12 @@ import { l10n } from '@difizen/mana-l10n';
|
|
|
4
4
|
import { duration } from 'moment';
|
|
5
5
|
|
|
6
6
|
import { LibroJupyterModel } from '../libro-jupyter-model.js';
|
|
7
|
-
import type {
|
|
8
|
-
ExecutedWithKernelCellModel,
|
|
9
|
-
ServerStatus,
|
|
10
|
-
} from '../libro-jupyter-protocol.js';
|
|
7
|
+
import type { ServerStatus } from '../libro-jupyter-protocol.js';
|
|
11
8
|
import {
|
|
12
9
|
jupyterServiceStatus,
|
|
13
10
|
kernelStatus,
|
|
14
11
|
statusToColor,
|
|
12
|
+
ExecutedWithKernelCellModel,
|
|
15
13
|
} from '../libro-jupyter-protocol.js';
|
|
16
14
|
|
|
17
15
|
export const EXECUTE_INPUT = 'to_execute'; // 用户点击执行按钮的时间
|
|
@@ -100,7 +98,18 @@ export const getServiceStatusInfo = (
|
|
|
100
98
|
};
|
|
101
99
|
}
|
|
102
100
|
|
|
103
|
-
|
|
101
|
+
let status = libroModel.kernelConnection.status;
|
|
102
|
+
|
|
103
|
+
if (status === 'unknown') {
|
|
104
|
+
const hasRunningCell = libroModel.cells.some((cell) => {
|
|
105
|
+
return ExecutedWithKernelCellModel.is(cell.model) && cell.model.kernelExecuting;
|
|
106
|
+
});
|
|
107
|
+
if (hasRunningCell) {
|
|
108
|
+
status = 'busy';
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return kernelStatus[status];
|
|
104
113
|
};
|
|
105
114
|
|
|
106
115
|
// 判断服务未启动、kernel正在连接 -> return false
|