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