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.
1 line
20 KiB
1 line
20 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[124],{"6xWC":function(e,t,n){"use strict";n.r(t);var r=n("tJVT"),o=n("q1tI"),i=n.n(o);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}function l(e,t){if(null==e)return{};var n,r,o=s(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function f(e,t){return d(e)||g(e,t)||p(e,t)||b()}function d(e){if(Array.isArray(e))return e}function g(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done);r=!0)if(n.push(a.value),t&&n.length===t)break}catch(u){o=!0,i=u}finally{try{r||null==c["return"]||c["return"]()}finally{if(o)throw i}}return n}}function p(e,t){if(e){if("string"===typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduceRight((function(e,t){return t(e)}),e)}}function j(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return t.apply(n,[].concat(o,r))}}}function w(e){return{}.toString.call(e).includes("Object")}function M(e){return!Object.keys(e).length}function S(e){return"function"===typeof e}function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function E(e,t){return w(t)||I("changeType"),Object.keys(t).some((function(t){return!k(e,t)}))&&I("changeField"),t}function C(e){S(e)||I("selectorType")}function T(e){S(e)||w(e)||I("handlerType"),w(e)&&Object.values(e).some((function(e){return!S(e)}))&&I("handlersType")}function R(e){e||I("initialIsRequired"),w(e)||I("initialType"),M(e)&&I("initialContent")}function P(e,t){throw new Error(e[t]||e["default"])}var N={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},I=j(P)(N),V={changes:E,selector:C,handler:T,initial:R};function x(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};V.initial(e),V.handler(t);var n={current:e},r=j(L)(n,t),o=j(q)(n),i=j(V.changes)(e),a=j(D)(n);function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return V.selector(e),e(n.current)}function u(e){y(r,o,i,a)(e)}return[c,u]}function D(e,t){return S(t)?t(e.current):t}function q(e,t){return e.current=O(O({},e.current),t),t}function L(e,t,n){return S(t)?t(e.current):Object.keys(n).forEach((function(n){var r;return null===(r=t[n])||void 0===r?void 0:r.call(t,e.current[n])})),n}var _={create:x},A=_,z={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}},J=z;function W(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return t.apply(n,[].concat(o,r))}}}var U=W;function F(e){return{}.toString.call(e).includes("Object")}var H=F;function B(e){return e||G("configIsRequired"),H(e)||G("configType"),e.urls?(K(),{paths:{vs:e.urls.monacoBase}}):e}function K(){console.warn($.deprecation)}function Y(e,t){throw new Error(e[t]||e["default"])}var $={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},G=U(Y)($),Q={config:B},X=Q,Z=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduceRight((function(e,t){return t(e)}),e)}},ee=Z;function te(e,t){return Object.keys(t).forEach((function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],te(e[n],t[n]))})),u(u({},e),t)}var ne=te,re={type:"cancelation",msg:"operation is manually canceled"};function oe(e){var t=!1,n=new Promise((function(n,r){e.then((function(e){return t?r(re):n(e)})),e["catch"](r)}));return n.cancel=function(){return t=!0},n}var ie=oe,ae=A.create({config:J,isInitialized:!1,resolve:null,reject:null,monaco:null}),ce=f(ae,2),ue=ce[0],se=ce[1];function le(e){var t=X.config(e),n=t.monaco,r=l(t,["monaco"]);se((function(e){return{config:ne(e.config,r),monaco:n}}))}function fe(){var e=ue((function(e){var t=e.monaco,n=e.isInitialized,r=e.resolve;return{monaco:t,isInitialized:n,resolve:r}}));if(!e.isInitialized){if(se({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),ie(me);if(window.monaco&&window.monaco.editor)return be(window.monaco),e.resolve(window.monaco),ie(me);ee(de,pe)(he)}return ie(me)}function de(e){return document.body.appendChild(e)}function ge(e){var t=document.createElement("script");return e&&(t.src=e),t}function pe(e){var t=ue((function(e){var t=e.config,n=e.reject;return{config:t,reject:n}})),n=ge("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function he(){var e=ue((function(e){var t=e.config,n=e.resolve,r=e.reject;return{config:t,resolve:n,reject:r}})),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],(function(t){be(t),e.resolve(t)}),(function(t){e.reject(t)}))}function be(e){ue().monaco||se({monaco:e})}function ve(){return ue((function(e){var t=e.monaco;return t}))}var me=new Promise((function(e,t){return se({resolve:e,reject:t})})),Oe={config:le,init:fe,__getMonacoInstance:ve},ye=Oe,je=n("k1fw"),we=n("17x9"),Me=n.n(we),Se={display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"};function ke(e){var t=e.content;return i.a.createElement("div",{style:Se},t)}var Ee=ke,Ce={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Te=Ce;function Re(e){var t=e.width,n=e.height,r=e.isEditorReady,o=e.loading,a=e._ref,c=e.className,u=e.wrapperClassName;return i.a.createElement("section",{style:Object(je["a"])(Object(je["a"])({},Te.wrapper),{},{width:t,height:n}),className:u},!r&&i.a.createElement(Ee,{content:o}),i.a.createElement("div",{ref:a,style:Object(je["a"])(Object(je["a"])({},Te.fullWidth),!r&&Te.hide),className:c}))}Re.propTypes={width:Me.a.oneOfType([Me.a.number,Me.a.string]).isRequired,height:Me.a.oneOfType([Me.a.number,Me.a.string]).isRequired,loading:Me.a.oneOfType([Me.a.element,Me.a.string]).isRequired,isEditorReady:Me.a.bool.isRequired,className:Me.a.string,wrapperClassName:Me.a.string};var Pe=Re,Ne=Object(o["memo"])(Pe),Ie=Ne;function Ve(e){Object(o["useEffect"])(e,[])}var xe=Ve;function De(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=Object(o["useRef"])(!0);Object(o["useEffect"])(r.current||!n?function(){r.current=!1}:e,t)}var qe=De;function Le(){}function _e(e,t,n,r){return Ae(e,r)||ze(e,t,n,r)}function Ae(e,t){return e.editor.getModel(Je(e,t))}function ze(e,t,n,r){return e.editor.createModel(t,n,r&&Je(e,r))}function Je(e,t){return e.Uri.parse(t)}function We(e){return void 0===e}function Ue(e){var t=e.original,n=e.modified,a=e.language,c=e.originalLanguage,u=e.modifiedLanguage,s=e.originalModelPath,l=e.modifiedModelPath,f=e.keepCurrentOriginalModel,d=e.keepCurrentModifiedModel,g=e.theme,p=e.loading,h=e.options,b=e.height,v=e.width,m=e.className,O=e.wrapperClassName,y=e.beforeMount,j=e.onMount,w=Object(o["useState"])(!1),M=Object(r["a"])(w,2),S=M[0],k=M[1],E=Object(o["useState"])(!0),C=Object(r["a"])(E,2),T=C[0],R=C[1],P=Object(o["useRef"])(null),N=Object(o["useRef"])(null),I=Object(o["useRef"])(null),V=Object(o["useRef"])(j),x=Object(o["useRef"])(y);xe((function(){var e=ye.init();return e.then((function(e){return(N.current=e)&&R(!1)}))["catch"]((function(e){return"cancelation"!==(null===e||void 0===e?void 0:e.type)&&console.error("Monaco initialization: error:",e)})),function(){return P.current?L():e.cancel()}})),qe((function(){var e=P.current.getModifiedEditor();e.getOption(N.current.editor.EditorOption.readOnly)?e.setValue(n):n!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),e.pushUndoStop())}),[n],S),qe((function(){P.current.getModel().original.setValue(t)}),[t],S),qe((function(){var e=P.current.getModel(),t=e.original,n=e.modified;N.current.editor.setModelLanguage(t,c||a),N.current.editor.setModelLanguage(n,u||a)}),[a,c,u],S),qe((function(){N.current.editor.setTheme(g)}),[g],S),qe((function(){P.current.updateOptions(h)}),[h],S);var D=Object(o["useCallback"])((function(){x.current(N.current);var e=N.current.editor.createModel(t,c||a,s&&N.current.Uri.parse(s)),r=N.current.editor.createModel(n,u||a,l&&N.current.Uri.parse(l));P.current.setModel({original:e,modified:r})}),[a,n,u,t,c,s,l]),q=Object(o["useCallback"])((function(){P.current=N.current.editor.createDiffEditor(I.current,Object(je["a"])({automaticLayout:!0},h)),D(),N.current.editor.setTheme(g),k(!0)}),[h,g,D]);function L(){var e,t,n=P.current.getModel();f||(null===(e=n.original)||void 0===e||e.dispose());d||(null===(t=n.modified)||void 0===t||t.dispose());P.current.dispose()}return Object(o["useEffect"])((function(){S&&V.current(P.current,N.current)}),[S]),Object(o["useEffect"])((function(){!T&&!S&&q()}),[T,S,q]),i.a.createElement(Ie,{width:v,height:b,isEditorReady:S,loading:p,_ref:I,className:m,wrapperClassName:O})}Ue.propTypes={original:Me.a.string,modified:Me.a.string,language:Me.a.string,originalLanguage:Me.a.string,modifiedLanguage:Me.a.string,originalModelPath:Me.a.string,modifiedModelPath:Me.a.string,keepCurrentOriginalModel:Me.a.bool,keepCurrentModifiedModel:Me.a.bool,theme:Me.a.string,loading:Me.a.oneOfType([Me.a.element,Me.a.string]),options:Me.a.object,width:Me.a.oneOfType([Me.a.number,Me.a.string]),height:Me.a.oneOfType([Me.a.number,Me.a.string]),className:Me.a.string,wrapperClassName:Me.a.string,beforeMount:Me.a.func,onMount:Me.a.func},Ue.defaultProps={theme:"light",loading:"Loading...",options:{},keepCurrentOriginalModel:!1,keepCurrentModifiedModel:!1,width:"100%",height:"100%",beforeMount:Le,onMount:Le};function Fe(e){var t=Object(o["useRef"])();return Object(o["useEffect"])((function(){t.current=e}),[e]),t.current}var He=Fe,Be=A.create({backup:null}),Ke=Object(r["a"])(Be,2),Ye=Ke[0],$e=Ke[1],Ge=new Map;function Qe(e){var t=e.defaultValue,n=e.defaultLanguage,a=e.defaultPath,c=e.value,u=e.language,s=e.path,l=e.theme,f=e.line,d=e.loading,g=e.options,p=e.overrideServices,h=e.saveViewState,b=e.keepCurrentModel,v=e.width,m=e.height,O=e.className,y=e.wrapperClassName,j=e.beforeMount,w=e.onMount,M=e.onChange,S=e.onValidate,k=Object(o["useState"])(!1),E=Object(r["a"])(k,2),C=E[0],T=E[1],R=Object(o["useState"])(!0),P=Object(r["a"])(R,2),N=P[0],I=P[1],V=Object(o["useRef"])(null),x=Object(o["useRef"])(null),D=Object(o["useRef"])(null),q=Object(o["useRef"])(w),L=Object(o["useRef"])(j),_=Object(o["useRef"])(null),A=Object(o["useRef"])(c),z=He(s);xe((function(){var e=ye.init();return e.then((function(e){return(V.current=e)&&I(!1)}))["catch"]((function(e){return"cancelation"!==(null===e||void 0===e?void 0:e.type)&&console.error("Monaco initialization: error:",e)})),function(){return x.current?W():e.cancel()}})),qe((function(){var e=_e(V.current,t||c,n||u,s);e!==x.current.getModel()&&(h&&Ge.set(z,x.current.saveViewState()),x.current.setModel(e),h&&x.current.restoreViewState(Ge.get(s)))}),[s],C),qe((function(){x.current.updateOptions(g)}),[g],C),qe((function(){x.current.getOption(V.current.editor.EditorOption.readOnly)?x.current.setValue(c):c!==x.current.getValue()&&(x.current.executeEdits("",[{range:x.current.getModel().getFullModelRange(),text:c,forceMoveMarkers:!0}]),x.current.pushUndoStop())}),[c],C),qe((function(){V.current.editor.setModelLanguage(x.current.getModel(),u)}),[u],C),qe((function(){We(f)||x.current.revealLine(f)}),[f],C),qe((function(){V.current.editor.setTheme(l)}),[l],C);var J=Object(o["useCallback"])((function(){L.current(V.current);var e=s||a,r=_e(V.current,c||t,n||u,e);x.current=V.current.editor.create(D.current,Object(je["a"])({model:r,automaticLayout:!0},g),p),h&&x.current.restoreViewState(Ge.get(e)),V.current.editor.setTheme(l),Ye().backup||$e({backup:V.current.editor.setModelMarkers}),T(!0)}),[t,n,a,c,u,s,g,p,h,l]);function W(){var e,t;(null===(e=_.current)||void 0===e||e.dispose(),b)?h&&Ge.set(s,x.current.saveViewState()):null===(t=x.current.getModel())||void 0===t||t.dispose();x.current.dispose()}return Object(o["useEffect"])((function(){C&&q.current(x.current,V.current)}),[C]),Object(o["useEffect"])((function(){!N&&!C&&J()}),[N,C,J]),A.current=c,Object(o["useEffect"])((function(){var e,t;C&&M&&(null===(e=_.current)||void 0===e||e.dispose(),_.current=null===(t=x.current)||void 0===t?void 0:t.onDidChangeModelContent((function(e){var t=x.current.getValue();A.current!==t&&M(t,e)})))}),[C,M]),Object(o["useEffect"])((function(){C&&(V.current.editor.setModelMarkers=function(e,t,n){var r;null===(r=Ye().backup)||void 0===r||r.call(V.current.editor,e,t,n),null===S||void 0===S||S(n)})}),[C,S]),i.a.createElement(Ie,{width:v,height:m,isEditorReady:C,loading:d,_ref:D,className:O,wrapperClassName:y})}Qe.propTypes={defaultValue:Me.a.string,defaultPath:Me.a.string,defaultLanguage:Me.a.string,value:Me.a.string,language:Me.a.string,path:Me.a.string,theme:Me.a.string,line:Me.a.number,loading:Me.a.oneOfType([Me.a.element,Me.a.string]),options:Me.a.object,overrideServices:Me.a.object,saveViewState:Me.a.bool,keepCurrentModel:Me.a.bool,width:Me.a.oneOfType([Me.a.number,Me.a.string]),height:Me.a.oneOfType([Me.a.number,Me.a.string]),className:Me.a.string,wrapperClassName:Me.a.string,beforeMount:Me.a.func,onMount:Me.a.func,onChange:Me.a.func,onValidate:Me.a.func},Qe.defaultProps={theme:"light",loading:"Loading...",options:{},overrideServices:{},saveViewState:!0,keepCurrentModel:!1,width:"100%",height:"100%",beforeMount:Le,onMount:Le,onValidate:Le};var Xe=Qe,Ze=Object(o["memo"])(Xe),et=Ze,tt=n("9kvl"),nt=n("Dqnf"),rt=n("dhSg");ye.config({"vs/nls":{availableLanguages:{"*":"zh-cn"}}});var ot=function(e){e.index,e.loading,e.dispatch;var t=Object(o["useState"])("// type your cod222e..."),n=Object(r["a"])(t,2),a=n[0],c=(n[1],{selectOnLineNumbers:!0}),u=function(){},s=function(){};return Object(o["useEffect"])((function(){setTimeout((function(){rt["a"].publish("create-socket",1)}),500)}),[]),i.a.createElement("div",null,i.a.createElement(nt["a"],{sshConfigData:{host:"106.75.231.63",port:"2021",ws_url:"wss://pre-webssh.educoder.net/ws",username:"root",password:"123123",game_id:4799882,webssh_url:"http://172.16.94.254:8890/bridge",secret:"Dron_123123",width:1004,height:603,rows:33,columns:104},sid:1}),i.a.createElement(et,{width:800,height:400,language:"javascript",theme:"hc-black",value:a,options:c,onChange:u,editorDidMount:s}))};t["default"]=Object(tt["a"])((function(e){var t=e.index,n=e.loading;return{index:t,loading:n.models.index}}))(ot)},Dqnf:function(e,t,n){"use strict";var r=n("k1fw"),o=n("tJVT"),i=n("rAM+"),a=n("q1tI"),c=n.n(a),u=n("J66h"),s=n("/POA"),l=(n("q7KB"),n("dhSg")),f=n("bdgK");function d(e,t,n){var r=n._core._renderService.dimensions.actualCellWidth||9.5,o=n._core._renderService.dimensions.actualCellHeight||18,i=Math.floor(t/o),a=Math.floor(e/r);return[a,i]}function g(e,t){var n=new f["default"]((function(t){var n,r=Object(i["a"])(t);try{for(r.s();!(n=r.n()).done;){var a=n.value;if(a.target.offsetHeight>0||a.target.offsetWidth>0){var c=d(a.target.offsetWidth,a.target.offsetHeight,e),u=Object(o["a"])(c,2),s=u[0],f=u[1];console.log("cols, rows",s,f),e.resize(s,f),l["a"].publish("ssh-xterm-resize",{columns:s,rows:f,width:a.target.offsetWidth,height:a.target.offsetHeight})}}}catch(g){r.e(g)}finally{r.f()}}));return n.observe(t),n}var p=3e4;t["a"]=function(e){var t=e.sshConfigData,n=e.sid,i=Object(a["useState"])(null),f=Object(o["a"])(i,2),d=f[0],h=f[1],b=t.ws_url,v=t.password,m=t.port,O=Object(a["useRef"])(),y=Object(a["useRef"])(),j=Object(a["useRef"])(!1);return Object(a["useEffect"])((function(){if(O.current&&b){var e=new s["Terminal"]({fontSize:16,rendererType:"dom"});e.open(O.current),e.onData((function(e){y.current&&1===y.current.readyState&&(y.current.send(JSON.stringify({tp:"client",data:e})),l["a"].publish("on-operating-ssh"))})),e.write("Connecting..."),h(e);var t=g(e,O.current);return function(){e.dispose(),t.unobserve(O.current)}}}),[b,O.current]),Object(a["useEffect"])((function(){if(d&&b){var e=function(){var e=new WebSocket(b);y.current=e,e.onopen=function(){var n=d.element.parentElement;if(n){var o=n.offsetWidth,i=n.offsetHeight;console.log("init",{tp:"init",data:Object(r["a"])(Object(r["a"])({},t),{},{secret:v,width:o,height:i,rows:d.rows,columns:d.cols})}),e.send(JSON.stringify({tp:"init",data:Object(r["a"])(Object(r["a"])({},t),{},{secret:v,width:o,height:i,rows:d.rows,columns:d.cols})}))}d.focus()},e.onerror=function(t){console.log("------in socket error----",t,e,b)},e.onmessage=function(e){j.current||(d.write("\r"),setTimeout((function(){}),1e3)),j.current=!0,console.log("event:",e);var t=u["Base64"].decode(e.data.toString()),n=d._core._renderService.dimensions.actualCellWidth||9.5;console.log("data:",t,n,d),d.write(t)},e.onclose=function(e){o&&clearInterval(o),d.write("\r\nconnection closed")}},o=setInterval((function(){y.current&&y.current.send(JSON.stringify({tp:"h"}))}),p),i=l["a"].subscribe("create-socket",(function(t){n==t&&(y.current&&1===y.current.readyState?d.focus():e(),d.focus())})),a=l["a"].subscribe("close-socket",(function(e){n===e&&(y.current&&(y.current.close(),j.current=!1,d.clear()),y.current=null)})),c=l["a"].subscribe("ssh-xterm-resize",(function(e){y.current&&1===y.current.readyState&&y.current.send(JSON.stringify({tp:"resize",data:Object(r["a"])({},e)}))})),s=l["a"].subscribe("ssh-add-connect-time",(function(){y.current&&1===y.current.readyState&&y.current.send(JSON.stringify({tp:"overtime"}))}));return function(){a(),i(),c(),s(),y.current&&(y.current.close(),j.current=!1)}}}),[d,b,m]),c.a.createElement("div",{ref:O,className:"xterm-panel"},b?null:c.a.createElement("p",{style:{color:"#fff"}},"\u6b63\u5728\u8fde\u63a5\u547d\u4ee4\u884c\u670d\u52a1..."))}}}]); |