You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Terminal__index.58bcc0de...

2 lines
9.0 KiB

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[5111],{56167:function(C,v,o){o.d(v,{JW:function(){return X},Jd:function(){return G},Kl:function(){return Q},L5:function(){return R},MH:function(){return Y},MI:function(){return sn},Qo:function(){return U},SO:function(){return F},Tf:function(){return s},VT:function(){return S},XO:function(){return M},Xy:function(){return w},Y0:function(){return O},Ye:function(){return cn},Yv:function(){return rn},ZH:function(){return en},am:function(){return I},bD:function(){return un},eA:function(){return P},fA:function(){return nn},fY:function(){return h},g6:function(){return D},g7:function(){return ln},gT:function(){return $},gn:function(){return tn},h$:function(){return on},hG:function(){return b},i8:function(){return q},j3:function(){return J},lH:function(){return V},li:function(){return T},n4:function(){return a},pU:function(){return K},qK:function(){return i},sA:function(){return A},sP:function(){return H},t$:function(){return N},zl:function(){return p}});var t=o(40117),f=o(16427),c=Object.defineProperty,g=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,E=(n,e,u)=>e in n?c(n,e,{enumerable:!0,configurable:!0,writable:!0,value:u}):n[e]=u,r=(n,e)=>{for(var u in e||(e={}))l.call(e,u)&&E(n,u,e[u]);if(g)for(var u of g(e))m.call(e,u)&&E(n,u,e[u]);return n},k=(n,e,u)=>new Promise((W,z)=>{var an=j=>{try{B(u.next(j))}catch(Z){z(Z)}},dn=j=>{try{B(u.throw(j))}catch(Z){z(Z)}},B=j=>j.done?W(j.value):Promise.resolve(j.value).then(an,dn);B((u=u.apply(n,e)).next())});const _=(0,f.oP)(),d={};_!=null&&_.homework_common_id&&(d.homework_common_id=_==null?void 0:_.homework_common_id),_!=null&&_.exercisesId&&(d.exercise_id=_==null?void 0:_.exercisesId),console.log(_,d,"urlParamsAll");function M(n,e){return(0,t.U2)(`tasks/${n}.json`,r(r({},e),d))}function D(n,e={}){return(0,t.U2)(`myshixuns/${n}/challenges.json`,r({},e))}function F(n,e){return(0,t.U2)(`myshixuns/${n}/subject_challenges.json`,e)}function R(n,e,u){return(0,t.U2)(`tasks/${n}/star.json`,{shixun_id:e,star:u})}function T(n,e){return(0,t.U2)(`tasks/${n}/rep_content.json`,r(r({},e),d))}function a(n,e){return(0,t.v_)(`myshixuns/${n}/update_file.json`,e)}function i(n,e){return(0,t.U2)(`tasks/${n}/reset_original_code.json`,r(r({},e),d))}function s(n,e){return(0,t.v_)(`myshixuns/${n}/reset_repository.json`,e)}function b(n,e){return(0,t.U2)(`tasks/${n}/reset_passed_code.json`,r(r({},e),d))}function w(n,e){return(0,t.v_)(`tasks/${n}/game_build.json`,r(r({},e),d))}function P(n){return(0,t.ZP)("http://localhost:49352/api/game_build",{method:"post",body:n})}function U(n,e){return(0,t.U2)(`tasks/${n}/game_status.json`,r(r({},e),d))}function p(n,e){return(0,t.v_)(`tasks/${n}/choose_build.json`,r(r({},e),d))}function h(n){return(0,t.U2)(`myshixuns/${n}/get_remaining_time.json`)}function $(n){return(0,t.U2)(`tasks/${n}/picture_display.json`,d)}function y(n,e){return get(`courses/${n}/inform_detail.json`,e)}function O(n){return(0,t.v_)(`tasks/${n}/plus_or_cancel_praise.json`)}function K(n,e={}){return(0,t.v_)(`myshixuns/${n}/repository.json`,e)}function A(n,e={}){return(0,t.U2)(`myshixuns/${n}/start.json`,e)}function S(n,e={}){return(0,t.v_)(`myshixuns/${n}/force_delete_pod.json`,e)}function L(n,e={}){return get(`myshixuns/${n}/set_tpisession.json`,e)}function x(n){return get(`myshixuns/${n}/reset_pod.json`)}function I(n,e){return(0,t.U2)(`myshixuns/${n}/reset_pod.json`,e)}function G(n,e){return(0,t.ZP)(`/api/tasks/${n}/reboot_esc.json`,{method:"post",body:e})}function N(n){return(0,t.U2)(`tasks/${n}/check_test_sets.json`)}function V(n){return(0,t.U2)(`tasks/${n}/get_answer_info.json`)}function H(n){return(0,t.U2)(`tasks/${n}/get_choose_answer.json`)}function Y(n){return(0,t.U2)(`tasks/${n}/unlock_choose_answer.json`)}function J(n,e){return(0,t.U2)(`tasks/${n}/unlock_answer.json`,{answer_id:e})}function X(n,e,u,W){return(0,t.v_)(`tasks/${n}/set_games_status.json`,r({result:e,data:u},W||{}))}function Q(n,e){return(0,t.U2)(`myshixuns/${n}/active_pod.json`,e)}function q(n,e){return(0,t.U2)(`tasks/${n}/rank_list.json`,e)}function nn(n,e){return(0,t.v_)(`tasks/${n}/close_windows_vnc.json`,{tpi_id:e})}function en(n,e){return(0,t.U2)(`tasks/${n}/commit_files.json`,e)}function tn(n,e){return(0,t.U2)(`tasks/${n}/pull_files.json`,e)}function on(n,e){return(0,t.v_)(`tasks/${n}/log_output`,e)}function rn(n,e){return(0,t.U2)(`tasks/${n}/stop_log_output.json`,e)}function sn(n){return k(this,null,function*(){return(0,t.ZP)(`/api/myshixuns/${n.id}/add_file.json`,{method:"post",body:n})})}function un(n){return k(this,null,function*(){return(0,t.ZP)(`/api/myshixuns/${n.id}/delete_git_file.json`,{method:"Delete",body:n})})}function ln(n){return k(this,null,function*(){return(0,t.ZP)(`/api/myshixuns/${n.id}/mv_file.json`,{method:"post",body:n})})}function fn(n){return k(this,null,function*(){return Fetch(`/api/tasks/${n.id}/rep_content.json`,{method:"get",params:n})})}function cn(n,e){return(0,t.ZP)(`/api/shixuns/${n}/set_start_permanent.json`,{method:"put",body:e})}},87516:function(C,v,o){o.d(v,{Z:function(){return g}});var t=o(71471),f={ldsRing:"ldsRing___mpBZC",idsRingWrapper:"idsRingWrapper___Of9_n",ldsring:"ldsring___o0w2t"},c=o(59301),g=({message:l,className:m,children:E,style:r={}})=>c.createElement("div",{className:`custom-spinner ${f.idsRingWrapper} ${m}`},c.createElement("div",{className:f.ldsRing},c.createElement("div",null),c.createElement("div",null),c.createElement("div",null),c.createElement("div",null)),l?c.createElement("p",{style:r},l):null,E,c.createElement(t.Outlet,null))},89767:function(C,v,o){o.d(v,{Z:function(){return c}});var t=o(59301),f=o(4676);class c extends t.Component{constructor(l){super(l);const m=window.document;this.node=m.createElement("div"),m.body.appendChild(this.node)}render(){const{children:l}=this.props;return(0,f.createPortal)(l,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},41609:function(C,v,o){o.r(v);var t=o(59301),f=o(71471),c=o(67823),g=o(9472),l=o(46411),m=o(50535),E=o(40117),r=o(59301),k=Object.defineProperty,_=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable,D=(a,i,s)=>i in a?k(a,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[i]=s,F=(a,i)=>{for(var s in i||(i={}))d.call(i,s)&&D(a,s,i[s]);if(_)for(var s of _(i))M.call(i,s)&&D(a,s,i[s]);return a},R=(a,i,s)=>new Promise((b,w)=>{var P=h=>{try{p(s.next(h))}catch($){w($)}},U=h=>{try{p(s.throw(h))}catch($){w($)}},p=h=>h.done?b(h.value):Promise.resolve(h.value).then(P,U);p((s=s.apply(a,i)).next())});const T=({classroomList:a,globalSetting:i,loading:s,dispatch:b})=>{var w;const[P,U]=(0,t.useState)({}),[p,h]=(0,t.useState)({}),$=(0,f.useParams)(),[y]=(0,f.useSearchParams)();let O="68yrbx3ech4a";switch(y.get("type")){case"windows":O="hvp5tzfof4wl";break;case"vnc":O="m3ifqz82epo9";break}let K;(0,t.useEffect)(()=>{A()},[]),(0,t.useEffect)(()=>{P.host&&setTimeout(()=>{m.Z.publish("create-socket",1)},500)},[P]);const A=()=>R(void 0,null,function*(){var S,L;const x=yield(0,E.ZP)(`/api/tasks/${y.get("taskId")||O||"68yrbx3ech4a"}.json`,{method:"get"});if(h(F({},x)),y.get("type")==="terminal"){const I=yield(0,E.ZP)(`/api/myshixuns/${(S=x==null?void 0:x.myshixun)==null?void 0:S.identifier}/start.json`,{method:"get",game_id:(L=x==null?void 0:x.game)==null?void 0:L.id});U(F({},(I==null?void 0:I.data)||{}))}y.get("type")});return r.createElement("section",{style:{position:"fixed",width:"100%",height:"100%",zIndex:22,top:0,right:0,bottom:0,left:0}},y.get("type")==="terminal"&&r.createElement(c.Z,{sshConfigData:P,sid:1}),y.get("type")!=="terminal"&&(p==null?void 0:p.challenge)&&r.createElement(g.Z,{taskId:O,myshixunId:(w=p==null?void 0:p.myshixun)==null?void 0:w.identifier,vnc_url:y.get("type")==="vnc",window_vnc_url:y.get("type")==="windows",taskData:p}))};v.default=(0,f.connect)(({classroomList:a,loading:i,globalSetting:s})=>({classroomList:a,globalSetting:s,loading:i.models.classroomList}))(T)},45992:function(C,v,o){o.d(v,{BU:function(){return f},Dj:function(){return t},gH:function(){return c},vp:function(){return g}});function t(l){try{l.mozRequestFullScreen?l.mozRequestFullScreen():l.webkitRequestFullScreen&&l.webkitRequestFullScreen()}catch(m){console.log(m,":e")}}function f(){window.top.document.webkitExitFullscreen?window.top.document.webkitExitFullscreen():document.exitFullscreen?window.top.document.exitFullscreen():document.msExitFullscreen?window.top.document.msExitFullscreen():document.mozCancelFullScreen&&window.top.document.mozCancelFullScreen()}const c=()=>{if(document.webkitExitFullscreen)return"webkitfullscreenchange";if(document.exitFullscreen)return"fullscreenchange";if(document.msExitFullscreen)return"msfullscreenchange";if(document.mozCancelFullScreen)return"mozfullscreenchange"};function g(){var l=window.top.document.fullscreenElement||window.top.document.mozFullscreenElement||window.top.document.webkitFullscreenElement,m=document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled;return console.log("fullscreenElement",l),window.isFullScreen?window.isFullScreen:l!=null}}}]);