|
|
|
|
@ -1557,6 +1557,26 @@ function _getMyFileContent() {
|
|
|
|
|
}));
|
|
|
|
|
return _getMyFileContent.apply(this, arguments);
|
|
|
|
|
}
|
|
|
|
|
function saveGitFile(_x6) {
|
|
|
|
|
return _saveGitFile.apply(this, arguments);
|
|
|
|
|
}
|
|
|
|
|
function _saveGitFile() {
|
|
|
|
|
_saveGitFile = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6(params) {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
|
|
|
|
|
while (1) switch (_context6.prev = _context6.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
return _context6.abrupt("return", (0,fetch/* default */.ZP)("/api/sci/projects/".concat(params.id, "/commit_files.json"), {
|
|
|
|
|
method: 'post',
|
|
|
|
|
body: params
|
|
|
|
|
}));
|
|
|
|
|
case 1:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context6.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee6);
|
|
|
|
|
}));
|
|
|
|
|
return _saveGitFile.apply(this, arguments);
|
|
|
|
|
}
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Innovation/Tasks/data-sets/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1761,6 +1781,7 @@ var recordScreen = __webpack_require__(58897);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Countdown = statistic/* default */.Z.Countdown;
|
|
|
|
|
function TipContent() {
|
|
|
|
|
return /*#__PURE__*/_jsx("p", {
|
|
|
|
|
@ -1895,13 +1916,72 @@ function TipContent() {
|
|
|
|
|
setIsToolBar(false);
|
|
|
|
|
setIsDataBar(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//退出保存代码
|
|
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
|
|
window.addEventListener('beforeunload', onSaveContent);
|
|
|
|
|
return function () {
|
|
|
|
|
window.removeEventListener('beforeunload', onSaveContent);
|
|
|
|
|
};
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
//窗口关闭保存代码
|
|
|
|
|
var onSaveContent = /*#__PURE__*/function () {
|
|
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
try {
|
|
|
|
|
window.navigator.sendBeacon("".concat(env/* default */.Z.API_SERVER, "/api/sci/projects/").concat(params.taskId, "/commit_files.json"));
|
|
|
|
|
} catch (e) {}
|
|
|
|
|
case 1:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee);
|
|
|
|
|
}));
|
|
|
|
|
return function onSaveContent() {
|
|
|
|
|
return _ref2.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}();
|
|
|
|
|
function toShixun() {
|
|
|
|
|
// onBack();
|
|
|
|
|
(0,_umi_production_exports.getDvaApp)()._store.dispatch({
|
|
|
|
|
type: 'globalSetting/headerFooterToggle',
|
|
|
|
|
payload: true
|
|
|
|
|
});
|
|
|
|
|
_umi_production_exports.history.replace("/innovation/project/detail/".concat(params.taskId));
|
|
|
|
|
return _toShixun.apply(this, arguments);
|
|
|
|
|
}
|
|
|
|
|
function _toShixun() {
|
|
|
|
|
_toShixun = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
if (!(taskData.mirror_type === 'jupyterlab' || taskData.mirror_type === 'jupyternotebook')) {
|
|
|
|
|
_context5.next = 6;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
mediator/* default */.Z.publish('exit-jupyter-send');
|
|
|
|
|
_context5.next = 4;
|
|
|
|
|
return new Promise(function (resolve) {
|
|
|
|
|
return setTimeout(resolve, 1000);
|
|
|
|
|
});
|
|
|
|
|
case 4:
|
|
|
|
|
_context5.next = 8;
|
|
|
|
|
break;
|
|
|
|
|
case 6:
|
|
|
|
|
_context5.next = 8;
|
|
|
|
|
return saveGitFile({
|
|
|
|
|
id: params.taskId
|
|
|
|
|
});
|
|
|
|
|
case 8:
|
|
|
|
|
(0,_umi_production_exports.getDvaApp)()._store.dispatch({
|
|
|
|
|
type: 'globalSetting/headerFooterToggle',
|
|
|
|
|
payload: true
|
|
|
|
|
});
|
|
|
|
|
_umi_production_exports.history.replace("/innovation/project/detail/".concat(params.taskId));
|
|
|
|
|
case 10:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context5.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee5);
|
|
|
|
|
}));
|
|
|
|
|
return _toShixun.apply(this, arguments);
|
|
|
|
|
}
|
|
|
|
|
function onReset() {
|
|
|
|
|
if (resetVncLoading) {
|
|
|
|
|
@ -2056,9 +2136,9 @@ function TipContent() {
|
|
|
|
|
type: "primary",
|
|
|
|
|
disabled: !showSave,
|
|
|
|
|
className: "save-innovation",
|
|
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
setisshowmodal(true);
|
|
|
|
|
// const res = await saveEnv(params.taskId);
|
|
|
|
|
@ -2067,9 +2147,9 @@ function TipContent() {
|
|
|
|
|
// }
|
|
|
|
|
case 1:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context.stop();
|
|
|
|
|
return _context2.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee);
|
|
|
|
|
}, _callee2);
|
|
|
|
|
})),
|
|
|
|
|
children: "\u4FDD\u5B58\u955C\u50CF"
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
|
|
@ -2131,16 +2211,16 @@ function TipContent() {
|
|
|
|
|
},
|
|
|
|
|
form: form,
|
|
|
|
|
onFinish: ( /*#__PURE__*/function () {
|
|
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(value) {
|
|
|
|
|
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(value) {
|
|
|
|
|
var res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
setisloading(true);
|
|
|
|
|
_context3.next = 3;
|
|
|
|
|
_context4.next = 3;
|
|
|
|
|
return saveEnv(params.taskId, value);
|
|
|
|
|
case 3:
|
|
|
|
|
res = _context3.sent;
|
|
|
|
|
res = _context4.sent;
|
|
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
|
|
|
message/* default */.ZP.info('保存成功');
|
|
|
|
|
setisshowmodal(false);
|
|
|
|
|
@ -2152,26 +2232,26 @@ function TipContent() {
|
|
|
|
|
okText: '确认',
|
|
|
|
|
cancelText: '取消',
|
|
|
|
|
onOk: function () {
|
|
|
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
|
|
var res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
_context2.next = 2;
|
|
|
|
|
_context3.next = 2;
|
|
|
|
|
return saveEnv(params.taskId, objectSpread2_default()({
|
|
|
|
|
is_cover: true
|
|
|
|
|
}, value));
|
|
|
|
|
case 2:
|
|
|
|
|
res = _context2.sent;
|
|
|
|
|
res = _context3.sent;
|
|
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
|
|
|
message/* default */.ZP.info('覆盖成功');
|
|
|
|
|
setisshowmodal(false);
|
|
|
|
|
}
|
|
|
|
|
case 4:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context2.stop();
|
|
|
|
|
return _context3.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee2);
|
|
|
|
|
}, _callee3);
|
|
|
|
|
}));
|
|
|
|
|
function onOk() {
|
|
|
|
|
return _onOk.apply(this, arguments);
|
|
|
|
|
@ -2183,12 +2263,12 @@ function TipContent() {
|
|
|
|
|
setisloading(false);
|
|
|
|
|
case 7:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context3.stop();
|
|
|
|
|
return _context4.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee3);
|
|
|
|
|
}, _callee4);
|
|
|
|
|
}));
|
|
|
|
|
return function (_x) {
|
|
|
|
|
return _ref3.apply(this, arguments);
|
|
|
|
|
return _ref4.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}()),
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
@ -2232,13 +2312,13 @@ function TipContent() {
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
var FiveMinute = 300;
|
|
|
|
|
function VncTimer(_ref4) {
|
|
|
|
|
var onAddVncTime = _ref4.onAddVncTime,
|
|
|
|
|
onReset = _ref4.onReset,
|
|
|
|
|
toShixun = _ref4.toShixun,
|
|
|
|
|
_ref4$title = _ref4.title,
|
|
|
|
|
title = _ref4$title === void 0 ? '' : _ref4$title,
|
|
|
|
|
defaultTime = _ref4.defaultTime;
|
|
|
|
|
function VncTimer(_ref5) {
|
|
|
|
|
var onAddVncTime = _ref5.onAddVncTime,
|
|
|
|
|
onReset = _ref5.onReset,
|
|
|
|
|
toShixun = _ref5.toShixun,
|
|
|
|
|
_ref5$title = _ref5.title,
|
|
|
|
|
title = _ref5$title === void 0 ? '' : _ref5$title,
|
|
|
|
|
defaultTime = _ref5.defaultTime;
|
|
|
|
|
var _useState19 = (0,_react_17_0_2_react.useState)(defaultTime),
|
|
|
|
|
_useState20 = slicedToArray_default()(_useState19, 2),
|
|
|
|
|
time = _useState20[0],
|
|
|
|
|
@ -2272,31 +2352,31 @@ function VncTimer(_ref4) {
|
|
|
|
|
return _onAddTime.apply(this, arguments);
|
|
|
|
|
}
|
|
|
|
|
function _onAddTime() {
|
|
|
|
|
_onAddTime = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
|
|
|
|
|
_onAddTime = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6() {
|
|
|
|
|
var res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
|
|
|
|
|
while (1) switch (_context6.prev = _context6.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
setIsPlusTime(false);
|
|
|
|
|
if (!(time > 0)) {
|
|
|
|
|
_context4.next = 8;
|
|
|
|
|
_context6.next = 8;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
_context4.next = 4;
|
|
|
|
|
_context6.next = 4;
|
|
|
|
|
return onAddVncTime();
|
|
|
|
|
case 4:
|
|
|
|
|
res = _context4.sent;
|
|
|
|
|
res = _context6.sent;
|
|
|
|
|
setTime((res === null || res === void 0 ? void 0 : res.remaining_time) / 1000);
|
|
|
|
|
_context4.next = 10;
|
|
|
|
|
_context6.next = 10;
|
|
|
|
|
break;
|
|
|
|
|
case 8:
|
|
|
|
|
setTime(defaultTime);
|
|
|
|
|
onReset();
|
|
|
|
|
case 10:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context4.stop();
|
|
|
|
|
return _context6.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee4);
|
|
|
|
|
}, _callee6);
|
|
|
|
|
}));
|
|
|
|
|
return _onAddTime.apply(this, arguments);
|
|
|
|
|
}
|
|
|
|
|
@ -2549,6 +2629,13 @@ var TimeTicket = 30000;
|
|
|
|
|
columns: term.cols
|
|
|
|
|
})
|
|
|
|
|
}));
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
var initialCommand = "cd /data/workspace/keyan/myshixun\n";
|
|
|
|
|
socketInstance.send(JSON.stringify({
|
|
|
|
|
tp: 'client',
|
|
|
|
|
data: initialCommand
|
|
|
|
|
}));
|
|
|
|
|
}, 200);
|
|
|
|
|
}
|
|
|
|
|
term.focus();
|
|
|
|
|
};
|
|
|
|
|
@ -2558,6 +2645,7 @@ var TimeTicket = 30000;
|
|
|
|
|
// mediator.publish('on-recreate-socket')
|
|
|
|
|
};
|
|
|
|
|
socketInstance.onmessage = function (event) {
|
|
|
|
|
var _data;
|
|
|
|
|
if (!isFirstConnected.current) {
|
|
|
|
|
term.write('\r');
|
|
|
|
|
// term.focus()
|
|
|
|
|
@ -2568,6 +2656,9 @@ var TimeTicket = 30000;
|
|
|
|
|
isFirstConnected.current = true;
|
|
|
|
|
console.log('event:', event);
|
|
|
|
|
var data = base64.Base64.decode(event.data.toString());
|
|
|
|
|
if (((_data = data) === null || _data === void 0 ? void 0 : _data.indexOf("版本库代码路径:/data/workspace/myshixun/")) > -1) {
|
|
|
|
|
data = "\u7248\u672C\u5E93\u4EE3\u7801\u8DEF\u5F84\uFF1A/data/workspace/keyan/myshixun/\r\n";
|
|
|
|
|
}
|
|
|
|
|
var w = term._core._renderService.dimensions.actualCellWidth || 9.5;
|
|
|
|
|
console.log('data:', data, w, term);
|
|
|
|
|
term.write(data);
|
|
|
|
|
@ -3467,8 +3558,10 @@ var Jupyter_excluded = ["globalSetting", "loading", "taskData", "dispatch"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Jupyter_Countdown = statistic/* default */.Z.Countdown;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Status = /*#__PURE__*/function (Status) {
|
|
|
|
|
Status[Status["LoadFail"] = 1] = "LoadFail";
|
|
|
|
|
Status[Status["ReLoad"] = 2] = "ReLoad";
|
|
|
|
|
@ -3552,6 +3645,7 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
|
|
|
|
|
var timer = (0,_react_17_0_2_react.useRef)(null);
|
|
|
|
|
var saveJupyterData = (0,_react_17_0_2_react.useRef)({});
|
|
|
|
|
var clickEvaluating = (0,_react_17_0_2_react.useRef)(false);
|
|
|
|
|
var exitJupyter = (0,_react_17_0_2_react.useRef)(false);
|
|
|
|
|
var _useReducer = (0,_react_17_0_2_react.useReducer)(reducer_reducer, Jupyter_initialState),
|
|
|
|
|
_useReducer2 = slicedToArray_default()(_useReducer, 2),
|
|
|
|
|
state = _useReducer2[0],
|
|
|
|
|
@ -3564,49 +3658,84 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
|
|
|
|
|
// }, [vnc_url, with_code_file, unity_3d_routes]);
|
|
|
|
|
|
|
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
|
|
var sub = mediator/* default */.Z.subscribe('exit-jupyter-send', function () {
|
|
|
|
|
var iframe = document.getElementById('taskJupyterIframe');
|
|
|
|
|
if (iframe) {
|
|
|
|
|
exitJupyter.current = true;
|
|
|
|
|
iframe.contentWindow.postMessage('saveCode', '*');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
window.addEventListener('message', handleJupyterMessage);
|
|
|
|
|
return function () {
|
|
|
|
|
window.removeEventListener('message', handleJupyterMessage);
|
|
|
|
|
};
|
|
|
|
|
}, []);
|
|
|
|
|
var handleJupyterMessage = function handleJupyterMessage(e) {
|
|
|
|
|
if ((e === null || e === void 0 ? void 0 : e.data) === 'jupytermessage' && jupyterMessageFlag.current) {
|
|
|
|
|
jupyterMessageFlag.current = false;
|
|
|
|
|
handleSaveWithTPI();
|
|
|
|
|
if (!clickEvaluating.current) {
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
return jupyterMessageFlag.current = true;
|
|
|
|
|
}, 500);
|
|
|
|
|
}
|
|
|
|
|
// setTimeout(() => jupyterMessageFlag.current = true, 500)
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
var handleSaveWithTPI = /*#__PURE__*/function () {
|
|
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
|
|
var handleJupyterMessage = /*#__PURE__*/function () {
|
|
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(e) {
|
|
|
|
|
var res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
if (!((e === null || e === void 0 ? void 0 : e.data) === 'jupytermessage')) {
|
|
|
|
|
_context.next = 6;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
clickEvaluating.current = false;
|
|
|
|
|
_context.next = 4;
|
|
|
|
|
return saveGitFile({
|
|
|
|
|
id: params === null || params === void 0 ? void 0 : params.taskId
|
|
|
|
|
});
|
|
|
|
|
case 4:
|
|
|
|
|
res = _context.sent;
|
|
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0 && !exitJupyter.current) {
|
|
|
|
|
message/* default */.ZP.success({
|
|
|
|
|
content: '保存成功',
|
|
|
|
|
key: 'jupyter-message-key'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// jupyterMessageFlag.current = false;
|
|
|
|
|
// handleSaveWithTPI();
|
|
|
|
|
// if (!clickEvaluating.current) {
|
|
|
|
|
// setTimeout(() => (jupyterMessageFlag.current = true), 500);
|
|
|
|
|
// }
|
|
|
|
|
// // setTimeout(() => jupyterMessageFlag.current = true, 500)
|
|
|
|
|
case 6:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee);
|
|
|
|
|
}));
|
|
|
|
|
return function handleSaveWithTPI() {
|
|
|
|
|
return function handleJupyterMessage(_x) {
|
|
|
|
|
return _ref2.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}();
|
|
|
|
|
var handleGetJupyterData = /*#__PURE__*/function () {
|
|
|
|
|
var handleSaveWithTPI = /*#__PURE__*/function () {
|
|
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
|
|
var res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
_context2.next = 2;
|
|
|
|
|
case "end":
|
|
|
|
|
return _context2.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee2);
|
|
|
|
|
}));
|
|
|
|
|
return function handleSaveWithTPI() {
|
|
|
|
|
return _ref3.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}();
|
|
|
|
|
var handleGetJupyterData = /*#__PURE__*/function () {
|
|
|
|
|
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
|
|
var res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
_context3.next = 2;
|
|
|
|
|
return (0,task/* getJupyterData */.dU)({
|
|
|
|
|
identifier: params.identifier
|
|
|
|
|
});
|
|
|
|
|
case 2:
|
|
|
|
|
res = _context2.sent;
|
|
|
|
|
res = _context3.sent;
|
|
|
|
|
if (res) {
|
|
|
|
|
setJupyterData(res);
|
|
|
|
|
saveJupyterData.current = objectSpread2_default()({}, res);
|
|
|
|
|
@ -3620,44 +3749,44 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
|
|
|
|
|
}
|
|
|
|
|
case 4:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context2.stop();
|
|
|
|
|
return _context3.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee2);
|
|
|
|
|
}, _callee3);
|
|
|
|
|
}));
|
|
|
|
|
return function handleGetJupyterData() {
|
|
|
|
|
return _ref3.apply(this, arguments);
|
|
|
|
|
return _ref4.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}();
|
|
|
|
|
var handleGetJupyterTPIUrl = /*#__PURE__*/function () {
|
|
|
|
|
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
|
|
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
|
|
|
|
|
var res, _parseUrl, _res$url, _res$url2;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
_context3.next = 2;
|
|
|
|
|
_context4.next = 2;
|
|
|
|
|
return (0,task/* getInfoWithTPI */.rV)({
|
|
|
|
|
identifier: params.identifier
|
|
|
|
|
});
|
|
|
|
|
case 2:
|
|
|
|
|
res = _context3.sent;
|
|
|
|
|
res = _context4.sent;
|
|
|
|
|
setSpinning(false);
|
|
|
|
|
if (!(res !== null && res !== void 0 && res.url)) {
|
|
|
|
|
_context3.next = 14;
|
|
|
|
|
_context4.next = 14;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
setUrl(res.url);
|
|
|
|
|
token.current = (_parseUrl = (0,util/* parseUrl */.en)(res === null || res === void 0 || (_res$url = res.url) === null || _res$url === void 0 || (_res$url = _res$url[0]) === null || _res$url === void 0 ? void 0 : _res$url["url"])) === null || _parseUrl === void 0 ? void 0 : _parseUrl.token;
|
|
|
|
|
port.current = res.port;
|
|
|
|
|
if (!(((_res$url2 = res.url) === null || _res$url2 === void 0 ? void 0 : _res$url2.length) > 1)) {
|
|
|
|
|
_context3.next = 10;
|
|
|
|
|
_context4.next = 10;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return _context3.abrupt("return");
|
|
|
|
|
return _context4.abrupt("return");
|
|
|
|
|
case 10:
|
|
|
|
|
setUrlSign(false);
|
|
|
|
|
handleGetTPITimeInfo();
|
|
|
|
|
setStatus(Status.Success);
|
|
|
|
|
return _context3.abrupt("return");
|
|
|
|
|
return _context4.abrupt("return");
|
|
|
|
|
case 14:
|
|
|
|
|
if (res.status === -1) {
|
|
|
|
|
setStatus(Status.LoadFail);
|
|
|
|
|
@ -3667,12 +3796,12 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
|
|
|
|
|
}
|
|
|
|
|
case 15:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context3.stop();
|
|
|
|
|
return _context4.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee3);
|
|
|
|
|
}, _callee4);
|
|
|
|
|
}));
|
|
|
|
|
return function handleGetJupyterTPIUrl() {
|
|
|
|
|
return _ref4.apply(this, arguments);
|
|
|
|
|
return _ref5.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}();
|
|
|
|
|
var handleUrlClick = function handleUrlClick(num) {
|
|
|
|
|
@ -3682,29 +3811,29 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
|
|
|
|
|
setStatus(Status.Success);
|
|
|
|
|
};
|
|
|
|
|
var handleGetTPITimeInfo = /*#__PURE__*/function () {
|
|
|
|
|
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
|
|
|
|
|
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
|
|
|
|
|
var res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
_context4.next = 2;
|
|
|
|
|
_context5.next = 2;
|
|
|
|
|
return (0,task/* getTimeInfoWithTPI */.x4)({
|
|
|
|
|
identifier: params.identifier
|
|
|
|
|
});
|
|
|
|
|
case 2:
|
|
|
|
|
res = _context4.sent;
|
|
|
|
|
res = _context5.sent;
|
|
|
|
|
if (!((res === null || res === void 0 ? void 0 : res.status) !== 0)) {
|
|
|
|
|
_context4.next = 5;
|
|
|
|
|
_context5.next = 5;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return _context4.abrupt("return");
|
|
|
|
|
return _context5.abrupt("return");
|
|
|
|
|
case 5:
|
|
|
|
|
if (res !== null && res !== void 0 && res.useSeconds) {
|
|
|
|
|
_context4.next = 8;
|
|
|
|
|
_context5.next = 8;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
handleResetEnvModal();
|
|
|
|
|
return _context4.abrupt("return");
|
|
|
|
|
return _context5.abrupt("return");
|
|
|
|
|
case 8:
|
|
|
|
|
if (res !== null && res !== void 0 && res.remainingSeconds) {
|
|
|
|
|
setTime(Date.now() + res.remainingSeconds * 1000);
|
|
|
|
|
@ -3712,12 +3841,12 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
|
|
|
|
|
}
|
|
|
|
|
case 9:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context4.stop();
|
|
|
|
|
return _context5.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee4);
|
|
|
|
|
}, _callee5);
|
|
|
|
|
}));
|
|
|
|
|
return function handleGetTPITimeInfo() {
|
|
|
|
|
return _ref5.apply(this, arguments);
|
|
|
|
|
return _ref6.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}();
|
|
|
|
|
var handleResetEnvModal = function handleResetEnvModal() {
|
|
|
|
|
@ -3739,22 +3868,22 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
var handleResetEnv = /*#__PURE__*/function () {
|
|
|
|
|
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
|
|
|
|
|
var _ref7 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6() {
|
|
|
|
|
var res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
|
|
|
|
|
while (1) switch (_context6.prev = _context6.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
_context5.next = 2;
|
|
|
|
|
_context6.next = 2;
|
|
|
|
|
return (0,task/* resetWithTPI */.m_)({
|
|
|
|
|
identifier: params.identifier
|
|
|
|
|
});
|
|
|
|
|
case 2:
|
|
|
|
|
res = _context5.sent;
|
|
|
|
|
res = _context6.sent;
|
|
|
|
|
if (!((res === null || res === void 0 ? void 0 : res.status) !== 0)) {
|
|
|
|
|
_context5.next = 5;
|
|
|
|
|
_context6.next = 5;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return _context5.abrupt("return");
|
|
|
|
|
return _context6.abrupt("return");
|
|
|
|
|
case 5:
|
|
|
|
|
message/* default */.ZP.success('重置成功!');
|
|
|
|
|
setSpinning(false);
|
|
|
|
|
@ -3763,12 +3892,12 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
|
|
|
|
|
}, 300);
|
|
|
|
|
case 8:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context5.stop();
|
|
|
|
|
return _context6.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee5);
|
|
|
|
|
}, _callee6);
|
|
|
|
|
}));
|
|
|
|
|
return function handleResetEnv() {
|
|
|
|
|
return _ref6.apply(this, arguments);
|
|
|
|
|
return _ref7.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}();
|
|
|
|
|
var handleEndTimeFinish = function handleEndTimeFinish() {
|
|
|
|
|
@ -3789,30 +3918,30 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
|
|
|
|
|
okText: '立即延长',
|
|
|
|
|
cancelText: '不需要',
|
|
|
|
|
onOk: function () {
|
|
|
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6() {
|
|
|
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7() {
|
|
|
|
|
var res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
|
|
|
|
|
while (1) switch (_context6.prev = _context6.next) {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee7$(_context7) {
|
|
|
|
|
while (1) switch (_context7.prev = _context7.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
_context6.next = 2;
|
|
|
|
|
_context7.next = 2;
|
|
|
|
|
return (0,task/* activeWithTPI */.rB)({
|
|
|
|
|
identifier: params.identifier
|
|
|
|
|
});
|
|
|
|
|
case 2:
|
|
|
|
|
res = _context6.sent;
|
|
|
|
|
res = _context7.sent;
|
|
|
|
|
if (!(res.status === 0)) {
|
|
|
|
|
_context6.next = 7;
|
|
|
|
|
_context7.next = 7;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
_context6.next = 6;
|
|
|
|
|
_context7.next = 6;
|
|
|
|
|
return handleGetTPITimeInfo();
|
|
|
|
|
case 6:
|
|
|
|
|
message/* default */.ZP.success('延长成功!');
|
|
|
|
|
case 7:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context6.stop();
|
|
|
|
|
return _context7.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee6);
|
|
|
|
|
}, _callee7);
|
|
|
|
|
}));
|
|
|
|
|
function onOk() {
|
|
|
|
|
return _onOk.apply(this, arguments);
|
|
|
|
|
@ -3879,22 +4008,22 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
|
|
|
|
|
okText: '确定',
|
|
|
|
|
cancelText: '取消',
|
|
|
|
|
onOk: function () {
|
|
|
|
|
var _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7() {
|
|
|
|
|
var _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee8() {
|
|
|
|
|
var res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee7$(_context7) {
|
|
|
|
|
while (1) switch (_context7.prev = _context7.next) {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee8$(_context8) {
|
|
|
|
|
while (1) switch (_context8.prev = _context8.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
_context7.next = 2;
|
|
|
|
|
_context8.next = 2;
|
|
|
|
|
return (0,task/* syncCode */.fi)({
|
|
|
|
|
identifier: params.identifier
|
|
|
|
|
});
|
|
|
|
|
case 2:
|
|
|
|
|
res = _context7.sent;
|
|
|
|
|
res = _context8.sent;
|
|
|
|
|
if (!(res.status !== 0)) {
|
|
|
|
|
_context7.next = 5;
|
|
|
|
|
_context8.next = 5;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return _context7.abrupt("return");
|
|
|
|
|
return _context8.abrupt("return");
|
|
|
|
|
case 5:
|
|
|
|
|
message/* default */.ZP.success('操作成功');
|
|
|
|
|
setSpinning(false);
|
|
|
|
|
@ -3903,9 +4032,9 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
|
|
|
|
|
}, 300);
|
|
|
|
|
case 8:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context7.stop();
|
|
|
|
|
return _context8.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee7);
|
|
|
|
|
}, _callee8);
|
|
|
|
|
}));
|
|
|
|
|
function onOk() {
|
|
|
|
|
return _onOk2.apply(this, arguments);
|
|
|
|
|
@ -3997,9 +4126,9 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
/* harmony default export */ var Jupyter = ((0,_umi_production_exports.connect)(function (_ref7) {
|
|
|
|
|
var loading = _ref7.loading,
|
|
|
|
|
globalSetting = _ref7.globalSetting;
|
|
|
|
|
/* harmony default export */ var Jupyter = ((0,_umi_production_exports.connect)(function (_ref8) {
|
|
|
|
|
var loading = _ref8.loading,
|
|
|
|
|
globalSetting = _ref8.globalSetting;
|
|
|
|
|
return {
|
|
|
|
|
globalSetting: globalSetting,
|
|
|
|
|
loading: loading
|