filecat
Version:
FileCat Server Manager
2 lines • 7.76 kB
JavaScript
/*! For license information please see 402.138475a73186af1e5ac1.js.LICENSE.txt */
;(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[402],{4405(t,n,e){e.d(n,{n:()=>y,x:()=>h});var r=e(1499);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,n,e){return n=c(n),function(t,n){if(n&&("object"==o(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,u()?Reflect.construct(n,e||[],c(t).constructor):n.apply(t,e))}function u(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(u=function(){return!!t})()}function c(t){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},c(t)}function a(t,n){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},a(t,n)}function f(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,s(r.key),r)}}function l(t,n,e){return n&&f(t.prototype,n),e&&f(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t){var n=function(t,n){if("object"!=o(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,n||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==o(n)?n:n+""}function p(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}var y=l(function t(){p(this,t)}),h=function(t){function n(){return p(this,n),i(this,n,arguments)}return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&a(t,n)}(n,t),l(n,null,[{key:"getKey",value:function(t){return(0,r.Nr)("".concat(t.domain).concat(t.port).concat(t.username).concat(t.authorization))}}])}(y)},3402(t,n,e){e.r(n),e.d(n,{default:()=>m});var r=e(6540),o=e(7856),i=e(4188),u=e(4944),c=e(7444),a=e(6417),f=e(4405),l=e(505);function s(){var t,n,e="function"==typeof Symbol?Symbol:{},r=e.iterator||"@@iterator",o=e.toStringTag||"@@toStringTag";function i(e,r,o,i){var a=r&&r.prototype instanceof c?r:c,f=Object.create(a.prototype);return p(f,"_invoke",function(e,r,o){var i,c,a,f=0,l=o||[],s=!1,p={p:0,n:0,v:t,a:y,f:y.bind(t,4),d:function(n,e){return i=n,c=0,a=t,p.n=e,u}};function y(e,r){for(c=e,a=r,n=0;!s&&f&&!o&&n<l.length;n++){var o,i=l[n],y=p.p,h=i[2];e>3?(o=h===r)&&(a=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=y&&((o=e<2&&y<i[1])?(c=0,p.v=r,p.n=i[1]):y<h&&(o=e<3||i[0]>r||r>h)&&(i[4]=e,i[5]=r,p.n=h,c=0))}if(o||e>1)return u;throw s=!0,r}return function(o,l,h){if(f>1)throw TypeError("Generator is already running");for(s&&1===l&&y(l,h),c=l,a=h;(n=c<2?t:a)||!s;){i||(c?c<3?(c>1&&(p.n=-1),y(c,a)):p.n=a:p.v=a);try{if(f=2,i){if(c||(o="next"),n=i[o]){if(!(n=n.call(i,a)))throw TypeError("iterator result is not an object");if(!n.done)return n;a=n.value,c<2&&(c=0)}else 1===c&&(n=i.return)&&n.call(i),c<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((n=(s=p.n<0)?a:e.call(r,p))!==u)break}catch(n){i=t,c=1,a=n}finally{f=1}}return{value:n,done:s}}}(e,o,i),!0),f}var u={};function c(){}function a(){}function f(){}n=Object.getPrototypeOf;var l=[][r]?n(n([][r]())):(p(n={},r,function(){return this}),n),y=f.prototype=c.prototype=Object.create(l);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,p(t,o,"GeneratorFunction")),t.prototype=Object.create(y),t}return a.prototype=f,p(y,"constructor",f),p(f,"constructor",a),a.displayName="GeneratorFunction",p(f,o,"GeneratorFunction"),p(y),p(y,o,"Generator"),p(y,r,function(){return this}),p(y,"toString",function(){return"[object Generator]"}),(s=function(){return{w:i,m:h}})()}function p(t,n,e,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}p=function(t,n,e,r){function i(n,e){p(t,n,function(t){return this._invoke(n,e,t)})}n?o?o(t,n,{value:e,enumerable:!r,configurable:!r,writable:!r}):t[n]=e:(i("next",0),i("throw",1),i("return",2))},p(t,n,e,r)}function y(t,n,e,r,o,i,u){try{var c=t[i](u),a=c.value}catch(t){return void e(t)}c.done?n(a):Promise.resolve(a).then(r,o)}function h(t){return function(){var n=this,e=arguments;return new Promise(function(r,o){var i=t.apply(n,e);function u(t){y(i,r,o,u,c,"next",t)}function c(t){y(i,r,o,u,c,"throw",t)}u(void 0)})}}function b(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var r,o,i,u,c=[],a=!0,f=!1;try{if(i=(e=e.call(t)).next,0===n){if(Object(e)!==e)return;a=!1}else for(;!(a=(r=i.call(e)).done)&&(c.push(r.value),c.length!==n);a=!0);}catch(t){f=!0,o=t}finally{try{if(!a&&null!=e.return&&(u=e.return(),Object(u)!==u))return}finally{if(f)throw o}}return c}}(t,n)||function(t,n){if(t){if("string"==typeof t)return d(t,n);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?d(t,n):void 0}}(t,n)||function(){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 d(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=Array(n);e<n;e++)r[e]=t[e];return r}var v=r.lazy(function(){return e.e(614).then(e.bind(e,5614))});function m(t){var n=b((0,r.useState)(null),2),e=n[0],p=n[1],y=b((0,c.L4)(a.AG.fileShellShow),2),d=y[0],m=(y[1],b((0,c.L4)(a.AG.file_shell_hidden),2)),w=m[0],g=(m[1],b((0,c.L4)(a.AG.user_base_info),2)),_=g[0],O=(g[1],"dark"===_.user_data.theme?"#FFFFFF":"#000000"),j=function(){var t=h(s().m(function t(){var n,e,r;return s().w(function(t){for(;;)switch(t.n){case 0:return n=new o.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:O,cursor:O,selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4}),r=function(t){n.write(t)},e=function(t){n.clear(),n.write(t),e=r},t.n=1,u.ws.addMsg(i.HK.shell_getting,function(t){e(t.context)});case 1:return t.n=2,u.ws.addMsg(i.HK.shell_copy,function(t){t.context&&(0,l.lW)(t.context),n.focus()});case 2:n.onData(function(){var t=h(s().m(function t(n){var e;return s().w(function(t){for(;;)switch(t.n){case 0:return(e=new i.hf(i.HK.shell_send)).context=n,t.n=1,u.ws.send(e);case 1:return t.a(2)}},t)}));return function(n){return t.apply(this,arguments)}}()),p(n);case 3:return t.a(2)}},t)}));return function(){return t.apply(this,arguments)}}(),S=function(){null==e||e.dispose(),p(null)};(0,r.useEffect)(function(){return function(){S()}},[]),(0,r.useEffect)(function(){d.show?e?d.cmd&&u.ws.sendData(i.HK.shell_send,d.cmd):j():S()},[d]);return r.createElement(v,{show:d.show,file_shell_hidden:w,terminal:e,init:function(t,n){e.writeln("[38;2;29;153;243mopen shell...[0m ");var r=new i.hf(i.HK.shell_open),o=new f.n;o.init_path=d.path,o.rows=t,o.cols=n,o.http_token=localStorage.getItem("token"),r.context=o,u.ws.send(r),d.cmd&&u.ws.sendData(i.HK.shell_send,d.cmd)}})}}}]);