|
|
|
|
@ -10455,7 +10455,7 @@ function tasks_reducer(state, action) {
|
|
|
|
|
}
|
|
|
|
|
/* harmony default export */ var tasks = ((_a) => {
|
|
|
|
|
var props = tasks_objRest(_a, []);
|
|
|
|
|
var _a2;
|
|
|
|
|
var _a2, _b;
|
|
|
|
|
const userInfo = (0,_umi_production_exports.useSelector)((state2) => {
|
|
|
|
|
var _a3;
|
|
|
|
|
return (_a3 = state2 == null ? void 0 : state2.user) == null ? void 0 : _a3.userInfo;
|
|
|
|
|
@ -10547,7 +10547,7 @@ function tasks_reducer(state, action) {
|
|
|
|
|
tpi_type
|
|
|
|
|
} = tabActiveParams;
|
|
|
|
|
const prevCurrentPath = (0,_react_17_0_2_react.useRef)("");
|
|
|
|
|
const isLocalFetch = ["python"].includes(language) && (0,util/* isLocalApp */.WX)();
|
|
|
|
|
const isLocalFetch = ((_a2 = taskData == null ? void 0 : taskData.local_evaluate_languages) == null ? void 0 : _a2.includes(language)) && (0,util/* isLocalApp */.WX)() && (taskData == null ? void 0 : taskData.open_local_evaluate);
|
|
|
|
|
const isUpdateScript = (tpm_modified || tpm_script_modified) && st === 0;
|
|
|
|
|
const isNotice = (tpm_cases_modified || isUpdateScript) && myshixun.system_tip === true;
|
|
|
|
|
const isHtml = (mirror_name || []).indexOf("Html") !== -1;
|
|
|
|
|
@ -10571,7 +10571,7 @@ function tasks_reducer(state, action) {
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}, [currentPath, paths]);
|
|
|
|
|
const showReleaseResource = (taskData == null ? void 0 : taskData.exit_delete_pod_switch) && (userInfo == null ? void 0 : userInfo.user_id) === ((_a2 = taskData == null ? void 0 : taskData.user) == null ? void 0 : _a2.user_id) && tabs.some((item) => item.tab_type !== 1);
|
|
|
|
|
const showReleaseResource = (taskData == null ? void 0 : taskData.exit_delete_pod_switch) && (userInfo == null ? void 0 : userInfo.user_id) === ((_b = taskData == null ? void 0 : taskData.user) == null ? void 0 : _b.user_id) && tabs.some((item) => item.tab_type !== 1);
|
|
|
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
|
|
|
if (resizeYFlag.current || resizeXFlag.current) {
|
|
|
|
|
let onMove = function(e) {
|
|
|
|
|
@ -10732,7 +10732,7 @@ function tasks_reducer(state, action) {
|
|
|
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
|
|
|
function init2() {
|
|
|
|
|
return tasks_async(this, null, function* () {
|
|
|
|
|
var _a3, _b, _c;
|
|
|
|
|
var _a3, _b2, _c;
|
|
|
|
|
setCodeLoading(true);
|
|
|
|
|
const data = yield (0,service/* fetchCode */.li)(taskId, { path: currentPath });
|
|
|
|
|
if (data == null ? void 0 : data.content) {
|
|
|
|
|
@ -10743,7 +10743,7 @@ function tasks_reducer(state, action) {
|
|
|
|
|
escape(window.atob((_a3 = data == null ? void 0 : data.content) == null ? void 0 : _a3.content))
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
content2 = (_b = data == null ? void 0 : data.content) == null ? void 0 : _b.content;
|
|
|
|
|
content2 = (_b2 = data == null ? void 0 : data.content) == null ? void 0 : _b2.content;
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
content2 = window.atob((_c = data == null ? void 0 : data.content) == null ? void 0 : _c.content);
|
|
|
|
|
@ -10772,12 +10772,12 @@ function tasks_reducer(state, action) {
|
|
|
|
|
}
|
|
|
|
|
}, [st, currentPath, lastedGetTaskInfoTime, timestamp]);
|
|
|
|
|
const onUpdateCode = (evaluate = 0) => tasks_async(void 0, null, function* () {
|
|
|
|
|
var _a3, _b;
|
|
|
|
|
var _a3, _b2;
|
|
|
|
|
if (st === 0 && lastedUpdateTime > 0 && isEditPath || evaluate) {
|
|
|
|
|
const paramsFromExercise = _params.courseId && _params.exerciseId ? { exercise_id: _params.exerciseId } : {};
|
|
|
|
|
let ip;
|
|
|
|
|
if (searchParams.get("ip_limit") === "inner" || searchParams.get("ip_bind") === "true")
|
|
|
|
|
ip = yield (0,Exercise_ip/* findLocalIp */.y)({ ip_limit: searchParams.get("ip_limit"), ip_bind: searchParams.get("ip_bind") === "true" ? true : false, ip_bind_type: (_b = (_a3 = exerciseDataRef.current) == null ? void 0 : _a3.exercise) == null ? void 0 : _b.ip_bind_type });
|
|
|
|
|
ip = yield (0,Exercise_ip/* findLocalIp */.y)({ ip_limit: searchParams.get("ip_limit"), ip_bind: searchParams.get("ip_bind") === "true" ? true : false, ip_bind_type: (_b2 = (_a3 = exerciseDataRef.current) == null ? void 0 : _a3.exercise) == null ? void 0 : _b2.ip_bind_type });
|
|
|
|
|
const response = yield (0,service/* updateCode */.n4)(myshixun.identifier, tasks_spreadValues({
|
|
|
|
|
path: currentPath,
|
|
|
|
|
evaluate,
|
|
|
|
|
@ -10807,7 +10807,7 @@ function tasks_reducer(state, action) {
|
|
|
|
|
return true;
|
|
|
|
|
});
|
|
|
|
|
const onSaveContent = () => tasks_async(void 0, null, function* () {
|
|
|
|
|
var _a3, _b;
|
|
|
|
|
var _a3, _b2;
|
|
|
|
|
if (codeLoading)
|
|
|
|
|
return;
|
|
|
|
|
if (game) {
|
|
|
|
|
@ -10826,7 +10826,7 @@ function tasks_reducer(state, action) {
|
|
|
|
|
evaluate: 0,
|
|
|
|
|
content: (_a3 = stateRef.current.codeRepData) == null ? void 0 : _a3.content,
|
|
|
|
|
game_id: game.id,
|
|
|
|
|
tab_type: (_b = tabActiveParamsRef.current) == null ? void 0 : _b.tab_type,
|
|
|
|
|
tab_type: (_b2 = tabActiveParamsRef.current) == null ? void 0 : _b2.tab_type,
|
|
|
|
|
ip
|
|
|
|
|
}, paramsFromExercise);
|
|
|
|
|
let headers = {
|
|
|
|
|
@ -11120,7 +11120,7 @@ function tasks_reducer(state, action) {
|
|
|
|
|
}
|
|
|
|
|
function onEvalCode() {
|
|
|
|
|
return tasks_async(this, null, function* () {
|
|
|
|
|
var _a3, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
|
|
|
|
|
var _a3, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
|
|
|
|
|
try {
|
|
|
|
|
dispatch({ type: constant/* SHOW_EVALUATE_LOADING */.Ui });
|
|
|
|
|
const response = yield onUpdateCode(1);
|
|
|
|
|
@ -11130,7 +11130,7 @@ function tasks_reducer(state, action) {
|
|
|
|
|
type: "exercise/setActionTabs",
|
|
|
|
|
payload: {
|
|
|
|
|
key: "student-unlock",
|
|
|
|
|
exerciseParams: tasks_spreadProps(tasks_spreadValues({}, ((_a3 = exerciseDataRef.current) == null ? void 0 : _a3.exercise) || {}), { errorMessage: response == null ? void 0 : response.message, exercise_user_id: (_c = (_b = exerciseDataRef.current) == null ? void 0 : _b.exercise) == null ? void 0 : _c.exercise_user_id, id: searchParams.get("exercisesId") })
|
|
|
|
|
exerciseParams: tasks_spreadProps(tasks_spreadValues({}, ((_a3 = exerciseDataRef.current) == null ? void 0 : _a3.exercise) || {}), { errorMessage: response == null ? void 0 : response.message, exercise_user_id: (_c = (_b2 = exerciseDataRef.current) == null ? void 0 : _b2.exercise) == null ? void 0 : _c.exercise_user_id, id: searchParams.get("exercisesId") })
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
@ -11224,7 +11224,7 @@ function tasks_reducer(state, action) {
|
|
|
|
|
let time_out = false;
|
|
|
|
|
function getGameStatus(intervalTime2, finalTime, count2) {
|
|
|
|
|
return tasks_async(this, null, function* () {
|
|
|
|
|
var _a4, _b2;
|
|
|
|
|
var _a4, _b3;
|
|
|
|
|
const excuteTime = count2++ * intervalTime2;
|
|
|
|
|
if (excuteTime / 1e3 > finalTime) {
|
|
|
|
|
time_out = true;
|
|
|
|
|
@ -11240,7 +11240,7 @@ function tasks_reducer(state, action) {
|
|
|
|
|
const ds = source;
|
|
|
|
|
const { status, running_code_message, port, web_route } = ds;
|
|
|
|
|
if ((ds == null ? void 0 : ds.status) == 0) {
|
|
|
|
|
if (((_b2 = ds == null ? void 0 : ds.shixuns) == null ? void 0 : _b2.length) > 0) {
|
|
|
|
|
if (((_b3 = ds == null ? void 0 : ds.shixuns) == null ? void 0 : _b3.length) > 0) {
|
|
|
|
|
setshixuns(ds == null ? void 0 : ds.shixuns);
|
|
|
|
|
setvisible(true);
|
|
|
|
|
}
|
|
|
|
|
@ -11330,7 +11330,7 @@ function tasks_reducer(state, action) {
|
|
|
|
|
}
|
|
|
|
|
function onLocalRun(input) {
|
|
|
|
|
return tasks_async(this, null, function* () {
|
|
|
|
|
var _a3, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
|
|
|
var _a3, _b2, _c, _d, _e, _f, _g, _h, _i;
|
|
|
|
|
yield onUpdateCode();
|
|
|
|
|
const params = {};
|
|
|
|
|
if (searchParams.get("type") === "exercises") {
|
|
|
|
|
@ -11343,7 +11343,7 @@ function tasks_reducer(state, action) {
|
|
|
|
|
// 关卡id
|
|
|
|
|
subject_id: searchParams.get("subject_id") || "",
|
|
|
|
|
commitID: "",
|
|
|
|
|
ip: yield (0,Exercise_ip/* findLocalIp */.y)({ ip_limit: searchParams.get("ip_limit") || "no", ip_bind: searchParams.get("ip_bind") === "true" ? true : false, ip_bind_type: (_c = (_b = exerciseDataRef.current) == null ? void 0 : _b.exercise) == null ? void 0 : _c.ip_bind_type })
|
|
|
|
|
ip: yield (0,Exercise_ip/* findLocalIp */.y)({ ip_limit: searchParams.get("ip_limit") || "no", ip_bind: searchParams.get("ip_bind") === "true" ? true : false, ip_bind_type: (_c = (_b2 = exerciseDataRef.current) == null ? void 0 : _b2.exercise) == null ? void 0 : _c.ip_bind_type })
|
|
|
|
|
};
|
|
|
|
|
} else if (searchParams.get("type") === "competitions") {
|
|
|
|
|
params.extras = {
|
|
|
|
|
@ -11592,7 +11592,7 @@ function tasks_reducer(state, action) {
|
|
|
|
|
}
|
|
|
|
|
function onGetUnity3dMessage(mes) {
|
|
|
|
|
return tasks_async(this, null, function* () {
|
|
|
|
|
var _a3, _b, _c;
|
|
|
|
|
var _a3, _b2, _c;
|
|
|
|
|
const { GameState, Data, challenge: challenge2 } = mes;
|
|
|
|
|
if (challenge2 === "info") {
|
|
|
|
|
mediator/* default */.Z.publish("evaluate-unity3d-result", {
|
|
|
|
|
@ -11642,7 +11642,7 @@ function tasks_reducer(state, action) {
|
|
|
|
|
dispatch({
|
|
|
|
|
type: constant/* SHOW_EVALUATE_RESULT */.m5
|
|
|
|
|
});
|
|
|
|
|
(_c = (_b = (_a3 = window == null ? void 0 : window.frames) == null ? void 0 : _a3[0]) == null ? void 0 : _b.contentWindow) == null ? void 0 : _c.postMessage({
|
|
|
|
|
(_c = (_b2 = (_a3 = window == null ? void 0 : window.frames) == null ? void 0 : _a3[0]) == null ? void 0 : _b2.contentWindow) == null ? void 0 : _c.postMessage({
|
|
|
|
|
taskIdentifier: game == null ? void 0 : game.identifier
|
|
|
|
|
}, "*");
|
|
|
|
|
}
|
|
|
|
|
@ -11651,11 +11651,11 @@ function tasks_reducer(state, action) {
|
|
|
|
|
}
|
|
|
|
|
function onAddVncTime() {
|
|
|
|
|
return tasks_async(this, null, function* () {
|
|
|
|
|
var _a3, _b;
|
|
|
|
|
var _a3, _b2;
|
|
|
|
|
const res2 = yield (0,service/* addVncTime */.Kl)(
|
|
|
|
|
(_a3 = taskData == null ? void 0 : taskData.myshixun) == null ? void 0 : _a3.identifier,
|
|
|
|
|
{
|
|
|
|
|
game_id: (_b = taskData == null ? void 0 : taskData.game) == null ? void 0 : _b.id,
|
|
|
|
|
game_id: (_b2 = taskData == null ? void 0 : taskData.game) == null ? void 0 : _b2.id,
|
|
|
|
|
shixun_environment_id,
|
|
|
|
|
tab_type
|
|
|
|
|
}
|
|
|
|
|
|