Auto Submit

dev_local_v9_test3
autosubmit 1 year ago
parent 0ad0d5f108
commit ea346d7a15

@ -26,7 +26,7 @@
display: block !important;
}
</style><script>if(document.domain !== "www.educoder.net") document.title = '';</script>
<script src="/react/build/umi.66ac9c18.js"></script>
<script src="/react/build/umi.00e2aafa.js"></script>
<script src="/react/build/js/public.js"></script>
</body>
</html>

@ -551,9 +551,9 @@ var UploadFile = function UploadFile(_ref) {
/***/ }),
/***/ 37889:
/***/ 50405:
/*!*********************************************************!*\
!*** ./src/pages/Innovation/Edit/index.tsx + 9 modules ***!
!*** ./src/pages/Innovation/Edit/index.tsx + 7 modules ***!
\*********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
@ -565,12 +565,12 @@ __webpack_require__.d(__webpack_exports__, {
"default": function() { return /* binding */ Edit; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(7557);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(82242);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(7557);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(41498);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
@ -1201,292 +1201,8 @@ var DataSet = function DataSet(_ref) {
innovation: innovation
};
})(DataSet));
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
var tooltip = __webpack_require__(6848);
;// CONCATENATED MODULE: ./src/pages/Innovation/Edit/components/WarehouseModal/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var WarehouseModalmodules = ({"flex_box_center":"flex_box_center___ZASMX","flex_space_between":"flex_space_between___kUpH1","flex_box_vertical_center":"flex_box_vertical_center___gleEE","flex_box_center_end":"flex_box_center_end___y9Czq","flex_box_column":"flex_box_column___FcQaX","bottomNameWrap":"bottomNameWrap___pxg5d"});
// EXTERNAL MODULE: ./src/components/ui-customization/index.tsx + 32 modules
var ui_customization = __webpack_require__(62480);
// EXTERNAL MODULE: ./src/utils/util.tsx
var util = __webpack_require__(95972);
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.13@dayjs/dayjs.min.js
var dayjs_min = __webpack_require__(61186);
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
;// CONCATENATED MODULE: ./src/pages/Innovation/Edit/components/WarehouseModal/index.tsx
var WarehouseModal = function WarehouseModal(_ref) {
var value = _ref.value,
onChange = _ref.onChange;
var userInfo = (0,_umi_production_exports.useSelector)(function (state) {
var _state$user;
return state === null || state === void 0 || (_state$user = state.user) === null || _state$user === void 0 ? void 0 : _state$user.userInfo;
});
var _useState = (0,_react_17_0_2_react.useState)(true),
_useState2 = slicedToArray_default()(_useState, 2),
loading = _useState2[0],
setLoading = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)({}),
_useState4 = slicedToArray_default()(_useState3, 2),
selectedRow = _useState4[0],
setSelectedRow = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(0),
_useState6 = slicedToArray_default()(_useState5, 2),
total = _useState6[0],
setTotal = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)([]),
_useState8 = slicedToArray_default()(_useState7, 2),
list = _useState8[0],
setList = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)(false),
_useState10 = slicedToArray_default()(_useState9, 2),
visible = _useState10[0],
setVisible = _useState10[1];
var _useState11 = (0,_react_17_0_2_react.useState)({
page: 1,
per_page: 20,
category: ''
}),
_useState12 = slicedToArray_default()(_useState11, 2),
params = _useState12[0],
setParams = _useState12[1];
(0,_react_17_0_2_react.useEffect)(function () {
if (visible) {
if (value !== null && value !== void 0 && value.id) {
setSelectedRow(value);
} else {
setSelectedRow({});
}
getList(params);
}
}, [visible]);
var getList = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(record) {
var res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
setLoading(true);
_context.next = 3;
return (0,fetch/* default */.ZP)("/api/users/".concat(userInfo === null || userInfo === void 0 ? void 0 : userInfo.login, "/shixuns.json"), {
method: "get",
params: objectSpread2_default()({}, record)
});
case 3:
res = _context.sent;
if (res.shixuns) {
setList((res === null || res === void 0 ? void 0 : res.shixuns) || []);
setTotal(res === null || res === void 0 ? void 0 : res.count);
}
setLoading(false);
case 6:
case "end":
return _context.stop();
}
}, _callee);
}));
return function getList(_x) {
return _ref2.apply(this, arguments);
};
}();
var tabs = [{
id: '',
name: '全部'
}, {
id: 'manage',
name: "\u6211\u7BA1\u7406\u7684"
}, {
id: 'study',
name: "\u6211\u5B66\u4E60\u7684"
}, {
id: 'collect',
name: "\u6211\u6536\u85CF\u7684"
}];
var handleChangeCategory = function handleChangeCategory(category) {
params.category = category;
params.status = '';
params.page = 1;
setParams(objectSpread2_default()({}, params));
getList(params);
};
var handleSearch = function handleSearch(v) {
params.search = v;
params.page = 1;
setParams(objectSpread2_default()({}, params));
getList(params);
};
var handleChangePage = function handleChangePage(param) {
params.page = param === null || param === void 0 ? void 0 : param.current;
params.per_page = param === null || param === void 0 ? void 0 : param.pageSize;
setParams(objectSpread2_default()({}, params));
getList(params);
};
var columns = [{
title: '实践项目名称',
dataIndex: 'name',
width: 236,
render: function render(text, item) {
var _item$schools;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
className: WarehouseModalmodules.bottomNameWrap,
children: [!!((_item$schools = item.schools) !== null && _item$schools !== void 0 && _item$schools.length) && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u8BE5\u5B9E\u8DF5\u9879\u76EE\u9762\u5411\u6307\u5B9A\u5355\u4F4D\u5F00\u653E",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-zhidinggongkai1 mr5 c-orange translateY1 inline-block"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: text || '实践项目名称-未填写',
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: text || '实践项目名称-未填写'
})
})]
});
}
}, {
title: '管理员',
dataIndex: 'owner',
width: 100,
ellipsis: true,
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: text || '--',
placement: "bottomLeft",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: text || '--'
})
});
}
}, {
title: '合作者',
dataIndex: 'members',
width: 110,
ellipsis: true,
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: text.join("、"),
placement: "bottomLeft",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: text.join("、")
})
});
}
}, {
title: '最近修改',
dataIndex: 'updated_at',
width: 106,
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-grey-666",
children: dayjs_min_default()(text).format("YYYY-MM-DD")
});
}
}];
return /*#__PURE__*/(0,jsx_runtime.jsxs)(_react_17_0_2_react.Fragment, {
children: [value !== null && value !== void 0 && value.id ? /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
className: "c-black",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: (value === null || value === void 0 ? void 0 : value.name) || '实践项目名称-未填写'
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u5220\u9664",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
onClick: function onClick() {
return onChange(undefined);
},
className: "iconfont icon-shanchu15 c-red current font14 ml10"
})
})]
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
onClick: function onClick() {
return setVisible(true);
},
children: "\u5BFC\u5165\u5B9E\u8BADgit\u4ED3\u5E93"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
centered: true,
destroyOnClose: true,
onCancel: function onCancel() {
return setVisible(false);
},
open: visible,
title: '选择实训弹窗',
width: 1000,
onOk: function onOk() {
if (selectedRow !== null && selectedRow !== void 0 && selectedRow.id) {
onChange(selectedRow);
}
setVisible(false);
},
afterClose: function afterClose() {
setParams({
page: 1,
per_page: 20,
category: ''
});
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomTabs */.YG, {
value: params.category,
onChange: handleChangeCategory,
tabBarExtraContent: /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomInput */.t7, {
style: {
width: 303
},
placeholder: "\u8BF7\u8F93\u5165\u5B9E\u8BAD\u540D\u79F0\u8FDB\u884C\u641C\u7D22",
value: params.search,
onChange: handleSearch
}),
className: "mb25",
dataSource: tabs
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
dataSource: list,
bordered: false,
rowKey: "id",
columns: columns,
loading: loading,
scroll: {
y: 500
},
onChange: handleChangePage,
rowSelection: {
columnWidth: 60,
columnTitle: '选择',
type: 'radio',
onSelect: function onSelect(row) {
console.log(row, 22);
setSelectedRow(row);
},
selectedRowKeys: selectedRow !== null && selectedRow !== void 0 && selectedRow.id ? [selectedRow === null || selectedRow === void 0 ? void 0 : selectedRow.id] : []
},
pagination: {
pageSize: params.per_page,
total: total,
current: params.page,
showQuickJumper: true,
showSizeChanger: true,
hideOnSinglePage: !total,
className: 'mb0',
size: "default",
pageSizeOptions: ['10', '20', '50', '100', '200'],
showTotal: util/* showTotal */.rU
}
})]
})]
});
};
/* harmony default export */ var components_WarehouseModal = (WarehouseModal);
;// CONCATENATED MODULE: ./src/pages/Innovation/Edit/index.tsx
@ -1503,7 +1219,6 @@ var WarehouseModal = function WarehouseModal(_ref) {
var TextArea = input/* default */.Z.TextArea;
var layout = {
labelCol: {
@ -1585,7 +1300,7 @@ var CreatProject = function CreatProject() {
}, []);
var handleSave = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var formValues, _formValues$shixun_id, res, _res;
var formValues, res, _res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
@ -1600,9 +1315,7 @@ var CreatProject = function CreatProject() {
break;
}
_context.next = 8;
return (0,innovation/* createProject */.$L)(objectSpread2_default()(objectSpread2_default()({}, formValues), {}, {
shixun_id: (formValues === null || formValues === void 0 || (_formValues$shixun_id = formValues.shixun_id) === null || _formValues$shixun_id === void 0 ? void 0 : _formValues$shixun_id.id) || ''
}));
return (0,innovation/* createProject */.$L)(formValues);
case 8:
res = _context.sent;
if (res.status === 0) {
@ -1719,9 +1432,15 @@ var CreatProject = function CreatProject() {
initValue: initValue
})
}), !id && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "git_url",
label: "\u4EE3\u7801\u4ED3\u5E93",
name: "shixun_id",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(components_WarehouseModal, {})
rules: [{
pattern: /^(https?:\/\/)?((\d{1,3}\.){3}\d{1,3}|([\w-]+\.)+[\w-]+)(:\d+)?(\/[^\s]*)?$/i,
message: '请输入正确的地址'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
placeholder: "\u8BF7\u8F93\u5165\u5730\u5740"
})
})]
})), initValue && /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
justify: "end",

@ -49,45 +49,3 @@
color: red;
}
/*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/_css-loader@6.7.1@css-loader/dist/cjs.js??ruleSet[1].rules[5].oneOf[0].use[1]!./node_modules/_@umijs_bundler-webpack@4.4.4@@umijs/bundler-webpack/compiled/postcss-loader/index.js??ruleSet[1].rules[5].oneOf[0].use[2]!./node_modules/_@umijs_bundler-webpack@4.4.4@@umijs/bundler-webpack/compiled/less-loader/index.js??ruleSet[1].rules[5].oneOf[0].use[3]!./src/pages/Innovation/Edit/components/WarehouseModal/index.less?modules ***!
\******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
.flex_box_center___ZASMX {
justify-content: center;
align-items: center;
-webkit-justify-content: center;
box-align: center;
}
.flex_space_between___kUpH1 {
justify-content: space-between;
-webkit-box-pack: justify;
}
.flex_box_vertical_center___gleEE {
align-items: center;
box-align: center;
}
.flex_box_center_end___y9Czq {
justify-content: flex-end;
align-items: center;
-webkit-justify-content: flex-end;
-webkit-align-items: center;
-webkit-box-align: center;
-webkit-box-pack: end;
box-align: center;
box-pack: end;
}
.flex_box_column___FcQaX {
flex-direction: column;
box-orient: block-axis;
}
.bottomNameWrap___pxg5d {
cursor: pointer;
display: flex;
align-items: center;
overflow: hidden;
margin: 0;
}
.bottomNameWrap___pxg5d span:hover {
color: #165dff;
}

@ -1917,69 +1917,45 @@ function TipContent() {
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);
};
}();
// //退出保存代码
// useEffect(() => {
// window.addEventListener('beforeunload', onSaveContent);
// return () => {
// window.removeEventListener('beforeunload', onSaveContent);
// };
// }, []);
// //窗口关闭保存代码
// const onSaveContent = async () => {
// try {
// window.navigator.sendBeacon(`${ENV.API_SERVER}/api/sci/projects/${params.taskId}/commit_files.json`);
// } catch (e) {
// }
// };
function toShixun() {
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) {
_toShixun = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.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:
// if (taskData.mirror_type === 'jupyterlab' || taskData.mirror_type === 'jupyternotebook') {
// mediator.publish('exit-jupyter-send');
// await new Promise(resolve => setTimeout(resolve, 1000));
// } else {
// await saveGitFile({ id: params.taskId })
// }
(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 2:
case "end":
return _context5.stop();
return _context4.stop();
}
}, _callee5);
}, _callee4);
}));
return _toShixun.apply(this, arguments);
}
@ -2136,9 +2112,9 @@ function TipContent() {
type: "primary",
disabled: !showSave,
className: "save-innovation",
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
setisshowmodal(true);
// const res = await saveEnv(params.taskId);
@ -2147,9 +2123,9 @@ function TipContent() {
// }
case 1:
case "end":
return _context2.stop();
return _context.stop();
}
}, _callee2);
}, _callee);
})),
children: "\u4FDD\u5B58\u955C\u50CF"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
@ -2211,16 +2187,29 @@ function TipContent() {
},
form: form,
onFinish: ( /*#__PURE__*/function () {
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(value) {
var res;
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(value) {
var re, res;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
setisloading(true);
_context4.next = 3;
return saveEnv(params.taskId, value);
_context3.next = 3;
return saveGitFile({
id: params.taskId
});
case 3:
res = _context4.sent;
re = _context3.sent;
if (!((re === null || re === void 0 ? void 0 : re.status) !== 0)) {
_context3.next = 7;
break;
}
setisloading(false);
return _context3.abrupt("return");
case 7:
_context3.next = 9;
return saveEnv(params.taskId, value);
case 9:
res = _context3.sent;
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
message/* default */.ZP.info('保存成功');
setisshowmodal(false);
@ -2232,26 +2221,26 @@ function TipContent() {
okText: '确认',
cancelText: '取消',
onOk: function () {
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
var res;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
_context3.next = 2;
_context2.next = 2;
return saveEnv(params.taskId, objectSpread2_default()({
is_cover: true
}, value));
case 2:
res = _context3.sent;
res = _context2.sent;
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
message/* default */.ZP.info('覆盖成功');
setisshowmodal(false);
}
case 4:
case "end":
return _context3.stop();
return _context2.stop();
}
}, _callee3);
}, _callee2);
}));
function onOk() {
return _onOk.apply(this, arguments);
@ -2261,14 +2250,14 @@ function TipContent() {
});
}
setisloading(false);
case 7:
case 13:
case "end":
return _context4.stop();
return _context3.stop();
}
}, _callee4);
}, _callee3);
}));
return function (_x) {
return _ref4.apply(this, arguments);
return _ref3.apply(this, arguments);
};
}()),
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
@ -2312,13 +2301,13 @@ function TipContent() {
});
});
var FiveMinute = 300;
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;
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;
var _useState19 = (0,_react_17_0_2_react.useState)(defaultTime),
_useState20 = slicedToArray_default()(_useState19, 2),
time = _useState20[0],
@ -2352,31 +2341,31 @@ function VncTimer(_ref5) {
return _onAddTime.apply(this, arguments);
}
function _onAddTime() {
_onAddTime = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6() {
_onAddTime = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
var res;
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
while (1) switch (_context6.prev = _context6.next) {
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
while (1) switch (_context5.prev = _context5.next) {
case 0:
setIsPlusTime(false);
if (!(time > 0)) {
_context6.next = 8;
_context5.next = 8;
break;
}
_context6.next = 4;
_context5.next = 4;
return onAddVncTime();
case 4:
res = _context6.sent;
res = _context5.sent;
setTime((res === null || res === void 0 ? void 0 : res.remaining_time) / 1000);
_context6.next = 10;
_context5.next = 10;
break;
case 8:
setTime(defaultTime);
onReset();
case 10:
case "end":
return _context6.stop();
return _context5.stop();
}
}, _callee6);
}, _callee5);
}));
return _onAddTime.apply(this, arguments);
}
@ -3561,7 +3550,6 @@ var Jupyter_excluded = ["globalSetting", "loading", "taskData", "dispatch"];
var Jupyter_Countdown = statistic/* default */.Z.Countdown;
@ -3676,35 +3664,24 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
}, []);
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'
});
}
if ((e === null || e === void 0 ? void 0 : e.data) === 'jupytermessage') {
// clickEvaluating.current = false
// const res = await saveGitFile({ id: params?.taskId })
// if (res?.status === 0 && !exitJupyter.current) {
// message.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:
// jupyterMessageFlag.current = false;
// handleSaveWithTPI();
// if (!clickEvaluating.current) {
// setTimeout(() => (jupyterMessageFlag.current = true), 500);
// }
// // setTimeout(() => jupyterMessageFlag.current = true, 500)
}
case 1:
case "end":
return _context.stop();
}
@ -5595,7 +5572,7 @@ function Tasks_reducer(state, action) {
}
function _onResetVnc() {
_onResetVnc = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee19() {
var response, new_vnc_url;
var response, cloneTaskData, new_vnc_url;
return regeneratorRuntime_default()().wrap(function _callee19$(_context19) {
while (1) switch (_context19.prev = _context19.next) {
case 0:
@ -5605,17 +5582,27 @@ function Tasks_reducer(state, action) {
payload: true
});
mediator/* default */.Z.publish('vnc-reseting');
_context19.next = 5;
cloneTaskData = objectSpread2_default()({}, taskData);
_context19.next = 6;
return resetVnc(_params.taskId);
case 5:
case 6:
response = _context19.sent;
new_vnc_url = response.vnc_url;
taskData['vnc_url'] = new_vnc_url + '&timestamp=' + new Date().getTime();
mediator/* default */.Z.publish('vnc-reseting-done', response);
if (response.mirror_type === 'graph') {
new_vnc_url = response.vnc_url;
cloneTaskData['vnc_url'] = new_vnc_url + '&timestamp=' + new Date().getTime();
mediator/* default */.Z.publish('vnc-reseting-done', response);
}
if (response.mirror_type === 'webssh') {
cloneTaskData = objectSpread2_default()({}, response);
mediator/* default */.Z.publish('close-socket', 1);
setTimeout(function () {
mediator/* default */.Z.publish('create-socket', 1);
}, 1000);
}
dispatch({
type: UPDATE_TASK_DATA,
payload: {
taskData: taskData,
taskData: cloneTaskData,
resetVncLoading: false
}
});

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save