filecat 1.1.3 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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. 终端,默认是bash, windwos下是 powershell。
45
+ 6. 终端,内嵌了一个自定义终端,可以实现任意命令的过滤,防止用户执行恶意的rm -r / 命令,因为不是实际的pty环境,所以像node这样的软件想要交互式执行需要添加-i或者自定义处理函数。
46
46
  7. 超大文本日志查看器,对任意大小的文本右键使用作为日志类型查看,点击窗口后可以使用上下键来快速滚动翻页,还可以实时输出内容。
47
47
  - ssh代理,ftp代理: 可以管理多个linux服务器,作用和winscp类似,让终端和文件管理更方便。
48
48
  - http代理,类似postman 的发送http请求功能
@@ -53,6 +53,7 @@ url: http://116.198.245.137:5569/
53
53
  - 系统内存cpu信息,进程cpu信息(利用c插件、使用极低的资源,实时查看系统全部进程信息,类似windows的任务管理器),systemd管理(linux下才有)
54
54
  - wol网络唤醒
55
55
  - 虚拟网络,可以实现p2p,vpn功能。(不是端口转发,而是利用tun在主机上创建虚拟ip)
56
+ - 权限,支持各种系统权限,文件操作权限,命令权限.
56
57
  ## 五. 功能说明
57
58
  1. 由于一些库目前不支持mac(比如虚拟网络) **mac下无法使用**上面的安装方式直接安装成功,在windows需要管理员模式下运行,linux需要root权限才可以使用该功能。此外还很多功能没有在macos下测试过,只支持windows和Linux;
58
59
  2. 部分功能目前处于demo阶段,未来会持续优化;
@@ -62,7 +63,7 @@ url: http://116.198.245.137:5569/
62
63
  3. 支持更多的流媒体功能
63
64
  4. 支持更多的ddns平台
64
65
  5. 自动化爬虫
65
- 6. 路由权限
66
+ 6. 支持移动端
66
67
  ## 七. qq群
67
68
  824838674
68
69
  ## 八. 致谢
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see 181.bundle.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[181],{4091:(t,e,r)=>{r.d(e,{A:()=>h});var n=r(6540),o=r(952),i=r.n(o),a=(r(2327),r(1766),r(4854),r(8),r(846),r(975),r(4286),r(766),r(1234),r(4522)),c=r.n(a),u=r(8247);function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function f(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function s(t,e,r){return(e=function(t){var e=function(t){if("object"!=l(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=l(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==l(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(t){var e=(0,n.useRef)(null);return(0,n.useEffect)((function(){var r,n=i().edit(e.current,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?f(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({value:u.xK.get_value_temp(),showPrintMargin:!1,theme:"ace/theme/cloud9_day",mode:c().getModeForPath(null!==(r=t.name)&&void 0!==r?r:"").mode,wrap:!1,highlightActiveLine:!1,fontSize:14},t.options));return n.setOptions({enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}),n.container.addEventListener("wheel",(function(t){t.preventDefault()})),n.focus(),n.on("change",(function(e){t.on_change&&t.on_change()})),e.current=n,u.xK.set_editor_temp(n),function(){u.xK.set_editor_temp(null),n.destroy()}}),[]),n.createElement("div",{ref:e,style:{height:"100%",width:"100%"}})}r(47),i().config.set("basePath","https://cdn.jsdelivr.net/npm/ace-builds@".concat(o.version,"/src-min-noconflict/")),i().config.set("modePath","https://cdn.jsdelivr.net/npm/ace-builds@".concat(o.version,"/src-min-noconflict/")),i().config.set("themePath","https://cdn.jsdelivr.net/npm/ace-builds@".concat(o.version,"/src-min-noconflict/")),i().config.set("workerPath","https://cdn.jsdelivr.net/npm/ace-builds@".concat(o.version,"/src-min-noconflict/"))},7181:(t,e,r)=>{r.r(e),r.d(e,{default:()=>v});var n=r(6540),o=r(5997),i=r(7952),a=r(7444),c=r(6417),u=r(8247),l=r(4091);function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),c=new G(n||[]);return o(a,"_invoke",{value:P(t,r,c)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var y="suspendedStart",v="suspendedYield",m="executing",d="completed",g={};function b(){}function w(){}function E(){}var O={};l(O,a,(function(){return this}));var j=Object.getPrototypeOf,x=j&&j(j(T([])));x&&x!==r&&n.call(x,a)&&(O=x);var _=E.prototype=b.prototype=Object.create(O);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(o,i,a,c){var u=p(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==f(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function P(e,r,n){var o=y;return function(i,a){if(o===m)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=k(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var l=p(e,r,n);if("normal"===l.type){if(o=n.done?d:v,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=p(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(f(e)+" is not iterable")}return w.prototype=E,o(_,"constructor",{value:E,configurable:!0}),o(E,"constructor",{value:w,configurable:!0}),w.displayName=l(E,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,l(t,u,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},L(S.prototype),l(S.prototype,c,(function(){return this})),e.AsyncIterator=S,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new S(h(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(_),l(_,u,"Generator"),l(_,a,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,G.prototype={constructor:G,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),N(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;N(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function h(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return y(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function v(){var t=p((0,a.L4)(c.A.editorSetting),2),e=t[0],r=t[1],f=p((0,n.useState)(!1),2),y=f[0],v=f[1];function m(){return d.apply(this,arguments)}function d(){var t;return t=s().mark((function t(){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.save||!y){t.next=5;break}return t.next=3,e.save(u.xK.get_editor_value());case 3:u.xK.set_value_temp(""),v(!1);case 5:case"end":return t.stop()}}),t)})),d=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){h(i,n,o,a,c,"next",t)}function c(t){h(i,n,o,a,c,"throw",t)}a(void 0)}))},d.apply(this,arguments)}var g=function(t){t.ctrlKey&&"s"===t.key&&(t.preventDefault(),e.save&&y&&m())};(0,n.useEffect)((function(){return function(){v(!1)}}),[e]),(0,n.useEffect)((function(){return document.addEventListener("keydown",g),function(){document.removeEventListener("keydown",g)}}),[y,e]);var b=n.createElement("div",{id:"editor-container"},n.createElement(i.A,{ignore_tags:!0,left_children:[n.createElement(o.rA,{key:1,title:"取消",icon:"close",onClick:function(){u.xK.set_value_temp(""),r({open:!1,model:"",fileName:"",save:null})}}),n.createElement("title",{key:2},e.fileName)]},e.menu_list&&e.menu_list,y&&n.createElement(o.rA,{title:"保存",icon:"save",onClick:m})),n.createElement(l.A,{name:e.fileName,on_change:function(){y||v(!0)}}));return e.open&&b}}}]);
2
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[181],{4091:(t,e,r)=>{r.d(e,{A:()=>h});var n=r(6540),o=r(952),i=r.n(o),a=(r(2327),r(1766),r(4854),r(8),r(846),r(975),r(4286),r(766),r(1234),r(4522)),c=r.n(a),u=r(8247);function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function f(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function s(t,e,r){return(e=function(t){var e=function(t){if("object"!=l(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=l(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==l(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(t){var e=(0,n.useRef)(null);return(0,n.useEffect)((function(){var r,n,o=i().edit(e.current,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?f(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({value:u.xK.get_value_temp(),showPrintMargin:!1,theme:"ace/theme/cloud9_day",mode:null!==(r=t.model)&&void 0!==r?r:c().getModeForPath(null!==(n=t.name)&&void 0!==n?n:"").mode,wrap:!1,highlightActiveLine:!1,fontSize:14},t.options));return o.setOptions({enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}),o.container.addEventListener("wheel",(function(t){t.preventDefault()})),o.focus(),o.on("change",(function(e){t.on_change&&t.on_change()})),e.current=o,u.xK.set_editor_temp(o),function(){u.xK.set_editor_temp(null),o.destroy()}}),[]),n.createElement("div",{ref:e,style:{height:"100%",width:"100%"}})}r(47),i().config.set("basePath","https://cdn.jsdelivr.net/npm/ace-builds@".concat(o.version,"/src-min-noconflict/")),i().config.set("modePath","https://cdn.jsdelivr.net/npm/ace-builds@".concat(o.version,"/src-min-noconflict/")),i().config.set("themePath","https://cdn.jsdelivr.net/npm/ace-builds@".concat(o.version,"/src-min-noconflict/")),i().config.set("workerPath","https://cdn.jsdelivr.net/npm/ace-builds@".concat(o.version,"/src-min-noconflict/"))},7181:(t,e,r)=>{r.r(e),r.d(e,{default:()=>v});var n=r(6540),o=r(5997),i=r(7952),a=r(7444),c=r(6417),u=r(8247),l=r(4091);function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),c=new G(n||[]);return o(a,"_invoke",{value:P(t,r,c)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var y="suspendedStart",v="suspendedYield",m="executing",d="completed",g={};function b(){}function w(){}function E(){}var O={};l(O,a,(function(){return this}));var j=Object.getPrototypeOf,x=j&&j(j(T([])));x&&x!==r&&n.call(x,a)&&(O=x);var _=E.prototype=b.prototype=Object.create(O);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(o,i,a,c){var u=p(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==f(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function P(e,r,n){var o=y;return function(i,a){if(o===m)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=k(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var l=p(e,r,n);if("normal"===l.type){if(o=n.done?d:v,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=p(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(f(e)+" is not iterable")}return w.prototype=E,o(_,"constructor",{value:E,configurable:!0}),o(E,"constructor",{value:w,configurable:!0}),w.displayName=l(E,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,l(t,u,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},L(S.prototype),l(S.prototype,c,(function(){return this})),e.AsyncIterator=S,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new S(h(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(_),l(_,u,"Generator"),l(_,a,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,G.prototype={constructor:G,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),N(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;N(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function h(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return y(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function v(){var t=p((0,a.L4)(c.A.editorSetting),2),e=t[0],r=t[1],f=p((0,n.useState)(!1),2),y=f[0],v=f[1];function m(){return d.apply(this,arguments)}function d(){var t;return t=s().mark((function t(){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.save||!y){t.next=5;break}return t.next=3,e.save(u.xK.get_editor_value());case 3:u.xK.set_value_temp(""),v(!1);case 5:case"end":return t.stop()}}),t)})),d=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){h(i,n,o,a,c,"next",t)}function c(t){h(i,n,o,a,c,"throw",t)}a(void 0)}))},d.apply(this,arguments)}var g=function(t){t.ctrlKey&&"s"===t.key&&(t.preventDefault(),e.save&&y&&m())};(0,n.useEffect)((function(){return function(){v(!1)}}),[e]),(0,n.useEffect)((function(){return document.addEventListener("keydown",g),function(){document.removeEventListener("keydown",g)}}),[y,e]);var b=n.createElement("div",{id:"editor-container"},n.createElement(i.A,{ignore_tags:!0,left_children:[n.createElement(o.rA,{key:1,title:"取消",icon:"close",onClick:function(){u.xK.set_value_temp(""),r({open:!1,model:"",fileName:"",save:null})}}),n.createElement("title",{key:2},e.fileName)]},e.menu_list&&e.menu_list,y&&n.createElement(o.rA,{title:"保存",icon:"save",onClick:m})),n.createElement(l.A,{name:e.fileName,model:e.model,on_change:function(){y||v(!0)}}));return e.open&&b}}}]);
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see 29.bundle.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[29],{3029:(t,e,r)=>{r.d(e,{N:()=>S});var n=r(6540);function o(t){return n.createElement("div",null,t.div?n.createElement("div",{className:"nav_list_a",style:{background:t.color}},t.name):t.clickItem||"dir"===t._type?n.createElement("div",{className:"nav_list_a",style:{background:t.color},onClick:function(){"dir"!==t._type?t.clickItem&&t.clickItem(t):t.click_dir(t.item)}},t.name):n.createElement("a",{href:t.url,target:t.target,className:"nav_list_a",style:{background:t.color}},t.name))}var i=r(4694),a=r(3033),c=r(5997),u=r(7767),l=r(7444),f=r(6417);function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function h(){return h=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},h.apply(null,arguments)}function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){v(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function v(t,e,r){return(e=function(t){var e=function(t){if("object"!=s(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==s(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function d(){d=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),c=new N(n||[]);return o(a,"_invoke",{value:S(t,r,c)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",y="suspendedYield",v="executing",m="completed",b={};function g(){}function w(){}function E(){}var _={};l(_,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(C([])));x&&x!==r&&n.call(x,a)&&(_=x);var O=E.prototype=g.prototype=Object.create(_);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function r(o,i,a,c){var u=h(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==s(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function S(e,r,n){var o=p;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===b)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=h(e,r,n);if("normal"===l.type){if(o=n.done?m:y,l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,b;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(s(e)+" is not iterable")}return w.prototype=E,o(O,"constructor",{value:E,configurable:!0}),o(E,"constructor",{value:w,configurable:!0}),w.displayName=l(E,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,l(t,u,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},j(L.prototype),l(L.prototype,c,(function(){return this})),e.AsyncIterator=L,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new L(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=C,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,b):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},e}function m(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function b(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){m(i,n,o,a,c,"next",t)}function c(t){m(i,n,o,a,c,"throw",t)}a(void 0)}))}}function g(t){return function(t){if(Array.isArray(t))return _(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||E(t)||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 w(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||E(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(t,e){if(t){if("string"==typeof t)return _(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(t,e):void 0}}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var k,x,O=["#ffffff","#fefff8","#fcfdf1","#d3d2dc","#f8f9fd","#ebf4fe","#ebebeb","#e8f7eb","#eaf2f9"],j=[],L=[];function S(t){var e=w((0,n.useState)([]),2),r=e[0],s=e[1],p=w((0,n.useState)(-1),2),v=p[0],m=p[1],E=(0,u.zy)(),_=w((0,n.useState)(!1),2),S=_[0],P=_[1],A=w((0,n.useState)(!1),2),I=A[0],N=A[1],C=w((0,n.useState)([]),2),T=C[0],D=C[1],F=w((0,l.L4)(f.A.nav_index_add_item_by_now_list),2),G=F[0],Y=F[1],z=function(t){-1!==v?L[v]._children=t:j=t};(0,n.useEffect)((function(){var e=function(){var e=b(d().mark((function e(){var r;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.getItems){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,t.getItems();case 4:(r=e.sent).map((function(t,e){t.color=(0,i.Lr)(O)})),s(j=r);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}),[E]);var M=function(){var e=b(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!S){e.next=6;break}if(!t.save){e.next=4;break}return e.next=4,t.save(j);case 4:e.next=7;break;case 6:x=r;case 7:P(!S);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),U=function(){var e=b(d().mark((function e(){var n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=[],e.t1=g(r),e.t2=y,e.t3={name:"",color:(0,i.Lr)(O)},e.t4=t.get_pre_add_item,!e.t4){e.next=9;break}return e.next=8,t.get_pre_add_item();case 8:e.t4=e.sent;case 9:e.t5=e.t4,e.t6=(0,e.t2)(e.t3,e.t5),e.t7=[e.t6],n=e.t0.concat.call(e.t0,e.t1,e.t7),z(n),s(n);case 15:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,n.useEffect)((function(){if(G){var t=[].concat(g(r),[y({name:"",color:(0,i.Lr)(O)},G)]);z(t),s(t),P(!0),Y(void 0)}}),[G]);var $=function(t){m(v+1),s(t._children),L.push(t)};return n.createElement("div",{className:"nav_list_div"},-1!==v&&n.createElement(c.rA,{title:"返回",icon:"arrow_back",onClick:function(){s(0===v?j:L[v-1]._children),m(v-1),L.pop()}}),r.map((function(e,u){return n.createElement("div",{key:u,draggable:!0,onDragOver:function(t){t.preventDefault()},onDragStart:function(t){return function(t,e){k=e}(0,u)},onDrop:function(t){return function(t,e){var n=g(r),o=n[k];n.splice(k,1),n.splice(e,0,o),z(n),s(n)}(0,u)},style:{cursor:S?"move":"pointer"}},n.createElement(o,h({name:e.name,item:e},e,{div:S,target:"_blank",click_dir:$,clickItem:t.clickItem})),S&&(void 0!==T.find((function(t){return t===u}))||I)&&n.createElement("div",{className:I?"":" site_edit "},"dir"===e._type?n.createElement(a.Sm,{value:e.name,handleInputChange:function(t){e.name=t},placeholder:"输入类目名",no_border:!0}):t.items.map((function(t,r){return n.createElement("div",{key:r},n.createElement(a.Sm,{value:e[t.key],handleInputChange:function(r){e[t.key]=r},placeholder:t.preName,no_border:!0}))})),!I&&n.createElement(c.C3,{text:"折叠",clickFun:function(){D((0,i.P1)(T,u))}})),S&&n.createElement("div",{style:{display:"block"}},n.createElement("span",{className:"div-row "},n.createElement(c.C3,{text:"删除",clickFun:function(){var t,e;t=u,(e=g(r)).splice(t,1),z(e),s(e)}}),n.createElement(c.C3,{text:"编辑",clickFun:function(){void 0===T.find((function(t){return t===u}))&&D([].concat(g(T),[u]))}}))))})),S&&n.createElement("div",{style:{display:"block"}},n.createElement(c.rA,{title:"取消",icon:"cancel",onClick:function(){D([]),P(!1),x&&s(x),N(!1)}}),n.createElement(c.rA,{title:"添加",icon:"add",onClick:U}),n.createElement(c.rA,{title:"添加类目",icon:"add_box",onClick:function(){var t=[].concat(g(r),[{name:"",_type:"dir",_children:[],color:(0,i.Lr)(O)}]);z(t),s(t)}}),n.createElement(c.rA,{title:"全部编辑",icon:I?"unfold_less":"unfold_more",onClick:function(){N(!I)}})),n.createElement(c.rA,{icon:S?"save":"edit",title:S?"保存":"编辑",onClick:M}))}}}]);
2
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[29],{3029:(t,e,r)=>{r.d(e,{N:()=>S});var n=r(6540);function o(t){return n.createElement("div",null,t.div?n.createElement("div",{className:"nav_list_a",style:{background:t.color}},t.name):t.clickItem||"dir"===t._type?n.createElement("div",{className:"nav_list_a",style:{background:t.color},onClick:function(){"dir"!==t._type?t.clickItem&&t.clickItem(t):t.click_dir(t.item)}},t.name):n.createElement("a",{href:t.url,target:t.target,className:"nav_list_a",style:{background:t.color}},t.name))}var i=r(4694),a=r(3033),c=r(5997),u=r(7767),l=r(7444),f=r(6417);function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function h(){return h=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},h.apply(null,arguments)}function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){v(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function v(t,e,r){return(e=function(t){var e=function(t){if("object"!=s(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==s(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function d(){d=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),c=new N(n||[]);return o(a,"_invoke",{value:S(t,r,c)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",y="suspendedYield",v="executing",m="completed",b={};function g(){}function w(){}function _(){}var E={};l(E,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(C([])));x&&x!==r&&n.call(x,a)&&(E=x);var O=_.prototype=g.prototype=Object.create(E);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function r(o,i,a,c){var u=h(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==s(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function S(e,r,n){var o=p;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===b)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=h(e,r,n);if("normal"===l.type){if(o=n.done?m:y,l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,b;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(s(e)+" is not iterable")}return w.prototype=_,o(O,"constructor",{value:_,configurable:!0}),o(_,"constructor",{value:w,configurable:!0}),w.displayName=l(_,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,l(t,u,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},j(L.prototype),l(L.prototype,c,(function(){return this})),e.AsyncIterator=L,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new L(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=C,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,b):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},e}function m(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function b(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){m(i,n,o,a,c,"next",t)}function c(t){m(i,n,o,a,c,"throw",t)}a(void 0)}))}}function g(t){return function(t){if(Array.isArray(t))return E(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_(t)||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 w(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||_(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(t,e){if(t){if("string"==typeof t)return E(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(t,e):void 0}}function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var k,x,O=["#ffffff","#fefff8","#fcfdf1","#d3d2dc","#f8f9fd","#ebf4fe","#ebebeb","#e8f7eb","#eaf2f9"],j=[],L=[];function S(t){var e=w((0,n.useState)([]),2),r=e[0],s=e[1],p=w((0,n.useState)(-1),2),v=p[0],m=p[1],_=(0,u.zy)(),E=w((0,n.useState)(!1),2),S=E[0],P=E[1],A=w((0,n.useState)(!1),2),I=A[0],N=A[1],C=w((0,n.useState)([]),2),T=C[0],D=C[1],F=w((0,l.L4)(f.A.nav_index_add_item_by_now_list),2),G=F[0],Y=F[1],z=function(t){-1!==v?L[v]._children=t:j=t};(0,n.useEffect)((function(){var e=function(){var e=b(d().mark((function e(){var r;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.getItems){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,t.getItems();case 4:(r=e.sent).map((function(t,e){t.color=(0,i.Lr)(O)})),s(j=r);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}),[_]);var M=function(){var e=b(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!S){e.next=6;break}if(!t.save){e.next=4;break}return e.next=4,t.save(j);case 4:e.next=7;break;case 6:x=r;case 7:P(!S);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),U=function(){var e=b(d().mark((function e(){var n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=[],e.t1=g(r),e.t2=y,e.t3={name:"",color:(0,i.Lr)(O)},e.t4=t.get_pre_add_item,!e.t4){e.next=9;break}return e.next=8,t.get_pre_add_item();case 8:e.t4=e.sent;case 9:e.t5=e.t4,e.t6=(0,e.t2)(e.t3,e.t5),e.t7=[e.t6],n=e.t0.concat.call(e.t0,e.t1,e.t7),z(n),s(n);case 15:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,n.useEffect)((function(){if(G){var t=[].concat(g(r),[y({name:"",color:(0,i.Lr)(O)},G)]);z(t),s(t),P(!0),Y(void 0)}}),[G]);var $=function(t){m(v+1),s(t._children),L.push(t)};return n.createElement("div",{className:"nav_list_div"},-1!==v&&n.createElement(c.rA,{title:"返回",icon:"arrow_back",onClick:function(){s(0===v?j:L[v-1]._children),m(v-1),L.pop()}}),r.map((function(e,u){return n.createElement("div",{key:u,draggable:!0,onDragOver:function(t){t.preventDefault()},onDragStart:function(t){return function(t,e){k=e}(0,u)},onDrop:function(t){return function(t,e){var n=g(r),o=n[k];n.splice(k,1),n.splice(e,0,o),z(n),s(n)}(0,u)},style:{cursor:S?"move":"pointer"}},n.createElement(o,h({name:e.name,item:e},e,{div:S,target:"_blank",click_dir:$,clickItem:t.clickItem})),S&&(void 0!==T.find((function(t){return t===u}))||I)&&n.createElement("div",{className:I?"":" site_edit "},"dir"===e._type?n.createElement(a.Sm,{value:e.name,handleInputChange:function(t){e.name=t},placeholder:"输入类目名",no_border:!0}):t.items.map((function(t,r){return n.createElement("div",{key:r},n.createElement(a.Sm,{value:e[t.key],handleInputChange:function(r){e[t.key]=r},placeholder:t.preName,no_border:!0}))})),!I&&n.createElement(c.C3,{text:"折叠",clickFun:function(){D((0,i.P1)(T,u))}})),S&&n.createElement("div",{style:{display:"block"}},n.createElement("span",{className:"div-row "},n.createElement(c.C3,{text:"删除",clickFun:function(){var t,e;t=u,(e=g(r)).splice(t,1),z(e),s(e)}}),n.createElement(c.C3,{text:"编辑",clickFun:function(){void 0===T.find((function(t){return t===u}))&&D([].concat(g(T),[u]))}}))))})),S&&n.createElement("div",{style:{display:"block"}},n.createElement(c.rA,{title:"取消",icon:"cancel",onClick:function(){D([]),P(!1),x&&s(x),N(!1)}}),n.createElement(c.rA,{title:"添加",icon:"add",onClick:U}),n.createElement(c.rA,{title:"添加类目",icon:"add_box",onClick:function(){var t=[].concat(g(r),[{name:"",_type:"dir",_children:[],color:(0,i.Lr)(O)}]);z(t),s(t)}}),n.createElement(c.rA,{title:"全部编辑",icon:I?"unfold_less":"unfold_more",onClick:function(){N(!I)}})),(void 0===t.have_auth_edit||!0===t.have_auth_edit)&&n.createElement(c.rA,{icon:S?"save":"edit",title:S?"保存":"编辑",onClick:M}))}}}]);