|
|
|
|
@ -1863,6 +1863,7 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
|
|
|
|
|
showTool = _useState32[0],
|
|
|
|
|
setShowTool = _useState32[1];
|
|
|
|
|
var exerciseDataRef = (0,_react_17_0_2_react.useRef)();
|
|
|
|
|
var checkGameBuildRef = (0,_react_17_0_2_react.useRef)(false);
|
|
|
|
|
var _useState33 = (0,_react_17_0_2_react.useState)(false),
|
|
|
|
|
_useState34 = slicedToArray_default()(_useState33, 2),
|
|
|
|
|
showModal = _useState34[0],
|
|
|
|
|
@ -2000,6 +2001,7 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
checkGameBuildRef.current = false;
|
|
|
|
|
_context3.t0 = task/* saveWithTPI */.zE;
|
|
|
|
|
_context3.t1 = params.identifier;
|
|
|
|
|
_context3.t2 = port.current;
|
|
|
|
|
@ -2008,18 +2010,18 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
|
|
|
|
|
_context3.t5 = searchParams.get("exercisesId");
|
|
|
|
|
_context3.t6 = searchParams.get("exercisesId");
|
|
|
|
|
if (!_context3.t6) {
|
|
|
|
|
_context3.next = 11;
|
|
|
|
|
_context3.next = 12;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
_context3.next = 10;
|
|
|
|
|
_context3.next = 11;
|
|
|
|
|
return (0,ip/* findLocalIp */.y)({
|
|
|
|
|
ip_limit: (_exerciseDataRef$curr = exerciseDataRef.current) === null || _exerciseDataRef$curr === void 0 || (_exerciseDataRef$curr = _exerciseDataRef$curr.exercise) === null || _exerciseDataRef$curr === void 0 ? void 0 : _exerciseDataRef$curr.ip_limit,
|
|
|
|
|
ip_bind: (_exerciseDataRef$curr2 = exerciseDataRef.current) === null || _exerciseDataRef$curr2 === void 0 || (_exerciseDataRef$curr2 = _exerciseDataRef$curr2.exercise) === null || _exerciseDataRef$curr2 === void 0 ? void 0 : _exerciseDataRef$curr2.ip_bind,
|
|
|
|
|
ip_bind_type: (_exerciseDataRef$curr3 = exerciseDataRef.current) === null || _exerciseDataRef$curr3 === void 0 || (_exerciseDataRef$curr3 = _exerciseDataRef$curr3.exercise) === null || _exerciseDataRef$curr3 === void 0 ? void 0 : _exerciseDataRef$curr3.ip_bind_type
|
|
|
|
|
});
|
|
|
|
|
case 10:
|
|
|
|
|
_context3.t6 = _context3.sent;
|
|
|
|
|
case 11:
|
|
|
|
|
_context3.t6 = _context3.sent;
|
|
|
|
|
case 12:
|
|
|
|
|
_context3.t7 = _context3.t6;
|
|
|
|
|
_context3.t8 = {
|
|
|
|
|
identifier: _context3.t1,
|
|
|
|
|
@ -2029,12 +2031,12 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
|
|
|
|
|
exercise_id: _context3.t5,
|
|
|
|
|
ip: _context3.t7
|
|
|
|
|
};
|
|
|
|
|
_context3.next = 15;
|
|
|
|
|
_context3.next = 16;
|
|
|
|
|
return (0, _context3.t0)(_context3.t8);
|
|
|
|
|
case 15:
|
|
|
|
|
case 16:
|
|
|
|
|
res = _context3.sent;
|
|
|
|
|
if (!(res.status === 0)) {
|
|
|
|
|
_context3.next = 20;
|
|
|
|
|
_context3.next = 21;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (clickEvaluating.current) {
|
|
|
|
|
@ -2046,11 +2048,11 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
|
|
|
|
|
key: "save-jupyter"
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
_context3.next = 23;
|
|
|
|
|
_context3.next = 24;
|
|
|
|
|
break;
|
|
|
|
|
case 20:
|
|
|
|
|
case 21:
|
|
|
|
|
if (!(res.status === -5 && typeof_default()(res === null || res === void 0 ? void 0 : res.message) === "object")) {
|
|
|
|
|
_context3.next = 23;
|
|
|
|
|
_context3.next = 24;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
(0,_umi_production_exports.getDvaApp)()._store.dispatch({
|
|
|
|
|
@ -2065,7 +2067,7 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return _context3.abrupt("return");
|
|
|
|
|
case 23:
|
|
|
|
|
case 24:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context3.stop();
|
|
|
|
|
}
|
|
|
|
|
@ -2491,6 +2493,7 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
var evaluating = function evaluating() {
|
|
|
|
|
checkGameBuildRef.current = true;
|
|
|
|
|
var iframe = document.getElementById('taskJupyterIframe');
|
|
|
|
|
if (!iframe) {
|
|
|
|
|
return;
|
|
|
|
|
@ -2499,9 +2502,12 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
|
|
|
|
|
clickEvaluating.current = true;
|
|
|
|
|
setBtnLoading(true);
|
|
|
|
|
setCaseVisible(true);
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// handleSaveWithTPI()
|
|
|
|
|
// },500)
|
|
|
|
|
// 检测是否执行了评测,因有些镜像没有更新
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
if (checkGameBuildRef.current) {
|
|
|
|
|
handleSaveWithTPI();
|
|
|
|
|
}
|
|
|
|
|
}, 5000);
|
|
|
|
|
};
|
|
|
|
|
var tipReset = function tipReset(obj) {
|
|
|
|
|
modal/* default */.Z.confirm({
|
|
|
|
|
|