filecat 1.1.1 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/dist/623.bundle.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see 623.bundle.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[623],{3430:(t,e,r)=>{function n(t){return n="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},n(t)}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function i(t,e,r){return e&&o(t.prototype,e),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function a(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}r.d(e,{XM:()=>u,tl:()=>c});var c=i((function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)})),u=function(t){return t[t.win=0]="win",t[t.linux=1]="linux",t}({})},7481:(t,e,r)=>{r.d(e,{S:()=>a,X:()=>i});var n=r(6540);function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function i(t){var e,r,i,a=(r=n.useState([]),i=2,function(t){if(Array.isArray(t))return t}(r)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(r,i)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(r,i)||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.")}()),c=a[0],u=a[1];return(0,n.useEffect)((function(){t.children?u(Array.isArray(t.children)?t.children:[t.children]):u(t.rows)}),[t.rows,t.children]),n.createElement("table",null,n.createElement("thead",null,n.createElement("tr",null,null===(e=t.headers)||void 0===e?void 0:e.map((function(t,e){return n.createElement("th",{key:e},t)})))),n.createElement("tbody",null,c.map((function(e,r){return n.createElement("tr",{key:r},e.map((function(e,r){var o;return n.createElement("td",{style:{width:null!==(o=t.width)&&void 0!==o?o:"auto"},key:r,className:r===c.length-1?"small":""},e)})))}))))}function a(t){return n.createElement("div",{style:{display:t.isFlex?"flex":"block"}},t.columns.map((function(t,e){return n.createElement("div",{key:e},t)})))}},7704:(t,e,r)=>{r.d(e,{$:()=>f});var n=r(6540),o=r(2543),i=r.n(o),a=r(3616),c=(r(9448),r(505)),u=r(2042);function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return s(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(t,e):void 0}}(t,e)||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 s(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function f(t){var e=l((0,n.useState)(25),2),r=e[0],o=e[1],s=(0,n.useRef)(null),f=(0,n.useCallback)(new a.FitAddon,[]),h=(0,n.useRef)(null),p=(0,n.useRef)(null),y=l((0,n.useState)(!1),2),d=y[0],m=y[1],v=(0,n.useCallback)(i().throttle((function(t){f.fit();var e=parseFloat(getComputedStyle(h.current).fontSize),r=window.innerHeight/e-4,n=(window.innerHeight-t.clientY)/e,i=2.25+s.current.offsetHeight/e;n<=r&&n>=i&&o(parseFloat(n.toFixed(2)))}),32),[]);(0,n.useEffect)((function(){t.terminal&&(t.terminal.open(p.current),t.terminal.loadAddon(f),f.fit(),t.init&&t.init(t.terminal.rows,t.terminal.cols),t.terminal.attachCustomKeyEventHandler((function(e){if(e.ctrlKey&&"c"===e.key){var r=t.terminal.getSelection();if(r)return(0,c.l)(r),(0,u.LW)("已复制"),e.preventDefault(),t.terminal.focus(),!1}else if("keydown"===e.type&&"v"===e.key&&e.ctrlKey)return!1;return!0})))}),[t.terminal]),(0,n.useEffect)((function(){return function(){t.terminal&&t.terminal.dispose()}}),[]);var g=function(){m(!1),h.current.removeEventListener("pointermove",v)};if(t.show)return t.get_simple?n.createElement("div",{className:"pty",style:{height:"100%"},ref:p}):n.createElement("div",{className:"shell",style:{height:"".concat(r,"em"),display:"".concat(t.file_shell_hidden?"none":"block")},ref:h},n.createElement("div",{className:"shell__divider",ref:s,onPointerDown:function(){m(!0),h.current.addEventListener("pointermove",v)},onPointerUp:g}),n.createElement("div",{className:"pty",style:{height:"".concat(r-1,"em")},ref:p}),d&&n.createElement("div",{className:"shell__overlay",onPointerUp:g}))}},9623:(t,e,r)=>{r.r(e),r.d(e,{default:()=>ce});var n=r(6540),o=r(5725),i=r(447),a=r(8868);function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}const u=function(t){var e,r,o=t.percentage,i=(0,n.useRef)(null),u=(e=(0,n.useState)(null),r=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(e,r)||function(t,e){if(t){if("string"==typeof t)return c(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}(e,r)||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.")}()),l=u[0],s=u[1];return(0,n.useEffect)((function(){var t=i.current.getContext("2d"),e=new a.Ay(t,{type:"doughnut",data:{labels:["use","left"],datasets:[{data:[o,100-o],backgroundColor:["#007bff","#f0f0f0"],borderWidth:0}]},options:{plugins:{legend:{display:!1},tooltip:{enabled:!1}},elements:{arc:{borderWidth:0}}}});return s(e),function(){e.destroy()}}),[]),(0,n.useEffect)((function(){l&&(l.data.datasets[0].data=[o,100-o],l.update())}),[o]),n.createElement("div",{style:{width:"8rem",overflow:"hidden"}},n.createElement("canvas",{ref:i}))};var l=r(4238),s=r(4944),f=r(6007),h=r(7952),p=r(5997),y=r(7481),d=r(3459),m=r(2389),v=r(7444),g=r(6417),w=r(4777),b=r(2042);function E(t){return E="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},E(t)}function x(){x=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new C(n||[]);return o(a,"_invoke",{value:A(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function w(){}var b={};l(b,a,(function(){return this}));var S=Object.getPrototypeOf,L=S&&S(S(N([])));L&&L!==r&&n.call(L,a)&&(b=L);var k=w.prototype=v.prototype=Object.create(b);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==E(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function A(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=O(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function O(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(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 I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function N(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(E(e)+" is not iterable")}return g.prototype=w,o(k,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},_(j.prototype),l(j.prototype,c,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new j(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(k),l(k,u,"Generator"),l(k,a,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=N,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function S(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=_(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function L(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function k(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||_(t,e)||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 _(t,e){if(t){if("string"==typeof t)return j(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?j(t,e):void 0}}function j(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function A(t){var e=(0,m.Bd)().t,r=k((0,v.L4)(g.A.disk),2),a=(r[0],r[1]),c=k((0,n.useState)({}),2),u=c[0],l=c[1],s=k((0,n.useState)([]),2),w=s[0],b=s[1],E=[e("名字"),e("当前值"),e("历史最低"),e("临界值")],_=function(){var r,o=(r=x().mark((function r(){var o,i,a,c,u,s,h;return x().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,f.Yu.post("sys/disk/info",{name:t.name});case 2:if((o=r.sent).code===d.m.Sucess){a=[],c=S(null!==(i=o.data.ata_smart_attributes)&&void 0!==i?i:[]);try{for(c.s();!(u=c.n()).done;)s=u.value,h=void 0,s[1]>=s[2]?h="var(--icon-green)":s[1]<=s[3]&&(h="var(--icon-red)"),s[0]=n.createElement("span",{style:{color:h}},e(s[0])),a.push(s)}catch(t){c.e(t)}finally{c.f()}b(o.data.ata_smart_attributes),l(o.data)}case 4:case"end":return r.stop()}}),r)})),function(){var t=this,e=arguments;return new Promise((function(n,o){var i=r.apply(t,e);function a(t){L(i,n,o,a,c,"next",t)}function c(t){L(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return o.apply(this,arguments)}}();return(0,n.useEffect)((function(){_()}),[u]),n.createElement("div",null,n.createElement(h.A,null,n.createElement(p.rA,{icon:"close",title:e("关闭"),onClick:function(){a({})}})),n.createElement(o.jW,{isFull:!0,more:!0},n.createElement(o.NN,null,n.createElement(o.fI,null,n.createElement(o.VP,{widthPer:30},n.createElement(o.xh,null,n.createElement(i.Zp,{title:e("基本信息")},n.createElement(o.Yh,{left:e("名字"),right:t.name}),n.createElement(o.Yh,{left:e("厂商名称"),right:t.typeName}),n.createElement(o.Yh,{left:e("类型"),right:t.type}),n.createElement(o.Yh,{left:e("容量"),right:t.total}))),n.createElement(o.xh,null,n.createElement(i.Zp,{title:e("物理信息")},n.createElement(o.Yh,{left:e("是否健康"),right:!0===u.smart_status?"是":"否"}),n.createElement(o.Yh,{left:e("设备型号"),right:u.model_name}),n.createElement(o.Yh,{left:e("序列号"),right:u.serial_number}),n.createElement(o.Yh,{left:e("固件版本"),right:u.firmware_version}),n.createElement(o.Yh,{left:e("转速(每分钟)"),right:u.rotation_rate}),n.createElement(o.Yh,{left:e("通电时长(小时)"),right:u.power_on_time_hours}),n.createElement(o.Yh,{left:e("通电次数"),right:u.power_cycle_count}),n.createElement(o.Yh,{left:e("温度(°C)"),right:u.temperature}),n.createElement(o.Yh,{left:e("通信协议"),right:u.device_protocol})))),n.createElement(o.VP,{widthPer:50},n.createElement(o.xh,null,n.createElement(i.uF,{title:e("SMART详细信息")},n.createElement(y.X,{headers:E,rows:w,width:"10rem"}))))))))}var O=function(t){return t[t.mount=0]="mount",t}({});function P(){return P=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},P.apply(null,arguments)}function I(t){return n.createElement("div",{className:"black-tip",onClick:function(){t.click&&t.click(t)},onContextMenu:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),t.onContextMenu&&t.onContextMenu(e,t)}},t.name)}var C=function(t){return n.createElement("li",null,t.click?n.createElement(I,P({},t.node,{name:t.render?t.render(t.node):t.node.name,click:t.click,onContextMenu:t.onContextMenu})):n.createElement("div",null,t.render?t.render(t.node):t.node.name),t.node.children&&t.node.children.length>0&&n.createElement("ul",null,t.node.children.map((function(e,r){return n.createElement(C,{key:r,node:e,click:t.click,onContextMenu:t.onContextMenu,render:t.render})}))))};const N=function(t){return n.createElement("div",{className:"card-tree-view"},n.createElement("ul",null,t.list&&t.list.map((function(e,r){return n.createElement(C,{key:r,node:e,click:t.click,onContextMenu:t.onContextMenu,render:t.render})}))))};var T=r(8247);function F(t){return F="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},F(t)}function G(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=$(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function Y(){Y=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:_(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function w(){}var b={};l(b,a,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(I([])));x&&x!==r&&n.call(x,a)&&(b=x);var S=w.prototype=v.prototype=Object.create(b);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==F(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function A(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 O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(F(e)+" is not iterable")}return g.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},L(k.prototype),l(k.prototype,c,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=I,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function M(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function K(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){M(i,n,o,a,c,"next",t)}function c(t){M(i,n,o,a,c,"throw",t)}a(void 0)}))}}function H(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||$(t,e)||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 $(t,e){if(t){if("string"==typeof t)return V(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?V(t,e):void 0}}function V(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var U=function(t){return n.createElement("div",{style:{border:"2px solid black",padding:"10px",width:"300px",height:"300px",position:"relative"}},t.name,t.lvms.map((function(t,e){return n.createElement("div",{key:e,style:{margin:"5px",height:"".concat(40,"px"),display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid "}},t.name)})))};function W(){return n.createElement("div",{style:{position:"relative",height:"300px",margin:"10px",width:"30px",display:"flex",alignItems:"center",justifyContent:"center"}},n.createElement("div",{style:{width:0,height:0,borderTop:"10px solid transparent",borderBottom:"10px solid transparent",borderLeft:"10px solid black"}}))}function Z(){var t=(0,m.Bd)().t,e=H((0,v.L4)(g.A.disk),2),r=(e[0],e[1]),a=H((0,n.useState)({}),2),c=a[0],u=(a[1],H((0,n.useState)([]),2)),l=u[0],s=u[1],w=H((0,n.useState)([]),2),E=w[0],x=w[1],S=H((0,v.L4)(g.A.showPrompt),2),L=(S[0],S[1],H((0,n.useState)([]),2)),k=L[0],_=(L[1],(0,T.kZ)().click_file),j=H((0,v.L4)(g.A.prompt_card),2),A=(j[0],j[1]),P=[t("挂载点"),"uuid",t("类型"),t("文件系统类型"),t("文件系统容量"),t("卷容量"),t("设备路径"),t("分区表类型")],I=function(){var t=K(Y().mark((function t(){var e;return Y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.Yu.get("disk/blk");case 2:return(e=t.sent).code===d.m.Sucess&&s(e.data),t.abrupt("return",e.code);case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),C=function(){var t=K(Y().mark((function t(){return Y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:I();case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return(0,n.useEffect)((function(){C()}),[c]),n.createElement("div",null,n.createElement(h.A,null,n.createElement(p.rA,{icon:"close",title:t("关闭"),onClick:function(){r({})}})),n.createElement(o.jW,{isFull:!0,more:!0},n.createElement(o.NN,null,n.createElement(o.fI,null,n.createElement(o.VP,{widthPer:40},n.createElement(i.Zp,{title:t("物理块(硬盘)设备、逻辑卷、物理卷"),titleCom:n.createElement("div",null,n.createElement(p.rA,{icon:"file_open",title:t("打开挂载文件"),onClick:K(Y().mark((function e(){return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:_({name:"fstab(谨慎修改,内容错误会导致系统无法启动)",model:"text",sys_path:"etc/fstab",menu_list:[n.createElement(p.rA,{icon:"info",title:t("提示"),onClick:K(Y().mark((function t(){return Y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:A({open:!0,title:"信息",context_div:n.createElement("div",null,n.createElement("ul",null,n.createElement("li",null,"通用格式:","<文件系统> <挂载点> <类型> <挂载选项> <dump> <fsck> "),n.createElement("li",null,"文件系统,有多种格式",n.createElement("ul",null,n.createElement("li",null,"1(usb口默认名称)./dev/sda1"),n.createElement("li",null,"2(唯一Id).UUID=123e4567-e89b-12d3-a456-426614174000"),n.createElement("li",null,"3.LABEL=DATA"))),n.createElement("li",null,"挂载点,就是文件路径,例如 /mnt/data ,这个目录要提前创建,且为空"),n.createElement("li",null,"类型,就是文件系统类型,对于系统不支持的类型,例如ntfs需要额外前提安装ntfs-3g"),n.createElement("li",null,'挂载选项的值只能是以下这些,可以用 "," 同时使用多个选项',n.createElement("ul",null,n.createElement("li",null,"defaults:使用默认挂载选项"),n.createElement("li",null,"noatime:不更新访问时间,提高性能"),n.createElement("li",null,"auto:系统启动时自动挂载"),n.createElement("li",null,"rw:以读写方式挂载"),n.createElement("li",null,"nofail:防止启动阻塞,挂载失败系统继续执行"),n.createElement("li",null,"...等"))),n.createElement("li",null,"dump 0是需要备份 1是不需要备份"),n.createElement("li",null,"Fsck 整数值0是不检查,文件系统检查顺序越小越先检查"),n.createElement("li",null,"提示:只有含有文件系统的逻辑卷,或者分区才可以进行挂载。")))});case 1:case"end":return t.stop()}}),t)})))}),n.createElement(p.rA,{key:1,icon:"update",title:t("更新挂载"),onClick:K(Y().mark((function t(){return Y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.Yu.post("cmd/exe",{type:O.mount});case 2:t.sent.code===d.m.Sucess&&(0,b.LW)("挂载文件已生效");case 4:case"end":return t.stop()}}),t)})))})]});case 1:case"end":return e.stop()}}),e)})))}),n.createElement(p.rA,{icon:"update",title:t("刷新"),onClick:K(Y().mark((function t(){return Y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,I();case 2:if(t.t0=t.sent,t.t1=d.m.Sucess,t.t0!==t.t1){t.next=6;break}(0,b.LW)("刷新成功");case 6:case 7:case"end":return t.stop()}}),t)})))}))},n.createElement(y.X,{headers:P,rows:E,width:"10rem"}),n.createElement(N,{list:l,render:function(t){var e=t.name;return t.label&&(e+="(".concat(t.label,")")),t.mountpoint?n.createElement("span",null,e,n.createElement("span",{style:{color:"green"}},"(已挂载)")):e},onContextMenu:function(t,e){t.preventDefault()},click:function(e){var r="";if(e.mountpoint)for(var o=0;o<e.mountpoints.length;o++)r+=e.mountpoints[o]+";";x([[n.createElement(i.xP,null,r),n.createElement(i.xP,null,e.uuid),t(e.type),t(e.fstype),e.fssize,e.size,n.createElement(i.xP,null,e.path),e.pttype]])}}))),n.createElement(o.VP,{widthPer:60},k.map((function(e,r){var a,c=[],u=G(e.pv_list);try{for(u.s();!(a=u.n()).done;){var l=a.value;c.push({name:"".concat(l.name,"---(").concat(l.size,")---(").concat(l.free_size,")")})}}catch(t){u.e(t)}finally{u.f()}var s,f=[],h=G(e.lv_list);try{for(h.s();!(s=h.n()).done;){var p=s.value;f.push({name:"".concat(p.name,"---(").concat(p.size,")")})}}catch(t){h.e(t)}finally{h.f()}return n.createElement(i.Zp,{key:r},n.createElement(o.n5,null,n.createElement(U,{name:t("物理卷"),lvms:c}),n.createElement(W,null),n.createElement(U,{name:"".concat(t("逻辑卷"),"---(").concat(e.name,")---size(").concat(e.size,")"),lvms:[]}),n.createElement(W,null),n.createElement(U,{name:t("逻辑卷"),lvms:f})))})))))))}var B=r(3430);function X(t){return X="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},X(t)}function z(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Q(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function D(){D=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:_(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function w(){}var b={};l(b,a,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(I([])));x&&x!==r&&n.call(x,a)&&(b=x);var S=w.prototype=v.prototype=Object.create(b);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==X(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function A(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 O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(X(e)+" is not iterable")}return g.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},L(k.prototype),l(k.prototype,c,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=I,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function R(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function J(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){R(i,n,o,a,c,"next",t)}function c(t){R(i,n,o,a,c,"throw",t)}a(void 0)}))}}function q(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||Q(t,e)||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 Q(t,e){if(t){if("string"==typeof t)return tt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?tt(t,e):void 0}}function tt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var et=!0;function rt(t){var e=(0,m.Bd)().t,r=[e("名字"),e("厂商名称"),e("类型"),e("容量")],a=[e("名字"),e("物理硬盘"),e("文件系统类型"),e("挂载位置"),e("总容量"),e("剩余容量")],c=q((0,v.L4)(g.A.user_base_info),2),E=c[0],x=(c[1],q((0,n.useState)(0),2)),S=x[0],L=x[1],k=q((0,n.useState)(0),2),_=k[0],j=k[1],O=q((0,n.useState)(0),2),P=O[0],I=O[1],C=q((0,n.useState)(0),2),N=C[0],T=C[1],F=q((0,n.useState)({}),2),G=F[0],Y=F[1],M=q((0,n.useState)(!1),2),K=M[0],H=M[1],$=q((0,n.useState)(!1),2),V=$[0],U=$[1],W=q((0,n.useState)(!1),2),X=W[0],R=W[1],Q=q((0,n.useState)(et),2),tt=Q[0],rt=Q[1],nt=q((0,n.useState)([]),2),ot=nt[0],it=nt[1],at=q((0,n.useState)([]),2),ct=at[0],ut=at[1],lt=q((0,v.L4)(g.A.user_base_info),2),st=lt[0],ft=(lt[1],q((0,v.L4)(g.A.disk),2)),ht=ft[0],pt=ft[1],yt=function(){var t=J(D().mark((function t(){var e;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(et){t.next=3;break}return s.ws.unConnect(),t.abrupt("return");case 3:return e=new l.hf(l.HK.sys_get),t.next=6,s.ws.send(e);case 6:s.ws.addMsg(l.HK.sys_getting,(function(t){var e,r,n;T(null===(e=t.context)||void 0===e?void 0:e.cpu_currentLoad);var o=null===(r=t.context)||void 0===r?void 0:r.memLeft,i=null===(n=t.context)||void 0===n?void 0:n.memTotal;j(o),I(i),L((i-o)/i*100)}));case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),dt=function(){var t=J(D().mark((function t(){return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,yt();case 2:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),mt=function(){var t=J(D().mark((function t(){var e,r;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.Yu.get("base");case 2:(e=t.sent).code===d.m.Sucess&&(r=e.data,Y(r));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),vt=function(){var t=J(D().mark((function t(){var r,o,a,c,u,l,s;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.Yu.get("disk");case 2:if((r=t.sent).code!==d.m.Sucess){t.next=25;break}o=r.data,a=[],c=!0,st.sysSoftWare&&st.sysSoftWare[w.jk.smartmontools]&&st.sysSoftWare[w.jk.smartmontools].installed||(c=!1),u=z(null!=o?o:[]),t.prev=9,s=D().mark((function t(){var r;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=l.value,a.push([n.createElement(i.xP,{context:r.name}),r.typeName,r.type,r.total,n.createElement(p.rA,{icon:"health_and_safety",title:e("查看健康信息"),onClick:function(){c?pt({type:"check",data:r}):(0,b.zN)("没有安装smartmontools")}})]);case 2:case"end":return t.stop()}}),t)})),u.s();case 12:if((l=u.n()).done){t.next=16;break}return t.delegateYield(s(),"t0",14);case 14:t.next=12;break;case 16:t.next=21;break;case 18:t.prev=18,t.t1=t.catch(9),u.e(t.t1);case 21:return t.prev=21,u.f(),t.finish(21);case 24:it(a);case 25:case"end":return t.stop()}}),t,null,[[9,18,21,24]])})));return function(){return t.apply(this,arguments)}}(),gt=function(){var t=J(D().mark((function t(){var e,r,o,a,c,u;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.Yu.get("filedisk");case 2:if((e=t.sent).code===d.m.Sucess){r=e.data,o=[],a=z(null!=r?r:[]);try{for(a.s();!(c=a.n()).done;)u=c.value,o.push([n.createElement(i.xP,{context:u.name}),n.createElement(i.xP,{context:u.device_name}),u.fsType,n.createElement(i.xP,{context:u.mount}),u.total,u.available])}catch(t){a.e(t)}finally{a.f()}ut(o)}case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return(0,n.useEffect)((function(){return dt(),function(){J(D().mark((function t(){return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:s.ws.isAilive()&&s.ws.setPromise(function(){var t=J(D().mark((function t(e){return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.ws.unConnect();case 2:e();case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 1:case"end":return t.stop()}}),t)})))()}}),[]),n.createElement("div",null,n.createElement(h.A,null,E.sys===B.XM.linux&&n.createElement(p.rA,{icon:"sd_card",title:"硬盘挂载",onClick:function(){pt({type:"mount"})}}),n.createElement(p.Z$,{defaultStatus:!1,text:e("基本信息"),clickFun:function(t){H(t),t&&mt()}}),n.createElement(p.Z$,{defaultStatus:!1,text:e("物理硬盘"),clickFun:function(t){U(t),t&&vt()}}),n.createElement(p.Z$,{defaultStatus:!1,text:e("文件硬盘"),clickFun:function(t){R(t),t&>()}}),n.createElement(p.Z$,{defaultStatus:tt,text:e("实时信息"),clickFun:function(t){rt(t),et=t,yt()}})),n.createElement(o.xh,null,tt&&n.createElement(o.fI,null,n.createElement(o.VP,{widthPer:33},n.createElement(i.Zp,{title:e("内存")},n.createElement(o.fI,null,n.createElement(o.VP,null,n.createElement(u,{percentage:S})),n.createElement(o.VP,null,n.createElement(o.fI,null,n.createElement(o.VP,{widthPer:100},n.createElement("div",null,n.createElement(o.Yh,{left:e("总容量"),center:"".concat(P,"G")}))),n.createElement(o.VP,{widthPer:100},n.createElement(o.Yh,{left:e("剩余"),center:"".concat(_,"G")}))))))),n.createElement(o.VP,{widthPer:33},n.createElement(i.Zp,{title:"cpu"},n.createElement(o.fI,null,n.createElement(o.VP,null,n.createElement(u,{percentage:N})),n.createElement(o.VP,null,n.createElement(o.fI,null,n.createElement(o.Yh,{left:e("使用率"),center:N}))))))),n.createElement(o.fI,null,K&&n.createElement(o.VP,null,n.createElement(i.Zp,{title:e("基本信息")},n.createElement(o.Yh,{left:e("总内存"),right:G.mem_total}),n.createElement(o.Yh,{left:"cpu ".concat(e("制造商")),right:G.cpu_manufacturer}),n.createElement(o.Yh,{left:"cpu ".concat(e("品牌")),right:G.cpu_brand}),n.createElement(o.Yh,{left:"cpu ".concat(e("逻辑核心")),right:G.cpu_core_num}),n.createElement(o.Yh,{left:"cpu ".concat(e("物理核心")),right:G.cpu_phy_core_num}),n.createElement(o.Yh,{left:"cpu ".concat(e("最大"),"hz"),right:G.cpu_speed_hz}),n.createElement(o.Yh,{left:"当前系统:pid;ppid",right:G.pid_ppid}))),V&&n.createElement(o.VP,null,n.createElement(i.uF,{title:e("物理硬盘")},n.createElement(y.X,{headers:r,rows:ot,width:"10rem"}))),X&&n.createElement(o.VP,null,n.createElement(i.uF,{title:e("文件硬盘")},n.createElement(y.X,{headers:a,rows:ct,width:"10rem"}))))),ht&&"check"===ht.type&&n.createElement(A,ht.data),ht&&"mount"===ht.type&&n.createElement(Z,null))}function nt(t){return n.createElement("h2",{className:"message"},n.createElement("i",{className:"material-icons"},"sentiment_dissatisfied"),n.createElement("span",null,t.context))}var ot=r(3033),it=r(7856),at=r(7704),ct=r(4405);function ut(t){return ut="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},ut(t)}function lt(){lt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:_(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function w(){}var b={};l(b,a,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(I([])));x&&x!==r&&n.call(x,a)&&(b=x);var S=w.prototype=v.prototype=Object.create(b);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==ut(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function A(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 O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(ut(e)+" is not iterable")}return g.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},L(k.prototype),l(k.prototype,c,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=I,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function st(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function ft(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){st(i,n,o,a,c,"next",t)}function c(t){st(i,n,o,a,c,"throw",t)}a(void 0)}))}}function ht(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return pt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?pt(t,e):void 0}}(t,e)||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 pt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function yt(t){var e=ht((0,n.useState)(null),2),r=e[0],o=e[1],i=ht((0,v.L4)(g.A.dockerShellShow),2),a=i[0],c=(i[1],function(){var t=ft(lt().mark((function t(){var e,r,n;return lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=new it.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:"#000000",cursor:"#000000",selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4,convertEol:!0}),s.ws.subscribeUnconnect(u),n=function(t){e.write(t)},r=function(t){e.clear(),e.write(t),r=n},s.ws.addMsg("logs"===a.type?l.HK.docker_shell_logs_getting:l.HK.docker_shell_exec_getting,(function(t){"error"===t.context&&u(),r(t.context)})),"exec"===a.type&&e.onData(function(){var t=ft(lt().mark((function t(e){var r;return lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(r=new l.hf(l.HK.docker_shell_exec)).context=e,t.next=4,s.ws.send(r);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),o(e);case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()),u=function(){ft(lt().mark((function t(){return lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r&&(r.writeln("[38;2;29;153;243mclose![0m "),r.dispose(),o(null));case 1:case"end":return t.stop()}}),t)})))()};return(0,n.useEffect)((function(){a.show?c():u()}),[a]),(0,n.useEffect)((function(){return function(){u()}}),[]),n.createElement(at.$,{show:a.show,terminal:r,init:function(t,e){r.writeln("[38;2;29;153;243mconnect...[0m ");var n,o=new ct.n;o.rows=t,o.cols=e,o.dockerId=a.dockerId,(n="logs"===a.type?new l.hf(l.HK.docker_shell_logs):new l.hf(l.HK.docker_shell_exec_open)).context=o,s.ws.send(n)}})}var dt=r(2869);function mt(t){return mt="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},mt(t)}function vt(){vt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:_(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function w(){}var b={};l(b,a,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(I([])));x&&x!==r&&n.call(x,a)&&(b=x);var S=w.prototype=v.prototype=Object.create(b);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==mt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function A(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 O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(mt(e)+" is not iterable")}return g.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},L(k.prototype),l(k.prototype,c,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=I,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function gt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=xt(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function wt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function bt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){wt(i,n,o,a,c,"next",t)}function c(t){wt(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Et(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||xt(t,e)||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 xt(t,e){if(t){if("string"==typeof t)return St(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?St(t,e):void 0}}function St(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var Lt="",kt=[],_t=!1;function jt(t){var e=(0,m.Bd)().t,r=Et((0,n.useState)({}),2),a=r[0],c=r[1],u=Et((0,n.useState)([]),2),w=u[0],E=u[1],x=Et((0,n.useState)([]),2),S=x[0],L=x[1],k=Et((0,v.L4)(g.A.dockerShellShow),2),_=k[0],j=k[1],A=Et((0,v.L4)(g.A.showPrompt),2),O=(A[0],A[1]),P=Et((0,n.useState)(Lt),2),I=P[0],C=P[1],N=Et((0,n.useState)(["id",e("名字"),e("镜像"),e("命令"),e("状态"),e("内存"),"cpu%",e("选择")]),2),T=N[0],F=(N[1],Et((0,n.useState)([]),2)),G=F[0],Y=F[1],M=Et((0,n.useState)(void 0),2),K=M[0],H=M[1],$=Et((0,n.useState)(!1),2),V=$[0],U=$[1],W=["id",e("name"),e("create时间"),e("大小"),n.createElement("span",null,"选中",n.createElement(p.rA,{icon:"check_box",title:"全选",onClick:function(){_t=!_t;for(var t={},e=0;e<S.length&&_t;e++)t[S[e][0].props.context]=1;c(t)}}))],Z=function(){var t=bt(vt().mark((function t(){var e;return vt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=new l.hf(l.HK.docker_get),t.next=3,s.ws.send(e);case 3:s.ws.addMsg(l.HK.docker_getting,(function(t){var e,r=[];if(Lt){var o,a=gt(t.context);try{for(a.s();!(o=a.n()).done;){var c,u=o.value,l=gt(u);try{for(l.s();!(c=l.n()).done;){var s=c.value;if("".concat(s).includes(Lt)){r.push(u);break}}}catch(t){l.e(t)}finally{l.f()}}}catch(t){a.e(t)}finally{a.f()}}else r.push.apply(r,function(t){if(Array.isArray(t))return St(t)}(e=t.context)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||xt(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());for(var f=function(){for(var t=r[h],e=0;e<t.length;e++)t[e]=n.createElement(i.xP,{context:t[e]});t.push(n.createElement(p.rA,{icon:"place",title:"选中",onClick:function(){Y(t)}}))},h=0;h<r.length;h++)f();E(r)}));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();(0,n.useEffect)((function(){return C(Lt),Z(),function(){bt(vt().mark((function t(){return vt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:j({show:!1,type:"",dockerId:""}),s.ws.isAilive()&&s.ws.setPromise(function(){var t=bt(vt().mark((function t(e){return vt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.ws.unConnect();case 2:e();case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 2:case"end":return t.stop()}}),t)})))()}}),[]),(0,n.useEffect)((function(){Lt=I}),[I]);var B=function(){s.ws.isAilive()&&s.ws.setPromise(function(){var t=bt(vt().mark((function t(e){var r;return vt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(r=new l.hf("logs"===_.type?l.HK.docker_shell_logs_cancel:l.HK.docker_shell_exec_cancel)).context="",t.next=4,s.ws.send(r);case 4:e();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},X=function(t){var e=new l.hf(l.HK.docker_switch);e.context={type:t,dockerId:G[0].props.context},Y([]),s.ws.send(e)},z=function(){var t=bt(vt().mark((function t(){var e,r,o,a,c,u,l;return vt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.Yu.get("docker/images");case 2:if((e=t.sent).code===d.m.Sucess){for(o=null!==(r=e.data)&&void 0!==r?r:[],a=[],c=0;c<o.length;c++)u=o[c],l=[n.createElement(i.xP,{context:u[0]}),n.createElement(i.xP,{context:u[1]}),u[2],u[3],""],a.push(l);kt=a,L(a)}case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),D=function(){var t=bt(vt().mark((function t(){var e,r;return vt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=Object.keys(a),t.next=3,f.Yu.post("docker/check/delete",{ids:e});case 3:if((r=t.sent).code!==d.m.Sucess){t.next=13;break}if(0!==r.data.length){t.next=12;break}return t.next=8,f.Yu.post("docker/delete",{ids:e});case 8:t.sent.code===d.m.Sucess&&((0,b.LW)("删除完成"),z()),t.next=13;break;case 12:(0,b.N9)("有镜像正在运行".concat(JSON.stringify(r.data)));case 13:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),R=function(){var t=bt(vt().mark((function t(){var e;return vt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=new l.hf(l.HK.docker_get),t.next=3,s.ws.send(e);case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return n.createElement("div",null,n.createElement(h.A,{left_children:n.createElement(p.Z$,{defaultStatus:!1,text:e("docker镜像"),clickFun:function(t){U(t),t?(s.ws.unConnect(),z(),Y([])):(Z(),L([]))}})},Object.keys(a).length>0&&n.createElement(p.rA,{icon:"delete",title:"删除镜像",onClick:D}),G.length>0&&n.createElement("div",null,G[1].props.context),G.length>0&&n.createElement("div",null,n.createElement(p.rA,{icon:"delete",title:"删除容器",onClick:function(){O({show:!0,overlay:!0,type:dt.PromptEnum.DockerDel,data:{dockerId:G[0].props.context,name:G[1].props.context}})}}),n.createElement(p.rA,{icon:"print",title:"打印日志",onClick:function(){_.show?(j({show:!1,type:"",dockerId:""}),B()):j({show:!0,dockerId:G[0].props.context,type:"logs"})}}),n.createElement(p.rA,{icon:"personal_video",title:"执行命令",onClick:function(){_.show?(j({show:!1,type:"",dockerId:""}),B()):j({show:!0,dockerId:G[0].props.context,type:"exec"})}}),G[4].props.context.includes("Up")?n.createElement(p.rA,{icon:"stop",title:"停止",onClick:function(){return X("stop")}}):n.createElement(p.rA,{icon:"play_arrow",title:"开启",onClick:function(){X("start")}})),(0!==w.length||I)&&!V&&n.createElement(p.rA,{icon:"refresh",title:"列表更新",onClick:R})),n.createElement(o.xh,null,V&&n.createElement(o.fI,null,n.createElement(o.VP,{widthPer:80},n.createElement(i.uF,{title:"镜像(".concat(S.length,")"),titleCom:n.createElement(ot.Sm,{placeholder:"过滤镜像",value:K,handleInputChange:function(t){H(t)},handlerEnter:function(){var t=[];if(K){var e,r=gt(S);try{for(r.s();!(e=r.n()).done;){var n=e.value;(n[0].props.context.includes(K)||n[1].props.context.includes(K))&&t.push(n)}}catch(t){r.e(t)}finally{r.f()}L(t)}else L(kt)}})},n.createElement(y.X,{headers:W,rows:S.map((function(t,r){return t[4]=n.createElement(ot.GL,{value:r,context:e(""),selected:a[t[0].props.context],onchange:function(){var e,r;e=t[0].props.context,r={},Object.assign(r,a),r[e]?delete r[e]:r[e]=1,c(r)}}),t})),width:"10rem"})))),0===w.length&&!I&&!V&&n.createElement(nt,{context:"检测不到docker,主机可能没有安装docker or 容器为空"}),(0!==w.length||I)&&!V&&n.createElement(o.fI,null,n.createElement(o.VP,{widthPer:80},n.createElement(i.uF,{title:"容器(".concat(w.length,")"),titleCom:n.createElement(ot.Sm,{placeholder:"过滤",value:I,handleInputChange:function(t){C(t)}})},n.createElement(y.X,{headers:T,rows:w,width:"10rem"}))))),n.createElement(yt,null))}var At=r(8815),Ot=r(4694);function Pt(t){return Pt="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},Pt(t)}function It(){It=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:_(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function w(){}var b={};l(b,a,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(I([])));x&&x!==r&&n.call(x,a)&&(b=x);var S=w.prototype=v.prototype=Object.create(b);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==Pt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function A(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 O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(Pt(e)+" is not iterable")}return g.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},L(k.prototype),l(k.prototype,c,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=I,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Ct(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Gt(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function Nt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Tt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Nt(i,n,o,a,c,"next",t)}function c(t){Nt(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Ft(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||Gt(t,e)||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 Gt(t,e){if(t){if("string"==typeof t)return Yt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Yt(t,e):void 0}}function Yt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var Mt="",Kt=!1,Ht=!1;function $t(t){var e=(0,m.Bd)().t,r=Ft((0,n.useState)([]),2),a=r[0],c=r[1],u=Ft((0,n.useState)([]),2),f=u[0],d=u[1],v=Ft((0,n.useState)(0),2),g=v[0],w=v[1],b=Ft((0,n.useState)(""),2),E=b[0],x=b[1],S=Ft((0,n.useState)(["pid",e("名字"),"创建用户",n.createElement("span",null,e("内存"),n.createElement(p.rA,{icon:"sort",title:"升序",onClick:function(){Kt=!Kt}})),n.createElement("span",null,"cpu%",n.createElement(p.rA,{icon:"sort",title:"升序",onClick:function(){Ht=!Ht}})),e("选择")]),2),L=S[0],k=(S[1],function(){var t=Tt(It().mark((function t(){var e;return It().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=new l.hf(l.HK.process_get),t.next=3,s.ws.send(e);case 3:s.ws.addMsg(l.HK.process_getting,(function(t){var e,r=[];if(Mt){var o,a=Ct(t.context);try{for(a.s();!(o=a.n()).done;){var u,l=o.value,s=Ct(l);try{for(s.s();!(u=s.n()).done;){var f=u.value;if("".concat(f).includes(Mt)){r.push(l);break}}}catch(t){s.e(t)}finally{s.f()}}}catch(t){a.e(t)}finally{a.f()}}else r.push.apply(r,function(t){if(Array.isArray(t))return Yt(t)}(e=t.context)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||Gt(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());Kt&&(0,Ot.di)(r,(function(t){return t[3]}),!1),Ht&&(0,Ot.di)(r,(function(t){return t[4]}),!1);for(var h=function(){for(var t=r[y],e=0;e<t.length;e++)t[e]=n.createElement(i.xP,{context:3===e?(0,At.v7)(t[e]):t[e]});t.push(n.createElement(p.rA,{icon:"place",title:"选中",onClick:function(){d(t)}}))},y=0;y<r.length;y++)h();w(r.length),c(r)}));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}());return(0,n.useEffect)((function(){return x(Mt),k(),function(){Tt(It().mark((function t(){return It().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:s.ws.isAilive()&&s.ws.setPromise(function(){var t=Tt(It().mark((function t(e){return It().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.ws.unConnect();case 2:e();case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 1:case"end":return t.stop()}}),t)})))()}}),[]),(0,n.useEffect)((function(){Mt=E}),[E]),n.createElement("div",null,n.createElement(h.A,null,f.length>0&&n.createElement("div",null,f[1].props.context),f.length>0&&n.createElement("div",null,n.createElement(p.rA,{icon:"stop",title:"停止",onClick:function(){var t=new l.hf(l.HK.process_close);t.context={pid:f[0].props.context},d([]),s.ws.send(t)}}))),n.createElement(o.xh,null,0!==a.length||Mt?n.createElement(o.fI,null,n.createElement(o.VP,{widthPer:80},n.createElement(i.uF,{title:"进程(".concat(g,")"),titleCom:n.createElement(ot.Sm,{placeholder:"过滤",value:E,handleInputChange:function(t){x(t)}})},n.createElement(y.X,{headers:L,rows:a,width:"10rem"})))):n.createElement(nt,{context:"加载中请等待..."})))}function Vt(t){return Vt="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},Vt(t)}function Ut(){Ut=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:_(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function w(){}var b={};l(b,a,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(I([])));x&&x!==r&&n.call(x,a)&&(b=x);var S=w.prototype=v.prototype=Object.create(b);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==Vt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function A(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 O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(Vt(e)+" is not iterable")}return g.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},L(k.prototype),l(k.prototype,c,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=I,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Wt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Zt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Wt(i,n,o,a,c,"next",t)}function c(t){Wt(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Bt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Xt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Xt(t,e):void 0}}(t,e)||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 Xt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function zt(t){var e=Bt((0,n.useState)(null),2),r=e[0],o=e[1],i=Bt((0,v.L4)(g.A.systemd_shell_show),2),a=i[0],c=(i[1],function(){var t=Zt(Ut().mark((function t(){var e;return Ut().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=new it.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:"#000000",cursor:"#000000",selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4,convertEol:!0}),s.ws.subscribeUnconnect(u),s.ws.addMsg(l.HK.systemd_logs_getting,(function(t){"error"===t.context&&u(),e.write(t.context)})),o(e);case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()),u=function(){Zt(Ut().mark((function t(){return Ut().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r&&(r.writeln("[38;2;29;153;243mclose![0m "),r.dispose(),o(null));case 1:case"end":return t.stop()}}),t)})))()};return(0,n.useEffect)((function(){if(a.show){c();var t=function(t){s.ws.unConnect()};return document.addEventListener("cancel_systemd_logs",t),function(){document.removeEventListener("cancel_systemd_logs",t)}}u()}),[a]),(0,n.useEffect)((function(){return function(){u()}}),[]),n.createElement(at.$,{show:a.show,terminal:r,init:function(t,e){r.writeln("[38;2;29;153;243mconnect...[0m ");var n={unit_name:a.unit_name},o=new l.hf(l.HK.systemd_logs_get);o.context=n,s.ws.send(o)}})}function Dt(t){return Dt="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},Dt(t)}function Rt(){Rt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:_(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function w(){}var b={};l(b,a,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(I([])));x&&x!==r&&n.call(x,a)&&(b=x);var S=w.prototype=v.prototype=Object.create(b);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==Dt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function A(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 O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(Dt(e)+" is not iterable")}return g.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},L(k.prototype),l(k.prototype,c,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=I,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Jt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=ee(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function qt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Qt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){qt(i,n,o,a,c,"next",t)}function c(t){qt(i,n,o,a,c,"throw",t)}a(void 0)}))}}function te(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||ee(t,e)||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 ee(t,e){if(t){if("string"==typeof t)return re(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?re(t,e):void 0}}function re(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var ne,oe="";function ie(t){var e=(0,m.Bd)().t,r=te((0,v.L4)(g.A.systemd_shell_show),2),a=r[0],c=r[1],u=te((0,v.L4)(g.A.confirm),2),w=(u[0],u[1]),E=te((0,n.useState)(["pid","name","process",e("创建用户"),e("内存"),e("cpu%"),e("active状态"),e("选择")]),2),x=E[0],S=(E[1],te((0,n.useState)(["单元名字","加载状态",e("active(sub)状态"),e("描述"),e("选择")]),2)),L=S[0],k=(S[1],te((0,n.useState)([]),2)),_=k[0],j=k[1],A=te((0,n.useState)([]),2),O=A[0],P=A[1],I=te((0,n.useState)([]),2),C=I[0],N=I[1],F=te((0,n.useState)(!1),2),G=F[0],Y=F[1],M=te((0,n.useState)([]),2),K=M[0],H=M[1],$=te((0,n.useState)(""),2),V=$[0],U=$[1],W=te((0,n.useState)(""),2),Z=W[0],B=W[1],X=te((0,n.useState)(new Set),2),z=X[0],D=X[1],R=te((0,v.L4)(g.A.editorSetting),2),J=(R[0],R[1]),q=function(){var t=Qt(Rt().mark((function t(){var e;return Rt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=new l.hf(l.HK.systemd_inside_get),t.next=3,s.ws.send(e);case 3:s.ws.addMsg(l.HK.systemd_inside_getting,(function(t){var e,r=[];if(oe){var o,a=Jt(t.context);try{for(a.s();!(o=a.n()).done;){var c,u=o.value,l=Jt(u);try{for(l.s();!(c=l.n()).done;){var s=c.value;if("".concat(s).includes(oe)){r.push(u);break}}}catch(t){l.e(t)}finally{l.f()}}}catch(t){a.e(t)}finally{a.f()}}else r.push.apply(r,function(t){if(Array.isArray(t))return re(t)}(e=t.context)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||ee(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());for(var f=function(){for(var t=r[h],e=0;e<t.length;e++)t[e]=n.createElement(i.xP,{context:4===e?(0,At.v7)(t[e]):t[e]});t.push(n.createElement(p.rA,{icon:"place",title:"选中",onClick:function(){N(t)}}))},h=0;h<r.length;h++)f();j(r)}));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();(0,n.useEffect)((function(){return B(oe),q(),function(){Qt(Rt().mark((function t(){return Rt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:s.ws.isAilive()&&s.ws.setPromise(function(){var t=Qt(Rt().mark((function t(e){return Rt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.ws.unConnect();case 2:e();case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 1:case"end":return t.stop()}}),t)})))()}}),[]),(0,n.useEffect)((function(){oe=Z}),[Z]);var Q=function(t){if(a.show){c({show:!1,unit_name:""});var e=new CustomEvent("cancel_systemd_logs",{detail:{}});document.dispatchEvent(e)}else c({show:!0,unit_name:t})},tt=function(){var t=Qt(Rt().mark((function t(e){return Rt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:w({open:!0,handle:function(){var t=Qt(Rt().mark((function t(){return Rt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.Yu.post("systemd/sys/delete",{unit_name:e});case 2:t.sent.code===d.m.Sucess&&((0,b.LW)("删除成功"),w({open:!1,handle:null}));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()});case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),et=function(){var t=Qt(Rt().mark((function t(e){return Rt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:w({open:!0,handle:function(){var t=Qt(Rt().mark((function t(){return Rt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.Yu.post("systemd/delete",{unit_name:e});case 2:t.sent.code===d.m.Sucess&&((0,b.LW)("删除成功"),w({open:!1,handle:null}));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()});case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),rt=function(){var t=Qt(Rt().mark((function t(){var e,r,o,a,c,u,l;return Rt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.Yu.get("systemd/inside/all");case 2:if((e=t.sent).code===d.m.Sucess){t.next=5;break}return t.abrupt("return");case 5:return D(new Set(e.data)),t.next=8,f.Yu.get("systemd/allget");case 8:if((r=t.sent).code!==d.m.Sucess){t.next=30;break}o=r.data,a=[],c=Jt(null!=o?o:[]),t.prev=13,l=Rt().mark((function t(){var e,r;return Rt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=u.value,(r=[n.createElement(i.xP,{context:e.unit}),e.load,"".concat(e.active,"(").concat(e.sub,")"),n.createElement(i.xP,{context:e.description})]).push(n.createElement(p.rA,{icon:"place",title:"添加",onClick:function(){H(r)}})),a.push(r);case 4:case"end":return t.stop()}}),t)})),c.s();case 16:if((u=c.n()).done){t.next=20;break}return t.delegateYield(l(),"t0",18);case 18:t.next=16;break;case 20:t.next=25;break;case 22:t.prev=22,t.t1=t.catch(13),c.e(t.t1);case 25:return t.prev=25,c.f(),t.finish(25);case 28:ne=a,P(a);case 30:case"end":return t.stop()}}),t,null,[[13,22,25,28]])})));return function(){return t.apply(this,arguments)}}(),it=function(){var t=Qt(Rt().mark((function t(e){var r;return Rt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.Yu.post("systemd/add",{unit_name:e});case 2:(r=t.sent).code===d.m.Sucess&&(D(new Set(r.data)),(0,b.LW)("添加成功"));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),at=function(){var e=Qt(Rt().mark((function e(r){var n;return Rt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.Yu.post("systemd/get/context",{unit_name:r});case 2:(n=e.sent).code===d.m.Sucess&&(J({model:"text",open:!0,fileName:t.name,save:function(){var t=Qt(Rt().mark((function t(e){var r;return Rt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={context:e},"/"===n.data.path[0]&&(n.data.path=n.data.path.slice(1)),t.next=4,f.$M.post("save/".concat(n.data.path,"?is_sys_path=1"),r);case 4:t.sent.code===d.m.Sucess&&(T.xK.set_value_temp(""),J({open:!1,model:"",fileName:"",save:null}));case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}),T.xK.set_value_temp(n.data.context));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return n.createElement("div",null,n.createElement(h.A,{left_children:n.createElement(p.Z$,{defaultStatus:!1,text:e("系统systemd单元"),clickFun:function(t){Y(t),t?(rt(),N([])):H([])}})},C.length>0&&n.createElement("div",null,C[1].props.context),K.length>0&&n.createElement("div",null,K[0].props.context),C.length>0&&n.createElement("div",null,n.createElement(p.rA,{icon:"delete",title:"从实时监控删除",onClick:function(){et(C[1].props.context)}}),n.createElement(p.rA,{icon:"print",title:"打印日志",onClick:function(){Q(C[1].props.context)}})),K.length>0&&n.createElement("div",null,n.createElement(p.rA,{icon:"delete",title:"删除系统上的sytemd",onClick:function(){tt(K[0].props.context)}}),n.createElement(p.rA,{icon:"print",title:"打印日志",onClick:function(){Q(K[0].props.context)}}),n.createElement(p.rA,{icon:"text_fields",title:"sytemd文件内容",onClick:function(){at(K[0].props.context)}}),!z.has(K[0].props.context)&&n.createElement(p.rA,{icon:"plus_one",title:"添加到管理",onClick:function(){return it(K[0].props.context)}}))),n.createElement(o.xh,null,G&&n.createElement(o.fI,null,n.createElement(o.VP,{widthPer:80},n.createElement(i.uF,{title:"systemd系统单元(".concat(O.length,")"),titleCom:n.createElement(ot.Sm,{placeholder:"过滤单元",value:V,handleInputChange:function(t){U(t)},handlerEnter:function(){var t=[];if(V){var e,r=Jt(ne);try{for(r.s();!(e=r.n()).done;){var n=e.value;(n[0].props.context.includes(V)||n[3].props.context.includes(V))&&t.push(n)}}catch(t){r.e(t)}finally{r.f()}P(t)}else P(ne)}})},n.createElement(y.X,{headers:L,rows:O,width:"10rem"})))),0===_.length&&!G&&n.createElement(nt,{context:"没有管理的单元 or 加载中请等待..."}),0!==_.length&&!G&&n.createElement(o.fI,null,n.createElement(o.VP,{widthPer:80},n.createElement(i.uF,{title:"filecat监控单元(".concat(_.length,")"),titleCom:n.createElement(ot.Sm,{placeholder:"过滤单元",value:Z,handleInputChange:function(t){B(t)}})},n.createElement(y.X,{headers:x,rows:_,width:"10rem"}))))),n.createElement(zt,null))}function ae(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ce(t){var e,r,i=(0,m.Bd)().t,a=(e=(0,v.L4)(g.A.user_base_info),r=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(e,r)||function(t,e){if(t){if("string"==typeof t)return ae(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ae(t,e):void 0}}(e,r)||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.")}()),c=a[0],u=(a[1],[{index:1,name:i("系统性能"),rto:"sys/"},{index:2,name:i("系统进程"),rto:"process/"},{index:3,name:i("docker容器"),rto:"docker/"}]);return c.sys===B.XM.linux&&u.push({index:4,name:i("systemd"),rto:"systemd/"}),n.createElement(o.W1,{optionList:u},n.createElement(rt,null),n.createElement($t,null),n.createElement(jt,null),n.createElement(ie,null))}}}]);
|
|
2
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[623],{3430:(t,e,r)=>{function n(t){return n="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},n(t)}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function i(t,e,r){return e&&o(t.prototype,e),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function a(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}r.d(e,{XM:()=>u,tl:()=>c});var c=i((function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)})),u=function(t){return t[t.win=0]="win",t[t.linux=1]="linux",t}({})},7481:(t,e,r)=>{r.d(e,{S:()=>a,X:()=>i});var n=r(6540);function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function i(t){var e,r,i,a=(r=n.useState([]),i=2,function(t){if(Array.isArray(t))return t}(r)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(r,i)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(r,i)||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.")}()),c=a[0],u=a[1];return(0,n.useEffect)((function(){t.children?u(Array.isArray(t.children)?t.children:[t.children]):u(t.rows)}),[t.rows,t.children]),n.createElement("table",null,n.createElement("thead",null,n.createElement("tr",null,null===(e=t.headers)||void 0===e?void 0:e.map((function(t,e){return n.createElement("th",{key:e},t)})))),n.createElement("tbody",null,c.map((function(e,r){return n.createElement("tr",{key:r},e.map((function(e,r){var o;return n.createElement("td",{style:{width:null!==(o=t.width)&&void 0!==o?o:"auto"},key:r,className:r===c.length-1?"small":""},e)})))}))))}function a(t){return n.createElement("div",{style:{display:t.isFlex?"flex":"block"}},t.columns.map((function(t,e){return n.createElement("div",{key:e},t)})))}},7704:(t,e,r)=>{r.d(e,{$:()=>f});var n=r(6540),o=r(2543),i=r.n(o),a=r(3616),c=(r(9448),r(505)),u=r(2042);function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return s(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(t,e):void 0}}(t,e)||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 s(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function f(t){var e=l((0,n.useState)(25),2),r=e[0],o=e[1],s=(0,n.useRef)(null),f=(0,n.useCallback)(new a.FitAddon,[]),h=(0,n.useRef)(null),p=(0,n.useRef)(null),y=l((0,n.useState)(!1),2),d=y[0],m=y[1],v=(0,n.useCallback)(i().throttle((function(t){f.fit();var e=parseFloat(getComputedStyle(h.current).fontSize),r=window.innerHeight/e-4,n=(window.innerHeight-t.clientY)/e,i=2.25+s.current.offsetHeight/e;n<=r&&n>=i&&o(parseFloat(n.toFixed(2)))}),32),[]);(0,n.useEffect)((function(){t.terminal&&(t.terminal.open(p.current),t.terminal.loadAddon(f),f.fit(),t.init&&t.init(t.terminal.rows,t.terminal.cols),t.terminal.attachCustomKeyEventHandler((function(e){if(e.ctrlKey&&"c"===e.key){var r=t.terminal.getSelection();if(r)return(0,c.l)(r),(0,u.LW)("已复制"),e.preventDefault(),t.terminal.focus(),!1}else if("keydown"===e.type&&"v"===e.key&&e.ctrlKey)return!1;return!0})))}),[t.terminal]),(0,n.useEffect)((function(){return function(){t.terminal&&t.terminal.dispose()}}),[]);var g=function(){m(!1),h.current.removeEventListener("pointermove",v)};if(t.show)return t.get_simple?n.createElement("div",{className:"pty",style:{height:"100%"},ref:p}):n.createElement("div",{className:"shell",style:{height:"".concat(r,"em"),display:"".concat(t.file_shell_hidden?"none":"block")},ref:h},n.createElement("div",{className:"shell__divider",ref:s,onPointerDown:function(){m(!0),h.current.addEventListener("pointermove",v)},onPointerUp:g}),n.createElement("div",{className:"pty",style:{height:"".concat(r-1,"em")},ref:p}),d&&n.createElement("div",{className:"shell__overlay",onPointerUp:g}))}},9623:(t,e,r)=>{r.r(e),r.d(e,{default:()=>ce});var n=r(6540),o=r(5725),i=r(447),a=r(8868);function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}const u=function(t){var e,r,o=t.percentage,i=(0,n.useRef)(null),u=(e=(0,n.useState)(null),r=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(e,r)||function(t,e){if(t){if("string"==typeof t)return c(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}(e,r)||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.")}()),l=u[0],s=u[1];return(0,n.useEffect)((function(){var t=i.current.getContext("2d"),e=new a.Ay(t,{type:"doughnut",data:{labels:["use","left"],datasets:[{data:[o,100-o],backgroundColor:["#007bff","#f0f0f0"],borderWidth:0}]},options:{plugins:{legend:{display:!1},tooltip:{enabled:!1}},elements:{arc:{borderWidth:0}}}});return s(e),function(){e.destroy()}}),[]),(0,n.useEffect)((function(){l&&(l.data.datasets[0].data=[o,100-o],l.update())}),[o]),n.createElement("div",{style:{width:"8rem",overflow:"hidden"}},n.createElement("canvas",{ref:i}))};var l=r(4238),s=r(4944),f=r(6007),h=r(7952),p=r(5997),y=r(7481),d=r(3459),m=r(2389),v=r(7444),g=r(6417),w=r(4777),b=r(2042);function E(t){return E="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},E(t)}function x(){x=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new C(n||[]);return o(a,"_invoke",{value:A(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function w(){}var b={};l(b,a,(function(){return this}));var S=Object.getPrototypeOf,L=S&&S(S(N([])));L&&L!==r&&n.call(L,a)&&(b=L);var k=w.prototype=v.prototype=Object.create(b);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==E(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function A(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=O(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function O(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(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 I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function N(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(E(e)+" is not iterable")}return g.prototype=w,o(k,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},_(j.prototype),l(j.prototype,c,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new j(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(k),l(k,u,"Generator"),l(k,a,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=N,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function S(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=_(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function L(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function k(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||_(t,e)||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 _(t,e){if(t){if("string"==typeof t)return j(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?j(t,e):void 0}}function j(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function A(t){var e=(0,m.Bd)().t,r=k((0,v.L4)(g.A.disk),2),a=(r[0],r[1]),c=k((0,n.useState)({}),2),u=c[0],l=c[1],s=k((0,n.useState)([]),2),w=s[0],b=s[1],E=[e("名字"),e("当前值"),e("历史最低"),e("临界值")],_=function(){var r,o=(r=x().mark((function r(){var o,i,a,c,u,s,h;return x().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,f.Yu.post("sys/disk/info",{name:t.name});case 2:if((o=r.sent).code===d.m.Sucess){a=[],c=S(null!==(i=o.data.ata_smart_attributes)&&void 0!==i?i:[]);try{for(c.s();!(u=c.n()).done;)s=u.value,h=void 0,s[1]>=s[2]?h="var(--icon-green)":s[1]<=s[3]&&(h="var(--icon-red)"),s[0]=n.createElement("span",{style:{color:h}},e(s[0])),a.push(s)}catch(t){c.e(t)}finally{c.f()}b(o.data.ata_smart_attributes),l(o.data)}case 4:case"end":return r.stop()}}),r)})),function(){var t=this,e=arguments;return new Promise((function(n,o){var i=r.apply(t,e);function a(t){L(i,n,o,a,c,"next",t)}function c(t){L(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return o.apply(this,arguments)}}();return(0,n.useEffect)((function(){_()}),[u]),n.createElement("div",null,n.createElement(h.A,null,n.createElement(p.rA,{icon:"close",title:e("关闭"),onClick:function(){a({})}})),n.createElement(o.jW,{isFull:!0,more:!0},n.createElement(o.NN,null,n.createElement(o.fI,null,n.createElement(o.VP,{widthPer:30},n.createElement(o.xh,null,n.createElement(i.Zp,{title:e("基本信息")},n.createElement(o.Yh,{left:e("名字"),right:t.name}),n.createElement(o.Yh,{left:e("厂商名称"),right:t.typeName}),n.createElement(o.Yh,{left:e("类型"),right:t.type}),n.createElement(o.Yh,{left:e("容量"),right:t.total}))),n.createElement(o.xh,null,n.createElement(i.Zp,{title:e("物理信息")},n.createElement(o.Yh,{left:e("是否健康"),right:!0===u.smart_status?"是":"否"}),n.createElement(o.Yh,{left:e("设备型号"),right:u.model_name}),n.createElement(o.Yh,{left:e("序列号"),right:u.serial_number}),n.createElement(o.Yh,{left:e("固件版本"),right:u.firmware_version}),n.createElement(o.Yh,{left:e("转速(每分钟)"),right:u.rotation_rate}),n.createElement(o.Yh,{left:e("通电时长(小时)"),right:u.power_on_time_hours}),n.createElement(o.Yh,{left:e("通电次数"),right:u.power_cycle_count}),n.createElement(o.Yh,{left:e("温度(°C)"),right:u.temperature}),n.createElement(o.Yh,{left:e("通信协议"),right:u.device_protocol})))),n.createElement(o.VP,{widthPer:50},n.createElement(o.xh,null,n.createElement(i.uF,{title:e("SMART详细信息")},n.createElement(y.X,{headers:E,rows:w,width:"10rem"}))))))))}var O=function(t){return t[t.mount=0]="mount",t}({});function P(){return P=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},P.apply(null,arguments)}function I(t){return n.createElement("div",{className:"black-tip",onClick:function(){t.click&&t.click(t)},onContextMenu:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),t.onContextMenu&&t.onContextMenu(e,t)}},t.name)}var C=function(t){return n.createElement("li",null,t.click?n.createElement(I,P({},t.node,{name:t.render?t.render(t.node):t.node.name,click:t.click,onContextMenu:t.onContextMenu})):n.createElement("div",null,t.render?t.render(t.node):t.node.name),t.node.children&&t.node.children.length>0&&n.createElement("ul",null,t.node.children.map((function(e,r){return n.createElement(C,{key:r,node:e,click:t.click,onContextMenu:t.onContextMenu,render:t.render})}))))};const N=function(t){return n.createElement("div",{className:"card-tree-view"},n.createElement("ul",null,t.list&&t.list.map((function(e,r){return n.createElement(C,{key:r,node:e,click:t.click,onContextMenu:t.onContextMenu,render:t.render})}))))};var T=r(8247);function F(t){return F="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},F(t)}function G(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=$(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function Y(){Y=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:_(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function w(){}var b={};l(b,a,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(I([])));x&&x!==r&&n.call(x,a)&&(b=x);var S=w.prototype=v.prototype=Object.create(b);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==F(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function A(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 O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(F(e)+" is not iterable")}return g.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},L(k.prototype),l(k.prototype,c,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=I,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function M(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function K(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){M(i,n,o,a,c,"next",t)}function c(t){M(i,n,o,a,c,"throw",t)}a(void 0)}))}}function H(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||$(t,e)||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 $(t,e){if(t){if("string"==typeof t)return V(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?V(t,e):void 0}}function V(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var U=function(t){return n.createElement("div",{style:{border:"2px solid black",padding:"10px",width:"300px",height:"300px",position:"relative"}},t.name,t.lvms.map((function(t,e){return n.createElement("div",{key:e,style:{margin:"5px",height:"".concat(40,"px"),display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid "}},t.name)})))};function W(){return n.createElement("div",{style:{position:"relative",height:"300px",margin:"10px",width:"30px",display:"flex",alignItems:"center",justifyContent:"center"}},n.createElement("div",{style:{width:0,height:0,borderTop:"10px solid transparent",borderBottom:"10px solid transparent",borderLeft:"10px solid black"}}))}function Z(){var t=(0,m.Bd)().t,e=H((0,v.L4)(g.A.disk),2),r=(e[0],e[1]),a=H((0,n.useState)({}),2),c=a[0],u=(a[1],H((0,n.useState)([]),2)),l=u[0],s=u[1],w=H((0,n.useState)([]),2),E=w[0],x=w[1],S=H((0,v.L4)(g.A.showPrompt),2),L=(S[0],S[1],H((0,n.useState)([]),2)),k=L[0],_=(L[1],(0,T.kZ)().click_file),j=H((0,v.L4)(g.A.prompt_card),2),A=(j[0],j[1]),P=[t("挂载点"),"uuid",t("类型"),t("文件系统类型"),t("文件系统容量"),t("卷容量"),t("设备路径"),t("分区表类型")],I=function(){var t=K(Y().mark((function t(){var e;return Y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.Yu.get("disk/blk");case 2:return(e=t.sent).code===d.m.Sucess&&s(e.data),t.abrupt("return",e.code);case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),C=function(){var t=K(Y().mark((function t(){return Y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:I();case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return(0,n.useEffect)((function(){C()}),[c]),n.createElement("div",null,n.createElement(h.A,null,n.createElement(p.rA,{icon:"close",title:t("关闭"),onClick:function(){r({})}})),n.createElement(o.jW,{isFull:!0,more:!0},n.createElement(o.NN,null,n.createElement(o.fI,null,n.createElement(o.VP,{widthPer:40},n.createElement(i.Zp,{title:t("物理块(硬盘)设备、逻辑卷、物理卷"),titleCom:n.createElement("div",null,n.createElement(p.rA,{icon:"file_open",title:t("打开挂载文件"),onClick:K(Y().mark((function e(){return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:_({name:"fstab(谨慎修改,内容错误会导致系统无法启动)",model:"text",sys_path:"etc/fstab",menu_list:[n.createElement(p.rA,{icon:"info",title:t("提示"),onClick:K(Y().mark((function t(){return Y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:A({open:!0,title:"信息",context_div:n.createElement("div",null,n.createElement("ul",null,n.createElement("li",null,"通用格式:","<文件系统> <挂载点> <类型> <挂载选项> <dump> <fsck> "),n.createElement("li",null,"文件系统,有多种格式",n.createElement("ul",null,n.createElement("li",null,"1(usb口默认名称)./dev/sda1"),n.createElement("li",null,"2(唯一Id).UUID=123e4567-e89b-12d3-a456-426614174000"),n.createElement("li",null,"3.LABEL=DATA"))),n.createElement("li",null,"挂载点,就是文件路径,例如 /mnt/data ,这个目录要提前创建,且为空"),n.createElement("li",null,"类型,就是文件系统类型,对于系统不支持的类型,例如ntfs需要额外前提安装ntfs-3g"),n.createElement("li",null,'挂载选项的值只能是以下这些,可以用 "," 同时使用多个选项',n.createElement("ul",null,n.createElement("li",null,"defaults:使用默认挂载选项"),n.createElement("li",null,"noatime:不更新访问时间,提高性能"),n.createElement("li",null,"auto:系统启动时自动挂载"),n.createElement("li",null,"rw:以读写方式挂载"),n.createElement("li",null,"nofail:防止启动阻塞,挂载失败系统继续执行"),n.createElement("li",null,"...等"))),n.createElement("li",null,"dump 0是需要备份 1是不需要备份"),n.createElement("li",null,"Fsck 整数值0是不检查,文件系统检查顺序越小越先检查"),n.createElement("li",null,"提示:只有含有文件系统的逻辑卷,或者分区才可以进行挂载。")))});case 1:case"end":return t.stop()}}),t)})))}),n.createElement(p.rA,{key:1,icon:"update",title:t("更新挂载"),onClick:K(Y().mark((function t(){return Y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.Yu.post("cmd/exe",{type:O.mount});case 2:t.sent.code===d.m.Sucess&&(0,b.LW)("挂载文件已生效");case 4:case"end":return t.stop()}}),t)})))})]});case 1:case"end":return e.stop()}}),e)})))}),n.createElement(p.rA,{icon:"update",title:t("刷新"),onClick:K(Y().mark((function t(){return Y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,I();case 2:if(t.t0=t.sent,t.t1=d.m.Sucess,t.t0!==t.t1){t.next=6;break}(0,b.LW)("刷新成功");case 6:case 7:case"end":return t.stop()}}),t)})))}))},n.createElement(y.X,{headers:P,rows:E,width:"10rem"}),n.createElement(N,{list:l,render:function(t){var e=t.name;return t.label&&(e+="(".concat(t.label,")")),t.mountpoint?n.createElement("span",null,e,n.createElement("span",{style:{color:"green"}},"(已挂载)")):e},onContextMenu:function(t,e){t.preventDefault()},click:function(e){var r="";if(e.mountpoint)for(var o=0;o<e.mountpoints.length;o++)r+=e.mountpoints[o]+";";x([[n.createElement(i.xP,null,r),n.createElement(i.xP,null,e.uuid),t(e.type),t(e.fstype),e.fssize,e.size,n.createElement(i.xP,null,e.path),e.pttype]])}}))),n.createElement(o.VP,{widthPer:60},k.map((function(e,r){var a,c=[],u=G(e.pv_list);try{for(u.s();!(a=u.n()).done;){var l=a.value;c.push({name:"".concat(l.name,"---(").concat(l.size,")---(").concat(l.free_size,")")})}}catch(t){u.e(t)}finally{u.f()}var s,f=[],h=G(e.lv_list);try{for(h.s();!(s=h.n()).done;){var p=s.value;f.push({name:"".concat(p.name,"---(").concat(p.size,")")})}}catch(t){h.e(t)}finally{h.f()}return n.createElement(i.Zp,{key:r},n.createElement(o.n5,null,n.createElement(U,{name:t("物理卷"),lvms:c}),n.createElement(W,null),n.createElement(U,{name:"".concat(t("逻辑卷"),"---(").concat(e.name,")---size(").concat(e.size,")"),lvms:[]}),n.createElement(W,null),n.createElement(U,{name:t("逻辑卷"),lvms:f})))})))))))}var B=r(3430);function X(t){return X="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},X(t)}function z(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Q(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function D(){D=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:_(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function w(){}var b={};l(b,a,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(I([])));x&&x!==r&&n.call(x,a)&&(b=x);var S=w.prototype=v.prototype=Object.create(b);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==X(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function A(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 O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(X(e)+" is not iterable")}return g.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},L(k.prototype),l(k.prototype,c,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=I,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function R(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function J(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){R(i,n,o,a,c,"next",t)}function c(t){R(i,n,o,a,c,"throw",t)}a(void 0)}))}}function q(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||Q(t,e)||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 Q(t,e){if(t){if("string"==typeof t)return tt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?tt(t,e):void 0}}function tt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var et=!0;function rt(t){var e=(0,m.Bd)().t,r=[e("名字"),e("厂商名称"),e("类型"),e("容量")],a=[e("名字"),e("物理硬盘"),e("文件系统类型"),e("挂载位置"),e("总容量"),e("剩余容量")],c=q((0,v.L4)(g.A.user_base_info),2),E=c[0],x=(c[1],q((0,n.useState)(0),2)),S=x[0],L=x[1],k=q((0,n.useState)(0),2),_=k[0],j=k[1],O=q((0,n.useState)(0),2),P=O[0],I=O[1],C=q((0,n.useState)(0),2),N=C[0],T=C[1],F=q((0,n.useState)({}),2),G=F[0],Y=F[1],M=q((0,n.useState)(!1),2),K=M[0],H=M[1],$=q((0,n.useState)(!1),2),V=$[0],U=$[1],W=q((0,n.useState)(!1),2),X=W[0],R=W[1],Q=q((0,n.useState)(et),2),tt=Q[0],rt=Q[1],nt=q((0,n.useState)([]),2),ot=nt[0],it=nt[1],at=q((0,n.useState)([]),2),ct=at[0],ut=at[1],lt=q((0,v.L4)(g.A.user_base_info),2),st=lt[0],ft=(lt[1],q((0,v.L4)(g.A.disk),2)),ht=ft[0],pt=ft[1],yt=function(){var t=J(D().mark((function t(){var e;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(et){t.next=3;break}return s.ws.unConnect(),t.abrupt("return");case 3:return e=new l.hf(l.HK.sys_get),t.next=6,s.ws.send(e);case 6:s.ws.addMsg(l.HK.sys_getting,(function(t){var e,r,n;T(null===(e=t.context)||void 0===e?void 0:e.cpu_currentLoad);var o=null===(r=t.context)||void 0===r?void 0:r.memLeft,i=null===(n=t.context)||void 0===n?void 0:n.memTotal;j(o),I(i),L((i-o)/i*100)}));case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),dt=function(){var t=J(D().mark((function t(){return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,yt();case 2:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),mt=function(){var t=J(D().mark((function t(){var e,r;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.Yu.get("base");case 2:(e=t.sent).code===d.m.Sucess&&(r=e.data,Y(r));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),vt=function(){var t=J(D().mark((function t(){var r,o,a,c,u,l,s;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.Yu.get("disk");case 2:if((r=t.sent).code!==d.m.Sucess){t.next=25;break}o=r.data,a=[],c=!0,st.sysSoftWare&&st.sysSoftWare[w.jk.smartmontools]&&st.sysSoftWare[w.jk.smartmontools].installed||(c=!1),u=z(null!=o?o:[]),t.prev=9,s=D().mark((function t(){var r;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=l.value,a.push([n.createElement(i.xP,{context:r.name}),r.typeName,r.type,r.total,n.createElement(p.rA,{icon:"health_and_safety",title:e("查看健康信息"),onClick:function(){c?pt({type:"check",data:r}):(0,b.zN)("没有安装smartmontools")}})]);case 2:case"end":return t.stop()}}),t)})),u.s();case 12:if((l=u.n()).done){t.next=16;break}return t.delegateYield(s(),"t0",14);case 14:t.next=12;break;case 16:t.next=21;break;case 18:t.prev=18,t.t1=t.catch(9),u.e(t.t1);case 21:return t.prev=21,u.f(),t.finish(21);case 24:it(a);case 25:case"end":return t.stop()}}),t,null,[[9,18,21,24]])})));return function(){return t.apply(this,arguments)}}(),gt=function(){var t=J(D().mark((function t(){var e,r,o,a,c,u;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.Yu.get("filedisk");case 2:if((e=t.sent).code===d.m.Sucess){r=e.data,o=[],a=z(null!=r?r:[]);try{for(a.s();!(c=a.n()).done;)u=c.value,o.push([n.createElement(i.xP,{context:u.name}),n.createElement(i.xP,{context:u.device_name}),u.fsType,n.createElement(i.xP,{context:u.mount}),u.total,u.available])}catch(t){a.e(t)}finally{a.f()}ut(o)}case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return(0,n.useEffect)((function(){return dt(),function(){J(D().mark((function t(){return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:s.ws.isAilive()&&s.ws.setPromise(function(){var t=J(D().mark((function t(e){return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.ws.unConnect();case 2:e();case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 1:case"end":return t.stop()}}),t)})))()}}),[]),n.createElement("div",null,n.createElement(h.A,null,E.sys===B.XM.linux&&n.createElement(p.rA,{icon:"sd_card",title:"硬盘挂载",onClick:function(){pt({type:"mount"})}}),n.createElement(p.Z$,{defaultStatus:!1,text:e("基本信息"),clickFun:function(t){H(t),t&&mt()}}),n.createElement(p.Z$,{defaultStatus:!1,text:e("物理硬盘"),clickFun:function(t){U(t),t&&vt()}}),n.createElement(p.Z$,{defaultStatus:!1,text:e("文件硬盘"),clickFun:function(t){R(t),t&>()}}),n.createElement(p.Z$,{defaultStatus:tt,text:e("实时信息"),clickFun:function(t){rt(t),et=t,yt()}})),n.createElement(o.xh,null,tt&&n.createElement(o.fI,null,n.createElement(o.VP,{widthPer:33},n.createElement(i.Zp,{title:e("内存")},n.createElement(o.fI,null,n.createElement(o.VP,null,n.createElement(u,{percentage:S})),n.createElement(o.VP,null,n.createElement(o.fI,null,n.createElement(o.VP,{widthPer:100},n.createElement("div",null,n.createElement(o.Yh,{left:e("总容量"),center:"".concat(P,"G")}))),n.createElement(o.VP,{widthPer:100},n.createElement(o.Yh,{left:e("剩余"),center:"".concat(_,"G")}))))))),n.createElement(o.VP,{widthPer:33},n.createElement(i.Zp,{title:"cpu"},n.createElement(o.fI,null,n.createElement(o.VP,null,n.createElement(u,{percentage:N})),n.createElement(o.VP,null,n.createElement(o.fI,null,n.createElement(o.Yh,{left:e("使用率"),center:N}))))))),n.createElement(o.fI,null,K&&n.createElement(o.VP,null,n.createElement(i.Zp,{title:e("基本信息")},n.createElement(o.Yh,{left:e("总内存"),right:G.mem_total}),n.createElement(o.Yh,{left:"cpu ".concat(e("制造商")),right:G.cpu_manufacturer}),n.createElement(o.Yh,{left:"cpu ".concat(e("品牌")),right:G.cpu_brand}),n.createElement(o.Yh,{left:"cpu ".concat(e("逻辑核心")),right:G.cpu_core_num}),n.createElement(o.Yh,{left:"cpu ".concat(e("物理核心")),right:G.cpu_phy_core_num}),n.createElement(o.Yh,{left:"cpu ".concat(e("最大"),"hz"),right:G.cpu_speed_hz}),n.createElement(o.Yh,{left:"当前系统:pid;ppid",right:G.pid_ppid}),n.createElement(o.Yh,{left:"运行用户",right:G.user}))),V&&n.createElement(o.VP,null,n.createElement(i.uF,{title:e("物理硬盘")},n.createElement(y.X,{headers:r,rows:ot,width:"10rem"}))),X&&n.createElement(o.VP,null,n.createElement(i.uF,{title:e("文件硬盘")},n.createElement(y.X,{headers:a,rows:ct,width:"10rem"}))))),ht&&"check"===ht.type&&n.createElement(A,ht.data),ht&&"mount"===ht.type&&n.createElement(Z,null))}function nt(t){return n.createElement("h2",{className:"message"},n.createElement("i",{className:"material-icons"},"sentiment_dissatisfied"),n.createElement("span",null,t.context))}var ot=r(3033),it=r(7856),at=r(7704),ct=r(4405);function ut(t){return ut="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},ut(t)}function lt(){lt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:_(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function w(){}var b={};l(b,a,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(I([])));x&&x!==r&&n.call(x,a)&&(b=x);var S=w.prototype=v.prototype=Object.create(b);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==ut(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function A(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 O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(ut(e)+" is not iterable")}return g.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},L(k.prototype),l(k.prototype,c,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=I,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function st(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function ft(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){st(i,n,o,a,c,"next",t)}function c(t){st(i,n,o,a,c,"throw",t)}a(void 0)}))}}function ht(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return pt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?pt(t,e):void 0}}(t,e)||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 pt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function yt(t){var e=ht((0,n.useState)(null),2),r=e[0],o=e[1],i=ht((0,v.L4)(g.A.dockerShellShow),2),a=i[0],c=(i[1],function(){var t=ft(lt().mark((function t(){var e,r,n;return lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=new it.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:"#000000",cursor:"#000000",selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4,convertEol:!0}),s.ws.subscribeUnconnect(u),n=function(t){e.write(t)},r=function(t){e.clear(),e.write(t),r=n},s.ws.addMsg("logs"===a.type?l.HK.docker_shell_logs_getting:l.HK.docker_shell_exec_getting,(function(t){"error"===t.context&&u(),r(t.context)})),"exec"===a.type&&e.onData(function(){var t=ft(lt().mark((function t(e){var r;return lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(r=new l.hf(l.HK.docker_shell_exec)).context=e,t.next=4,s.ws.send(r);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),o(e);case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()),u=function(){ft(lt().mark((function t(){return lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r&&(r.writeln("[38;2;29;153;243mclose![0m "),r.dispose(),o(null));case 1:case"end":return t.stop()}}),t)})))()};return(0,n.useEffect)((function(){a.show?c():u()}),[a]),(0,n.useEffect)((function(){return function(){u()}}),[]),n.createElement(at.$,{show:a.show,terminal:r,init:function(t,e){r.writeln("[38;2;29;153;243mconnect...[0m ");var n,o=new ct.n;o.rows=t,o.cols=e,o.dockerId=a.dockerId,(n="logs"===a.type?new l.hf(l.HK.docker_shell_logs):new l.hf(l.HK.docker_shell_exec_open)).context=o,s.ws.send(n)}})}var dt=r(2869);function mt(t){return mt="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},mt(t)}function vt(){vt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:_(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function w(){}var b={};l(b,a,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(I([])));x&&x!==r&&n.call(x,a)&&(b=x);var S=w.prototype=v.prototype=Object.create(b);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==mt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function A(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 O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(mt(e)+" is not iterable")}return g.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},L(k.prototype),l(k.prototype,c,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=I,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function gt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=xt(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function wt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function bt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){wt(i,n,o,a,c,"next",t)}function c(t){wt(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Et(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||xt(t,e)||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 xt(t,e){if(t){if("string"==typeof t)return St(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?St(t,e):void 0}}function St(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var Lt="",kt=[],_t=!1;function jt(t){var e=(0,m.Bd)().t,r=Et((0,n.useState)({}),2),a=r[0],c=r[1],u=Et((0,n.useState)([]),2),w=u[0],E=u[1],x=Et((0,n.useState)([]),2),S=x[0],L=x[1],k=Et((0,v.L4)(g.A.dockerShellShow),2),_=k[0],j=k[1],A=Et((0,v.L4)(g.A.showPrompt),2),O=(A[0],A[1]),P=Et((0,n.useState)(Lt),2),I=P[0],C=P[1],N=Et((0,n.useState)(["id",e("名字"),e("镜像"),e("命令"),e("状态"),e("内存"),"cpu%",e("选择")]),2),T=N[0],F=(N[1],Et((0,n.useState)([]),2)),G=F[0],Y=F[1],M=Et((0,n.useState)(void 0),2),K=M[0],H=M[1],$=Et((0,n.useState)(!1),2),V=$[0],U=$[1],W=["id",e("name"),e("create时间"),e("大小"),n.createElement("span",null,"选中",n.createElement(p.rA,{icon:"check_box",title:"全选",onClick:function(){_t=!_t;for(var t={},e=0;e<S.length&&_t;e++)t[S[e][0].props.context]=1;c(t)}}))],Z=function(){var t=bt(vt().mark((function t(){var e;return vt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=new l.hf(l.HK.docker_get),t.next=3,s.ws.send(e);case 3:s.ws.addMsg(l.HK.docker_getting,(function(t){var e,r=[];if(Lt){var o,a=gt(t.context);try{for(a.s();!(o=a.n()).done;){var c,u=o.value,l=gt(u);try{for(l.s();!(c=l.n()).done;){var s=c.value;if("".concat(s).includes(Lt)){r.push(u);break}}}catch(t){l.e(t)}finally{l.f()}}}catch(t){a.e(t)}finally{a.f()}}else r.push.apply(r,function(t){if(Array.isArray(t))return St(t)}(e=t.context)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||xt(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());for(var f=function(){for(var t=r[h],e=0;e<t.length;e++)t[e]=n.createElement(i.xP,{context:t[e]});t.push(n.createElement(p.rA,{icon:"place",title:"选中",onClick:function(){Y(t)}}))},h=0;h<r.length;h++)f();E(r)}));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();(0,n.useEffect)((function(){return C(Lt),Z(),function(){bt(vt().mark((function t(){return vt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:j({show:!1,type:"",dockerId:""}),s.ws.isAilive()&&s.ws.setPromise(function(){var t=bt(vt().mark((function t(e){return vt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.ws.unConnect();case 2:e();case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 2:case"end":return t.stop()}}),t)})))()}}),[]),(0,n.useEffect)((function(){Lt=I}),[I]);var B=function(){s.ws.isAilive()&&s.ws.setPromise(function(){var t=bt(vt().mark((function t(e){var r;return vt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(r=new l.hf("logs"===_.type?l.HK.docker_shell_logs_cancel:l.HK.docker_shell_exec_cancel)).context="",t.next=4,s.ws.send(r);case 4:e();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},X=function(t){var e=new l.hf(l.HK.docker_switch);e.context={type:t,dockerId:G[0].props.context},Y([]),s.ws.send(e)},z=function(){var t=bt(vt().mark((function t(){var e,r,o,a,c,u,l;return vt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.Yu.get("docker/images");case 2:if((e=t.sent).code===d.m.Sucess){for(o=null!==(r=e.data)&&void 0!==r?r:[],a=[],c=0;c<o.length;c++)u=o[c],l=[n.createElement(i.xP,{context:u[0]}),n.createElement(i.xP,{context:u[1]}),u[2],u[3],""],a.push(l);kt=a,L(a)}case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),D=function(){var t=bt(vt().mark((function t(){var e,r;return vt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=Object.keys(a),t.next=3,f.Yu.post("docker/check/delete",{ids:e});case 3:if((r=t.sent).code!==d.m.Sucess){t.next=13;break}if(0!==r.data.length){t.next=12;break}return t.next=8,f.Yu.post("docker/delete",{ids:e});case 8:t.sent.code===d.m.Sucess&&((0,b.LW)("删除完成"),z()),t.next=13;break;case 12:(0,b.N9)("有镜像正在运行".concat(JSON.stringify(r.data)));case 13:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),R=function(){var t=bt(vt().mark((function t(){var e;return vt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=new l.hf(l.HK.docker_get),t.next=3,s.ws.send(e);case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return n.createElement("div",null,n.createElement(h.A,{left_children:n.createElement(p.Z$,{defaultStatus:!1,text:e("docker镜像"),clickFun:function(t){U(t),t?(s.ws.unConnect(),z(),Y([])):(Z(),L([]))}})},Object.keys(a).length>0&&n.createElement(p.rA,{icon:"delete",title:"删除镜像",onClick:D}),G.length>0&&n.createElement("div",null,G[1].props.context),G.length>0&&n.createElement("div",null,n.createElement(p.rA,{icon:"delete",title:"删除容器",onClick:function(){O({show:!0,overlay:!0,type:dt.PromptEnum.DockerDel,data:{dockerId:G[0].props.context,name:G[1].props.context}})}}),n.createElement(p.rA,{icon:"print",title:"打印日志",onClick:function(){_.show?(j({show:!1,type:"",dockerId:""}),B()):j({show:!0,dockerId:G[0].props.context,type:"logs"})}}),n.createElement(p.rA,{icon:"personal_video",title:"执行命令",onClick:function(){_.show?(j({show:!1,type:"",dockerId:""}),B()):j({show:!0,dockerId:G[0].props.context,type:"exec"})}}),G[4].props.context.includes("Up")?n.createElement(p.rA,{icon:"stop",title:"停止",onClick:function(){return X("stop")}}):n.createElement(p.rA,{icon:"play_arrow",title:"开启",onClick:function(){X("start")}})),(0!==w.length||I)&&!V&&n.createElement(p.rA,{icon:"refresh",title:"列表更新",onClick:R})),n.createElement(o.xh,null,V&&n.createElement(o.fI,null,n.createElement(o.VP,{widthPer:80},n.createElement(i.uF,{title:"镜像(".concat(S.length,")"),titleCom:n.createElement(ot.Sm,{placeholder:"过滤镜像",value:K,handleInputChange:function(t){H(t)},handlerEnter:function(){var t=[];if(K){var e,r=gt(S);try{for(r.s();!(e=r.n()).done;){var n=e.value;(n[0].props.context.includes(K)||n[1].props.context.includes(K))&&t.push(n)}}catch(t){r.e(t)}finally{r.f()}L(t)}else L(kt)}})},n.createElement(y.X,{headers:W,rows:S.map((function(t,r){return t[4]=n.createElement(ot.GL,{value:r,context:e(""),selected:a[t[0].props.context],onchange:function(){var e,r;e=t[0].props.context,r={},Object.assign(r,a),r[e]?delete r[e]:r[e]=1,c(r)}}),t})),width:"10rem"})))),0===w.length&&!I&&!V&&n.createElement(nt,{context:"检测不到docker,主机可能没有安装docker or 容器为空"}),(0!==w.length||I)&&!V&&n.createElement(o.fI,null,n.createElement(o.VP,{widthPer:80},n.createElement(i.uF,{title:"容器(".concat(w.length,")"),titleCom:n.createElement(ot.Sm,{placeholder:"过滤",value:I,handleInputChange:function(t){C(t)}})},n.createElement(y.X,{headers:T,rows:w,width:"10rem"}))))),n.createElement(yt,null))}var At=r(8815),Ot=r(4694);function Pt(t){return Pt="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},Pt(t)}function It(){It=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:_(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function w(){}var b={};l(b,a,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(I([])));x&&x!==r&&n.call(x,a)&&(b=x);var S=w.prototype=v.prototype=Object.create(b);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==Pt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function A(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 O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(Pt(e)+" is not iterable")}return g.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},L(k.prototype),l(k.prototype,c,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=I,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Ct(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Gt(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function Nt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Tt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Nt(i,n,o,a,c,"next",t)}function c(t){Nt(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Ft(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||Gt(t,e)||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 Gt(t,e){if(t){if("string"==typeof t)return Yt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Yt(t,e):void 0}}function Yt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var Mt="",Kt=!1,Ht=!1;function $t(t){var e=(0,m.Bd)().t,r=Ft((0,n.useState)([]),2),a=r[0],c=r[1],u=Ft((0,n.useState)([]),2),f=u[0],d=u[1],v=Ft((0,n.useState)(0),2),g=v[0],w=v[1],b=Ft((0,n.useState)(""),2),E=b[0],x=b[1],S=Ft((0,n.useState)(["pid",e("名字"),"创建用户",n.createElement("span",null,e("内存"),n.createElement(p.rA,{icon:"sort",title:"升序",onClick:function(){Kt=!Kt}})),n.createElement("span",null,"cpu%",n.createElement(p.rA,{icon:"sort",title:"升序",onClick:function(){Ht=!Ht}})),e("选择")]),2),L=S[0],k=(S[1],function(){var t=Tt(It().mark((function t(){var e;return It().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=new l.hf(l.HK.process_get),t.next=3,s.ws.send(e);case 3:s.ws.addMsg(l.HK.process_getting,(function(t){var e,r=[];if(Mt){var o,a=Ct(t.context);try{for(a.s();!(o=a.n()).done;){var u,l=o.value,s=Ct(l);try{for(s.s();!(u=s.n()).done;){var f=u.value;if("".concat(f).includes(Mt)){r.push(l);break}}}catch(t){s.e(t)}finally{s.f()}}}catch(t){a.e(t)}finally{a.f()}}else r.push.apply(r,function(t){if(Array.isArray(t))return Yt(t)}(e=t.context)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||Gt(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());Kt&&(0,Ot.di)(r,(function(t){return t[3]}),!1),Ht&&(0,Ot.di)(r,(function(t){return t[4]}),!1);for(var h=function(){for(var t=r[y],e=0;e<t.length;e++)t[e]=n.createElement(i.xP,{context:3===e?(0,At.v7)(t[e]):t[e]});t.push(n.createElement(p.rA,{icon:"place",title:"选中",onClick:function(){d(t)}}))},y=0;y<r.length;y++)h();w(r.length),c(r)}));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}());return(0,n.useEffect)((function(){return x(Mt),k(),function(){Tt(It().mark((function t(){return It().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:s.ws.isAilive()&&s.ws.setPromise(function(){var t=Tt(It().mark((function t(e){return It().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.ws.unConnect();case 2:e();case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 1:case"end":return t.stop()}}),t)})))()}}),[]),(0,n.useEffect)((function(){Mt=E}),[E]),n.createElement("div",null,n.createElement(h.A,null,f.length>0&&n.createElement("div",null,f[1].props.context),f.length>0&&n.createElement("div",null,n.createElement(p.rA,{icon:"stop",title:"停止",onClick:function(){var t=new l.hf(l.HK.process_close);t.context={pid:f[0].props.context},d([]),s.ws.send(t)}}))),n.createElement(o.xh,null,0!==a.length||Mt?n.createElement(o.fI,null,n.createElement(o.VP,{widthPer:80},n.createElement(i.uF,{title:"进程(".concat(g,")"),titleCom:n.createElement(ot.Sm,{placeholder:"过滤",value:E,handleInputChange:function(t){x(t)}})},n.createElement(y.X,{headers:L,rows:a,width:"10rem"})))):n.createElement(nt,{context:"加载中请等待..."})))}function Vt(t){return Vt="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},Vt(t)}function Ut(){Ut=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:_(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function w(){}var b={};l(b,a,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(I([])));x&&x!==r&&n.call(x,a)&&(b=x);var S=w.prototype=v.prototype=Object.create(b);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==Vt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function A(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 O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(Vt(e)+" is not iterable")}return g.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},L(k.prototype),l(k.prototype,c,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=I,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Wt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Zt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Wt(i,n,o,a,c,"next",t)}function c(t){Wt(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Bt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Xt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Xt(t,e):void 0}}(t,e)||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 Xt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function zt(t){var e=Bt((0,n.useState)(null),2),r=e[0],o=e[1],i=Bt((0,v.L4)(g.A.systemd_shell_show),2),a=i[0],c=(i[1],function(){var t=Zt(Ut().mark((function t(){var e;return Ut().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=new it.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:"#000000",cursor:"#000000",selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4,convertEol:!0}),s.ws.subscribeUnconnect(u),s.ws.addMsg(l.HK.systemd_logs_getting,(function(t){"error"===t.context&&u(),e.write(t.context)})),o(e);case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()),u=function(){Zt(Ut().mark((function t(){return Ut().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r&&(r.writeln("[38;2;29;153;243mclose![0m "),r.dispose(),o(null));case 1:case"end":return t.stop()}}),t)})))()};return(0,n.useEffect)((function(){if(a.show){c();var t=function(t){s.ws.unConnect()};return document.addEventListener("cancel_systemd_logs",t),function(){document.removeEventListener("cancel_systemd_logs",t)}}u()}),[a]),(0,n.useEffect)((function(){return function(){u()}}),[]),n.createElement(at.$,{show:a.show,terminal:r,init:function(t,e){r.writeln("[38;2;29;153;243mconnect...[0m ");var n={unit_name:a.unit_name},o=new l.hf(l.HK.systemd_logs_get);o.context=n,s.ws.send(o)}})}function Dt(t){return Dt="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},Dt(t)}function Rt(){Rt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:_(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function w(){}var b={};l(b,a,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(I([])));x&&x!==r&&n.call(x,a)&&(b=x);var S=w.prototype=v.prototype=Object.create(b);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==Dt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function A(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 O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(Dt(e)+" is not iterable")}return g.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},L(k.prototype),l(k.prototype,c,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=I,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Jt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=ee(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function qt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Qt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){qt(i,n,o,a,c,"next",t)}function c(t){qt(i,n,o,a,c,"throw",t)}a(void 0)}))}}function te(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||ee(t,e)||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 ee(t,e){if(t){if("string"==typeof t)return re(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?re(t,e):void 0}}function re(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var ne,oe="";function ie(t){var e=(0,m.Bd)().t,r=te((0,v.L4)(g.A.systemd_shell_show),2),a=r[0],c=r[1],u=te((0,v.L4)(g.A.confirm),2),w=(u[0],u[1]),E=te((0,n.useState)(["pid","name","process",e("创建用户"),e("内存"),e("cpu%"),e("active状态"),e("选择")]),2),x=E[0],S=(E[1],te((0,n.useState)(["单元名字","加载状态",e("active(sub)状态"),e("描述"),e("选择")]),2)),L=S[0],k=(S[1],te((0,n.useState)([]),2)),_=k[0],j=k[1],A=te((0,n.useState)([]),2),O=A[0],P=A[1],I=te((0,n.useState)([]),2),C=I[0],N=I[1],F=te((0,n.useState)(!1),2),G=F[0],Y=F[1],M=te((0,n.useState)([]),2),K=M[0],H=M[1],$=te((0,n.useState)(""),2),V=$[0],U=$[1],W=te((0,n.useState)(""),2),Z=W[0],B=W[1],X=te((0,n.useState)(new Set),2),z=X[0],D=X[1],R=te((0,v.L4)(g.A.editorSetting),2),J=(R[0],R[1]),q=function(){var t=Qt(Rt().mark((function t(){var e;return Rt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=new l.hf(l.HK.systemd_inside_get),t.next=3,s.ws.send(e);case 3:s.ws.addMsg(l.HK.systemd_inside_getting,(function(t){var e,r=[];if(oe){var o,a=Jt(t.context);try{for(a.s();!(o=a.n()).done;){var c,u=o.value,l=Jt(u);try{for(l.s();!(c=l.n()).done;){var s=c.value;if("".concat(s).includes(oe)){r.push(u);break}}}catch(t){l.e(t)}finally{l.f()}}}catch(t){a.e(t)}finally{a.f()}}else r.push.apply(r,function(t){if(Array.isArray(t))return re(t)}(e=t.context)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||ee(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());for(var f=function(){for(var t=r[h],e=0;e<t.length;e++)t[e]=n.createElement(i.xP,{context:4===e?(0,At.v7)(t[e]):t[e]});t.push(n.createElement(p.rA,{icon:"place",title:"选中",onClick:function(){N(t)}}))},h=0;h<r.length;h++)f();j(r)}));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();(0,n.useEffect)((function(){return B(oe),q(),function(){Qt(Rt().mark((function t(){return Rt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:s.ws.isAilive()&&s.ws.setPromise(function(){var t=Qt(Rt().mark((function t(e){return Rt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.ws.unConnect();case 2:e();case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 1:case"end":return t.stop()}}),t)})))()}}),[]),(0,n.useEffect)((function(){oe=Z}),[Z]);var Q=function(t){if(a.show){c({show:!1,unit_name:""});var e=new CustomEvent("cancel_systemd_logs",{detail:{}});document.dispatchEvent(e)}else c({show:!0,unit_name:t})},tt=function(){var t=Qt(Rt().mark((function t(e){return Rt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:w({open:!0,handle:function(){var t=Qt(Rt().mark((function t(){return Rt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.Yu.post("systemd/sys/delete",{unit_name:e});case 2:t.sent.code===d.m.Sucess&&((0,b.LW)("删除成功"),w({open:!1,handle:null}));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()});case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),et=function(){var t=Qt(Rt().mark((function t(e){return Rt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:w({open:!0,handle:function(){var t=Qt(Rt().mark((function t(){return Rt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.Yu.post("systemd/delete",{unit_name:e});case 2:t.sent.code===d.m.Sucess&&((0,b.LW)("删除成功"),w({open:!1,handle:null}));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()});case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),rt=function(){var t=Qt(Rt().mark((function t(){var e,r,o,a,c,u,l;return Rt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.Yu.get("systemd/inside/all");case 2:if((e=t.sent).code===d.m.Sucess){t.next=5;break}return t.abrupt("return");case 5:return D(new Set(e.data)),t.next=8,f.Yu.get("systemd/allget");case 8:if((r=t.sent).code!==d.m.Sucess){t.next=30;break}o=r.data,a=[],c=Jt(null!=o?o:[]),t.prev=13,l=Rt().mark((function t(){var e,r;return Rt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=u.value,(r=[n.createElement(i.xP,{context:e.unit}),e.load,"".concat(e.active,"(").concat(e.sub,")"),n.createElement(i.xP,{context:e.description})]).push(n.createElement(p.rA,{icon:"place",title:"添加",onClick:function(){H(r)}})),a.push(r);case 4:case"end":return t.stop()}}),t)})),c.s();case 16:if((u=c.n()).done){t.next=20;break}return t.delegateYield(l(),"t0",18);case 18:t.next=16;break;case 20:t.next=25;break;case 22:t.prev=22,t.t1=t.catch(13),c.e(t.t1);case 25:return t.prev=25,c.f(),t.finish(25);case 28:ne=a,P(a);case 30:case"end":return t.stop()}}),t,null,[[13,22,25,28]])})));return function(){return t.apply(this,arguments)}}(),it=function(){var t=Qt(Rt().mark((function t(e){var r;return Rt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.Yu.post("systemd/add",{unit_name:e});case 2:(r=t.sent).code===d.m.Sucess&&(D(new Set(r.data)),(0,b.LW)("添加成功"));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),at=function(){var e=Qt(Rt().mark((function e(r){var n;return Rt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.Yu.post("systemd/get/context",{unit_name:r});case 2:(n=e.sent).code===d.m.Sucess&&(J({model:"text",open:!0,fileName:t.name,save:function(){var t=Qt(Rt().mark((function t(e){var r;return Rt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={context:e},"/"===n.data.path[0]&&(n.data.path=n.data.path.slice(1)),t.next=4,f.$M.post("save/".concat(n.data.path,"?is_sys_path=1"),r);case 4:t.sent.code===d.m.Sucess&&(T.xK.set_value_temp(""),J({open:!1,model:"",fileName:"",save:null}));case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}),T.xK.set_value_temp(n.data.context));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return n.createElement("div",null,n.createElement(h.A,{left_children:n.createElement(p.Z$,{defaultStatus:!1,text:e("系统systemd单元"),clickFun:function(t){Y(t),t?(rt(),N([])):H([])}})},C.length>0&&n.createElement("div",null,C[1].props.context),K.length>0&&n.createElement("div",null,K[0].props.context),C.length>0&&n.createElement("div",null,n.createElement(p.rA,{icon:"delete",title:"从实时监控删除",onClick:function(){et(C[1].props.context)}}),n.createElement(p.rA,{icon:"print",title:"打印日志",onClick:function(){Q(C[1].props.context)}})),K.length>0&&n.createElement("div",null,n.createElement(p.rA,{icon:"delete",title:"删除系统上的sytemd",onClick:function(){tt(K[0].props.context)}}),n.createElement(p.rA,{icon:"print",title:"打印日志",onClick:function(){Q(K[0].props.context)}}),n.createElement(p.rA,{icon:"text_fields",title:"sytemd文件内容",onClick:function(){at(K[0].props.context)}}),!z.has(K[0].props.context)&&n.createElement(p.rA,{icon:"plus_one",title:"添加到管理",onClick:function(){return it(K[0].props.context)}}))),n.createElement(o.xh,null,G&&n.createElement(o.fI,null,n.createElement(o.VP,{widthPer:80},n.createElement(i.uF,{title:"systemd系统单元(".concat(O.length,")"),titleCom:n.createElement(ot.Sm,{placeholder:"过滤单元",value:V,handleInputChange:function(t){U(t)},handlerEnter:function(){var t=[];if(V){var e,r=Jt(ne);try{for(r.s();!(e=r.n()).done;){var n=e.value;(n[0].props.context.includes(V)||n[3].props.context.includes(V))&&t.push(n)}}catch(t){r.e(t)}finally{r.f()}P(t)}else P(ne)}})},n.createElement(y.X,{headers:L,rows:O,width:"10rem"})))),0===_.length&&!G&&n.createElement(nt,{context:"没有管理的单元 or 加载中请等待..."}),0!==_.length&&!G&&n.createElement(o.fI,null,n.createElement(o.VP,{widthPer:80},n.createElement(i.uF,{title:"filecat监控单元(".concat(_.length,")"),titleCom:n.createElement(ot.Sm,{placeholder:"过滤单元",value:Z,handleInputChange:function(t){B(t)}})},n.createElement(y.X,{headers:x,rows:_,width:"10rem"}))))),n.createElement(zt,null))}function ae(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ce(t){var e,r,i=(0,m.Bd)().t,a=(e=(0,v.L4)(g.A.user_base_info),r=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(e,r)||function(t,e){if(t){if("string"==typeof t)return ae(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ae(t,e):void 0}}(e,r)||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.")}()),c=a[0],u=(a[1],[{index:1,name:i("系统性能"),rto:"sys/"},{index:2,name:i("系统进程"),rto:"process/"},{index:3,name:i("docker容器"),rto:"docker/"}]);return c.sys===B.XM.linux&&u.push({index:4,name:i("systemd"),rto:"systemd/"}),n.createElement(o.W1,{optionList:u},n.createElement(rt,null),n.createElement($t,null),n.createElement(jt,null),n.createElement(ie,null))}}}]);
|