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

1 line
31 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[194],{"07cG":function(e,t,n){e.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},Dqnf:function(e,t,n){"use strict";var r=n("k1fw"),a=n("tJVT"),o=n("rAM+"),i=n("q1tI"),c=n.n(i),s=n("J66h"),u=n("/POA"),l=(n("q7KB"),n("dhSg")),f=n("bdgK");function h(e,t,n){var r=n._core._renderService.dimensions.actualCellWidth||9.5,a=n._core._renderService.dimensions.actualCellHeight||18,o=Math.floor(t/a),i=Math.floor(e/r);return[i,o]}function d(e,t){var n=new f["default"]((function(t){var n,r=Object(o["a"])(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.target.offsetHeight>0||i.target.offsetWidth>0){var c=h(i.target.offsetWidth,i.target.offsetHeight,e),s=Object(a["a"])(c,2),u=s[0],f=s[1];console.log("cols, rows",u,f),e.resize(u,f),l["a"].publish("ssh-xterm-resize",{columns:u,rows:f,width:i.target.offsetWidth,height:i.target.offsetHeight})}}}catch(d){r.e(d)}finally{r.f()}}));return n.observe(t),n}var p=3e4;t["a"]=function(e){var t=e.sshConfigData,n=e.sid,o=Object(i["useState"])(null),f=Object(a["a"])(o,2),h=f[0],v=f[1],m=t.ws_url,y=t.password,g=t.port,w=Object(i["useRef"])(),b=Object(i["useRef"])(),E=Object(i["useRef"])(!1);return Object(i["useEffect"])((function(){if(w.current&&m){var e=new u["Terminal"]({fontSize:16,rendererType:"dom"});e.open(w.current),e.onData((function(e){b.current&&1===b.current.readyState&&(b.current.send(JSON.stringify({tp:"client",data:e})),l["a"].publish("on-operating-ssh"))})),e.write("Connecting..."),v(e);var t=d(e,w.current);return function(){e.dispose(),t.unobserve(w.current)}}}),[m,w.current]),Object(i["useEffect"])((function(){if(h&&m){var e=function(){var e=new WebSocket(m);b.current=e,e.onopen=function(){var n=h.element.parentElement;if(n){var a=n.offsetWidth,o=n.offsetHeight;console.log("init",{tp:"init",data:Object(r["a"])(Object(r["a"])({},t),{},{secret:y,width:a,height:o,rows:h.rows,columns:h.cols})}),e.send(JSON.stringify({tp:"init",data:Object(r["a"])(Object(r["a"])({},t),{},{secret:y,width:a,height:o,rows:h.rows,columns:h.cols})}))}h.focus()},e.onerror=function(t){console.log("------in socket error----",t,e,m)},e.onmessage=function(e){E.current||(h.write("\r"),setTimeout((function(){}),1e3)),E.current=!0,console.log("event:",e);var t=s["Base64"].decode(e.data.toString()),n=h._core._renderService.dimensions.actualCellWidth||9.5;console.log("data:",t,n,h),h.write(t)},e.onclose=function(e){a&&clearInterval(a),h.write("\r\nconnection closed")}},a=setInterval((function(){b.current&&b.current.send(JSON.stringify({tp:"h"}))}),p),o=l["a"].subscribe("create-socket",(function(t){n==t&&(b.current&&1===b.current.readyState?h.focus():e(),h.focus())})),i=l["a"].subscribe("close-socket",(function(e){n===e&&(b.current&&(b.current.close(),E.current=!1,h.clear()),b.current=null)})),c=l["a"].subscribe("ssh-xterm-resize",(function(e){b.current&&1===b.current.readyState&&b.current.send(JSON.stringify({tp:"resize",data:Object(r["a"])({},e)}))})),u=l["a"].subscribe("ssh-add-connect-time",(function(){b.current&&1===b.current.readyState&&b.current.send(JSON.stringify({tp:"overtime"}))}));return function(){i(),o(),c(),u(),b.current&&(b.current.close(),E.current=!1)}}}),[h,m,g]),c.a.createElement("div",{ref:w,className:"xterm-panel"},m?null:c.a.createElement("p",{style:{color:"#fff"}},"\u6b63\u5728\u8fde\u63a5\u547d\u4ee4\u884c\u670d\u52a1..."))}},IxHN:function(e,t,n){"use strict";var r=n("q1tI"),a=n.n(r),o=n("07cG"),i=n.n(o);t["a"]=function(e){var t=e.message,n=e.className,r=e.children,o=e.style,c=void 0===o?{}:o;return a.a.createElement("div",{className:"".concat(i.a.idsRingWrapper," ").concat(n)},a.a.createElement("div",{className:i.a.ldsRing},a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null)),t?a.a.createElement("p",{style:c},t):null,r)}},Lmeb:function(e,t,n){},"VaU+":function(e,t,n){e.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(e,t,n){"use strict";n.r(t);n("+L6B");var r=n("2/Rp"),a=(n("miYZ"),n("tsqr")),o=(n("14J3"),n("BMrR")),i=(n("jCWc"),n("kPKH")),c=n("k1fw"),s=n("9og8"),u=(n("2qtc"),n("kLXV")),l=n("tJVT"),f=n("PpiC"),h=(n("aHsQ"),n("sGsY")),d=n("q1tI"),p=n.n(d),v=n("9kvl"),m=(n("Lmeb"),n("Ot1p")),y=n("Dqnf"),g=n("dhSg"),w=(n("MXD1"),n("CFYs")),b=n("rAM+"),E=n("IxHN"),O=n("bdgK"),_=n("M8RZ"),j=n("Ty5D"),x=n("1dTM"),S=n.n(x),L=n("HBuW"),T=n("VaU+"),N=n.n(T),k=n("ye1Q");function I(){I=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var o=t&&t.prototype instanceof y?t:y,i=Object.create(o.prototype),c=new k(r||[]);return a(i,"_invoke",{value:S(e,n,c)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",m={};function y(){}function g(){}function w(){}var b={};u(b,i,(function(){return this}));var E=Object.getPrototypeOf,O=E&&E(E(R([])));O&&O!==n&&r.call(O,i)&&(b=O);var _=w.prototype=y.prototype=Object.create(b);function j(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function n(a,o,i,c){var s=f(e[a],e,o);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(l).then((function(e){u.value=e,i(u)}),(function(e){return n("throw",e,i,c)}))}c(s.arg)}var o;a(this,"_invoke",{value:function(e,r){function a(){return new t((function(t,a){n(e,r,t,a)}))}return o=o?o.then(a,a):a()}})}function S(t,n,r){var a=h;return function(o,i){if(a===p)throw new Error("Generator is already running");if(a===v){if("throw"===o)throw i;return{value:e,done:!0}}for(r.method=o,r.arg=i;;){var c=r.delegate;if(c){var s=L(c,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===h)throw a=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=p;var u=f(t,n,r);if("normal"===u.type){if(a=r.done?v:d,u.arg===m)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(a=v,r.method="throw",r.arg=u.arg)}}}function L(t,n){var r=n.method,a=t.iterator[r];if(a===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,L(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var o=f(a,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,m;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,m):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,o=function n(){for(;++a<t.length;)if(r.call(t,a))return n.value=t[a],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(typeof t+" is not iterable")}return g.prototype=w,a(_,"constructor",{value:w,configurable:!0}),a(w,"constructor",{value:g,configurable:!0}),g.displayName=u(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,u(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},j(x.prototype),u(x.prototype,c,(function(){return this})),t.AsyncIterator=x,t.async=function(e,n,r,a,o){void 0===o&&(o=Promise);var i=new x(l(e,n,r,a),o);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},j(_),u(_,s,"Generator"),u(_,i,(function(){return this})),u(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=R,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(N),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function a(r,a){return c.type="throw",c.arg=t,n.next=r,a&&(n.method="next",n.arg=e),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),N(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;N(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:R(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}k["a"];function R(e){return e.replace(/\\u([\dA-Za-z]{4})/g,(function(e,t){return String.fromCharCode(parseInt("0x"+t))}))}function C(e){e||(e=window.location.search);var t=e.substr(1),n={};return t.split("&").forEach((function(e){var t=e.split("=");n[t[0]]=decodeURIComponent(t[1])})),n}var A={loading:!0,isLarge:!1,showClipBoardBox:!1,transferContent:"",mes:"\u5b9e\u9a8c\u73af\u5883\u51c6\u5907\u4e2d"},F=function(e){return e[e["SET_LOADING"]=0]="SET_LOADING",e[e["SET_IS_LARGE"]=1]="SET_IS_LARGE",e[e["SET_MES"]=2]="SET_MES",e[e["SET_STATE"]=3]="SET_STATE",e[e["SHOW_CLIPBOARD_BOX"]=4]="SHOW_CLIPBOARD_BOX",e[e["SET_TRANSFER_CONTENT"]=5]="SET_TRANSFER_CONTENT",e}(F||{});function G(e,t){switch(t.type){case F.SET_LOADING:return Object(c["a"])(Object(c["a"])({},e),{},{loading:t.payload});case F.SET_IS_LARGE:return Object(c["a"])(Object(c["a"])({},e),{},{isLarge:t.payload});case F.SET_MES:return Object(c["a"])(Object(c["a"])({},e),{},{mes:t.payload});case F.SET_STATE:return Object(c["a"])(Object(c["a"])({},e),t.payload);case F.SET_TRANSFER_CONTENT:return Object(c["a"])(Object(c["a"])({},e),{},{transferContent:t.payload});case F.SHOW_CLIPBOARD_BOX:return Object(c["a"])(Object(c["a"])({},e),{},{showClipBoardBox:t.payload});default:throw new Error}}var D=function(e){var t,n=e.vnc_url,r=e.window_vnc_url,o=(e.taskId,Object(d["useRef"])()),i=Object(d["useRef"])(),f=Object(d["useReducer"])(G,A),h=Object(l["a"])(f,2),v=h[0],m=h[1],y=Object(d["useState"])(0),x=Object(l["a"])(y,2),T=x[0],k=x[1],D=v.mes,P=v.loading,B=(v.showClipBoardBox,v.isLarge),W=(v.transferContent,Object(d["useState"])(0)),H=Object(l["a"])(W,2),z=H[0],J=H[1],M=Object(d["useRef"])(),q=Object(j["m"])();function V(){m({type:F.SET_IS_LARGE,payload:!B})}function Y(e){var t;return o.current&&(t=new O["default"]((function(t){var n,r=Object(b["a"])(t);try{for(r.s();!(n=r.n()).done;){var a=n.value;(a.target.offsetHeight>0||a.target.offsetWidth>0)&&e._eventHandlers.windowResize()}}catch(o){r.e(o)}finally{r.f()}})),t.observe(o.current)),t}var X=function(){var e=Object(s["a"])(I().mark((function e(){var n;return I().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(L["mb"])(Object(c["a"])({},q));case 2:if(n=e.sent,-3!==(null===n||void 0===n?void 0:n.status)){e.next=5;break}return e.abrupt("return",new Promise(function(){var e=Object(s["a"])(I().mark((function e(n,r){return I().wrap((function(e){while(1)switch(e.prev=e.next){case 0:u["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 e=Object(s["a"])(I().mark((function e(){return I().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return clearTimeout(t),J(0),X(),e.abrupt("return");case 4:case"end":return e.stop()}}),e)})));function n(){return e.apply(this,arguments)}return n}()});case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()));case 5:if(-1!==(null===n||void 0===n?void 0:n.status)){e.next=7;break}throw new String(null===n||void 0===n?void 0:n.message);case 7:return g["a"].publish("update-windows-time",null===n||void 0===n?void 0:n.data),e.abrupt("return",n);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(d["useEffect"])((function(){return M.current=setTimeout((function(){u["a"].confirm({title:p.a.createElement(p.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(){g["a"].publish("delayed-time",1),k(T+1)}})}),36e5),function(){clearTimeout(M.current)}}),[]),Object(d["useEffect"])((function(){var e,c;function u(e){r&&(a["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"),m({type:F.SET_LOADING,payload:!0}),k(T+1))}function l(){clearTimeout(t),J(100),setTimeout((function(){m({type:F.SET_LOADING,payload:!1})}),1300),g["a"].subscribe("send-ctrl-alt-delete",(function(){var t;null===(t=e)||void 0===t||t.sendCtrlAltDel()}))}function f(e){var t=R(e.detail.text);m({type:F.SET_TRANSFER_CONTENT,payload:t})}if((r||n)&&o.current){new Promise(Object(s["a"])(I().mark((function t(){var n,a,s,h,d,p,v,m,y,g;return I().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=C(),a="",t.next=4,X();case 4:h=t.sent,r?(s="Edu123",a=decodeURIComponent(null===h||void 0===h||null===(d=h.data)||void 0===d?void 0:d.vnc_url)):(v=new URL(null===h||void 0===h||null===(p=h.data)||void 0===p?void 0:p.vnc_url),m=v.protocol,y=v.searchParams,g=v.host,s=y.get("password"),a="".concat("https:"===m?"wss":"ws","://").concat(g,"/").concat(n.path||"websockify")),e=new S.a(o.current,a,{credentials:{password:s},wsProtocols:["binary"]}),c=Y(e),e.viewOnly=n.view_only||!1,e.scaleViewport=!!r||(n.scale||!1),e.scaleViewport=n.scale||!0,e.resizeSession=!0,i.current=e,e.addEventListener("disconnect",u),e.addEventListener("connect",l),e.addEventListener("clipboard",f);case 16:case"end":return t.stop()}}),t)}))));var h=g["a"].subscribe("vnc-reseting",(function(){m({type:F.SET_STATE,payload:{loading:!0,mes:"\u5b9e\u9a8c\u73af\u5883\u91cd\u7f6e\u4e2d"}})})),d=g["a"].subscribe("vnc-enlarge",(function(){m({type:F.SET_IS_LARGE,payload:!0})})),p=g["a"].subscribe("show-clipboard-box",(function(){m({type:F.SHOW_CLIPBOARD_BOX,payload:!0})}));return J(0),function(){var t,n,r,a;null===(t=e)||void 0===t||t.removeEventListener("disconnect",u),null===(n=e)||void 0===n||n.removeEventListener("connect",l),null===(r=e)||void 0===r||r.removeEventListener("clipboard",f),h(),d(),p(),null===(a=c)||void 0===a||a.unobserve(o.current)}}}),[n,r,T]),Object(d["useEffect"])((function(){0==z&&U()}),[z]);var U=function e(){z>99?z=99:(z+=1,t=setTimeout((function(){e()}),1500)),z<100&&J(z)};return p.a.createElement(d["Fragment"],null,p.a.createElement("div",{style:{backgroundColor:"#000"},className:"".concat(r?"vnc-panel-wrapper-windows":"vnc-panel-wrapper"," ").concat(B?"full-screen":"")},p.a.createElement("a",{className:"btn-vnc-resize",onClick:V},p.a.createElement("i",{className:"iconfont ".concat(B?"icon-tuichuquanping1":"icon-quanping1")})),P?p.a.createElement(E["a"],{className:N.a.spin,message:D,style:{color:"#4CACFF"}},p.a.createElement("div",{className:"tc",style:{width:500,margin:"0 auto",color:"#FFF"}},p.a.createElement(w["a"],{percent:z,format:function(e){return p.a.createElement("span",{className:"c-white"},e,"%")}}))):null,p.a.createElement("div",{ref:o,className:"vnc-panel ".concat(P?"hide":"animated fadeIn")})),p.a.createElement(_["a"],null))},P=n("m3rI");function B(){B=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var o=t&&t.prototype instanceof y?t:y,i=Object.create(o.prototype),c=new k(r||[]);return a(i,"_invoke",{value:S(e,n,c)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",m={};function y(){}function g(){}function w(){}var b={};u(b,i,(function(){return this}));var E=Object.getPrototypeOf,O=E&&E(E(I([])));O&&O!==n&&r.call(O,i)&&(b=O);var _=w.prototype=y.prototype=Object.create(b);function j(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function n(a,o,i,c){var s=f(e[a],e,o);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(l).then((function(e){u.value=e,i(u)}),(function(e){return n("throw",e,i,c)}))}c(s.arg)}var o;a(this,"_invoke",{value:function(e,r){function a(){return new t((function(t,a){n(e,r,t,a)}))}return o=o?o.then(a,a):a()}})}function S(t,n,r){var a=h;return function(o,i){if(a===p)throw new Error("Generator is already running");if(a===v){if("throw"===o)throw i;return{value:e,done:!0}}for(r.method=o,r.arg=i;;){var c=r.delegate;if(c){var s=L(c,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===h)throw a=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=p;var u=f(t,n,r);if("normal"===u.type){if(a=r.done?v:d,u.arg===m)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(a=v,r.method="throw",r.arg=u.arg)}}}function L(t,n){var r=n.method,a=t.iterator[r];if(a===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,L(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var o=f(a,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,m;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,m):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function I(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,o=function n(){for(;++a<t.length;)if(r.call(t,a))return n.value=t[a],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(typeof t+" is not iterable")}return g.prototype=w,a(_,"constructor",{value:w,configurable:!0}),a(w,"constructor",{value:g,configurable:!0}),g.displayName=u(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,u(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},j(x.prototype),u(x.prototype,c,(function(){return this})),t.AsyncIterator=x,t.async=function(e,n,r,a,o){void 0===o&&(o=Promise);var i=new x(l(e,n,r,a),o);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},j(_),u(_,s,"Generator"),u(_,i,(function(){return this})),u(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=I,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(N),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function a(r,a){return c.type="throw",c.arg=t,n.next=r,a&&(n.method="next",n.arg=e),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),N(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;N(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:I(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}var W=h["a"].Countdown,H=function(e){var t,n,h=e.shixunsDetail,v=(e.globalSetting,e.loading,e.dispatch),w=e.user,b=e.history,E=Object(f["a"])(e,["shixunsDetail","globalSetting","loading","dispatch","user","history"]),O=Object(d["useState"])({}),_=Object(l["a"])(O,2),j=_[0],x=_[1],S=Object(d["useState"])(400),T=Object(l["a"])(S,2),k=T[0],I=T[1],R=Object(d["useState"])(!1),C=Object(l["a"])(R,2),A=C[0],F=C[1],G=Object(d["useState"])(""),H=Object(l["a"])(G,2),z=H[0],J=H[1],M=Object(d["useState"])(Date.now()+36e5),q=Object(l["a"])(M,2),V=q[0],Y=q[1],X=E.match.params,U=(E.location.query,Object(d["useState"])(!1)),K=Object(l["a"])(U,2),Q=K[0],Z=K[1],$=h.mirrorApplies,ee=Object(d["useRef"])();Object(d["useEffect"])((function(){return v({type:"globalSetting/headerFooterToggle",payload:!1}),ne(),re(),window.addEventListener("resize",ne),g["a"].subscribe("delayed-time",(function(){Y(Date.now()+36e5)})),function(){window.removeEventListener("resize",ne),clearTimeout(ee.current),v({type:"globalSetting/headerFooterToggle",payload:!0})}}),[]),Object(d["useEffect"])((function(){j.host&&setTimeout((function(){g["a"].publish("create-socket",1)}),1500)}),[j]),Object(d["useEffect"])((function(){$.webssh&&(te(),ee.current=setTimeout((function(){u["a"].confirm({title:p.a.createElement(p.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(){g["a"].publish("ssh-add-connect-time",{}),g["a"].publish("delayed-time",1)}})}),36e5)),$.id&&ne()}),[$]);var te=function(){var e=Object(s["a"])(B().mark((function e(){var t;return B().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(L["nb"])(Object(c["a"])({},X));case 2:t=e.sent,x(Object(c["a"])({},t));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ne=function(){var e=window.innerHeight;I(e-($.audit_remark?400:270))},re=function(){var e=Object(s["a"])(B().mark((function e(){return B().wrap((function(e){while(1)switch(e.prev=e.next){case 0:v({type:"shixunsDetail/getMirrorApplies",payload:Object(c["a"])({},X)});case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return console.log(null===w||void 0===w?void 0:w.userInfo),p.a.createElement("section",{className:N.a.wrp},p.a.createElement("header",{className:N.a.header},p.a.createElement(o["a"],{align:"middle"},p.a.createElement(i["a"],{flex:"1"},p.a.createElement("img",{alt:"\u7528\u6237\u5934\u50cf",height:"40",src:"".concat(P["a"].IMG_SERVER,"/images/").concat(null===w||void 0===w||null===(t=w.userInfo)||void 0===t?void 0:t.image_url),width:"40",style:{borderRadius:"50%"}}),p.a.createElement("span",{className:"ml10"},null===w||void 0===w||null===(n=w.userInfo)||void 0===n?void 0:n.real_name)),p.a.createElement(i["a"],{flex:"1"},p.a.createElement("span",{className:"mr10 font18"},$.name)),p.a.createElement(i["a"],null,p.a.createElement("span",null,"\u5269\u4f59\u65f6\u957f:",p.a.createElement(W,{className:N.a.cuttDown,value:V,format:"mm:ss",valueStyle:{color:"#FFF"}})),p.a.createElement("span",{className:"icon-kaiguan font20 current ml60",onClick:function(){u["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 e;b.push("/users/".concat(null===(e=w.userInfo)||void 0===e?void 0:e.login,"/experiment-img"))}})}})))),p.a.createElement("aside",{className:N.a.container},p.a.createElement(o["a"],null,p.a.createElement(i["a"],{style:{position:"relative",width:Q?"0%":"40%"}},p.a.createElement("section",{className:"".concat(N.a.info," ml40 mr40"),style:{display:Q?"none":"flex"}},p.a.createElement("aside",null,p.a.createElement(o["a"],{align:"middle",style:{height:68,borderBottom:"1px solid #f1f1f1"}},p.a.createElement(i["a"],{className:"font18"},"\u5b9e\u9a8c\u73af\u5883\u8bf4\u660e ",p.a.createElement("span",{className:"font16 ml20 c-grey-999"},"\u8bf7\u6309\u6a21\u677f\u586b\u5199\u5b9e\u9a8c\u73af\u5883\u8bf4\u660e"))),p.a.createElement("aside",{className:"mt30 flex1"},p.a.createElement(m["a"],{height:k,defaultValue:$.description||"",onChange:function(e){return J(e)}}),$.audit_remark&&p.a.createElement("aside",{className:"mt10 font16 c-grey-999 mb10"},"\u5ba1\u6838\u4e0d\u901a\u8fc7\u539f\u56e0\uff1a",p.a.createElement("span",{className:"c-red"},$.audit_remark))),p.a.createElement("aside",{className:"mb20"},p.a.createElement(o["a"],{justify:"center",gutter:[20,20],className:N.a.buttons},p.a.createElement(i["a"],null,p.a.createElement(r["a"],{type:"primary",size:"large",loading:A,onClick:Object(s["a"])(B().mark((function e(){var t;return B().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return F(!0),u["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(){}}),e.next=4,Object(L["pb"])(Object(c["a"])(Object(c["a"])({},X),{},{description:z}));case 4:t=e.sent,0===(null===t||void 0===t?void 0:t.status)&&a["b"].success("\u4fdd\u5b58\u6210\u529f"),F(!1);case 7:case"end":return e.stop()}}),e)})))},"\u4fdd\u5b58")),p.a.createElement(i["a"],null,p.a.createElement(r["a"],{type:"primary",ghost:!0,size:"large",onClick:Object(s["a"])(B().mark((function e(){return B().wrap((function(e){while(1)switch(e.prev=e.next){case 0:u["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 e=Object(s["a"])(B().mark((function e(){var t,n;return B().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(L["ob"])(Object(c["a"])(Object(c["a"])({},X),{},{description:z}));case 2:t=e.sent,0===(null===t||void 0===t?void 0:t.status)&&(b.push("/users/".concat(null===(n=w.userInfo)||void 0===n?void 0:n.login,"/experiment-img")),a["b"].success("\u7533\u8bf7\u53d1\u5e03\u6210\u529f"));case 4:case"end":return e.stop()}}),e)})));function t(){return e.apply(this,arguments)}return t}()});case 1:case"end":return e.stop()}}),e)})))},"\u7533\u8bf7\u53d1\u5e03")))))),p.a.createElement("div",{className:Q?N.a.elseShrink:N.a.shrink,onClick:function(){return Z(!Q)}},p.a.createElement("i",{className:"iconfont icon-cela"}))),p.a.createElement(i["a"],{style:{background:"#000",width:Q?"100%":"60%"}},p.a.createElement("div",null,p.a.createElement("aside",{className:N.a.fullBtn},p.a.createElement("span",{className:"icon-quanping"})),$.webssh&&p.a.createElement(y["a"],{sshConfigData:j,sid:1}),((null===$||void 0===$?void 0:$.vnc)||(null===$||void 0===$?void 0:$.windows))&&p.a.createElement(D,{taskId:"windows"===$.type?"pcf9t4w6vrnz":"ijby95c82nsh",vnc_url:$.vnc,window_vnc_url:$.windows}))))))};t["default"]=Object(v["a"])((function(e){var t=e.shixunsDetail,n=e.loading,r=e.user,a=e.globalSetting;return{shixunsDetail:t,globalSetting:a,user:r,loading:n.models.shixunsDetail}}))(H)}}]);