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__Shixuns__New__ImagePrevi...

3 lines
32 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[124],{"07cG":function(Ee,me,u){Ee.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},Dqnf:function(Ee,me,u){"use strict";var ye=u("k1fw"),G=u("tJVT"),ke=u("rAM+"),k=u("q1tI"),we=u.n(k),Y=u("J66h"),Be=u.n(Y),X=u("/POA"),O=u.n(X),z=u("q7KB"),ze=u.n(z),Oe=u("ER/M"),re=u.n(Oe),Re=u("dhSg"),Xe=u("bdgK");function Fe(ae,_e,he){var je=he._core._renderService.dimensions.actualCellWidth||9.5,M=he._core._renderService.dimensions.actualCellHeight||18,P=Math.floor(_e/M),Q=Math.floor(ae/je);return[Q,P]}function R(ae,_e){var he=new Xe.default(function(je){var M=Object(ke.a)(je),P;try{for(M.s();!(P=M.n()).done;){var Q=P.value;if(Q.target.offsetHeight>0||Q.target.offsetWidth>0){var oe=Fe(Q.target.offsetWidth,Q.target.offsetHeight,ae),Pe=Object(G.a)(oe,2),Se=Pe[0],Z=Pe[1];console.log("cols, rows",Se,Z),Re.a.publish("ssh-xterm-resize",{columns:Se,rows:Z,width:Q.target.offsetWidth,height:Q.target.offsetHeight}),ae.resize(Se,Z);var L=Y.Base64.decode("IA=="),Le=Y.Base64.decode("CBtbSw==");ae.write(L),ae.write(Le)}}}catch(q){M.e(q)}finally{M.f()}});return he.observe(_e),he}var c=3e4;me.a=function(ae){var _e=ae.sshConfigData,he=ae.sid,je=Object(k.useState)(null),M=Object(G.a)(je,2),P=M[0],Q=M[1],oe=_e.ws_url,Pe=_e.password,Se=_e.port,Z=Object(k.useRef)(),L=Object(k.useRef)(),Le=Object(k.useRef)(!1);return Object(k.useEffect)(function(){if(Z.current&&oe){var q=new X.Terminal({fontSize:16,rendererType:"dom"});q.open(Z.current),q.onData(function(Ne){L.current&&(L.current.readyState===1&&(L.current.send(JSON.stringify({tp:"client",data:Ne})),Re.a.publish("on-operating-ssh")))}),q.write("Connecting..."),Q(q);var be=R(q,Z.current);return function(){q.dispose(),be.unobserve(Z.current)}}},[oe,Z.current]),Object(k.useEffect)(function(){if(P&&oe){var q=function(){var ge=new WebSocket(oe);L.current=ge,ge.onopen=function(){var ie=P.element.parentElement;if(ie){var Te=ie.offsetWidth,S=ie.offsetHeight;console.log("init",{tp:"init",data:Object(ye.a)(Object(ye.a)({},_e),{},{secret:Pe,width:Te,height:S,rows:P.rows,columns:P.cols})}),ge.send(JSON.stringify({tp:"init",data:Object(ye.a)(Object(ye.a)({},_e),{},{secret:Pe,width:Te,height:S,rows:P.rows,columns:P.cols})}))}P.focus()},ge.onerror=function(ie){console.log("------in socket error----",ie,ge,oe)},ge.onmessage=function(ie){Le.current||(P.write("\r"),setTimeout(function(){},1e3)),Le.current=!0,console.log("event:",ie);var Te=Y.Base64.decode(ie.data.toString()),S=P._core._renderService.dimensions.actualCellWidth||9.5;console.log("data:",Te,S,P),P.write(Te)},ge.onclose=function(ie){be&&clearInterval(be),P.write(`\r
connection closed`)}},be=setInterval(function(){L.current&&L.current.send(JSON.stringify({tp:"h"}))},c),Ne=Re.a.subscribe("create-socket",function(Ue){he==Ue&&(L.current&&L.current.readyState===1?P.focus():q(),P.focus())}),ee=Re.a.subscribe("close-socket",function(Ue){he===Ue&&(L.current&&(L.current.close(),Le.current=!1,P.clear()),L.current=null)}),We=Re.a.subscribe("ssh-xterm-resize",function(Ue){L.current&&L.current.readyState===1&&L.current.send(JSON.stringify({tp:"resize",data:Object(ye.a)({},Ue)}))}),se=Re.a.subscribe("ssh-add-connect-time",function(){L.current&&L.current.readyState===1&&L.current.send(JSON.stringify({tp:"overtime"}))});return function(){ee(),Ne(),We(),se(),L.current&&(L.current.close(),Le.current=!1)}}},[P,oe,Se]),we.a.createElement("div",{ref:Z,className:re.a["xterm-panel"]},oe?null:we.a.createElement("p",{style:{color:"#fff"}},"\u6B63\u5728\u8FDE\u63A5\u547D\u4EE4\u884C\u670D\u52A1..."))}},"ER/M":function(Ee,me,u){Ee.exports={"xterm-panel":"xterm-panel___2r2xx"}},IxHN:function(Ee,me,u){"use strict";var ye=u("q1tI"),G=u.n(ye),ke=u("07cG"),k=u.n(ke);me.a=function(we){var Y=we.message,Be=we.className,X=we.children,O=we.style,z=O===void 0?{}:O;return G.a.createElement("div",{className:"".concat(k.a.idsRingWrapper," ").concat(Be)},G.a.createElement("div",{className:k.a.ldsRing},G.a.createElement("div",null),G.a.createElement("div",null),G.a.createElement("div",null),G.a.createElement("div",null)),Y?G.a.createElement("p",{style:z},Y):null,X)}},Lmeb:function(Ee,me,u){},"VaU+":function(Ee,me,u){Ee.exports={wrp:"wrp___1lJPu",header:"header___2p05v",cuttDown:"cuttDown___1-ls7",container:"container___1Nx55",info:"info___2lI6e",buttons:"buttons___3Q0yr",fullBtn:"fullBtn___18HVx",shrink:"shrink___367DS",elseShrink:"elseShrink___3Anw7",spin:"spin___3h9s3"}},iJb0:function(Ee,me,u){"use strict";u.r(me);var ye=u("+L6B"),G=u("2/Rp"),ke=u("miYZ"),k=u("tsqr"),we=u("14J3"),Y=u("BMrR"),Be=u("jCWc"),X=u("kPKH"),O=u("k1fw"),z=u("9og8"),ze=u("2qtc"),Oe=u("kLXV"),re=u("tJVT"),Re=u("PpiC"),Xe=u("aHsQ"),Fe=u("sGsY"),R=u("q1tI"),c=u.n(R),ae=u("9kvl"),_e=u("Lmeb"),he=u("Ot1p"),je=u("Dqnf"),M=u("dhSg"),P=u("MXD1"),Q=u("CFYs"),oe=u("rAM+"),Pe=u("IxHN"),Se=u("bdgK"),Z=u("M8RZ"),L=u("Ty5D"),Le=u("1dTM"),q=u.n(Le),be=u("HBuW"),Ne=u("VaU+"),ee=u.n(Ne),We=u("ye1Q");function se(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */se=function(){return l};var l={},v=Object.prototype,h=v.hasOwnProperty,N=typeof Symbol=="function"?Symbol:{},C=N.iterator||"@@iterator",Me=N.asyncIterator||"@@asyncIterator",pe=N.toStringTag||"@@toStringTag";function p(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{p({},"")}catch(t){p=function(n,r,a){return n[r]=a}}function j(t,e,n,r){var a=e&&e.prototype instanceof te?e:te,o=Object.create(a.prototype),s=new $(r||[]);return o._invoke=function(_,m,i){var d="suspendedStart";return function(f,W){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(f==="throw")throw W;return ve()}for(i.method=f,i.arg=W;;){var de=i.delegate;if(de){var b=ce(de,i);if(b){if(b===E)continue;return b}}if(i.method==="next")i.sent=i._sent=i.arg;else if(i.method==="throw"){if(d==="suspendedStart")throw d="completed",i.arg;i.dispatchException(i.arg)}else i.method==="return"&&i.abrupt("return",i.arg);d="executing";var g=x(_,m,i);if(g.type==="normal"){if(d=i.done?"completed":"suspendedYield",g.arg===E)continue;return{value:g.arg,done:i.done}}g.type==="throw"&&(d="completed",i.method="throw",i.arg=g.arg)}}}(t,n,s),o}function x(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(r){return{type:"throw",arg:r}}}l.wrap=j;var E={};function te(){}function I(){}function U(){}var le={};p(le,C,function(){return this});var ne=Object.getPrototypeOf,H=ne&&ne(ne(V([])));H&&H!==v&&h.call(H,C)&&(le=H);var A=U.prototype=te.prototype=Object.create(le);function Ce(t){["next","throw","return"].forEach(function(e){p(t,e,function(n){return this._invoke(e,n)})})}function K(t,e){function n(a,o,s,_){var m=x(t[a],t,o);if(m.type!=="throw"){var i=m.arg,d=i.value;return d&&typeof d=="object"&&h.call(d,"__await")?e.resolve(d.__await).then(function(f){n("next",f,s,_)},function(f){n("throw",f,s,_)}):e.resolve(d).then(function(f){i.value=f,s(i)},function(f){return n("throw",f,s,_)})}_(m.arg)}var r;this._invoke=function(a,o){function s(){return new e(function(_,m){n(a,o,_,m)})}return r=r?r.then(s,s):s()}}function ce(t,e){var n=t.iterator[e.method];if(n===void 0){if(e.delegate=null,e.method==="throw"){if(t.iterator.return&&(e.method="return",e.arg=void 0,ce(t,e),e.method==="throw"))return E;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return E}var r=x(n,t.iterator,e.arg);if(r.type==="throw")return e.method="throw",e.arg=r.arg,e.delegate=null,E;var a=r.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,e.method!=="return"&&(e.method="next",e.arg=void 0),e.delegate=null,E):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,E)}function B(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function $(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(B,this),this.reset(!0)}function V(t){if(t){var e=t[C];if(e)return e.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length)){var n=-1,r=function a(){for(;++n<t.length;)if(h.call(t,n))return a.value=t[n],a.done=!1,a;return a.value=void 0,a.done=!0,a};return r.next=r}}return{next:ve}}function ve(){return{value:void 0,done:!0}}return I.prototype=U,p(A,"constructor",U),p(U,"constructor",I),I.displayName=p(U,pe,"GeneratorFunction"),l.isGeneratorFunction=function(t){var e=typeof t=="function"&&t.constructor;return!!e&&(e===I||(e.displayName||e.name)==="GeneratorFunction")},l.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,U):(t.__proto__=U,p(t,pe,"GeneratorFunction")),t.prototype=Object.create(A),t},l.awrap=function(t){return{__await:t}},Ce(K.prototype),p(K.prototype,Me,function(){return this}),l.AsyncIterator=K,l.async=function(t,e,n,r,a){a===void 0&&(a=Promise);var o=new K(j(t,e,n,r),a);return l.isGeneratorFunction(e)?o:o.next().then(function(s){return s.done?s.value:o.next()})},Ce(A),p(A,pe,"Generator"),p(A,C,function(){return this}),p(A,"toString",function(){return"[object Generator]"}),l.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function r(){for(;e.length;){var a=e.pop();if(a in t)return r.value=a,r.done=!1,r}return r.done=!0,r}},l.values=V,$.prototype={constructor:$,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(F),!e)for(var n in this)n.charAt(0)==="t"&&h.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if(e.type==="throw")throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(i,d){return s.type="throw",s.arg=e,n.next=i,d&&(n.method="next",n.arg=void 0),!!d}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if(o.tryLoc==="root")return r("end");if(o.tryLoc<=this.prev){var _=h.call(o,"catchLoc"),m=h.call(o,"finallyLoc");if(_&&m){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(_){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!m)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,n){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&h.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&(e==="break"||e==="continue")&&o.tryLoc<=n&&n<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=n,o?(this.method="next",this.next=o.finallyLoc,E):this.complete(s)},complete:function(e,n){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&n&&(this.next=n),E},finish:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),F(r),E}},catch:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===e){var a=r.completion;if(a.type==="throw"){var o=a.arg;F(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:V(e),resultName:n,nextLoc:r},this.method==="next"&&(this.arg=void 0),E}},l}var Ue=c.a.createElement(We.a,{style:{fontSize:24},spin:!0});function ge(l){return l.replace(/\\u([\dA-Za-z]{4})/g,function(v,h){return String.fromCharCode(parseInt("0x"+h))})}function ie(l){l||(l=window.location.search);var v=l.substr(1),h={};return v.split("&").forEach(function(N){var C=N.split("=");h[C[0]]=decodeURIComponent(C[1])}),h}var Te={loading:!0,isLarge:!1,showClipBoardBox:!1,transferContent:"",mes:"\u5B9E\u9A8C\u73AF\u5883\u51C6\u5907\u4E2D"},S;(function(l){l[l.SET_LOADING=0]="SET_LOADING",l[l.SET_IS_LARGE=1]="SET_IS_LARGE",l[l.SET_MES=2]="SET_MES",l[l.SET_STATE=3]="SET_STATE",l[l.SHOW_CLIPBOARD_BOX=4]="SHOW_CLIPBOARD_BOX",l[l.SET_TRANSFER_CONTENT=5]="SET_TRANSFER_CONTENT"})(S||(S={}));function He(l,v){switch(v.type){case S.SET_LOADING:return Object(O.a)(Object(O.a)({},l),{},{loading:v.payload});case S.SET_IS_LARGE:return Object(O.a)(Object(O.a)({},l),{},{isLarge:v.payload});case S.SET_MES:return Object(O.a)(Object(O.a)({},l),{},{mes:v.payload});case S.SET_STATE:return Object(O.a)(Object(O.a)({},l),v.payload);case S.SET_TRANSFER_CONTENT:return Object(O.a)(Object(O.a)({},l),{},{transferContent:v.payload});case S.SHOW_CLIPBOARD_BOX:return Object(O.a)(Object(O.a)({},l),{},{showClipBoardBox:v.payload});default:throw new Error}}var Ke=function(l){var v=l.vnc_url,h=l.window_vnc_url,N=l.taskId,C=Object(R.useRef)(),Me=Object(R.useRef)(),pe=Object(R.useReducer)(He,Te),p=Object(re.a)(pe,2),j=p[0],x=p[1],E=Object(R.useState)(0),te=Object(re.a)(E,2),I=te[0],U=te[1],le=j.mes,ne=j.loading,H=j.showClipBoardBox,A=j.isLarge,Ce=j.transferContent,K=Object(R.useState)(0),ce=Object(re.a)(K,2),B=ce[0],F=ce[1],$,V=Object(R.useRef)(),ve=Object(L.m)();function t(){x({type:S.SHOW_CLIPBOARD_BOX,payload:!1})}function e(){x({type:S.SET_IS_LARGE,payload:!A})}function n(s){var _;return C.current&&(_=new Se.default(function(m){var i=Object(oe.a)(m),d;try{for(i.s();!(d=i.n()).done;){var f=d.value;(f.target.offsetHeight>0||f.target.offsetWidth>0)&&s._eventHandlers.windowResize()}}catch(W){i.e(W)}finally{i.f()}}),_.observe(C.current)),_}var r=function(){var s=Object(z.a)(se().mark(function _(){var m;return se().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,Object(be.lb)(Object(O.a)({},ve));case 2:if(m=d.sent,!((m==null?void 0:m.status)===-3)){d.next=5;break}return d.abrupt("return",new Promise(function(){var f=Object(z.a)(se().mark(function W(de,b){return se().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:Oe.a.confirm({content:"\u68C0\u6D4B\u5230\u60A8\u5DF2\u7ECF\u5F00\u542F\u4E86\u5176\u4ED6windows\u73AF\u5883\uFF0C\u8BF7\u5148\u5173\u95ED\u73AF\u5883\u540E\uFF0C\u518D\u8FDE\u63A5",okText:"\u7ACB\u5373\u5173\u95ED",cancelText:"\u7A0D\u540E\u5173\u95ED",onOk:function(){var y=Object(z.a)(se().mark(function D(){return se().wrap(function(fe){for(;;)switch(fe.prev=fe.next){case 0:return clearTimeout($),F(0),r(),fe.abrupt("return");case 4:case"end":return fe.stop()}},D)}));function T(){return y.apply(this,arguments)}return T}()});case 1:case"end":return w.stop()}},W)}));return function(W,de){return f.apply(this,arguments)}}()));case 5:if(!((m==null?void 0:m.status)===-1)){d.next=7;break}throw new String(m==null?void 0:m.message);case 7:return M.a.publish("update-windows-time",m==null?void 0:m.data),d.abrupt("return",m);case 9:case"end":return d.stop()}},_)}));return function(){return s.apply(this,arguments)}}();Object(R.useEffect)(function(){return V.current=setTimeout(function(){Oe.a.confirm({title:c.a.createElement(c.a.Fragment,null,"\u5B9E\u9A8C\u73AF\u5883\u5EF6\u65F6\u63D0\u9192"),content:"\u5F53\u524D\u5B9E\u9A8C\u73AF\u5883\u5C06\u4E8E 5 \u5206\u949F\u540E\u5173\u95ED\uFF0C\u9700\u8981\u5EF6\u957F\u4F7F\u7528\u65F6\u95F4\u5417\uFF1F",okText:"\u7ACB\u5373\u5EF6\u957F",cancelText:"\u4E0D\u9700\u8981",onOk:function(){M.a.publish("delayed-time",1),U(I+1)}})},1e3*60*60),function(){clearTimeout(V.current)}},[]),Object(R.useEffect)(function(){var s,_;function m(b){h&&(k.b.warn("\u7531\u4E8E\u957F\u65F6\u95F4\u672A\u64CD\u4F5C\uFF0C\u8FDE\u63A5\u5931\u6548\uFF0C\u6B63\u5728\u91CD\u65B0\u8FDE\u63A5Windows VNC\u670D\u52A1"),x({type:S.SET_LOADING,payload:!0}),U(I+1))}function i(){clearTimeout($),F(100),setTimeout(function(){x({type:S.SET_LOADING,payload:!1})},1300),M.a.subscribe("send-ctrl-alt-delete",function(){var b;(b=s)===null||b===void 0||b.sendCtrlAltDel()})}function d(b){var g=ge(b.detail.text);x({type:S.SET_TRANSFER_CONTENT,payload:g})}if((h||v)&&C.current){new Promise(Object(z.a)(se().mark(function b(){var g,w,y,T,D,J,fe,xe,Ae,Ge;return se().wrap(function(Ie){for(;;)switch(Ie.prev=Ie.next){case 0:return g=ie(),w="",Ie.next=4,r();case 4:T=Ie.sent,h?(y="Edu123",w=decodeURIComponent(T==null||((D=T.data)===null||D===void 0)?void 0:D.vnc_url)):(fe=new URL(T==null||((J=T.data)===null||J===void 0)?void 0:J.vnc_url),xe=fe.protocol,Ae=fe.searchParams,Ge=fe.host,y=Ae.get("password"),w="".concat(xe==="https:"?"wss":"ws","://").concat(Ge,"/").concat(g.path||"websockify")),s=new q.a(C.current,w,{credentials:{password:y},wsProtocols:["binary"]}),_=n(s),s.viewOnly=g.view_only||!1,h?s.scaleViewport=!0:s.scaleViewport=g.scale||!1,s.scaleViewport=g.scale||!0,s.resizeSession=!0,Me.current=s,s.addEventListener("disconnect",m),s.addEventListener("connect",i),s.addEventListener("clipboard",d);case 16:case"end":return Ie.stop()}},b)})));var f=M.a.subscribe("vnc-reseting",function(){x({type:S.SET_STATE,payload:{loading:!0,mes:"\u5B9E\u9A8C\u73AF\u5883\u91CD\u7F6E\u4E2D"}})}),W=M.a.subscribe("vnc-enlarge",function(){x({type:S.SET_IS_LARGE,payload:!0})}),de=M.a.subscribe("show-clipboard-box",function(){x({type:S.SHOW_CLIPBOARD_BOX,payload:!0})});return F(0),function(){var b,g,w,y;(b=s)===null||b===void 0||b.removeEventListener("disconnect",m),(g=s)===null||g===void 0||g.removeEventListener("connect",i),(w=s)===null||w===void 0||w.removeEventListener("clipboard",d),f(),W(),de(),(y=_)===null||y===void 0||y.unobserve(C.current)}}},[v,h,I]);function a(s){var _;(_=Me.current)===null||_===void 0||_.clipboardPasteFrom(s),x({type:S.SET_TRANSFER_CONTENT,payload:s}),k.b.success("\u4FDD\u5B58\u6210\u529F\uFF01\u4F60\u53EF\u4EE5\u5728\u5B9E\u9A8C\u73AF\u5883\u4E2D\u7C98\u8D34\u8BE5\u5185\u5BB9"),t()}Object(R.useEffect)(function(){B==0&&o()},[B]);var o=function s(){B>99?B=99:(B=B+1,$=setTimeout(function(){s()},1500)),B<100&&F(B)};return c.a.createElement(R.Fragment,null,c.a.createElement("div",{style:{backgroundColor:"#000"},className:"".concat(h?"vnc-panel-wrapper-windows":"vnc-panel-wrapper"," ").concat(A?"full-screen":"")},c.a.createElement("a",{className:"btn-vnc-resize",onClick:e},c.a.createElement("i",{className:"iconfont ".concat(A?"icon-tuichuquanping1":"icon-quanping1")})),ne?c.a.createElement(Pe.a,{className:ee.a.spin,message:le,style:{color:"#4CACFF"}},c.a.createElement("div",{className:"tc",style:{width:500,margin:"0 auto",color:"#FFF"}},c.a.createElement(Q.a,{percent:B,format:function(_){return c.a.createElement("span",{className:"c-white"},_,"%")}}))):null,c.a.createElement("div",{ref:C,className:"vnc-panel ".concat(ne?"hide":"animated fadeIn")})),c.a.createElement(Z.a,null))},$e=u("m3rI");function ue(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ue=function(){return l};var l={},v=Object.prototype,h=v.hasOwnProperty,N=typeof Symbol=="function"?Symbol:{},C=N.iterator||"@@iterator",Me=N.asyncIterator||"@@asyncIterator",pe=N.toStringTag||"@@toStringTag";function p(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{p({},"")}catch(t){p=function(n,r,a){return n[r]=a}}function j(t,e,n,r){var a=e&&e.prototype instanceof te?e:te,o=Object.create(a.prototype),s=new $(r||[]);return o._invoke=function(_,m,i){var d="suspendedStart";return function(f,W){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(f==="throw")throw W;return ve()}for(i.method=f,i.arg=W;;){var de=i.delegate;if(de){var b=ce(de,i);if(b){if(b===E)continue;return b}}if(i.method==="next")i.sent=i._sent=i.arg;else if(i.method==="throw"){if(d==="suspendedStart")throw d="completed",i.arg;i.dispatchException(i.arg)}else i.method==="return"&&i.abrupt("return",i.arg);d="executing";var g=x(_,m,i);if(g.type==="normal"){if(d=i.done?"completed":"suspendedYield",g.arg===E)continue;return{value:g.arg,done:i.done}}g.type==="throw"&&(d="completed",i.method="throw",i.arg=g.arg)}}}(t,n,s),o}function x(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(r){return{type:"throw",arg:r}}}l.wrap=j;var E={};function te(){}function I(){}function U(){}var le={};p(le,C,function(){return this});var ne=Object.getPrototypeOf,H=ne&&ne(ne(V([])));H&&H!==v&&h.call(H,C)&&(le=H);var A=U.prototype=te.prototype=Object.create(le);function Ce(t){["next","throw","return"].forEach(function(e){p(t,e,function(n){return this._invoke(e,n)})})}function K(t,e){function n(a,o,s,_){var m=x(t[a],t,o);if(m.type!=="throw"){var i=m.arg,d=i.value;return d&&typeof d=="object"&&h.call(d,"__await")?e.resolve(d.__await).then(function(f){n("next",f,s,_)},function(f){n("throw",f,s,_)}):e.resolve(d).then(function(f){i.value=f,s(i)},function(f){return n("throw",f,s,_)})}_(m.arg)}var r;this._invoke=function(a,o){function s(){return new e(function(_,m){n(a,o,_,m)})}return r=r?r.then(s,s):s()}}function ce(t,e){var n=t.iterator[e.method];if(n===void 0){if(e.delegate=null,e.method==="throw"){if(t.iterator.return&&(e.method="return",e.arg=void 0,ce(t,e),e.method==="throw"))return E;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return E}var r=x(n,t.iterator,e.arg);if(r.type==="throw")return e.method="throw",e.arg=r.arg,e.delegate=null,E;var a=r.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,e.method!=="return"&&(e.method="next",e.arg=void 0),e.delegate=null,E):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,E)}function B(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function $(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(B,this),this.reset(!0)}function V(t){if(t){var e=t[C];if(e)return e.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length)){var n=-1,r=function a(){for(;++n<t.length;)if(h.call(t,n))return a.value=t[n],a.done=!1,a;return a.value=void 0,a.done=!0,a};return r.next=r}}return{next:ve}}function ve(){return{value:void 0,done:!0}}return I.prototype=U,p(A,"constructor",U),p(U,"constructor",I),I.displayName=p(U,pe,"GeneratorFunction"),l.isGeneratorFunction=function(t){var e=typeof t=="function"&&t.constructor;return!!e&&(e===I||(e.displayName||e.name)==="GeneratorFunction")},l.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,U):(t.__proto__=U,p(t,pe,"GeneratorFunction")),t.prototype=Object.create(A),t},l.awrap=function(t){return{__await:t}},Ce(K.prototype),p(K.prototype,Me,function(){return this}),l.AsyncIterator=K,l.async=function(t,e,n,r,a){a===void 0&&(a=Promise);var o=new K(j(t,e,n,r),a);return l.isGeneratorFunction(e)?o:o.next().then(function(s){return s.done?s.value:o.next()})},Ce(A),p(A,pe,"Generator"),p(A,C,function(){return this}),p(A,"toString",function(){return"[object Generator]"}),l.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function r(){for(;e.length;){var a=e.pop();if(a in t)return r.value=a,r.done=!1,r}return r.done=!0,r}},l.values=V,$.prototype={constructor:$,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(F),!e)for(var n in this)n.charAt(0)==="t"&&h.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if(e.type==="throw")throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(i,d){return s.type="throw",s.arg=e,n.next=i,d&&(n.method="next",n.arg=void 0),!!d}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if(o.tryLoc==="root")return r("end");if(o.tryLoc<=this.prev){var _=h.call(o,"catchLoc"),m=h.call(o,"finallyLoc");if(_&&m){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(_){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!m)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,n){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&h.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&(e==="break"||e==="continue")&&o.tryLoc<=n&&n<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=n,o?(this.method="next",this.next=o.finallyLoc,E):this.complete(s)},complete:function(e,n){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&n&&(this.next=n),E},finish:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),F(r),E}},catch:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===e){var a=r.completion;if(a.type==="throw"){var o=a.arg;F(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:V(e),resultName:n,nextLoc:r},this.method==="next"&&(this.arg=void 0),E}},l}var Ve=Fe.a.Countdown,Je=function(v){var h,N,C=v.shixunsDetail,Me=v.globalSetting,pe=v.loading,p=v.dispatch,j=v.user,x=v.history,E=Object(Re.a)(v,["shixunsDetail","globalSetting","loading","dispatch","user","history"]),te=Object(R.useState)({}),I=Object(re.a)(te,2),U=I[0],le=I[1],ne=Object(R.useState)(400),H=Object(re.a)(ne,2),A=H[0],Ce=H[1],K=Object(R.useState)(!1),ce=Object(re.a)(K,2),B=ce[0],F=ce[1],$=Object(R.useState)(""),V=Object(re.a)($,2),ve=V[0],t=V[1],e=Object(R.useState)(Date.now()+1e3*60*60),n=Object(re.a)(e,2),r=n[0],a=n[1],o=E.match.params,s=E.location.query,_=Object(R.useState)(!1),m=Object(re.a)(_,2),i=m[0],d=m[1],f=C.mirrorApplies,W=Object(R.useRef)();Object(R.useEffect)(function(){return p({type:"globalSetting/headerFooterToggle",payload:!1}),b(),g(),window.addEventListener("resize",b),M.a.subscribe("delayed-time",function(){a(Date.now()+1e3*60*60)}),function(){window.removeEventListener("resize",b),clearTimeout(W.current),p({type:"globalSetting/headerFooterToggle",payload:!0})}},[]),Object(R.useEffect)(function(){U.host&&setTimeout(function(){M.a.publish("create-socket",1)},1500)},[U]),Object(R.useEffect)(function(){f.webssh&&(de(),W.current=setTimeout(function(){Oe.a.confirm({title:c.a.createElement(c.a.Fragment,null,"\u5B9E\u9A8C\u73AF\u5883\u5EF6\u65F6\u63D0\u9192"),content:"\u5F53\u524D\u5B9E\u9A8C\u73AF\u5883\u5C06\u4E8E 15 \u5206\u949F\u540E\u5173\u95ED\uFF0C\u9700\u8981\u5EF6\u957F\u4F7F\u7528\u65F6\u95F4\u5417\uFF1F",okText:"\u7ACB\u5373\u5EF6\u957F",cancelText:"\u4E0D\u9700\u8981",onOk:function(){M.a.publish("ssh-add-connect-time",{}),M.a.publish("delayed-time",1)}})},1e3*60*60)),f.id&&b()},[f]);var de=function(){var w=Object(z.a)(ue().mark(function y(){var T;return ue().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,Object(be.mb)(Object(O.a)({},o));case 2:T=J.sent,le(Object(O.a)({},T));case 4:case"end":return J.stop()}},y)}));return function(){return w.apply(this,arguments)}}(),b=function(){var y=window.innerHeight;Ce(y-(f.audit_remark?400:270))},g=function(){var w=Object(z.a)(ue().mark(function y(){return ue().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:p({type:"shixunsDetail/getMirrorApplies",payload:Object(O.a)({},o)});case 1:case"end":return D.stop()}},y)}));return function(){return w.apply(this,arguments)}}();return console.log(j==null?void 0:j.userInfo),c.a.createElement("section",{className:ee.a.wrp},c.a.createElement("header",{className:ee.a.header},c.a.createElement(Y.a,{align:"middle"},c.a.createElement(X.a,{flex:"1"},c.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"40",src:"".concat($e.a.IMG_SERVER,"/images/").concat(j==null||((h=j.userInfo)===null||h===void 0)?void 0:h.image_url),width:"40",style:{borderRadius:"50%"}}),c.a.createElement("span",{className:"ml10"},j==null||((N=j.userInfo)===null||N===void 0)?void 0:N.real_name)),c.a.createElement(X.a,{flex:"1"},c.a.createElement("span",{className:"mr10 font18"},f.name)),c.a.createElement(X.a,null,c.a.createElement("span",null,"\u5269\u4F59\u65F6\u957F:",c.a.createElement(Ve,{className:ee.a.cuttDown,value:r,format:"mm:ss",valueStyle:{color:"#FFF"}})),c.a.createElement("span",{className:"icon-kaiguan font20 current ml60",onClick:function(){Oe.a.confirm({title:"\u9000\u51FA\u955C\u50CF",content:"\u4F60\u786E\u5B9A\u8981\u9000\u51FA\u955C\u50CF\u5417\uFF1F",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var T;x.push("/users/".concat((T=j.userInfo)===null||T===void 0?void 0:T.login,"/experiment-img"))}})}})))),c.a.createElement("aside",{className:ee.a.container},c.a.createElement(Y.a,null,c.a.createElement(X.a,{style:{position:"relative",width:i?"0%":"40%"}},c.a.createElement("section",{className:"".concat(ee.a.info," ml40 mr40"),style:{display:i?"none":"flex"}},c.a.createElement("aside",null,c.a.createElement(Y.a,{align:"middle",style:{height:68,borderBottom:"1px solid #f1f1f1"}},c.a.createElement(X.a,{className:"font18"},"\u5B9E\u9A8C\u73AF\u5883\u8BF4\u660E ",c.a.createElement("span",{className:"font16 ml20 c-grey-999"},"\u8BF7\u6309\u6A21\u677F\u586B\u5199\u5B9E\u9A8C\u73AF\u5883\u8BF4\u660E"))),c.a.createElement("aside",{className:"mt30 flex1"},c.a.createElement(he.a,{height:A,defaultValue:f.description||"",onChange:function(y){return t(y)}}),f.audit_remark&&c.a.createElement("aside",{className:"mt10 font16 c-grey-999 mb10"},"\u5BA1\u6838\u4E0D\u901A\u8FC7\u539F\u56E0\uFF1A",c.a.createElement("span",{className:"c-red"},f.audit_remark))),c.a.createElement("aside",{className:"mb20"},c.a.createElement(Y.a,{justify:"center",gutter:[20,20],className:ee.a.buttons},c.a.createElement(X.a,null,c.a.createElement(G.a,{type:"primary",size:"large",loading:B,onClick:Object(z.a)(ue().mark(function w(){var y;return ue().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return F(!0),Oe.a.info({title:"\u4FDD\u5B58\u955C\u50CF",centered:!0,content:"\u4E34\u65F6\u955C\u50CF\u7CFB\u7EDF\u9ED8\u8BA4\u53EA\u4FDD\u5B5830\u5929\uFF0C\u8FC7\u671F\u5C06\u4F1A\u81EA\u52A8\u6E05\u7406\u3002\u8BF7\u5C3D\u5FEB\u7533\u8BF7\u53D1\u5E03\u3002",okText:"\u6211\u77E5\u9053\u4E86",onOk:function(){}}),D.next=4,Object(be.ob)(Object(O.a)(Object(O.a)({},o),{},{description:ve}));case 4:y=D.sent,(y==null?void 0:y.status)===0&&k.b.success("\u4FDD\u5B58\u6210\u529F"),F(!1);case 7:case"end":return D.stop()}},w)}))},"\u4FDD\u5B58")),c.a.createElement(X.a,null,c.a.createElement(G.a,{type:"primary",ghost:!0,size:"large",onClick:Object(z.a)(ue().mark(function w(){return ue().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:Oe.a.confirm({title:"\u7533\u8BF7\u53D1\u5E03",centered:!0,content:"\u4F60\u786E\u5B9A\u8981\u7533\u8BF7\u53D1\u5E03\u8BE5\u955C\u50CF\uFF1F",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var D=Object(z.a)(ue().mark(function fe(){var xe,Ae;return ue().wrap(function(De){for(;;)switch(De.prev=De.next){case 0:return De.next=2,Object(be.nb)(Object(O.a)(Object(O.a)({},o),{},{description:ve}));case 2:xe=De.sent,(xe==null?void 0:xe.status)===0&&(x.push("/users/".concat((Ae=j.userInfo)===null||Ae===void 0?void 0:Ae.login,"/experiment-img")),k.b.success("\u7533\u8BF7\u53D1\u5E03\u6210\u529F"));case 4:case"end":return De.stop()}},fe)}));function J(){return D.apply(this,arguments)}return J}()});case 1:case"end":return T.stop()}},w)}))},"\u7533\u8BF7\u53D1\u5E03")))))),c.a.createElement("div",{className:i?ee.a.elseShrink:ee.a.shrink,onClick:function(){return d(!i)}},c.a.createElement("i",{className:"iconfont icon-cela"}))),c.a.createElement(X.a,{style:{background:"#000",width:i?"100%":"60%"}},c.a.createElement("div",null,c.a.createElement("aside",{className:ee.a.fullBtn},c.a.createElement("span",{className:"icon-quanping"})),f.webssh&&c.a.createElement(je.a,{sshConfigData:U,sid:1}),((f==null?void 0:f.vnc)||(f==null?void 0:f.windows))&&c.a.createElement(Ke,{taskId:f.type==="windows"?"pcf9t4w6vrnz":"ijby95c82nsh",vnc_url:f.vnc,window_vnc_url:f.windows}))))))},Ye=me.default=Object(ae.a)(function(l){var v=l.shixunsDetail,h=l.loading,N=l.user,C=l.globalSetting;return{shixunsDetail:v,globalSetting:C,user:N,loading:h.models.shixunsDetail}})(Je)}}]);