filecat 1.1.3 → 2.0.2
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/README.md +3 -2
- package/build/dist/181.bundle.js +1 -1
- package/build/dist/29.bundle.js +1 -1
- package/build/dist/432.bundle.js +1 -1
- package/build/dist/467.bundle.js +1 -1
- package/build/dist/523.bundle.js +2 -0
- package/build/dist/623.bundle.js +1 -1
- package/build/dist/654.bundle.js +1 -1
- package/build/dist/674.bundle.js +1 -1
- package/build/dist/734.bundle.js +1 -1
- package/build/dist/874.bundle.js +1 -1
- package/build/dist/892.bundle.js +1 -1
- package/build/dist/943.bundle.js +1 -1
- package/build/dist/bundle.js +1 -1
- package/build/dist/bundle.js.LICENSE.txt +3 -3
- package/build/main.js +18 -18
- package/env +6 -0
- package/package.json +2 -1
- package/build/dist/977.bundle.js +0 -2
- /package/build/dist/{977.bundle.js.LICENSE.txt → 523.bundle.js.LICENSE.txt} +0 -0
package/build/dist/467.bundle.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see 467.bundle.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[467],{8694:(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,r){return(e=c(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(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,c(n.key),n)}}function a(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(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+""}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.d(e,{$K:()=>s,RB:()=>p,eq:()=>f,qB:()=>l,vo:()=>h,vr:()=>y});var l=a((function t(){u(this,t)})),f=function(t){return t[t.tcp=0]="tcp",t[t.udp=1]="udp",t}({}),s=a((function t(){u(this,t),o(this,"open",!1),o(this,"model",f.udp),o(this,"key","")})),h=a((function t(){u(this,t),o(this,"open",!1),o(this,"key","")})),p=function(t){return t[t.row=1]="row",t[t.json=2]="json",t[t.form=3]="form",t}({}),y=a((function t(){u(this,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)})))}},8467:(t,e,r)=>{r.r(e),r.d(e,{default:()=>P});var n=r(6540),o=r(5725),i=r(6007),a=r(2042),c=r(3459),u=r(447),l=r(3033),f=r(5997),s=r(7481),h=r(8694),p=r(4944),y=r(4238),v=r(2389);function m(t){return m="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},m(t)}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 f(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),c=new N(n||[]);return o(a,"_invoke",{value:_(t,r,c)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",p="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var x={};l(x,a,(function(){return this}));var S=Object.getPrototypeOf,L=S&&S(S(C([])));L&&L!==r&&n.call(L,a)&&(x=L);var k=E.prototype=b.prototype=Object.create(x);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==m(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).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===v){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=I(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=s(e,r,n);if("normal"===l.type){if(o=n.done?v:p,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function I(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,I(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=s(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;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,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}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 A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function C(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(m(e)+" is not iterable")}return w.prototype=E,o(k,"constructor",{value:E,configurable:!0}),o(E,"constructor",{value:w,configurable:!0}),w.displayName=l(E,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,l(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},j(O.prototype),l(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new O(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(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=C,N.prototype={constructor:N,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(A),!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,g):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),g},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),A(r),g}},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;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function g(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 b(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){g(i,n,o,a,c,"next",t)}function c(t){g(i,n,o,a,c,"throw",t)}a(void 0)}))}}function w(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 E(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)?E(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 E(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 x(t){var e=(0,v.Bd)().t,r=w((0,n.useState)(void 0),2),m=r[0],g=r[1],E=w((0,n.useState)(!1),2),x=E[0],S=E[1],L=w((0,n.useState)(!1),2),k=L[0],j=L[1],O=w((0,n.useState)(""),2),_=O[0],I=O[1],P=w((0,n.useState)([e("".concat(e("虚拟"),"ip")),"".concat(e("物理"),"ip"),e("在线状态")]),2),A=P[0],N=(P[1],w((0,n.useState)([]),2)),C=(N[0],N[1]);(0,n.useEffect)((function(){var t=function(){var t=b(d().mark((function t(){var e,r;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=new y.hf(y.HK.vir_net_serverIno_get),t.next=3,p.ws.send(e);case 3:r=t.sent,C(r);case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();t();var e=function(){var e=b(d().mark((function e(){var r,n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i._U.get("vir/server/get");case 2:if((r=e.sent).code===c.m.Sucess){e.next=5;break}return e.abrupt("return");case 5:n=r.data,g(n.port),I(n.key),j(n.model===h.eq.udp),S(n.open),setInterval(t,3e4);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}),[]);var T=function(){var t=b(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(e=new h.$K).open=x,e.model=k?h.eq.udp:h.eq.tcp,e.key=_,e.port=parseInt(m),t.next=7,i._U.post("vir/server/save",e);case 7:if(t.sent.code===c.m.Sucess){t.next=11;break}return(0,a.zN)("网络错误"),t.abrupt("return");case 11:(0,a.LW)("保存成功");case 12:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return n.createElement("div",null,n.createElement(o.fI,null,n.createElement(o.VP,null,n.createElement(u.Zp,{title:"",rightBottomCom:n.createElement(f.C3,{text:e("保存"),clickFun:T})},n.createElement(l.Sm,{placeholder:"port",value:m,handleInputChange:function(t){g(t)}}),n.createElement(l.Sm,{placeholder:"key ",value:_,handleInputChange:function(t){I(t)}}),n.createElement("form",null,e("状态"),":",n.createElement(s.S,{isFlex:!0,columns:[n.createElement(l.U6,{value:1,context:e("开启"),selected:x,onchange:function(){S(!x)}}),n.createElement(l.U6,{value:1,context:e("关闭"),selected:!x,onchange:function(){S(!x)}})]})),n.createElement("form",null,e("模式"),n.createElement(s.S,{isFlex:!0,columns:[n.createElement(l.U6,{value:1,context:"tcp".concat(e("流量转发")),selected:!k,onchange:function(){j(!k)}}),n.createElement(l.U6,{value:1,context:"udp".concat(e("点对点")),selected:k,onchange:function(){j(!k)}})]}))),n.createElement(u.Zp,{title:""},n.createElement(s.X,{headers:A,rows:[],width:"10rem"})))))}function S(t){return S="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},S(t)}function L(){L=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 f(t,e,r,n){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new N(n||[]);return o(a,"_invoke",{value:_(t,r,c)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",p="suspendedYield",y="executing",v="completed",m={};function d(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(C([])));x&&x!==r&&n.call(x,a)&&(w=x);var k=b.prototype=d.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==S(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).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===v){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=I(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=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=s(e,r,n);if("normal"===l.type){if(o=n.done?v:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function I(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,I(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=s(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 A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function C(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(S(e)+" is not iterable")}return g.prototype=b,o(k,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,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,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},j(O.prototype),l(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new O(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(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=C,N.prototype={constructor:N,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(A),!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),A(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;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function k(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){k(i,n,o,a,c,"next",t)}function c(t){k(i,n,o,a,c,"throw",t)}a(void 0)}))}}function O(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 _(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)?_(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 _(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=(0,v.Bd)().t,r=O((0,n.useState)(""),2),p=r[0],y=r[1],m=O((0,n.useState)(void 0),2),d=m[0],g=m[1],b=O((0,n.useState)(""),2),w=b[0],E=b[1],x=O((0,n.useState)(void 0),2),S=x[0],k=x[1],_=O((0,n.useState)(!1),2),I=_[0],P=_[1],A=O((0,n.useState)(""),2),N=A[0],C=A[1];(0,n.useEffect)((function(){var t=function(){var t=j(L().mark((function t(){var e,r;return L().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i._U.get("vir/client/get");case 2:if((e=t.sent).code===c.m.Sucess){t.next=5;break}return t.abrupt("return");case 5:r=e.data,k(r.serverPort),E(r.serverIp),y(r.ip),g(r.mask),C(r.key),P(r.open);case 12:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();t()}),[]);var T=function(){var t=j(L().mark((function t(){var e;return L().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(e=new h.vo).ip=p,e.mask=parseInt(d),e.key=N,e.serverIp=w,e.serverPort=parseInt(S),e.open=I,t.next=9,i._U.post("vir/client/save",e);case 9:if(t.sent.code===c.m.Sucess){t.next=13;break}return(0,a.zN)("网络错误"),t.abrupt("return");case 13:(0,a.LW)("保存成功");case 14:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return n.createElement("div",null,n.createElement(o.fI,null,n.createElement(o.VP,null,n.createElement(u.Zp,{title:"",rightBottomCom:n.createElement(f.C3,{text:e("保存"),clickFun:T})},n.createElement(l.Sm,{placeholder:"ip ",value:p,handleInputChange:function(t){y(t)}}),n.createElement(l.Sm,{placeholder:"mask",value:d,handleInputChange:function(t){g(t)}}),n.createElement(l.Sm,{placeholder:"".concat(e("服务器"),"ip"),value:w,handleInputChange:function(t){E(t)}}),n.createElement(l.Sm,{placeholder:"".concat(e("服务器"),"part"),value:S,handleInputChange:function(t){k(t)}}),n.createElement(l.Sm,{placeholder:"key ",value:N,handleInputChange:function(t){C(t)}}),n.createElement(s.S,{isFlex:!0,columns:[n.createElement(l.U6,{value:1,context:e("开启"),selected:I,onchange:function(){P(!I)}}),n.createElement(l.U6,{value:1,context:e("关闭"),selected:!I,onchange:function(){P(!I)}})]})),n.createElement(u.Zp,{title:""},n.createElement("div",null,"ip: 虚拟ip, “10.0.0.0 - 10.255.255.255”和“172.16.0.0 - 172.31.255.255”和“192.168.0.0 - 192.168.255.255”这三个网段属于内网ip"),n.createElement("div",null,"mask: 一些常见的子网掩码网段/8:255.0.0.0;/16:255.255.0.0 ;/24:255.255.255.0"),n.createElement("div",null,"key:用于验证身份信息并加密的和服务器设置的一样")))))}function P(){var t=(0,v.Bd)().t,e=[{index:2,name:t("服务端"),rto:"server/"},{index:1,name:t("客户端"),rto:"client/"}];return n.createElement(o.W1,{optionList:e},n.createElement(I,null),n.createElement(x,null))}}}]);
|
|
2
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[467],{8694:(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,r){return(e=c(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(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,c(n.key),n)}}function a(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(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+""}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.d(e,{$K:()=>s,RB:()=>p,eq:()=>f,qB:()=>l,vo:()=>h,vr:()=>y});var l=a((function t(){u(this,t)})),f=function(t){return t[t.tcp=0]="tcp",t[t.udp=1]="udp",t}({}),s=a((function t(){u(this,t),o(this,"open",!1),o(this,"model",f.udp),o(this,"key","")})),h=a((function t(){u(this,t),o(this,"open",!1),o(this,"key","")})),p=function(t){return t[t.row=1]="row",t[t.json=2]="json",t[t.form=3]="form",t}({}),y=a((function t(){u(this,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)})))}},8467:(t,e,r)=>{r.r(e),r.d(e,{default:()=>P});var n=r(6540),o=r(5725),i=r(6007),a=r(2042),c=r(3459),u=r(447),l=r(3033),f=r(5997),s=r(7481),h=r(8694),p=r(4944),y=r(4238),v=r(2389);function m(t){return m="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},m(t)}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 f(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),c=new N(n||[]);return o(a,"_invoke",{value:_(t,r,c)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",p="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var x={};l(x,a,(function(){return this}));var S=Object.getPrototypeOf,L=S&&S(S(C([])));L&&L!==r&&n.call(L,a)&&(x=L);var k=E.prototype=b.prototype=Object.create(x);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==m(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).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===v){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=I(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=s(e,r,n);if("normal"===l.type){if(o=n.done?v:p,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function I(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,I(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=s(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;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,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}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 A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function C(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(m(e)+" is not iterable")}return w.prototype=E,o(k,"constructor",{value:E,configurable:!0}),o(E,"constructor",{value:w,configurable:!0}),w.displayName=l(E,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,l(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},j(O.prototype),l(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new O(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(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=C,N.prototype={constructor:N,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(A),!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,g):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),g},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),A(r),g}},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;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function g(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 b(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){g(i,n,o,a,c,"next",t)}function c(t){g(i,n,o,a,c,"throw",t)}a(void 0)}))}}function w(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 E(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)?E(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 E(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 x(t){var e=(0,v.Bd)().t,r=w((0,n.useState)(void 0),2),m=r[0],g=r[1],E=w((0,n.useState)(!1),2),x=E[0],S=E[1],L=w((0,n.useState)(!1),2),k=L[0],j=L[1],O=w((0,n.useState)(""),2),_=O[0],I=O[1],P=w((0,n.useState)([e("".concat(e("虚拟"),"ip")),"".concat(e("物理"),"ip"),e("在线状态")]),2),A=P[0],N=(P[1],w((0,n.useState)([]),2)),C=(N[0],N[1]);(0,n.useEffect)((function(){var t=function(){var t=b(d().mark((function t(){var e,r;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=new y.hf(y.HK.vir_net_serverIno_get),t.next=3,p.ws.send(e);case 3:r=t.sent,C(r);case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();t();var e=function(){var e=b(d().mark((function e(){var r,n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i._U.get("vir/server/get");case 2:if((r=e.sent).code===c.m.Sucess){e.next=5;break}return e.abrupt("return");case 5:n=r.data,g(n.port),I(n.key),j(n.model===h.eq.udp),S(n.open),setInterval(t,3e4);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return e(),function(){p.ws.unConnect()}}),[]);var T=function(){var t=b(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(e=new h.$K).open=x,e.model=k?h.eq.udp:h.eq.tcp,e.key=_,e.port=parseInt(m),t.next=7,i._U.post("vir/server/save",e);case 7:if(t.sent.code===c.m.Sucess){t.next=11;break}return(0,a.zN)("网络错误"),t.abrupt("return");case 11:(0,a.LW)("保存成功");case 12:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return n.createElement("div",null,n.createElement(o.fI,null,n.createElement(o.VP,null,n.createElement(u.Zp,{title:"",rightBottomCom:n.createElement(f.C3,{text:e("保存"),clickFun:T})},n.createElement(l.Sm,{placeholder:"port",value:m,handleInputChange:function(t){g(t)}}),n.createElement(l.Sm,{placeholder:"key ",value:_,handleInputChange:function(t){I(t)}}),n.createElement("form",null,e("状态"),":",n.createElement(s.S,{isFlex:!0,columns:[n.createElement(l.U6,{value:1,context:e("开启"),selected:x,onchange:function(){S(!x)}}),n.createElement(l.U6,{value:1,context:e("关闭"),selected:!x,onchange:function(){S(!x)}})]})),n.createElement("form",null,e("模式"),n.createElement(s.S,{isFlex:!0,columns:[n.createElement(l.U6,{value:1,context:"tcp".concat(e("流量转发")),selected:!k,onchange:function(){j(!k)}}),n.createElement(l.U6,{value:1,context:"udp".concat(e("点对点")),selected:k,onchange:function(){j(!k)}})]}))),n.createElement(u.Zp,{title:""},n.createElement(s.X,{headers:A,rows:[],width:"10rem"})))))}function S(t){return S="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},S(t)}function L(){L=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 f(t,e,r,n){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new N(n||[]);return o(a,"_invoke",{value:_(t,r,c)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",p="suspendedYield",y="executing",v="completed",m={};function d(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(C([])));x&&x!==r&&n.call(x,a)&&(w=x);var k=b.prototype=d.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==S(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).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===v){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=I(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=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=s(e,r,n);if("normal"===l.type){if(o=n.done?v:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function I(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,I(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=s(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 A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function C(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(S(e)+" is not iterable")}return g.prototype=b,o(k,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,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,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},j(O.prototype),l(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new O(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(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=C,N.prototype={constructor:N,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(A),!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),A(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;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function k(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){k(i,n,o,a,c,"next",t)}function c(t){k(i,n,o,a,c,"throw",t)}a(void 0)}))}}function O(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 _(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)?_(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 _(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=(0,v.Bd)().t,r=O((0,n.useState)(""),2),p=r[0],y=r[1],m=O((0,n.useState)(void 0),2),d=m[0],g=m[1],b=O((0,n.useState)(""),2),w=b[0],E=b[1],x=O((0,n.useState)(void 0),2),S=x[0],k=x[1],_=O((0,n.useState)(!1),2),I=_[0],P=_[1],A=O((0,n.useState)(""),2),N=A[0],C=A[1];(0,n.useEffect)((function(){var t=function(){var t=j(L().mark((function t(){var e,r;return L().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i._U.get("vir/client/get");case 2:if((e=t.sent).code===c.m.Sucess){t.next=5;break}return t.abrupt("return");case 5:r=e.data,k(r.serverPort),E(r.serverIp),y(r.ip),g(r.mask),C(r.key),P(r.open);case 12:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();t()}),[]);var T=function(){var t=j(L().mark((function t(){var e;return L().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(e=new h.vo).ip=p,e.mask=parseInt(d),e.key=N,e.serverIp=w,e.serverPort=parseInt(S),e.open=I,t.next=9,i._U.post("vir/client/save",e);case 9:if(t.sent.code===c.m.Sucess){t.next=13;break}return(0,a.zN)("网络错误"),t.abrupt("return");case 13:(0,a.LW)("保存成功");case 14:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return n.createElement("div",null,n.createElement(o.fI,null,n.createElement(o.VP,null,n.createElement(u.Zp,{title:"",rightBottomCom:n.createElement(f.C3,{text:e("保存"),clickFun:T})},n.createElement(l.Sm,{placeholder:"ip ",value:p,handleInputChange:function(t){y(t)}}),n.createElement(l.Sm,{placeholder:"mask",value:d,handleInputChange:function(t){g(t)}}),n.createElement(l.Sm,{placeholder:"".concat(e("服务器"),"ip"),value:w,handleInputChange:function(t){E(t)}}),n.createElement(l.Sm,{placeholder:"".concat(e("服务器"),"part"),value:S,handleInputChange:function(t){k(t)}}),n.createElement(l.Sm,{placeholder:"key ",value:N,handleInputChange:function(t){C(t)}}),n.createElement(s.S,{isFlex:!0,columns:[n.createElement(l.U6,{value:1,context:e("开启"),selected:I,onchange:function(){P(!I)}}),n.createElement(l.U6,{value:1,context:e("关闭"),selected:!I,onchange:function(){P(!I)}})]})),n.createElement(u.Zp,{title:""},n.createElement("div",null,"ip: 虚拟ip, “10.0.0.0 - 10.255.255.255”和“172.16.0.0 - 172.31.255.255”和“192.168.0.0 - 192.168.255.255”这三个网段属于内网ip"),n.createElement("div",null,"mask: 一些常见的子网掩码网段/8:255.0.0.0;/16:255.255.0.0 ;/24:255.255.255.0"),n.createElement("div",null,"key:用于验证身份信息并加密的和服务器设置的一样")))))}function P(){var t=(0,v.Bd)().t,e=[{index:2,name:t("服务端"),rto:"server/"},{index:1,name:t("客户端"),rto:"client/"}];return n.createElement(o.W1,{optionList:e},n.createElement(I,null),n.createElement(x,null))}}}]);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 523.bundle.js.LICENSE.txt */
|
|
2
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[523],{7481:(e,t,n)=>{n.d(t,{S:()=>i,X:()=>a});var r=n(6540);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function a(e){var t,n,a,i=(n=r.useState([]),a=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],u=!0,l=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(n,a)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(n,a)||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=i[0],u=i[1];return(0,r.useEffect)((function(){e.children?u(Array.isArray(e.children)?e.children:[e.children]):u(e.rows)}),[e.rows,e.children]),r.createElement("table",null,r.createElement("thead",null,r.createElement("tr",null,null===(t=e.headers)||void 0===t?void 0:t.map((function(e,t){return r.createElement("th",{key:t},e)})))),r.createElement("tbody",null,c.map((function(t,n){return r.createElement("tr",{key:n},t.map((function(t,n){var o;return r.createElement("td",{style:{width:null!==(o=e.width)&&void 0!==o?o:"auto"},key:n,className:n===c.length-1?"small":""},t)})))}))))}function i(e){return r.createElement("div",{style:{display:e.isFlex?"flex":"block"}},e.columns.map((function(e,t){return r.createElement("div",{key:t},e)})))}},8523:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Ie});var r=n(6540),o=n(5725),a=n(3430),i=n(3413),c=n.n(i),u=n(6007),l=n(3459),s=n(447),f=n(5997),h=n(3033),d=n(7481),p=n(2389),m=n(7444),v=n(6417);function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function _(e){return function(e){if(Array.isArray(e))return k(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||x(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.")}()}function g(){g=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var a=t&&t.prototype instanceof _?t:_,i=Object.create(a.prototype),c=new V(r||[]);return o(i,"_invoke",{value:j(e,n,c)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var h="suspendedStart",d="suspendedYield",p="executing",m="completed",v={};function _(){}function w(){}function b(){}var E={};l(E,i,(function(){return this}));var x=Object.getPrototypeOf,k=x&&x(x(N([])));k&&k!==n&&r.call(k,i)&&(E=k);var S=b.prototype=_.prototype=Object.create(E);function L(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function n(o,a,i,c){var u=f(e[o],e,a);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==y(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(s).then((function(e){l.value=e,i(l)}),(function(e){return n("throw",e,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function j(t,n,r){var o=h;return function(a,i){if(o===p)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var c=r.delegate;if(c){var u=C(c,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var l=f(t,n,r);if("normal"===l.type){if(o=r.done?m:d,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=m,r.method="throw",r.arg=l.arg)}}}function C(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,C(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var a=f(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,v;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function V(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function N(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(y(t)+" is not iterable")}return w.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:w,configurable:!0}),w.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},L(O.prototype),l(O.prototype,c,(function(){return this})),t.AsyncIterator=O,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new O(s(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},L(S),l(S,u,"Generator"),l(S,i,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=N,V.prototype={constructor:V,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(I),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),I(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;I(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:N(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function w(e,t,n,r,o,a,i){try{var c=e[a](i),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}function b(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){w(a,r,o,i,c,"next",e)}function c(e){w(a,r,o,i,c,"throw",e)}i(void 0)}))}}function E(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],u=!0,l=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(e,t)||x(e,t)||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 x(e,t){if(e){if("string"==typeof e)return k(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function S(e){var t=(0,p.Bd)().t,n=E((0,m.L4)(v.A.prompt_card),2),a=(n[0],n[1]),i=(t("路由"),"".concat(t("文件"),"|http").concat(t("路径")),t("删除"),E((0,r.useState)([]),2)),c=i[0],u=i[1],l=function(){var t=b(g().mark((function t(){var n;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.getItems){t.next=5;break}return t.next=3,e.getItems();case 3:n=t.sent,u(n);case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();(0,r.useEffect)((function(){l()}),[]);var y=function(){var t=b(g().mark((function t(){return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.save){t.next=3;break}return t.next=3,e.save(c);case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return r.createElement(o.xh,null,r.createElement(s.uF,{self_title:r.createElement("span",{className:" div-row "},r.createElement("h2",null,t("页面资源路由"))," ",r.createElement(f.rA,{icon:"info",onClick:function(){var e;e=r.createElement("div",null,'需要以 "/api" 开头的路由,会自动识别文件地址和http地址,将页面转到对应结果。'),a({open:!0,title:"信息",context_div:r.createElement("div",null,e)})},title:"信息"})),titleCom:r.createElement("div",null,r.createElement(f.rA,{icon:"add",title:t("添加"),onClick:function(){u([[]].concat(_(c)))}}),r.createElement(f.rA,{icon:"save",title:t("保存"),onClick:y}))},r.createElement(d.X,{headers:e.headers,rows:c.map((function(e,n){var o=[r.createElement(h.Sm,{value:e[0],handleInputChange:function(t){e[0]=t,u(_(c))},no_border:!0}),r.createElement(h.Sm,{value:e[1],handleInputChange:function(t){e[1]=t,u(_(c))},no_border:!0}),r.createElement(h.Sm,{value:e[2],handleInputChange:function(t){e[2]=t,u(_(c))},no_border:!0}),r.createElement(f.rA,{icon:"delete",title:t("删除"),onClick:function(){return function(e){c.splice(e,1),u(_(c))}(n)}})];return o})),width:"10rem"})))}var L=n(8247),O=n(2042);function j(e){return j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},j(e)}function C(e){return function(e){if(Array.isArray(e))return G(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||P(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.")}()}function A(){A=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),c=new V(r||[]);return o(i,"_invoke",{value:L(e,n,c)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var h="suspendedStart",d="suspendedYield",p="executing",m="completed",v={};function y(){}function _(){}function g(){}var w={};l(w,i,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(N([])));E&&E!==n&&r.call(E,i)&&(w=E);var x=g.prototype=y.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(o,a,i,c){var u=f(e[o],e,a);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==j(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(s).then((function(e){l.value=e,i(l)}),(function(e){return n("throw",e,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function L(t,n,r){var o=h;return function(a,i){if(o===p)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var c=r.delegate;if(c){var u=O(c,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var l=f(t,n,r);if("normal"===l.type){if(o=r.done?m:d,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=m,r.method="throw",r.arg=l.arg)}}}function O(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var a=f(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,v;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function V(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function N(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(j(t)+" is not iterable")}return _.prototype=g,o(x,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:_,configurable:!0}),_.displayName=l(g,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===_||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,u,"GeneratorFunction")),e.prototype=Object.create(x),e},t.awrap=function(e){return{__await:e}},k(S.prototype),l(S.prototype,c,(function(){return this})),t.AsyncIterator=S,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new S(s(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(x),l(x,u,"Generator"),l(x,i,(function(){return this})),l(x,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=N,V.prototype={constructor:V,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(I),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),I(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;I(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:N(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function I(e,t,n,r,o,a,i){try{var c=e[a](i),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}function V(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){I(a,r,o,i,c,"next",e)}function c(e){I(a,r,o,i,c,"throw",e)}i(void 0)}))}}function N(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],u=!0,l=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(e,t)||P(e,t)||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 P(e,t){if(e){if("string"==typeof e)return G(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?G(e,t):void 0}}function G(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function T(){var e=(0,p.Bd)().t,t=N((0,m.L4)(v.A.prompt_card),2),n=(t[0],t[1]),a=[e("路由"),e("auth"),e("备注")],i=N((0,m.L4)(v.A.editorSetting),2),y=(i[0],i[1]),_=N((0,r.useState)([]),2),g=_[0],w=_[1],b=function(){var e=V(A().mark((function e(){var t;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.XO.get("api/customer_router");case 2:(t=e.sent).code===l.m.Sucess&&w(t.data);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,r.useEffect)((function(){b()}),[]);var E=function(){var e=V(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.XO.post("api/customer_router/save",g);case 2:e.sent.code===l.m.Sucess&&new(c())({type:"success",text:"保存成功",timeout:1e3,layout:"bottomLeft"}).show();case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),x=function(){var e=V(A().mark((function e(t){var n;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.router){e.next=3;break}return(0,O.zN)("路由不能为空"),e.abrupt("return");case 3:return e.next=5,u.XO.get("jscode/".concat(encodeURIComponent(t.router)));case 5:n=e.sent,y({model:"ace/mode/javascript",open:!0,fileName:t.router,save:function(){var e=V(A().mark((function e(n){var r;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={context:n,router:t.router},e.next=3,u.XO.post("jscode/save",r);case 3:0===e.sent.code&&(L.xK.set_value_temp(""),y({open:!1,model:"",fileName:"",save:null}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}),L.xK.set_value_temp(n.data);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return r.createElement(o.xh,null,r.createElement(s.uF,{self_title:r.createElement("span",{className:" div-row "},r.createElement("h2",null,e("自定义api路由"))," ",r.createElement(f.rA,{icon:"info",onClick:function(){var e;e=r.createElement("div",null,'需要以 "/api" 开头的路由。'),n({open:!0,title:"信息",context_div:r.createElement("div",null,e)})},title:"信息"})),titleCom:r.createElement("div",null,r.createElement(f.rA,{icon:"add",title:e("添加"),onClick:function(){w([{note:"",needAuth:!1,router:""}].concat(C(g)))}}),r.createElement(f.rA,{icon:"save",title:e("保存"),onClick:E}))},r.createElement(d.X,{headers:a,rows:g.map((function(t,n){var o=[r.createElement(h.Sm,{value:t.router,handleInputChange:function(e){t.router=e,w(C(g))},no_border:!0}),r.createElement(h.l6,{defaultValue:t.needAuth,onChange:function(e){t.needAuth="true"===e,w(C(g))},options:[{title:e("是"),value:!0},{title:e("否"),value:!1}],no_border:!0}),r.createElement(h.Sm,{value:t.note,handleInputChange:function(e){t.note=e,w(C(g))},no_border:!0}),r.createElement("div",null,r.createElement(f.rA,{icon:"delete",title:e("删除"),onClick:function(){return function(e){g.splice(e,1),w(C(g))}(n)}}),r.createElement(f.rA,{icon:"edit",title:e("编辑"),onClick:function(){return x(t)}}))];return o})),width:"10rem"})))}function F(e){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F(e)}function X(){X=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),c=new A(r||[]);return o(i,"_invoke",{value:L(e,n,c)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var h="suspendedStart",d="suspendedYield",p="executing",m="completed",v={};function y(){}function _(){}function g(){}var w={};l(w,i,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(I([])));E&&E!==n&&r.call(E,i)&&(w=E);var x=g.prototype=y.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(o,a,i,c){var u=f(e[o],e,a);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==F(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(s).then((function(e){l.value=e,i(l)}),(function(e){return n("throw",e,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function L(t,n,r){var o=h;return function(a,i){if(o===p)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var c=r.delegate;if(c){var u=O(c,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var l=f(t,n,r);if("normal"===l.type){if(o=r.done?m:d,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=m,r.method="throw",r.arg=l.arg)}}}function O(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var a=f(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,v;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function I(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(F(t)+" is not iterable")}return _.prototype=g,o(x,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:_,configurable:!0}),_.displayName=l(g,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===_||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,u,"GeneratorFunction")),e.prototype=Object.create(x),e},t.awrap=function(e){return{__await:e}},k(S.prototype),l(S.prototype,c,(function(){return this})),t.AsyncIterator=S,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new S(s(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(x),l(x,u,"Generator"),l(x,i,(function(){return this})),l(x,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=I,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;C(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:I(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function M(e,t,n,r,o,a,i){try{var c=e[a](i),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}function B(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){M(a,r,o,i,c,"next",e)}function c(e){M(a,r,o,i,c,"throw",e)}i(void 0)}))}}function U(){var e=(0,p.Bd)().t,t=[e("路由"),"".concat(e("文件"),"|http").concat(e("路径")),e("备注")],n=function(){var e=B(X().mark((function e(t){return X().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.XO.post("customer_router/save",t);case 2:e.sent.code===l.m.Sucess&&new(c())({type:"success",text:"保存成功",timeout:1e3,layout:"bottomLeft"}).show();case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),a=function(){var e=B(X().mark((function e(){var t;return X().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.XO.get("customer_router");case 2:if((t=e.sent).code!==l.m.Sucess){e.next=5;break}return e.abrupt("return",t.data);case 5:return e.abrupt("return",[]);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return r.createElement(o.fI,null,r.createElement(o.VP,null,r.createElement(S,{headers:t,getItems:a,save:n})),r.createElement(o.VP,null,r.createElement(T,null)))}var W=function(e){return e.username="username",e.password="password",e.password_hash="password_hash",e.navindex_remote_ssh_key="navindex_remote_ssh_key",e.user_id_name_mapping="user_id_name_mapping",e.user_id_info_data_mapping="user_id_info_data_mapping",e.user_unique_id_num="user_unique_id_num",e.role_unique_id_num="role_unique_id_num",e.sys_all_roles="sys_all_roles",e.ddns_http_url_key="ddns_http_url_key",e.ddns_tx_key="tengxun_ddns_key",e.ddns_dnspod_key="ddns_dnspod",e.ddns_ali_key="ali_ddns_key",e.navindex_net_key_list="navindex_net_key_list",e.navindex_wol_key="navindex_wol_key",e.customer_router_key="customer_router_key",e.customer_api_router_key="customer_api_router_key",e.token_setting="token_setting",e.files_pre_mulu_key="files_pre_mulu_key",e.sys_software="sys_software",e.extra_env_path="extra_env_path",e.protection_directory="sys_protection_directory",e.self_auth_jscode="self_auth_jscode",e.navindex_video_key="navindex_video_tag_key",e.systemd_key="systemd_key",e.vir_server_data_key="vir_server_net_data_key",e.vir_client_data_key="vir_client_net_data_key",e.vir_data_client_hash_key="vir_data_client_hash_key",e.vir_data_server_hash_key="vir_data_server_hash_key",e.language="user_language",e.navindex_rdp_key="navindex_rdp_tag_key",e.navindex_key="navindex_key_list",e.http_tag_key="http_tag_key",e.self_shell_cmd_check_open_status="self_shell_cmd_check_open_status",e.self_shell_cmd_jscode="self_shell_cmd_jscode",e}({}).self_auth_jscode,Y=n(4777),z=n(7952);function Z(e){return Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Z(e)}function $(){$=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),c=new A(r||[]);return o(i,"_invoke",{value:L(e,n,c)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var h="suspendedStart",d="suspendedYield",p="executing",m="completed",v={};function y(){}function _(){}function g(){}var w={};l(w,i,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(I([])));E&&E!==n&&r.call(E,i)&&(w=E);var x=g.prototype=y.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(o,a,i,c){var u=f(e[o],e,a);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==Z(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(s).then((function(e){l.value=e,i(l)}),(function(e){return n("throw",e,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function L(t,n,r){var o=h;return function(a,i){if(o===p)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var c=r.delegate;if(c){var u=O(c,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var l=f(t,n,r);if("normal"===l.type){if(o=r.done?m:d,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=m,r.method="throw",r.arg=l.arg)}}}function O(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var a=f(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,v;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function I(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(Z(t)+" is not iterable")}return _.prototype=g,o(x,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:_,configurable:!0}),_.displayName=l(g,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===_||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,u,"GeneratorFunction")),e.prototype=Object.create(x),e},t.awrap=function(e){return{__await:e}},k(S.prototype),l(S.prototype,c,(function(){return this})),t.AsyncIterator=S,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new S(s(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(x),l(x,u,"Generator"),l(x,i,(function(){return this})),l(x,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=I,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;C(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:I(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function K(e,t,n,r,o,a,i){try{var c=e[a](i),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}function q(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){K(a,r,o,i,c,"next",e)}function c(e){K(a,r,o,i,c,"throw",e)}i(void 0)}))}}function H(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],u=!0,l=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return R(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?R(e,t):void 0}}(e,t)||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 R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function D(){var e=H((0,r.useState)(""),2),t=e[0],n=e[1],i=H((0,r.useState)(""),2),c=i[0],y=i[1],_=H((0,r.useState)(!1),2),g=_[0],w=_[1],b=H((0,r.useState)(!1),2),E=b[0],x=b[1],k=H((0,m.L4)(v.A.editorSetting),2),S=(k[0],k[1]),j=H((0,r.useState)(Y.aM.close),2),C=j[0],A=j[1],I=H((0,r.useState)(void 0),2),V=I[0],N=I[1],P=(0,p.Bd)(),G=P.t,T=P.i18n,F=H((0,m.L4)(v.A.user_base_info),2),X=F[0],M=(F[1],(0,L.MH)().check_user_auth),B=H((0,r.useState)(""),2),U=B[0],Z=B[1],K=function(){var e=q($().mark((function e(){var n;return $().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&c){e.next=3;break}return(0,O.zN)("账号密码不能为空"),e.abrupt("return");case 3:return(n=new a.tl).username=t,n.password=c,n.user_id=X.user_data.id,e.next=9,u.wm.post("updatePassword",n);case 9:e.sent.code===l.m.Sucess&&(0,O.LW)("修改成功");case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,r.useEffect)((function(){var e,t=function(){var e=q($().mark((function e(){var t,n,r,o;return $().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.XO.get("self_auth_open");case 2:return t=e.sent,w(t.data),e.next=6,u.XO.get("shell_cmd_check_open");case 6:return n=e.sent,x(n.data),e.next=10,u.XO.get("token");case 10:if((r=e.sent).code!==l.m.Sucess){e.next=17;break}if(o=r.data){e.next=15;break}return e.abrupt("return");case 15:o.length&&N(o.length),o.mode&&A(o.mode);case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();t(),Z(null==X||null===(e=X.user_data)||void 0===e?void 0:e.language)}),[]);var R=function(){var e=q($().mark((function e(){var t;return $().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.XO.get("self_auth_open/jscode");case 2:t=e.sent,S({model:"ace/mode/javascript",open:!0,fileName:"",save:function(){var e=q($().mark((function e(t){var n;return $().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={context:t,router:W},e.next=3,u.XO.post("jscode/save",n);case 3:0===e.sent.code&&(L.xK.set_value_temp(""),S({open:!1,model:"",fileName:"",save:null}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}),L.xK.set_value_temp(t.data);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),D=function(){var e=q($().mark((function e(){var t;return $().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.XO.get("shell_cmd_check_open/jscode");case 2:t=e.sent,S({model:"ace/mode/javascript",open:!0,fileName:"",save:function(){var e=q($().mark((function e(t){var n;return $().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={context:t},e.next=3,u.XO.post("shell_cmd_check_open/jscode/save",n);case 3:0===e.sent.code&&(L.xK.set_value_temp(""),S({open:!1,model:"",fileName:"",save:null}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}),L.xK.set_value_temp(t.data);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),J=function(){var e=q($().mark((function e(){return $().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.XO.post("self_auth_open/save",{open:g});case 2:e.sent.code===l.m.Sucess&&(0,O.LW)("修改成功");case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Q=function(){var e=q($().mark((function e(){return $().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.XO.post("shell_cmd_check_open/save",{open:E});case 2:e.sent.code===l.m.Sucess&&(0,O.LW)("修改成功");case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ee=function(){var e=q($().mark((function e(){var t;return $().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=new Y.Gd).mode=C,Y.aM.length!==t.mode||V||(0,O.zN)("秒数不能为空"),t.length=parseInt(V),e.next=6,u.XO.post("token/save",t);case 6:e.sent.code===l.m.Sucess&&(0,O.LW)("保存成功");case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),te=function(){var e=q($().mark((function e(){return $().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T.changeLanguage(U),e.next=3,u.wm.post("language/save",{language:U});case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ne=function(){var e=q($().mark((function e(){return $().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.XO.get("token/clear");case 2:e.sent.code===l.m.Sucess&&(0,O.LW)("清理完成,重新登录");case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return r.createElement(o.fI,null,r.createElement(o.VP,{widthPer:30},r.createElement(o.xh,null,M(a.oV.docker_images_delete),r.createElement(s.Zp,{title:G("自定义登录auth"),rightBottomCom:r.createElement(f.C3,{text:G("保存"),clickFun:J}),titleCom:r.createElement(f.rA,{icon:"edit",title:G("代码修改"),onClick:R})},r.createElement(h.l6,{value:g,onChange:function(e){w("true"===e)},options:[{title:G("开启"),value:!0},{title:G("关闭"),value:!1}]})),r.createElement(s.Zp,{title:G("自定义shell命令校验"),rightBottomCom:r.createElement(f.C3,{text:G("保存"),clickFun:Q}),titleCom:r.createElement(f.rA,{icon:"edit",title:G("代码修改"),onClick:D})},r.createElement(h.l6,{value:E,onChange:function(e){x("true"===e)},options:[{title:G("开启"),value:!0},{title:G("关闭"),value:!1}]})),r.createElement(s.Zp,{title:G("修改密码"),rightBottomCom:r.createElement(f.C3,{text:G("确定修改"),clickFun:K})},r.createElement(h.Sm,{placeholder:G("新账号"),value:t,handleInputChange:function(e){n(e)}}),r.createElement(h.Sm,{placeholder:G("新密码"),value:c,handleInputChange:function(e){y(e)}})))),r.createElement(o.VP,{widthPer:30},r.createElement(o.xh,null,r.createElement(s.Zp,{title:G("语言"),rightBottomCom:r.createElement(f.C3,{text:G("保存"),clickFun:te})},r.createElement(h.l6,{value:U,onChange:function(e){Z(e)},options:[{title:"English",value:"en"},{title:"中文",value:"zh"}]})),r.createElement(s.Zp,{title:G("token过期时间"),rightBottomCom:r.createElement(d.S,{isFlex:!0,columns:[r.createElement(f.C3,{text:G("清空token"),clickFun:ne}),r.createElement(f.C3,{text:G("保存"),clickFun:ee})]})},r.createElement(d.S,{isFlex:!0,columns:[r.createElement(h.U6,{value:1,context:G("关闭"),selected:C===Y.aM.close,onchange:function(){A(Y.aM.close)}}),r.createElement(h.U6,{value:1,context:G("指定时间"),selected:C===Y.aM.length,onchange:function(){A(Y.aM.length)}}),r.createElement(h.U6,{value:1,context:G("永不过期"),selected:C===Y.aM.forver,onchange:function(){A(Y.aM.forver)}})]}),C===Y.aM.length&&r.createElement(h.Sm,{placeholder:G("秒"),value:V,handleInputChange:function(e){N(e)}})))),r.createElement(z.A,{left_children:r.createElement("span",null," ",r.createElement("span",{className:"credits"},"version:".concat("2.0.2")),r.createElement("span",{className:"credits"},"系统运行于:",X.runing_time_length))}))}var J=n(7523);function Q(e){return Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Q(e)}function ee(e){return function(e){if(Array.isArray(e))return ie(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ae(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.")}()}function te(){te=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),c=new A(r||[]);return o(i,"_invoke",{value:L(e,n,c)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var h="suspendedStart",d="suspendedYield",p="executing",m="completed",v={};function y(){}function _(){}function g(){}var w={};l(w,i,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(I([])));E&&E!==n&&r.call(E,i)&&(w=E);var x=g.prototype=y.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(o,a,i,c){var u=f(e[o],e,a);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==Q(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(s).then((function(e){l.value=e,i(l)}),(function(e){return n("throw",e,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function L(t,n,r){var o=h;return function(a,i){if(o===p)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var c=r.delegate;if(c){var u=O(c,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var l=f(t,n,r);if("normal"===l.type){if(o=r.done?m:d,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=m,r.method="throw",r.arg=l.arg)}}}function O(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var a=f(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,v;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function I(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(Q(t)+" is not iterable")}return _.prototype=g,o(x,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:_,configurable:!0}),_.displayName=l(g,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===_||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,u,"GeneratorFunction")),e.prototype=Object.create(x),e},t.awrap=function(e){return{__await:e}},k(S.prototype),l(S.prototype,c,(function(){return this})),t.AsyncIterator=S,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new S(s(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(x),l(x,u,"Generator"),l(x,i,(function(){return this})),l(x,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=I,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;C(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:I(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function ne(e,t,n,r,o,a,i){try{var c=e[a](i),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}function re(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){ne(a,r,o,i,c,"next",e)}function c(e){ne(a,r,o,i,c,"throw",e)}i(void 0)}))}}function oe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],u=!0,l=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(e,t)||ae(e,t)||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 ae(e,t){if(e){if("string"==typeof e)return ie(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ie(e,t):void 0}}function ie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ce(){var e=(0,p.Bd)(),t=e.t,n=(e.i18n,(0,r.useContext)(J.F)),a=n.initUserInfo,i=n.reloadUserInfo,c=oe((0,r.useState)([]),2),y=c[0],_=c[1],g=oe((0,r.useState)([]),2),w=g[0],b=g[1],E=oe((0,m.L4)(v.A.prompt_card),2),x=(E[0],E[1]),k=oe((0,r.useState)(""),2),S=(k[0],k[1],oe((0,r.useState)([]),2)),j=S[0],C=S[1],A=[t("编号"),t("路径"),t("是否默认"),t("备注")],I=[t("软件"),t("是否安装"),t("路径")],V=[t("编号"),t("路径"),t("备注")],N=((0,L.MH)().check_user_auth,function(){var e=re(te().mark((function e(){var t,n,r,o;return te().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.XO.get("filesSetting");case 2:return(t=e.sent).code===l.m.Sucess&&_(t.data),e.next=6,u.XO.get("outside/software/get");case 6:return(n=e.sent).code===l.m.Sucess&&b(n.data),e.next=10,u.XO.get("protection_dir");case 10:(r=e.sent).code===l.m.Sucess&&C(null!==(o=r.data)&&void 0!==o?o:[]);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}());(0,r.useEffect)((function(){N()}),[]);var P=function(){var e=re(te().mark((function e(){var t;return te().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=0;t<y.length;t++)y[t].index=t;return e.next=3,u.XO.post("filesSetting/save",y);case 3:e.sent.code===l.m.Sucess&&((0,O.LW)("保存成功"),i());case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),G=function(){var e=re(te().mark((function e(){return te().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.XO.post("protection_dir/save",j);case 2:e.sent.code===l.m.Sucess&&((0,O.LW)("保存成功"),i());case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),T=function(){var e=re(te().mark((function e(){return te().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.XO.post("outside/software/save",w);case 2:e.sent.code===l.m.Sucess&&((0,O.LW)("保存成功"),a());case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),F=function(e){var t;e===Y.jk.ffmpeg?t=r.createElement("div",null,"视频转换,rtsp播放器等媒体功能都需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置"):e===Y.jk.smartmontools?t=r.createElement("div",null,"磁盘检查需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置。"):e===Y.jk.ntfs_3g?t=r.createElement("div",null,"如果在linux需要挂载ntfs的硬盘,需要这个软件支持。"):"保护目录"===e?t=r.createElement("div",null,"在删除的时候保护目录会拒绝删除。",r.createElement("ul",null,r.createElement("li",null,"可以使用 /* 来表达该目录下所有文件都禁止删除"))):"文件夹路径"===e&&(t=r.createElement("div",null,"用于在文件夹下切换根目录")),x({open:!0,title:"信息",context_div:r.createElement("div",null,t)})};return r.createElement(o.fI,null,r.createElement(o.VP,{widthPer:50},r.createElement(o.xh,null,r.createElement(s.uF,{title:t("外部软件"),titleCom:r.createElement(f.rA,{icon:"save",title:t("保存"),onClick:T})},r.createElement(d.X,{headers:I,rows:w.map((function(e,n){return[r.createElement("div",null,e.id),r.createElement(s.fq,{ok:e.installed}),r.createElement(h.Sm,{value:e.path,handleInputChange:function(t){e.path=t},no_border:!0,placeholder:t("默认使用环境变量")}),r.createElement(f.rA,{icon:"info",onClick:function(){F(e.id)},title:"信息"})]})),width:"10rem"}))),r.createElement(o.xh,null,r.createElement(s.uF,{self_title:r.createElement("span",{className:" div-row "},r.createElement("h2",null,t("文件夹路径"))," ",r.createElement(f.rA,{icon:"info",onClick:function(){F("文件夹路径")},title:"信息"})),titleCom:r.createElement("div",null,r.createElement(f.rA,{icon:"add",title:t("添加"),onClick:function(){_([].concat(ee(y),[{note:"",default:!1,path:""}]))}}),r.createElement(f.rA,{icon:"save",title:t("保存"),onClick:P}))},r.createElement(d.X,{headers:A,rows:y.map((function(e,n){var o=[r.createElement("div",null,n),r.createElement(h.Sm,{value:e.path,handleInputChange:function(t){e.path=t},no_border:!0}),r.createElement(h.l6,{value:e.default,onChange:function(e){!function(e,t,n){for(var r=[],o=0;o<y.length;o++)y[o].default=o===n&&"true"===t,r.push(y[o]);_([]),_(r)}(0,e,n)},options:[{title:t("是"),value:!0},{title:t("否"),value:!1}],no_border:!0}),r.createElement(h.Sm,{value:e.note,handleInputChange:function(t){e.note=t},no_border:!0}),r.createElement("div",null,0!==n&&r.createElement(f.rA,{icon:"delete",title:t("删除"),onClick:function(){return function(e){y.splice(e,1),_(ee(y))}(n)}}))];return o})),width:"10rem"})),r.createElement(s.uF,{self_title:r.createElement("span",{className:" div-row "},r.createElement("h2",null,t("保护路径"))," ",r.createElement(f.rA,{icon:"info",onClick:function(){F("保护目录")},title:"信息"})),titleCom:r.createElement("div",null,r.createElement(f.rA,{icon:"add",title:t("添加"),onClick:function(){C([].concat(ee(j),[{path:"",note:""}]))}}),r.createElement(f.rA,{icon:"save",title:t("保存"),onClick:G}))},r.createElement(d.X,{headers:V,rows:j.map((function(e,n){var o=[r.createElement("div",null,n),r.createElement(h.Sm,{value:e.path,handleInputChange:function(t){e.path=t},no_border:!0}),r.createElement(h.Sm,{value:e.note,handleInputChange:function(t){e.note=t},no_border:!0}),r.createElement(f.rA,{icon:"delete",title:t("删除"),onClick:function(){return function(e){j.splice(e,1),C(ee(j))}(n)}})];return o})),width:"10rem"})))))}var ue=n(4694),le=n(1499);function se(e){var t=(0,p.Bd)(),n=t.t;return t.i18n,r.createElement(r.Fragment,null,r.createElement("h3",null,n("功能权限")),r.createElement("div",{className:"checkbox_container"},r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.user_manage),checked:e.is_selected(a.oV.user_manage),onChange:function(){e.select_auth(a.oV.user_manage)}}),n("用户管理")),r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.role_manage),checked:e.is_selected(a.oV.role_manage),onChange:function(){e.select_auth(a.oV.role_manage)}}),n("角色管理")),r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.sys_process_close),checked:e.is_selected(a.oV.sys_process_close),onChange:function(){e.select_auth(a.oV.sys_process_close)}}),n("系统进程关闭")),r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.docker_container_update),checked:e.is_selected(a.oV.docker_container_update),onChange:function(){e.select_auth(a.oV.docker_container_update)}}),n("docker容器停止、删除")),r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.docker_images_delete),checked:e.is_selected(a.oV.docker_images_delete),onChange:function(){e.select_auth(a.oV.docker_images_delete)}}),n("docker镜像删除")),r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.systemd_update),checked:e.is_selected(a.oV.systemd_update),onChange:function(){e.select_auth(a.oV.systemd_update)}}),n("systemd删除、添加管理")),r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.vir_net),checked:e.is_selected(a.oV.vir_net),onChange:function(){e.select_auth(a.oV.vir_net)}}),n("虚拟网络")),r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.token_update),checked:e.is_selected(a.oV.token_update),onChange:function(){e.select_auth(a.oV.token_update)}}),n("token时间修改")),r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.code_auth),checked:e.is_selected(a.oV.code_auth),onChange:function(){e.select_auth(a.oV.code_auth)}}),n("自定义auth")),r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.code_resource),checked:e.is_selected(a.oV.code_resource),onChange:function(){e.select_auth(a.oV.code_resource)}}),n("自定义资源路由")),r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.code_api),checked:e.is_selected(a.oV.code_api),onChange:function(){e.select_auth(a.oV.code_api)}}),n("自定义api路由")),r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.update_password),checked:e.is_selected(a.oV.update_password),onChange:function(){e.select_auth(a.oV.update_password)}}),n("修改密码")),r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.sys_disk_mount),checked:e.is_selected(a.oV.sys_disk_mount),onChange:function(){e.select_auth(a.oV.sys_disk_mount)}}),n("磁盘挂载")),r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.ddns),checked:e.is_selected(a.oV.ddns),onChange:function(){e.select_auth(a.oV.ddns)}}),"ddns"),r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.crypto_ssh_file),checked:e.is_selected(a.oV.crypto_ssh_file),onChange:function(){e.select_auth(a.oV.crypto_ssh_file)}}),n("ssh密钥保存到磁盘")),r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.outside_software_path),checked:e.is_selected(a.oV.outside_software_path),onChange:function(){e.select_auth(a.oV.outside_software_path)}}),n("外部软件路径")),r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.filecat_file_delete_cut_rename),checked:e.is_selected(a.oV.filecat_file_delete_cut_rename),onChange:function(){e.select_auth(a.oV.filecat_file_delete_cut_rename)}}),n("文件删除、剪切、重命名")),r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.filecat_file_context_update_upload_created_copy),checked:e.is_selected(a.oV.filecat_file_context_update_upload_created_copy),onChange:function(){e.select_auth(a.oV.filecat_file_context_update_upload_created_copy)}}),n("文件创建、上传、内容更新")),r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.filecat_file_context_update),checked:e.is_selected(a.oV.filecat_file_context_update),onChange:function(){e.select_auth(a.oV.filecat_file_context_update)}}),n("内容更新")),r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.shell_cmd_check),checked:e.is_selected(a.oV.shell_cmd_check),onChange:function(){e.select_auth(a.oV.shell_cmd_check)}}),n("shell命令检测"))),r.createElement("h3",null,n("标签编辑权限")),r.createElement("div",{className:"checkbox_container"},r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.net_site_tag_update),checked:e.is_selected(a.oV.net_site_tag_update),onChange:function(){e.select_auth(a.oV.net_site_tag_update)}}),n("网址")),r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.ssh_proxy_tag_update),checked:e.is_selected(a.oV.ssh_proxy_tag_update),onChange:function(){e.select_auth(a.oV.ssh_proxy_tag_update)}}),n("ssh代理")),r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.http_proxy_tag_update),checked:e.is_selected(a.oV.http_proxy_tag_update),onChange:function(){e.select_auth(a.oV.http_proxy_tag_update)}}),n("http代理")),r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.browser_proxy_tag_update),checked:e.is_selected(a.oV.browser_proxy_tag_update),onChange:function(){e.select_auth(a.oV.browser_proxy_tag_update)}}),n("浏览器代理")),r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.rdp_proxy_tag_update),checked:e.is_selected(a.oV.rdp_proxy_tag_update),onChange:function(){e.select_auth(a.oV.rdp_proxy_tag_update)}}),n("rdp代理")),r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.wol_proxy_tag_update),checked:e.is_selected(a.oV.wol_proxy_tag_update),onChange:function(){e.select_auth(a.oV.wol_proxy_tag_update)}}),n("网络唤醒")),r.createElement("div",null,r.createElement("input",{type:"checkbox",disabled:e.is_disable(a.oV.rtsp_proxy_tag_update),checked:e.is_selected(a.oV.rtsp_proxy_tag_update),onChange:function(){e.select_auth(a.oV.rtsp_proxy_tag_update)}}),n(" rtsp播放器"))))}function fe(e){return fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fe(e)}function he(e){return function(e){if(Array.isArray(e))return ge(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||_e(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.")}()}function de(){de=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),c=new A(r||[]);return o(i,"_invoke",{value:L(e,n,c)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var h="suspendedStart",d="suspendedYield",p="executing",m="completed",v={};function y(){}function _(){}function g(){}var w={};l(w,i,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(I([])));E&&E!==n&&r.call(E,i)&&(w=E);var x=g.prototype=y.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(o,a,i,c){var u=f(e[o],e,a);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==fe(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(s).then((function(e){l.value=e,i(l)}),(function(e){return n("throw",e,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function L(t,n,r){var o=h;return function(a,i){if(o===p)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var c=r.delegate;if(c){var u=O(c,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var l=f(t,n,r);if("normal"===l.type){if(o=r.done?m:d,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=m,r.method="throw",r.arg=l.arg)}}}function O(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var a=f(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,v;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function I(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(fe(t)+" is not iterable")}return _.prototype=g,o(x,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:_,configurable:!0}),_.displayName=l(g,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===_||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,u,"GeneratorFunction")),e.prototype=Object.create(x),e},t.awrap=function(e){return{__await:e}},k(S.prototype),l(S.prototype,c,(function(){return this})),t.AsyncIterator=S,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new S(s(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(x),l(x,u,"Generator"),l(x,i,(function(){return this})),l(x,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=I,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;C(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:I(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function pe(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=_e(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},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 a,i=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){c=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(c)throw a}}}}function me(e,t,n,r,o,a,i){try{var c=e[a](i),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}function ve(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){me(a,r,o,i,c,"next",e)}function c(e){me(a,r,o,i,c,"throw",e)}i(void 0)}))}}function ye(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],u=!0,l=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(e,t)||_e(e,t)||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 _e(e,t){if(e){if("string"==typeof e)return ge(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ge(e,t):void 0}}function ge(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var we=new Map;function be(){var e,t,n=(0,p.Bd)(),i=n.t,c=(n.i18n,(0,r.useContext)(J.F)),y=(c.initUserInfo,c.reloadUserInfo,ye((0,m.L4)(v.A.user_base_info),2)),_=(y[0],y[1],ye((0,r.useState)([]),2)),g=_[0],w=_[1],b=ye((0,m.L4)(v.A.prompt_card),2),E=(b[0],b[1],ye((0,r.useState)(!1),2)),x=E[0],k=E[1],S=ye((0,r.useState)(!1),2),L=S[0],j=S[1],C=ye((0,m.L4)(v.A.confirm),2),A=(C[0],C[1]),I=ye((0,r.useState)(""),2),V=I[0],N=I[1],P=ye((0,r.useState)(""),2),G=P[0],T=P[1],F=ye((0,r.useState)(""),2),X=F[0],M=F[1],B=ye((0,r.useState)([]),2),U=B[0],W=B[1],Y=ye((0,r.useState)([]),2),z=Y[0],Z=Y[1],$=ye((0,r.useState)(""),2),K=$[0],q=$[1],H=ye((0,r.useState)("en"),2),R=H[0],D=H[1],Q=ye((0,r.useState)([]),2),ee=Q[0],te=Q[1],ne=ye((0,r.useState)(""),2),re=ne[0],oe=ne[1],ae=ye((0,r.useState)(!1),2),ie=ae[0],ce=ae[1],fe=ye((0,r.useState)(""),2),me=fe[0],_e=fe[1],ge=ye((0,r.useState)(""),2),be=ge[0],Ee=ge[1],xe=ye((0,r.useState)({}),2),ke=xe[0],Se=xe[1],Le=ye((0,r.useState)([]),2),Oe=Le[0],je=Le[1],Ce=[i("用户id"),i("用户名"),i("目录范围"),i("备注")],Ae=function(){var e=ve(de().mark((function e(){var t,n,r,o,a;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.wm.get("all_users");case 2:return(t=e.sent).code===l.m.Sucess&&w(t.data),e.next=6,u.wm.get("all_roles");case 6:if((n=e.sent).code===l.m.Sucess){je(n.data),we.clear(),r=pe(n.data);try{for(r.s();!(o=r.n()).done;)a=o.value,we.set(a.role_id,a)}catch(e){r.e(e)}finally{r.f()}}case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ie=function(e){var t,n,r,o,a,i,c,u,l,s,f,h;N(null!==(t=null==e?void 0:e.username)&&void 0!==t?t:""),T(null!==(n=null==e?void 0:e.password)&&void 0!==n?n:""),M(null!==(r=null==e?void 0:e.cwd)&&void 0!==r?r:""),W(null!==(o=null==e?void 0:e.access_dirs)&&void 0!==o?o:[]),Z(null!==(a=null==e?void 0:e.not_access_dirs)&&void 0!==a?a:[]),q(null!==(i=null==e?void 0:e.access_cmd)&&void 0!==i?i:""),D(null!==(c=null==e?void 0:e.language)&&void 0!==c?c:""),te(null!==(u=null==e?void 0:e.auth_list)&&void 0!==u?u:[]),oe(null!==(l=null==e?void 0:e.note)&&void 0!==l?l:""),ce(null!==(s=null==e?void 0:e.is_root)&&void 0!==s&&s),_e(null!==(f=null==e?void 0:e.id)&&void 0!==f?f:""),null!=e&&e.bind_role_id&&Ve(e.bind_role_id,null!==(h=e.auth_list)&&void 0!==h?h:[])};(0,r.useEffect)((function(){Ae()}),[]);var Ve=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e)return Ee(""),void Se({});var n=we.get(e);if(n){if(n.cwd&&M(n.cwd),n.access_dirs&&n.access_dirs.length>0&&W(n.access_dirs),n.not_access_dirs&&n.not_access_dirs.length>0&&Z(n.not_access_dirs),n.access_cmd&&q(n.access_cmd),n.language&&D(n.language),n.auth_list&&n.auth_list.length>0){var r,o=new Set(n.auth_list),a=pe(t);try{for(a.s();!(r=a.n()).done;){var i=r.value;o.add(i)}}catch(e){a.e(e)}finally{a.f()}te(Array.from(o))}Ee(e),Se(n)}},Ne=function(){if(V)if((0,le.CB)(V))(0,O.zN)("username not empty char");else{if(X){var e=new a.E0;return e.language=R,e.access_dirs=U,e.username=V,e.password=G,e.not_access_dirs=z,e.cwd=X,e.note=re,e.access_cmd=K,e.auth_list=ee,e.bind_role_id=be,e}(0,O.zN)("cwd not empty")}else(0,O.zN)("username not empty")},Pe=function(){var e=ve(de().mark((function e(){var t,n;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(G){e.next=3;break}return(0,O.zN)("password not empty"),e.abrupt("return");case 3:if(!(0,le.CB)(G)){e.next=6;break}return(0,O.zN)("username not empty char"),e.abrupt("return");case 6:return t=Ne(),e.next=9,u.wm.post("create_user",t);case 9:n=e.sent,Ae(),n.code===l.m.Sucess&&((0,O.LW)("创建完成"),Ae(),k(!1),j(!1),Ie(void 0));case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ge=function(){var e=ve(de().mark((function e(){var t;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=Ne()){e.next=3;break}return e.abrupt("return");case 3:return t.id=me,e.next=6,u.wm.post("save_user",t);case 6:e.sent.code===l.m.Sucess&&((0,O.LW)("保存完成"),Ae());case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Te=function(){var e=ve(de().mark((function e(t){return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:A({open:!0,title:"确定删除吗",handle:function(){var e=ve(de().mark((function e(){var n;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(n=new a.E0).username=t,e.next=4,u.wm.post("delete_user",n);case 4:e.sent.code===l.m.Sucess&&((0,O.LW)("删除完成"),Ae(),A({open:!1,handle:null}));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return r.createElement(o.fI,null,r.createElement(o.VP,{widthPer:50},r.createElement(o.xh,null,r.createElement(s.uF,{self_title:r.createElement("span",{className:" div-row "},r.createElement("h2",null,i("用户"))),titleCom:r.createElement("div",null,r.createElement(f.rA,{icon:"add",title:i("添加"),onClick:function(){k(!0),j(!1),Ie(void 0)}}))},r.createElement(d.X,{headers:Ce,rows:g.map((function(e,t){return[r.createElement("p",null,e.id),r.createElement(s.xP,null,e.username),r.createElement(s.xP,null,e.cwd),r.createElement(s.xP,null,e.note),r.createElement("div",null,r.createElement(f.rA,{icon:"edit",title:i("编辑"),onClick:function(){return function(e){k(!1),j(!0),Ie(e)}(e)}}),!e.is_root&&r.createElement(f.rA,{icon:"delete",title:i("删除"),onClick:function(){return Te(e.username)}}))]})),width:"10rem"})))),r.createElement(o.VP,{widthPer:50},(x||L)&&r.createElement(o.xh,null,r.createElement(s.Zp,{self_title:r.createElement("span",{className:" div-row "},r.createElement("h2",null,i("".concat(x?"添加":"编辑")))," "),rightBottomCom:r.createElement("div",null,r.createElement(f.rA,{icon:"cancel",title:i("取消"),onClick:function(){k(!1),j(!1),Ie(void 0)}}),x&&r.createElement(f.rA,{icon:"add_circle",title:i("添加"),onClick:Pe}),L&&r.createElement(f.rA,{icon:"save",title:i("保存"),onClick:Ge}))},r.createElement("label",null,i("用户名")),r.createElement(h.Sm,{value:V,handleInputChange:function(e){return N(e)}}),r.createElement("label",null,i("密码")),r.createElement(h.Sm,{value:G,handleInputChange:function(e){return T(e)}}),r.createElement("label",null,!(null!=ke&&null!==(e=ke.access_dirs)&&void 0!==e&&e.length)&&r.createElement(f.rA,{icon:"add",onClick:function(){W([].concat(he(U),[""]))},title:"添加"}),i("目录范围")),r.createElement(h.Sm,{disabled:""!==ke.cwd&&void 0!==ke.cwd,value:X,handleInputChange:function(e){return M(e)}}),(null!=U?U:[]).map((function(e,t){var n,o,a,c;return r.createElement("div",{key:t,style:{display:"flex"}},r.createElement("div",{style:{width:"90%"}},r.createElement(h.Sm,{disabled:0!==(null==ke||null===(n=ke.access_dirs)||void 0===n?void 0:n.length)&&void 0!==(null==ke||null===(o=ke.access_dirs)||void 0===o?void 0:o.length),value:e,handleInputChange:function(e){U[t]=e,W(he(U))}})),0===(null==ke||null===(a=ke.access_dirs)||void 0===a?void 0:a.length)||void 0===(null==ke||null===(c=ke.access_dirs)||void 0===c?void 0:c.length)&&r.createElement(f.rA,{icon:"delete",onClick:function(){U.splice(t,1),W(he(U))},title:i("删除")}))})),r.createElement("label",null,!(null!=ke&&null!==(t=ke.not_access_dirs)&&void 0!==t&&t.length)&&r.createElement(f.rA,{icon:"add",onClick:function(){Z([].concat(he(z),[""]))},title:i("添加")}),i("禁止目录范围")),(null!=z?z:[]).map((function(e,t){var n,o,a,c;return r.createElement("div",{key:t,style:{display:"flex"}},r.createElement("div",{style:{width:"90%"}},r.createElement(h.Sm,{disabled:0!==(null==ke||null===(n=ke.not_access_dirs)||void 0===n?void 0:n.length)&&void 0!==(null==ke||null===(o=ke.not_access_dirs)||void 0===o?void 0:o.length),value:e,handleInputChange:function(e){z[t]=e,Z(he(z))}})),0===(null==ke||null===(a=ke.not_access_dirs)||void 0===a?void 0:a.length)||void 0===(null==ke||null===(c=ke.not_access_dirs)||void 0===c?void 0:c.length)&&r.createElement(f.rA,{icon:"delete",onClick:function(){z.splice(t,1),Z(he(z))},title:i("删除")}))})),r.createElement("label",null,i("可执行的命令")),r.createElement(h.Sm,{disabled:""!==ke.access_cmd&&void 0!==ke.access_cmd,value:K,placeholder:"use blank split",handleInputChange:function(e){return q(e)}}),!ie&&r.createElement(r.Fragment,null,r.createElement("label",null,i("角色")),r.createElement(h.l6,{value:be,onChange:function(e){Ve(e)},options:function(){var e=[];e.push({title:"NOT",value:""});var t,n=pe(Oe);try{for(n.s();!(t=n.n()).done;){var r=t.value;e.push({title:r.role_name,value:r.role_id})}}catch(e){n.e(e)}finally{n.f()}return e}()})),r.createElement("label",null,i("语言")),r.createElement(h.l6,{disabled:""!==ke.language&&void 0!==ke.language,value:R,onChange:function(e){D(e)},options:[{title:"English",value:"en"},{title:"中文",value:"zh"}]}),r.createElement("p",{className:"small"},i("标签编辑是所有人都可见的的数据")),r.createElement(se,{is_disable:function(e){if(!0===ie)return!0;if(be){var t,n=we.get(be);if(n)return(null!==(t=n.auth_list)&&void 0!==t?t:[]).includes(e)}return!1},is_selected:function(e){return!0===ie||void 0!==(null==ee?void 0:ee.find((function(t){return t===e})))},select_auth:function(e){ee?ee.includes(e)?((0,ue.I)(ee,(function(t){return t===e})),te(he(ee))):te([].concat(he(ee),[e])):te([e])}}),r.createElement("label",null,i("备注")),r.createElement(h.Sm,{value:re,handleInputChange:function(e){return oe(e)}})))))}function Ee(e){return Ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ee(e)}function xe(e){return function(e){if(Array.isArray(e))return Ce(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||je(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.")}()}function ke(){ke=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),c=new A(r||[]);return o(i,"_invoke",{value:L(e,n,c)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var h="suspendedStart",d="suspendedYield",p="executing",m="completed",v={};function y(){}function _(){}function g(){}var w={};l(w,i,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(I([])));E&&E!==n&&r.call(E,i)&&(w=E);var x=g.prototype=y.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(o,a,i,c){var u=f(e[o],e,a);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==Ee(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(s).then((function(e){l.value=e,i(l)}),(function(e){return n("throw",e,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function L(t,n,r){var o=h;return function(a,i){if(o===p)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var c=r.delegate;if(c){var u=O(c,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var l=f(t,n,r);if("normal"===l.type){if(o=r.done?m:d,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=m,r.method="throw",r.arg=l.arg)}}}function O(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var a=f(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,v;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function I(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(Ee(t)+" is not iterable")}return _.prototype=g,o(x,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:_,configurable:!0}),_.displayName=l(g,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===_||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,u,"GeneratorFunction")),e.prototype=Object.create(x),e},t.awrap=function(e){return{__await:e}},k(S.prototype),l(S.prototype,c,(function(){return this})),t.AsyncIterator=S,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new S(s(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(x),l(x,u,"Generator"),l(x,i,(function(){return this})),l(x,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=I,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;C(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:I(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function Se(e,t,n,r,o,a,i){try{var c=e[a](i),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}function Le(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){Se(a,r,o,i,c,"next",e)}function c(e){Se(a,r,o,i,c,"throw",e)}i(void 0)}))}}function Oe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],u=!0,l=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(e,t)||je(e,t)||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 je(e,t){if(e){if("string"==typeof e)return Ce(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ce(e,t):void 0}}function Ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ae(){var e=(0,p.Bd)(),t=e.t,n=(e.i18n,(0,r.useContext)(J.F)),i=(n.initUserInfo,n.reloadUserInfo,Oe((0,m.L4)(v.A.user_base_info),2)),c=(i[0],i[1],Oe((0,r.useState)([]),2)),y=c[0],_=c[1],g=Oe((0,m.L4)(v.A.prompt_card),2),w=(g[0],g[1],Oe((0,r.useState)(!1),2)),b=w[0],E=w[1],x=Oe((0,r.useState)(!1),2),k=x[0],S=x[1],L=Oe((0,m.L4)(v.A.confirm),2),j=(L[0],L[1]),C=Oe((0,r.useState)(""),2),A=C[0],I=C[1],V=Oe((0,r.useState)(""),2),N=V[0],P=V[1],G=Oe((0,r.useState)([]),2),T=G[0],F=G[1],X=Oe((0,r.useState)([]),2),M=X[0],B=X[1],U=Oe((0,r.useState)(""),2),W=U[0],Y=U[1],z=Oe((0,r.useState)(""),2),Z=z[0],$=z[1],K=Oe((0,r.useState)([]),2),q=K[0],H=K[1],R=Oe((0,r.useState)(""),2),D=R[0],Q=R[1],ee=Oe((0,r.useState)(""),2),te=ee[0],ne=ee[1],re=[t("角色id"),t("角色名"),t("备注")],oe=function(){var e=Le(ke().mark((function e(){var t;return ke().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.wm.get("all_roles");case 2:(t=e.sent).code===l.m.Sucess&&_(t.data);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ae=function(e){var t,n,r,o,a,i,c,u,l;I(null!==(t=null==e?void 0:e.role_name)&&void 0!==t?t:""),P(null!==(n=null==e?void 0:e.cwd)&&void 0!==n?n:""),F(null!==(r=null==e?void 0:e.access_dirs)&&void 0!==r?r:[]),B(null!==(o=null==e?void 0:e.not_access_dirs)&&void 0!==o?o:[]),Y(null!==(a=null==e?void 0:e.access_cmd)&&void 0!==a?a:""),$(null!==(i=null==e?void 0:e.language)&&void 0!==i?i:""),H(null!==(c=null==e?void 0:e.auth_list)&&void 0!==c?c:[]),Q(null!==(u=null==e?void 0:e.role_id)&&void 0!==u?u:""),ne(null!==(l=null==e?void 0:e.role_note)&&void 0!==l?l:"")};(0,r.useEffect)((function(){oe()}),[]);var ie=function(){if(A){var e=new a.E0;return e.language=Z,e.access_dirs=T,e.role_name=A,e.not_access_dirs=M,e.cwd=N,e.access_cmd=W,e.auth_list=q,e.role_note=te,e}(0,O.zN)("role_name not empty")},ce=function(){var e=Le(ke().mark((function e(){var t,n;return ke().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=ie()){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,u.wm.post("create_role",t);case 5:n=e.sent,oe(),n.code===l.m.Sucess&&((0,O.LW)("创建完成"),oe(),E(!1),S(!1),ae(void 0));case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),le=function(){var e=Le(ke().mark((function e(){var t;return ke().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=ie()){e.next=3;break}return e.abrupt("return");case 3:return t.role_id=D,e.next=6,u.wm.post("save_role",t);case 6:e.sent.code===l.m.Sucess&&((0,O.LW)("保存完成"),oe());case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),fe=function(){var e=Le(ke().mark((function e(t){return ke().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:j({open:!0,title:"确定删除吗",handle:function(){var e=Le(ke().mark((function e(){var n;return ke().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(n=new a.E0).role_id=t,e.next=4,u.wm.post("delete_role",n);case 4:e.sent.code===l.m.Sucess&&((0,O.LW)("删除完成"),oe(),j({open:!1,handle:null}));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return r.createElement(o.fI,null,r.createElement(o.VP,{widthPer:50},r.createElement(o.xh,null,r.createElement(s.uF,{self_title:r.createElement("span",{className:" div-row "},r.createElement("h2",null,t("角色"))),titleCom:r.createElement("div",null,r.createElement(f.rA,{icon:"add",title:t("添加"),onClick:function(){E(!0),S(!1),ae(void 0)}}))},r.createElement(d.X,{headers:re,rows:y.map((function(e,n){return[r.createElement("p",null,e.role_id),r.createElement(s.xP,null,e.role_name),r.createElement(s.xP,null,e.role_note),r.createElement("div",null,r.createElement(f.rA,{icon:"edit",title:t("编辑"),onClick:function(){return function(e){E(!1),S(!0),ae(e)}(e)}}),!e.is_root&&r.createElement(f.rA,{icon:"delete",title:t("删除"),onClick:function(){return fe(e.role_id)}}))]})),width:"10rem"})))),r.createElement(o.VP,{widthPer:50},(b||k)&&r.createElement(o.xh,null,r.createElement(s.Zp,{self_title:r.createElement("span",{className:" div-row "},r.createElement("h2",null,t("".concat(b?"添加":"编辑")))," "),rightBottomCom:r.createElement("div",null,r.createElement(f.rA,{icon:"cancel",title:t("取消"),onClick:function(){E(!1),S(!1),ae(void 0)}}),b&&r.createElement(f.rA,{icon:"add_circle",title:t("添加"),onClick:ce}),k&&r.createElement(f.rA,{icon:"save",title:t("保存"),onClick:le}))},r.createElement("label",null,"角色名"),r.createElement(h.Sm,{value:A,handleInputChange:function(e){return I(e)}}),r.createElement("label",null,"角色备注"),r.createElement(h.Sm,{value:te,handleInputChange:function(e){return ne(e)}}),r.createElement("label",null,r.createElement(f.rA,{icon:"add",onClick:function(){F([].concat(xe(T),[""]))},title:"添加"}),"目录范围"),r.createElement(h.Sm,{value:N,handleInputChange:function(e){return P(e)}}),(null!=T?T:[]).map((function(e,t){return r.createElement("div",{key:t,style:{display:"flex"}},r.createElement("div",{style:{width:"90%"}},r.createElement(h.Sm,{value:e,handleInputChange:function(e){T[t]=e,F(xe(T))}})),r.createElement(f.rA,{icon:"delete",onClick:function(){T.splice(t,1),F(xe(T))},title:"删除"}))})),r.createElement("label",null,r.createElement(f.rA,{icon:"add",onClick:function(){B([].concat(xe(M),[""]))},title:"添加"}),"禁止目录范围"),(null!=M?M:[]).map((function(e,t){return r.createElement("div",{key:t,style:{display:"flex"}},r.createElement("div",{style:{width:"90%"}},r.createElement(h.Sm,{value:e,handleInputChange:function(e){M[t]=e,B(xe(M))}})),r.createElement(f.rA,{icon:"delete",onClick:function(){M.splice(t,1),B(xe(M))},title:"删除"}))})),r.createElement("label",null,"可执行的命令"),r.createElement(h.Sm,{value:W,placeholder:"use blank split",handleInputChange:function(e){return Y(e)}}),r.createElement("label",null,"语言"),r.createElement(h.l6,{value:Z,onChange:function(e){$(e)},options:[{title:"NOT",value:""},{title:"English",value:"en"},{title:"中文",value:"zh"}]}),r.createElement("p",{className:"small"},"标签编辑是所有人都可见的的数据"),r.createElement(se,{is_disable:function(){return!1},is_selected:function(e){return void 0!==(null==q?void 0:q.find((function(t){return t===e})))},select_auth:function(e){q?(q.find((function(t){return t==e}))?(0,ue.I)(q,(function(t){return t===e})):q.push(e),H(xe(q))):H([e])}})))))}function Ie(){var e=(0,p.Bd)().t,t=(0,L.MH)().check_user_auth,n=[{index:1,name:e("系统"),rto:"password/"},{index:1,name:e("环境"),rto:"env_setting/"},{index:1,name:e("自定义路由"),rto:"customer_router/"}];return t(a.oV.user_manage)&&n.push({index:1,name:e("用户管理"),rto:"user_manager/"}),t(a.oV.role_manage)&&n.push({index:1,name:e("角色管理"),rto:"role_manager/"}),r.createElement(o.W1,{optionList:n},r.createElement(D,null),r.createElement(ce,null),r.createElement(U,null),t(a.oV.user_manage)&&r.createElement(be,null),t(a.oV.role_manage)&&r.createElement(Ae,null))}}}]);
|