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.async.js

2 lines
8.8 KiB

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