@ -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 = 1 0 ;
_context4 . next = 1 2 ;
break ;
}
throw new String ( res === null || res === void 0 ? void 0 : res . message ) ;
case 1 0 :
case 1 2 :
if ( ! ( ( res === null || res === void 0 ? void 0 : res . status ) === 0 ) ) {
_context4 . next = 1 5 ;
_context4 . next = 1 7 ;
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 1 5 :
case 1 7 :
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 1 1 :
case 1 3 :
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$challenge 3 , _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$challenge 3 = taskData . challenge ) === null || _taskData$challenge 3 === void 0 ? void 0 : _taskData$challenge 3 . 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$challenge 2 ;
var _taskData$challenge 4 ;
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$challenge 2 = taskData . challenge ) === null || _taskData$challenge 2 === void 0 ? void 0 : _taskData$challenge 2 . id ,
challenge _id : taskData === null || taskData === void 0 || ( _taskData$challenge 4 = taskData . challenge ) === null || _taskData$challenge 4 === void 0 ? void 0 : _taskData$challenge 4 . 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 = 1 4 ;
_context21 . next = 1 6 ;
break ;
}
mediator /* default */ . Z . publish ( "vnc-reset-" . concat ( index _tab ) ) ;
_context21 . next = 1 2 ;
_context21 . next = 1 4 ;
return reset ( ) ;
case 1 2 :
case 1 4 :
_res2 = _context21 . sent ;
if ( _res2 . status === 0 ) {
mediator /* default */ . Z . publish ( "reset-linux-windows-vnc-" . concat ( index _tab ) ) ;
}
case 1 4 :
case 1 6 :
if ( ! ( tab _type === 4 ) ) {
_context21 . next = 19 ;
_context21 . next = 2 1;
break ;
}
_context21 . next = 1 7 ;
_context21 . next = 1 9 ;
return reset ( ) ;
case 1 7 :
case 1 9 :
_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 2 1:
if ( ! ( tab _type === 5 ) ) {
_context21 . next = 2 5 ;
_context21 . next = 2 7 ;
break ;
}
mediator /* default */ . Z . publish ( "unity3d-reset" , 'start' ) ;
_context21 . next = 2 3 ;
_context21 . next = 2 5 ;
return reset ( ) ;
case 2 3 :
case 2 5 :
_res4 = _context21 . sent ;
if ( _res4 . status === 0 ) {
mediator /* default */ . Z . publish ( "unity3d-reset" , 'done' ) ;
}
case 2 5 :
case 2 7 :
dispatch ( {
type : constant /* SET_VNC_LOADING */ . RY ,
payload : false
} ) ;
case 2 6 :
case 2 8 :
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 = 1 0 ;
_context3 . next = 1 2 ;
break ;
}
return _context3 . abrupt ( "return" , new Promise ( /*#__PURE__*/ function ( ) {
@ -18054,15 +18096,15 @@ function reducer(state, action) {
return _ref3 . apply ( this , arguments ) ;
} ;
} ( ) ) ) ;
case 1 0 :
case 1 2 :
if ( ! ( ( res === null || res === void 0 ? void 0 : res . status ) === - 1 ) ) {
_context3 . next = 1 2 ;
_context3 . next = 1 4 ;
break ;
}
throw new String ( res === null || res === void 0 ? void 0 : res . message ) ;
case 1 2 :
case 1 4 :
if ( ! ( ( res === null || res === void 0 ? void 0 : res . status ) === 0 ) ) {
_context3 . next = 1 7 ;
_context3 . next = 1 9 ;
break ;
}
if ( virtual _machine ) {
@ -18075,7 +18117,7 @@ function reducer(state, action) {
index _tab : index _tab
} ) ) ;
return _context3 . abrupt ( "return" , res ) ;
case 1 7 :
case 1 9 :
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 :