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