Auto Submit

dev_local_v9_test1
autosubmit 1 year ago
parent 6aaae5ecce
commit 206a0eb271

@ -3283,8 +3283,8 @@ function getOperationResult(id, mode) {
function addNotes(id, params) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("myproblems/".concat(id, "/add_notes.json"), params);
}
function resetCode(id) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("myproblems/".concat(id, "/restore_initial_code.json"));
function resetCode(id, params) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("myproblems/".concat(id, "/restore_initial_code.json"), params);
}
function syncCode(id) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("myproblems/".concat(id, "/sync_code.json"));

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

@ -7023,8 +7023,8 @@ function getOperationResult(id, mode) {
function addNotes(id, params) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("myproblems/".concat(id, "/add_notes.json"), params);
}
function resetCode(id) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("myproblems/".concat(id, "/restore_initial_code.json"));
function resetCode(id, params) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("myproblems/".concat(id, "/restore_initial_code.json"), params);
}
function syncCode(id) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("myproblems/".concat(id, "/sync_code.json"));

@ -3941,8 +3941,8 @@ function getOperationResult(id, mode) {
function addNotes(id, params) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("myproblems/".concat(id, "/add_notes.json"), params);
}
function resetCode(id) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("myproblems/".concat(id, "/restore_initial_code.json"));
function resetCode(id, params) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("myproblems/".concat(id, "/restore_initial_code.json"), params);
}
function syncCode(id) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("myproblems/".concat(id, "/sync_code.json"));

@ -1181,8 +1181,8 @@ function getOperationResult(id, mode) {
function addNotes(id, params) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("myproblems/".concat(id, "/add_notes.json"), params);
}
function resetCode(id) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("myproblems/".concat(id, "/restore_initial_code.json"));
function resetCode(id, params) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("myproblems/".concat(id, "/restore_initial_code.json"), params);
}
function syncCode(id) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("myproblems/".concat(id, "/sync_code.json"));

@ -3510,31 +3510,38 @@ function MyProblem_reducer(state, action) {
}
function _onResetCode() {
_onResetCode = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee14() {
var response;
var datas, response;
return regeneratorRuntime_default()().wrap(function _callee14$(_context14) {
while (1) switch (_context14.prev = _context14.next) {
case 0:
_context14.prev = 0;
_context14.next = 3;
return (0,service/* resetCode */.H7)(id);
case 3:
datas = {};
if (searchParams.get("type") === 'exercises') {
datas.exercise_id = searchParams.get("exercisesId");
//试卷id
} else if (hack !== null && hack !== void 0 && hack.homework_common_id) {
datas.homework_common_id = hack === null || hack === void 0 ? void 0 : hack.homework_common_id;
}
_context14.next = 5;
return (0,service/* resetCode */.H7)(id, objectSpread2_default()({}, datas));
case 5:
response = _context14.sent;
if (response.status === 401) {
// history.replace('/login', { from: location.pathname })
} else {
onChangeCode(base64.Base64.decode(response.code));
}
_context14.next = 10;
_context14.next = 12;
break;
case 7:
_context14.prev = 7;
case 9:
_context14.prev = 9;
_context14.t0 = _context14["catch"](0);
console.log(_context14.t0);
case 10:
case 12:
case "end":
return _context14.stop();
}
}, _callee14, null, [[0, 7]]);
}, _callee14, null, [[0, 9]]);
}));
return _onResetCode.apply(this, arguments);
}
@ -4185,8 +4192,8 @@ function getOperationResult(id, mode) {
function addNotes(id, params) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("myproblems/".concat(id, "/add_notes.json"), params);
}
function resetCode(id) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("myproblems/".concat(id, "/restore_initial_code.json"));
function resetCode(id, params) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("myproblems/".concat(id, "/restore_initial_code.json"), params);
}
function syncCode(id) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("myproblems/".concat(id, "/sync_code.json"));

@ -883,6 +883,9 @@ function reducer(state, action) {
setPercent = _useState4[1];
var timeout = (0,_react_17_0_2_react.useRef)();
var params = (0,_umi_production_exports.useParams)();
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
searchParams = _useSearchParams2[0];
(0,_react_17_0_2_react.useEffect)(function () {
return function () {
var _guacaRef$current, _guacaRef$current$dis;
@ -959,7 +962,7 @@ function reducer(state, action) {
var getWindowVnc = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
var _taskData$myshixun, _res$data;
var res, _res$data2, _res$data3, _res$data4;
var datas, res, _res$data2, _res$data3, _res$data4;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
@ -970,16 +973,23 @@ function reducer(state, action) {
}, 1000);
});
case 2:
_context3.next = 4;
datas = {};
if (searchParams.get("type") === 'exercises') {
datas.exercise_id = searchParams.get("exercisesId");
//试卷id
} else if (params.courseId && params.homeworkId) {
datas.homework_common_id = params.homeworkId;
}
_context3.next = 6;
return (0,service/* startInit */.sA)((_taskData$myshixun = taskData.myshixun) === null || _taskData$myshixun === void 0 ? void 0 : _taskData$myshixun.identifier, objectSpread2_default()(objectSpread2_default()({}, params), {}, {
taskId: params.taskId,
shixun_environment_id: shixun_environment_id,
tab_type: tab_type
}));
case 4:
}, datas));
case 6:
res = _context3.sent;
if (!(res !== null && res !== void 0 && (_res$data = res.data) !== null && _res$data !== void 0 && (_res$data = _res$data.data_list) !== null && _res$data !== void 0 && _res$data.length)) {
_context3.next = 8;
_context3.next = 10;
break;
}
mediator/* default */.Z.publish('pod-restrict-data', {
@ -987,9 +997,9 @@ function reducer(state, action) {
data_list: res === null || res === void 0 || (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.data_list
});
return _context3.abrupt("return", Promise.reject());
case 8:
case 10:
if (!((res === null || res === void 0 ? void 0 : res.status) === -3)) {
_context3.next = 10;
_context3.next = 12;
break;
}
return _context3.abrupt("return", new Promise( /*#__PURE__*/function () {
@ -1035,15 +1045,15 @@ function reducer(state, action) {
return _ref3.apply(this, arguments);
};
}()));
case 10:
case 12:
if (!((res === null || res === void 0 ? void 0 : res.status) === -1)) {
_context3.next = 12;
_context3.next = 14;
break;
}
throw new String(res === null || res === void 0 ? void 0 : res.message);
case 12:
case 14:
if (!((res === null || res === void 0 ? void 0 : res.status) === 0)) {
_context3.next = 17;
_context3.next = 19;
break;
}
if (virtual_machine) {
@ -1056,7 +1066,7 @@ function reducer(state, action) {
index_tab: index_tab
}));
return _context3.abrupt("return", res);
case 17:
case 19:
case "end":
return _context3.stop();
}
@ -1149,7 +1159,7 @@ function reducer(state, action) {
doResize();
}
new Promise( /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
var params, res, _res$data5, _res$data6, character, _res$data7, _res$data8, urlParser, protocol, searchParams, host, search, searchUrl;
var params, res, _res$data5, _res$data6, character, _res$data7, _res$data8, urlParser, protocol, _searchParams, host, search, searchUrl;
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
@ -1175,9 +1185,9 @@ function reducer(state, action) {
socketUrlRef.current = decodeURIComponent(res === null || res === void 0 || (_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : _res$data7.link_url);
} else {
urlParser = new URL(decodeURIComponent(res === null || res === void 0 || (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8.link_url)); //no IE11 support
protocol = urlParser.protocol, searchParams = urlParser.searchParams, host = urlParser.host, search = urlParser.search;
protocol = urlParser.protocol, _searchParams = urlParser.searchParams, host = urlParser.host, search = urlParser.search;
searchUrl = (0,util/* parseUrl */.en)(search);
passwordRef.current = searchParams.get('password');
passwordRef.current = _searchParams.get('password');
socketUrlRef.current = "".concat(protocol === 'https:' ? 'wss' : 'ws', "://").concat(host, "/").concat(searchUrl.path || 'websockify');
}
case 12:

@ -280,6 +280,10 @@ var AddOrEditReservation = function AddOrEditReservation(_ref) {
_useState6 = slicedToArray_default()(_useState5, 2),
loading = _useState6[0],
setLoading = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)(''),
_useState8 = slicedToArray_default()(_useState7, 2),
tooltipTxt = _useState8[0],
setTooltipTxt = _useState8[1];
(0,_react_17_0_2_react.useEffect)(function () {
if (open) {
initData();
@ -291,23 +295,24 @@ var AddOrEditReservation = function AddOrEditReservation(_ref) {
while (1) switch (_context.prev = _context.next) {
case 0:
myForm.resetFields();
setTooltipTxt('');
myForm.setFieldsValue({
class_type: '校选'
});
_context.next = 4;
_context.next = 5;
return getCourseList();
case 4:
case 5:
if (!rowData) {
_context.next = 8;
_context.next = 9;
break;
}
_context.next = 7;
_context.next = 8;
return getContainerList(rowData === null || rowData === void 0 ? void 0 : rowData.course_id);
case 7:
case 8:
myForm.setFieldsValue(objectSpread2_default()(objectSpread2_default()({}, rowData), {}, {
schedule_date: dayjs_min_default()(rowData === null || rowData === void 0 ? void 0 : rowData.schedule_date)
}));
case 8:
case 9:
case "end":
return _context.stop();
}
@ -369,6 +374,8 @@ var AddOrEditReservation = function AddOrEditReservation(_ref) {
setContainerList(res === null || res === void 0 ? void 0 : res.homeworks);
});
};
// 新增预约
var add = function add(params) {
setLoading(true);
(0,fetch/* default */.ZP)("/api/appointment_classes.json", {
@ -383,6 +390,8 @@ var AddOrEditReservation = function AddOrEditReservation(_ref) {
});
setLoading(false);
};
// 修改预约
var edit = function edit(params) {
setLoading(true);
(0,fetch/* default */.ZP)("/api/appointment_classes/".concat(rowData === null || rowData === void 0 ? void 0 : rowData.id, ".json"), {
@ -397,6 +406,18 @@ var AddOrEditReservation = function AddOrEditReservation(_ref) {
});
setLoading(false);
};
// 提示文本
var tooltipCon = function tooltipCon(e) {
(0,fetch/* default */.ZP)("/api/homework_commons/".concat(e, "/shixun_service_configs.json"), {
method: 'get'
}).then(function (res) {
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
var _res$data, _res$data2, _res$data3;
setTooltipTxt("CPU ".concat(res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.cpu_limit, " \u6838, \u5185\u5B58 ").concat(res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.memory_limit, " M, \u78C1\u76D8 ").concat(res === null || res === void 0 || (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.resource_limit, " K"));
}
});
};
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
confirmLoading: loading,
maskClosable: false,
@ -509,6 +530,9 @@ var AddOrEditReservation = function AddOrEditReservation(_ref) {
width: '361px'
},
placeholder: "\u6559\u5B66\u8BFE\u5802\u91CC\u7684\u8BFE\u5802\u5B9E\u9A8C",
onChange: function onChange(e, option) {
tooltipCon(e);
},
children: containerList === null || containerList === void 0 ? void 0 : containerList.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
value: item === null || item === void 0 ? void 0 : item.homework_id,
@ -517,6 +541,13 @@ var AddOrEditReservation = function AddOrEditReservation(_ref) {
})
})
})]
}), (tooltipTxt === null || tooltipTxt === void 0 ? void 0 : tooltipTxt.length) > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
color: '#666',
height: 30,
paddingLeft: 80
},
children: tooltipTxt
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
colon: false,
label: "\u5F00\u8BFE\u4EBA\u6570",

@ -1536,20 +1536,27 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
var handleGetJupyterTPIUrl = /*#__PURE__*/function () {
var _ref9 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee8() {
var _res$data;
var res, _res$data2, _res$data3, _parseUrl, _res$data4, _res$data5, _res$data6, _res$data10, _res$data11, _res$data12, _res$data7, _res$data8, _res$data9;
var datas, res, _res$data2, _res$data3, _parseUrl, _res$data4, _res$data5, _res$data6, _res$data10, _res$data11, _res$data12, _res$data7, _res$data8, _res$data9;
return regeneratorRuntime_default()().wrap(function _callee8$(_context8) {
while (1) switch (_context8.prev = _context8.next) {
case 0:
_context8.next = 2;
return (0,task/* getInfoWithTPI */.rV)({
datas = {};
if (searchParams.get("type") === 'exercises') {
datas.exercise_id = searchParams.get("exercisesId");
//试卷id
} else if (searchParams.get("homework_common_id")) {
datas.homework_common_id = searchParams.get("homework_common_id");
}
_context8.next = 4;
return (0,task/* getInfoWithTPI */.rV)(objectSpread2_default()({
identifier: params.identifier,
homework_common_id: searchParams.get("homework_common_id") || ''
});
case 2:
}, datas));
case 4:
res = _context8.sent;
setSpinning(false);
if (!(res !== null && res !== void 0 && (_res$data = res.data) !== null && _res$data !== void 0 && (_res$data = _res$data.data_list) !== null && _res$data !== void 0 && _res$data.length)) {
_context8.next = 7;
_context8.next = 9;
break;
}
mediator/* default */.Z.publish('pod-restrict-data', {
@ -1557,9 +1564,9 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
data_list: res === null || res === void 0 || (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.data_list
});
return _context8.abrupt("return");
case 7:
case 9:
if (!(res !== null && res !== void 0 && res.data)) {
_context8.next = 21;
_context8.next = 23;
break;
}
setUrl(res.data);
@ -1567,13 +1574,13 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
token.current = (_parseUrl = (0,util/* parseUrl */.en)(res === null || res === void 0 || (_res$data4 = res.data) === null || _res$data4 === void 0 || (_res$data4 = _res$data4[0]) === null || _res$data4 === void 0 ? void 0 : _res$data4["link_url"])) === null || _parseUrl === void 0 ? void 0 : _parseUrl.token;
port.current = res === null || res === void 0 || (_res$data5 = res.data) === null || _res$data5 === void 0 || (_res$data5 = _res$data5[0]) === null || _res$data5 === void 0 ? void 0 : _res$data5["port"];
if (!(((_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : _res$data6.length) > 1)) {
_context8.next = 16;
_context8.next = 18;
break;
}
setTime(Date.now() + (res === null || res === void 0 || (_res$data7 = res.data) === null || _res$data7 === void 0 || (_res$data7 = _res$data7[0]) === null || _res$data7 === void 0 ? void 0 : _res$data7.remaining_time));
setEndTime((res === null || res === void 0 || (_res$data8 = res.data) === null || _res$data8 === void 0 || (_res$data8 = _res$data8[0]) === null || _res$data8 === void 0 ? void 0 : _res$data8.remaining_time) - 300 * 1000 <= 0 ? Date.now() + 1000 : Date.now() + ((res === null || res === void 0 || (_res$data9 = res.data) === null || _res$data9 === void 0 || (_res$data9 = _res$data9[0]) === null || _res$data9 === void 0 ? void 0 : _res$data9.remaining_time) - 300 * 1000));
return _context8.abrupt("return");
case 16:
case 18:
setUrlSign(false);
setStatus(Status.Success);
setTime(Date.now() + (res === null || res === void 0 || (_res$data10 = res.data) === null || _res$data10 === void 0 || (_res$data10 = _res$data10[0]) === null || _res$data10 === void 0 ? void 0 : _res$data10.remaining_time));
@ -1581,14 +1588,14 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
setEndTime((res === null || res === void 0 || (_res$data11 = res.data) === null || _res$data11 === void 0 || (_res$data11 = _res$data11[0]) === null || _res$data11 === void 0 ? void 0 : _res$data11.remaining_time) - 300 * 1000 <= 0 ? Date.now() + 1000 : Date.now() + ((res === null || res === void 0 || (_res$data12 = res.data) === null || _res$data12 === void 0 || (_res$data12 = _res$data12[0]) === null || _res$data12 === void 0 ? void 0 : _res$data12.remaining_time) - 300 * 1000));
return _context8.abrupt("return");
case 21:
case 23:
if (res.status === -1) {
setStatus(Status.LoadFail);
setUrlSign(false);
} else {
setStatus(Status.ReLoad);
}
case 22:
case 24:
case "end":
return _context8.stop();
}
@ -1803,28 +1810,35 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
cancelText: '取消',
onOk: function () {
var _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee12() {
var res;
var datas, res;
return regeneratorRuntime_default()().wrap(function _callee12$(_context12) {
while (1) switch (_context12.prev = _context12.next) {
case 0:
_context12.next = 2;
return (0,task/* syncCode */.fi)({
datas = {};
if (searchParams.get("type") === 'exercises') {
datas.exercise_id = searchParams.get("exercisesId");
//试卷id
} else if (searchParams.get("homework_common_id")) {
datas.homework_common_id = searchParams.get("homework_common_id");
}
_context12.next = 4;
return (0,task/* syncCode */.fi)(objectSpread2_default()({
identifier: params.identifier
});
case 2:
}, datas));
case 4:
res = _context12.sent;
if (!(res.status !== 0)) {
_context12.next = 5;
_context12.next = 7;
break;
}
return _context12.abrupt("return");
case 5:
case 7:
message/* default */.ZP.success('操作成功');
setSpinning(false);
setTimeout(function () {
return window.location.reload();
}, 300);
case 8:
case 10:
case "end":
return _context12.stop();
}
@ -1968,16 +1982,23 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
function _onResetGitCode() {
_onResetGitCode = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee15() {
var _window$location;
var response;
var datas, response;
return regeneratorRuntime_default()().wrap(function _callee15$(_context15) {
while (1) switch (_context15.prev = _context15.next) {
case 0:
_context15.next = 2;
return (0,service/* resetGitCode */.Tf)(jupyterData === null || jupyterData === void 0 ? void 0 : jupyterData.myshixun_identifier, {});
case 2:
datas = {};
if (searchParams.get("type") === 'exercises') {
datas.exercise_id = searchParams.get("exercisesId");
//试卷id
} else if (searchParams.get("homework_common_id")) {
datas.homework_common_id = searchParams.get("homework_common_id");
}
_context15.next = 4;
return (0,service/* resetGitCode */.Tf)(jupyterData === null || jupyterData === void 0 ? void 0 : jupyterData.myshixun_identifier, objectSpread2_default()({}, datas));
case 4:
response = _context15.sent;
if (!((response === null || response === void 0 ? void 0 : response.status) === -5)) {
_context15.next = 6;
_context15.next = 8;
break;
}
modal/* default */.Z.info({
@ -1994,10 +2015,10 @@ var TaskJupyterPage = function TaskJupyterPage(_ref) {
})
});
return _context15.abrupt("return");
case 6:
case 8:
(_window$location = window.location) === null || _window$location === void 0 || _window$location.reload();
return _context15.abrupt("return", response);
case 8:
case 10:
case "end":
return _context15.stop();
}

@ -11756,19 +11756,26 @@ var spin = __webpack_require__(71418);
var getWindowVnc = /*#__PURE__*/function () {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
var _taskData$myshixun2, _res$data;
var res, _res$data2, _res$data3;
var datas, res, _res$data2, _res$data3;
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
_context4.next = 2;
return (0,service/* startInit */.sA)((_taskData$myshixun2 = taskData.myshixun) === null || _taskData$myshixun2 === void 0 ? void 0 : _taskData$myshixun2.identifier, {
datas = {};
if (searchParams.get("type") === 'exercises') {
datas.exercise_id = searchParams.get("exercisesId");
//试卷id
} else if (params.courseId && params.homeworkId) {
datas.homework_common_id = searchParams.get("homework_common_id") || params.homeworkId;
}
_context4.next = 4;
return (0,service/* startInit */.sA)((_taskData$myshixun2 = taskData.myshixun) === null || _taskData$myshixun2 === void 0 ? void 0 : _taskData$myshixun2.identifier, objectSpread2_default()({
shixun_environment_id: shixun_environment_id,
tab_type: tab_type
});
case 2:
}, datas));
case 4:
res = _context4.sent;
if (!(res !== null && res !== void 0 && (_res$data = res.data) !== null && _res$data !== void 0 && (_res$data = _res$data.data_list) !== null && _res$data !== void 0 && _res$data.length)) {
_context4.next = 6;
_context4.next = 8;
break;
}
mediator/* default */.Z.publish('pod-restrict-data', {
@ -11776,9 +11783,9 @@ var spin = __webpack_require__(71418);
data_list: res === null || res === void 0 || (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.data_list
});
return _context4.abrupt("return");
case 6:
case 8:
if (!((res === null || res === void 0 ? void 0 : res.status) === -3)) {
_context4.next = 8;
_context4.next = 10;
break;
}
return _context4.abrupt("return", new Promise( /*#__PURE__*/function () {
@ -11824,15 +11831,15 @@ var spin = __webpack_require__(71418);
return _ref4.apply(this, arguments);
};
}()));
case 8:
case 10:
if (!((res === null || res === void 0 ? void 0 : res.status) === -1)) {
_context4.next = 10;
_context4.next = 12;
break;
}
throw new String(res === null || res === void 0 ? void 0 : res.message);
case 10:
case 12:
if (!((res === null || res === void 0 ? void 0 : res.status) === 0)) {
_context4.next = 15;
_context4.next = 17;
break;
}
setData(res === null || res === void 0 ? void 0 : res.data);
@ -11841,7 +11848,7 @@ var spin = __webpack_require__(71418);
}));
mediator/* default */.Z.publish('update-windows-time', res === null || res === void 0 ? void 0 : res.data);
return _context4.abrupt("return", res);
case 15:
case 17:
case "end":
return _context4.stop();
}
@ -16357,20 +16364,30 @@ function tasks_reducer(state, action) {
} //重置代码仓库
function _onResetCode() {
_onResetCode = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7() {
var response, content, language;
var _taskData$challenge;
var datas, response, content, language;
return regeneratorRuntime_default()().wrap(function _callee7$(_context7) {
while (1) switch (_context7.prev = _context7.next) {
case 0:
datas = {
challenge_id: (_taskData$challenge = taskData.challenge) === null || _taskData$challenge === void 0 ? void 0 : _taskData$challenge.id
};
if (searchParams.get("type") === 'exercises') {
datas.exercise_id = searchParams.get("exercisesId");
//试卷id
} else if (_params.courseId && _params.homeworkId) {
datas.homework_common_id = _params.homeworkId;
}
setCodeLoading(true);
_context7.next = 3;
return (0,service/* restoreCode */.qK)(taskId, {
_context7.next = 5;
return (0,service/* restoreCode */.qK)(taskId, objectSpread2_default()({
path: currentPath
});
case 3:
}, datas));
case 5:
response = _context7.sent;
content = response.content, language = response.language;
if (!((response === null || response === void 0 ? void 0 : response.status) === -5)) {
_context7.next = 9;
_context7.next = 11;
break;
}
es_modal/* default */.Z.info({
@ -16388,7 +16405,7 @@ function tasks_reducer(state, action) {
});
setCodeLoading(false);
return _context7.abrupt("return", Promise.reject());
case 9:
case 11:
dispatch({
type: constant/* FETCH_REP_CONTENT */.GB,
payload: objectSpread2_default()(objectSpread2_default()({}, codeRepData), {}, {
@ -16398,7 +16415,7 @@ function tasks_reducer(state, action) {
})
});
setCodeLoading(false);
case 11:
case 13:
case "end":
return _context7.stop();
}
@ -16411,17 +16428,25 @@ function tasks_reducer(state, action) {
} //加载上次通过的代码
function _onResetGitCode() {
_onResetGitCode = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee8() {
var _taskData$myshixun;
var response;
var _taskData$challenge2, _taskData$myshixun;
var datas, response;
return regeneratorRuntime_default()().wrap(function _callee8$(_context8) {
while (1) switch (_context8.prev = _context8.next) {
case 0:
_context8.next = 2;
return (0,service/* resetGitCode */.Tf)(taskData === null || taskData === void 0 || (_taskData$myshixun = taskData.myshixun) === null || _taskData$myshixun === void 0 ? void 0 : _taskData$myshixun.identifier, {});
case 2:
datas = {
challenge_id: (_taskData$challenge2 = taskData.challenge) === null || _taskData$challenge2 === void 0 ? void 0 : _taskData$challenge2.id
};
if (searchParams.get("type") === 'exercises') {
datas.exercise_id = searchParams.get("exercisesId");
} else if (_params.courseId && _params.homeworkId) {
datas.homework_common_id = _params.homeworkId;
}
_context8.next = 4;
return (0,service/* resetGitCode */.Tf)(taskData === null || taskData === void 0 || (_taskData$myshixun = taskData.myshixun) === null || _taskData$myshixun === void 0 ? void 0 : _taskData$myshixun.identifier, objectSpread2_default()({}, datas));
case 4:
response = _context8.sent;
if (!((response === null || response === void 0 ? void 0 : response.status) === -5)) {
_context8.next = 6;
_context8.next = 8;
break;
}
es_modal/* default */.Z.info({
@ -16438,10 +16463,10 @@ function tasks_reducer(state, action) {
})
});
return _context8.abrupt("return", Promise.reject());
case 6:
case 8:
init();
return _context8.abrupt("return", response);
case 8:
case 10:
case "end":
return _context8.stop();
}
@ -16728,7 +16753,7 @@ function tasks_reducer(state, action) {
}
function _onEvalCode() {
_onEvalCode = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee16() {
var _rs$data, response, resubmit, sec_key, content_modified, _exerciseDataRef$curr, _exerciseDataRef$curr2, params, _taskData$challenge, _response$content, _response$content2, _response$content3, rs, _rs$data2, _rs$data3, getGameStatus, count, intervalTime, time_out;
var _rs$data, response, resubmit, sec_key, content_modified, _exerciseDataRef$curr, _exerciseDataRef$curr2, params, _taskData$challenge3, _response$content, _response$content2, _response$content3, rs, _rs$data2, _rs$data3, getGameStatus, count, intervalTime, time_out;
return regeneratorRuntime_default()().wrap(function _callee16$(_context16) {
while (1) switch (_context16.prev = _context16.next) {
case 0:
@ -16785,7 +16810,7 @@ function tasks_reducer(state, action) {
//试卷id
question_id: searchParams.get("questionId"),
// 题目id
challenge_id: (_taskData$challenge = taskData.challenge) === null || _taskData$challenge === void 0 ? void 0 : _taskData$challenge.id,
challenge_id: (_taskData$challenge3 = taskData.challenge) === null || _taskData$challenge3 === void 0 ? void 0 : _taskData$challenge3.id,
// 关卡id
subject_id: searchParams.get("subject_id") || '',
commitID: response === null || response === void 0 || (_response$content = response.content) === null || _response$content === void 0 ? void 0 : _response$content.commitID
@ -16838,7 +16863,7 @@ function tasks_reducer(state, action) {
if (rs.status === 1) {
getGameStatus = /*#__PURE__*/function () {
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee15(intervalTime, finalTime, count) {
var _taskData$challenge2;
var _taskData$challenge4;
var excuteTime, source, ds, status, running_code_message, port, web_route, playUrl, isWeb, isOk, isPicture, isShowEvalResult, payload;
return regeneratorRuntime_default()().wrap(function _callee15$(_context15) {
while (1) switch (_context15.prev = _context15.next) {
@ -16853,7 +16878,7 @@ function tasks_reducer(state, action) {
time_out: time_out,
port: rs.port,
sec_key: sec_key,
challenge_id: taskData === null || taskData === void 0 || (_taskData$challenge2 = taskData.challenge) === null || _taskData$challenge2 === void 0 ? void 0 : _taskData$challenge2.id,
challenge_id: taskData === null || taskData === void 0 || (_taskData$challenge4 = taskData.challenge) === null || _taskData$challenge4 === void 0 ? void 0 : _taskData$challenge4.id,
subject_id: searchParams.get("subject_id") || ''
});
case 4:
@ -17133,7 +17158,7 @@ function tasks_reducer(state, action) {
} //重启云主机
function _onResetVnc() {
_onResetVnc = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee21() {
var reset, _res, _res2, _res3, str, cloneTabs, _res4;
var datas, reset, _res, _res2, _res3, str, cloneTabs, _res4;
return regeneratorRuntime_default()().wrap(function _callee21$(_context21) {
while (1) switch (_context21.prev = _context21.next) {
case 0:
@ -17141,6 +17166,13 @@ function tasks_reducer(state, action) {
type: constant/* SET_VNC_LOADING */.RY,
payload: true //工具栏控制
});
datas = {};
if (searchParams.get("type") === 'exercises') {
datas.exercise_id = searchParams.get("exercisesId");
//试卷id
} else if (_params.courseId && _params.homeworkId) {
datas.homework_common_id = _params.homeworkId;
}
reset = /*#__PURE__*/function () {
var _ref7 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee20() {
var _taskData$myshixun3;
@ -17168,38 +17200,38 @@ function tasks_reducer(state, action) {
};
}();
if (!(tab_type === 2)) {
_context21.next = 8;
_context21.next = 10;
break;
}
mediator/* default */.Z.publish('vnc-reseting');
_context21.next = 6;
_context21.next = 8;
return reset();
case 6:
case 8:
_res = _context21.sent;
if (_res.status === 0) {
mediator/* default */.Z.publish('vnc-reseting-done', _res);
}
case 8:
case 10:
if (!(tab_type === 3)) {
_context21.next = 14;
_context21.next = 16;
break;
}
mediator/* default */.Z.publish("vnc-reset-".concat(index_tab));
_context21.next = 12;
_context21.next = 14;
return reset();
case 12:
case 14:
_res2 = _context21.sent;
if (_res2.status === 0) {
mediator/* default */.Z.publish("reset-linux-windows-vnc-".concat(index_tab));
}
case 14:
case 16:
if (!(tab_type === 4)) {
_context21.next = 19;
_context21.next = 21;
break;
}
_context21.next = 17;
_context21.next = 19;
return reset();
case 17:
case 19:
_res3 = _context21.sent;
if (_res3.status === 0) {
str = index_tab.split('-')[0];
@ -17215,25 +17247,25 @@ function tasks_reducer(state, action) {
});
setTabs(cloneTabs);
}
case 19:
case 21:
if (!(tab_type === 5)) {
_context21.next = 25;
_context21.next = 27;
break;
}
mediator/* default */.Z.publish("unity3d-reset", 'start');
_context21.next = 23;
_context21.next = 25;
return reset();
case 23:
case 25:
_res4 = _context21.sent;
if (_res4.status === 0) {
mediator/* default */.Z.publish("unity3d-reset", 'done');
}
case 25:
case 27:
dispatch({
type: constant/* SET_VNC_LOADING */.RY,
payload: false
});
case 26:
case 28:
case "end":
return _context21.stop();
}
@ -17902,6 +17934,9 @@ function reducer(state, action) {
setPercent = _useState4[1];
var timeout = (0,_react_17_0_2_react.useRef)();
var params = (0,_umi_production_exports.useParams)();
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
searchParams = _useSearchParams2[0];
(0,_react_17_0_2_react.useEffect)(function () {
return function () {
var _guacaRef$current, _guacaRef$current$dis;
@ -17978,7 +18013,7 @@ function reducer(state, action) {
var getWindowVnc = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
var _taskData$myshixun, _res$data;
var res, _res$data2, _res$data3, _res$data4;
var datas, res, _res$data2, _res$data3, _res$data4;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
@ -17989,16 +18024,23 @@ function reducer(state, action) {
}, 1000);
});
case 2:
_context3.next = 4;
datas = {};
if (searchParams.get("type") === 'exercises') {
datas.exercise_id = searchParams.get("exercisesId");
//试卷id
} else if (params.courseId && params.homeworkId) {
datas.homework_common_id = params.homeworkId;
}
_context3.next = 6;
return (0,service/* startInit */.sA)((_taskData$myshixun = taskData.myshixun) === null || _taskData$myshixun === void 0 ? void 0 : _taskData$myshixun.identifier, objectSpread2_default()(objectSpread2_default()({}, params), {}, {
taskId: params.taskId,
shixun_environment_id: shixun_environment_id,
tab_type: tab_type
}));
case 4:
}, datas));
case 6:
res = _context3.sent;
if (!(res !== null && res !== void 0 && (_res$data = res.data) !== null && _res$data !== void 0 && (_res$data = _res$data.data_list) !== null && _res$data !== void 0 && _res$data.length)) {
_context3.next = 8;
_context3.next = 10;
break;
}
mediator/* default */.Z.publish('pod-restrict-data', {
@ -18006,9 +18048,9 @@ function reducer(state, action) {
data_list: res === null || res === void 0 || (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.data_list
});
return _context3.abrupt("return", Promise.reject());
case 8:
case 10:
if (!((res === null || res === void 0 ? void 0 : res.status) === -3)) {
_context3.next = 10;
_context3.next = 12;
break;
}
return _context3.abrupt("return", new Promise( /*#__PURE__*/function () {
@ -18054,15 +18096,15 @@ function reducer(state, action) {
return _ref3.apply(this, arguments);
};
}()));
case 10:
case 12:
if (!((res === null || res === void 0 ? void 0 : res.status) === -1)) {
_context3.next = 12;
_context3.next = 14;
break;
}
throw new String(res === null || res === void 0 ? void 0 : res.message);
case 12:
case 14:
if (!((res === null || res === void 0 ? void 0 : res.status) === 0)) {
_context3.next = 17;
_context3.next = 19;
break;
}
if (virtual_machine) {
@ -18075,7 +18117,7 @@ function reducer(state, action) {
index_tab: index_tab
}));
return _context3.abrupt("return", res);
case 17:
case 19:
case "end":
return _context3.stop();
}
@ -18168,7 +18210,7 @@ function reducer(state, action) {
doResize();
}
new Promise( /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
var params, res, _res$data5, _res$data6, character, _res$data7, _res$data8, urlParser, protocol, searchParams, host, search, searchUrl;
var params, res, _res$data5, _res$data6, character, _res$data7, _res$data8, urlParser, protocol, _searchParams, host, search, searchUrl;
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
@ -18194,9 +18236,9 @@ function reducer(state, action) {
socketUrlRef.current = decodeURIComponent(res === null || res === void 0 || (_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : _res$data7.link_url);
} else {
urlParser = new URL(decodeURIComponent(res === null || res === void 0 || (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8.link_url)); //no IE11 support
protocol = urlParser.protocol, searchParams = urlParser.searchParams, host = urlParser.host, search = urlParser.search;
protocol = urlParser.protocol, _searchParams = urlParser.searchParams, host = urlParser.host, search = urlParser.search;
searchUrl = (0,util/* parseUrl */.en)(search);
passwordRef.current = searchParams.get('password');
passwordRef.current = _searchParams.get('password');
socketUrlRef.current = "".concat(protocol === 'https:' ? 'wss' : 'ws', "://").concat(host, "/").concat(searchUrl.path || 'websockify');
}
case 12:

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