filecat 2.0.3 → 2.0.4
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 +1 -1
- package/build/dist/523.bundle.js +1 -1
- package/build/dist/943.bundle.js +1 -1
- package/build/dist/bundle.js +1 -1
- package/build/main.js +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@ url: http://116.198.245.137:5569/
|
|
|
42
42
|
4. studio 编辑器,右键文件夹可以打开一个类似vscode的编辑器页面,可用于linux程序临时开发环境。
|
|
43
43
|
5. [excalidraw](https://github.com/excalidraw/excalidraw)绘图编辑器,这是一个很好用白板工具。
|
|
44
44
|
5. 切换根目录,在设置中添加多个文件夹路径后,可以在右上角选择切换根目录,只对一个session生效。
|
|
45
|
-
6.
|
|
45
|
+
6. 终端,内嵌了一个自定义终端,可以实现任意命令的过滤,防止用户执行恶意的类似rm -rf / 命令,因为不是实际的pty环境,所以像node这样的软件想要交互式执行需要添加-i或者自定义处理函数,对于pty执行的程序虽然可以不用输出绝对路径,但是要输入文件的后缀,比如 cmd不能执行但是cmd.exe可以执行。
|
|
46
46
|
7. 超大文本日志查看器,对任意大小的文本右键使用作为日志类型查看,点击窗口后可以使用上下键来快速滚动翻页,还可以实时输出内容。
|
|
47
47
|
- ssh代理,ftp代理: 可以管理多个linux服务器,作用和winscp类似,让终端和文件管理更方便。
|
|
48
48
|
- http代理,类似postman 的发送http请求功能
|
package/build/dist/523.bundle.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
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.3")),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))}}}]);
|
|
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.4")),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))}}}]);
|