filecat 7.1.1 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dist/1142.2df73f922ad5f018d7fb.js +1 -0
- package/build/dist/1149.db8bfba469bbffe07b1c.js +1 -0
- package/build/dist/1384.8d1ae0401cf32bf88b83.js +1 -0
- package/build/dist/{2502.6a0501313a1fe1b8208a.js → 2502.f8b13f3430edb99be86f.js} +1 -1
- package/build/dist/{3328.85aa4fcbe515c670f1ad.js → 3328.4e573e64148ccdd95eb2.js} +1 -1
- package/build/dist/3659.97898b4c2bc7765a91f7.js +1 -0
- package/build/dist/5272.c6b01ba9d9321b267296.js +1 -0
- package/build/dist/5308.42feb31305850d55b34c.js +1 -0
- package/build/dist/6805.6b181f3ae37028391d63.js +1 -0
- package/build/dist/8603.d7eea8d253cff5aef62c.js +1 -0
- package/build/dist/8765.5f32a55b3f56992efb32.js +1 -0
- package/build/dist/9299.78bed0492387d25dd58b.js +1 -0
- package/build/dist/9546.de5433de4cead0a0e4b1.js +1 -0
- package/build/dist/9877.5bed2ede178cba58843b.js +1 -0
- package/build/dist/index.html +1 -1
- package/build/dist/main.fcdf5f00b8cdb69e55a5.js +2 -0
- package/build/main.js +1 -1
- package/package.json +1 -1
- package/build/dist/1149.cbeaf4f434dffe8aa534.js +0 -1
- package/build/dist/1384.edbad9c24d883a59724d.js +0 -1
- package/build/dist/3659.f0dbf1eed0113cfeb0d2.js +0 -1
- package/build/dist/5308.78bd4ed591fdfdcd82e7.js +0 -1
- package/build/dist/6805.e710a58739319eb7ae8a.js +0 -1
- package/build/dist/6966.2432063a0d9349aff6b4.js +0 -1
- package/build/dist/8603.5b96680516f93196c2c0.js +0 -1
- package/build/dist/8714.8fcad52f220ca72a1b6f.js +0 -1
- package/build/dist/8765.4b41dd887f09c4c1a556.js +0 -1
- package/build/dist/9546.421e124c9297955f5a4d.js +0 -1
- package/build/dist/main.d07c1bd328b47164e2a8.js +0 -2
- /package/build/dist/{main.d07c1bd328b47164e2a8.js.LICENSE.txt → main.fcdf5f00b8cdb69e55a5.js.LICENSE.txt} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[3659],{22081(e,n,t){var s=t(96540),r=t(16349),a=t(74848);const i=({percentage:e})=>{const n=(0,s.useRef)(null),[t,i]=(0,s.useState)(null);return(0,s.useEffect)(()=>{const t=n.current.getContext("2d"),s=new r.Ay(t,{type:"doughnut",data:{labels:["use","left"],datasets:[{data:[e,100-e],backgroundColor:["#007bff","#f0f0f0"],borderWidth:0}]},options:{plugins:{legend:{display:!1},tooltip:{enabled:!1}},elements:{arc:{borderWidth:0}}}});return i(s),()=>{s.destroy()}},[]),(0,s.useEffect)(()=>{t&&(t.data.datasets[0].data=[e,100-e],t.update())},[e]),(0,a.jsx)("div",{style:{width:"8rem",overflow:"hidden"},children:(0,a.jsx)("canvas",{ref:n})})};t.d(n,["A",0,i])},77481(e,n,t){t.d(n,{S:()=>o,X:()=>i});var s=t(96540),r=t(61443),a=t(74848);function i(e){const[n,t]=s.useState([]),i=(0,s.useRef)(-1),[o,l]=(0,s.useState)(-1),[c,d]=(0,s.useState)(-1);(0,s.useEffect)(()=>{e.children?t(Array.isArray(e.children)?e.children:[e.children]):t(e.rows)},[e.rows,e.children]);const u=()=>{i.current=-1,l(-1),d(-1)};return(0,a.jsxs)("table",{children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:e.headers?.map((n,t)=>{const s=!!e.filter&&(e.filter.column??0)===t;let i=n;if(s){const t=e.filter,s=t.options.find(e=>e.value===t.value);null!=t.value&&s&&(i=`${n} (${s.label})`)}return(0,a.jsx)("th",{className:s?"table-filter-col":"",children:s?(0,a.jsx)(r.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:i}):n},t)})})}),(0,a.jsx)("tbody",{children:n.map((n,t)=>{const s=!!e.onRowDrag;return(0,a.jsx)("tr",{className:s?(o===t?"row-dragging":"")+(c===t?" row-drop-target":""):"",draggable:s,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(n)},onDragStart:e=>{s&&(i.current=t,l(t),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!s||i.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(t))},onDrop:n=>{s&&(n.preventDefault(),(()=>{const n=i.current,t=c;u(),n<0||t<0||n===t||e.onRowDrag?.(n,t)})())},onDragEnd:u,children:n.map((t,s)=>{const r=s===n.length-1?"small":"";return(0,a.jsx)("td",{className:r,style:{width:e.width??"auto"},children:t},s)})},t)})})]})}function o(e){return(0,a.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,n)=>(0,a.jsx)("div",{children:e},n))})}},88062(e,n,t){t(96540),t(47022);var s=t(74848);function r(e){return(0,s.jsx)("div",{className:"black-tip",onClick:()=>{e.click&&e.click(e)},onContextMenu:n=>{n.stopPropagation(),n.nativeEvent.stopImmediatePropagation(),e.onContextMenu&&e.onContextMenu(n,e)},children:e.name})}const a=e=>(0,s.jsxs)("li",{children:[e.click?(0,s.jsx)(r,{...e.node,name:e.render?e.render(e.node):e.node.name,click:e.click,onContextMenu:e.onContextMenu}):(0,s.jsx)("div",{children:e.render?e.render(e.node):e.node.name}),e.node.children&&e.node.children.length>0&&(0,s.jsx)("ul",{children:e.node.children.map((n,t)=>(0,s.jsx)(a,{node:n,click:e.click,onContextMenu:e.onContextMenu,render:e.render},t))})]}),i=e=>(0,s.jsx)("div",{className:"card-tree-view",children:(0,s.jsx)("ul",{children:e.list&&e.list.map((n,t)=>(0,s.jsx)(a,{node:n,click:e.click,onContextMenu:e.onContextMenu,render:e.render},t))})});t.d(n,["A",0,i])},63659(e,n,t){t.r(n),t.d(n,{default:()=>N});var s=t(86149),r=t(96540),a=t(34843),i=t(82893),o=t(92275),l=t(14944),c=(t(14284),t(70447)),d=t(85997),u=t(62042),x=t(4412),h=t(75725),f=(t(22081),t(77481)),p=t(61443),j=t(47071),m=t(34289),g=t(88062),v=t(97856),w=t(88815),_=t(15629),b=t(74848);const k=r.lazy(()=>t.e(3233).then(()=>t(85614)));let y,C,S=-1;function N(e){const{t:n}=(0,s.B)(),[t,N]=(0,a.fp)(i.AG.workflow_show),[M,A]=(0,r.useState)([]),[D,E]=(0,r.useState)([]),[F,$]=(0,r.useState)(!1),[G,W]=(0,r.useState)(void 0),[P,X]=(0,r.useState)([]),[q,z]=(0,r.useState)(-1),[B,I]=(0,r.useState)(10),[J,O]=(0,r.useState)(0),[R,H]=(0,r.useState)(0),[K,T]=(0,r.useState)(""),[Z,V]=(0,r.useState)(!1),Y=[n("序号"),n("运行名称"),n("状态"),n("运行时长"),n("日期"),n("操作")],L=[n("名称"),n("状态"),n("cwd"),n("运行时长"),n("操作")],Q=async e=>{const n=new j._;n.page_num=e??q,n.page_size=B,n.dir_path=`${(0,m.GG)("file",(0,m.vX)())}`;const t=await l.ws.sendData(o.HK.workflow_get,n);if(!t)return;const s=t.context;s&&(A(s.list.map(e=>{const n="string"==typeof e.meta?JSON.parse(e.meta):e.meta;return n.index=e.index,n})),O(s.total),H((0,w.gw)(s.total,B)))};(0,r.useEffect)(()=>($(!1),y=void 0,C=void 0,S=-1,Q(),async()=>{C&&(C.dispose(),C=null)}),[]);const U=async e=>{const n=e.steps,t=[];(0,_.Y)(t,n??[]),X(t)},ee=async e=>{C||await new Promise(e=>{y=e,$(!0),(async()=>{const e=new v.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:"#000000",cursor:"#000000",selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4,convertEol:!0});C=e,W(e)})()}),e&&(C.reset(),C.write(e))};return(0,b.jsxs)("div",{children:[(0,b.jsxs)(x.aZ,{position:"right",children:[G&&(0,b.jsx)(d.rA,{icon:"print",title:"打印日志",onClick:()=>{$(!F)}}),(0,b.jsx)(d.rA,{icon:"close",title:n("关闭"),onClick:()=>{N(!1)}})]}),(0,b.jsx)(h.jW,{isFull:!0,more:!0,children:(0,b.jsx)(h.NN,{children:(0,b.jsx)(h.xh,{children:(0,b.jsxs)(h.fI,{children:[(0,b.jsx)(h.VP,{children:(0,b.jsx)(c.uF,{self_title:(0,b.jsx)("span",{className:" div-row ",children:(0,b.jsx)("h2",{children:n("历史记录")})}),titleCom:(0,b.jsx)("div",{className:" div-row ",children:(0,b.jsx)(p.Sm,{disabled:Z,value:K,placeholder:"搜索运行名称(支持正则)",handleInputChange:e=>{T(K)},handlerEnter:e=>{(async e=>{const n=new j._;n.search_name=e,n.dir_path=`${(0,m.GG)("file",(0,m.vX)())}`,V(!0);const t=await l.ws.sendData(o.HK.workflow_search_by_run_name,n);if(!t)return;const s=t.context;A(s.list.map(e=>{const n="string"==typeof e.meta?JSON.parse(e.meta):e.meta;return n.index=e.index,n})),O(s.total),H((0,w.gw)(s.total,B)),z(0),V(!1)})(e)}})}),rightBottomCom:(0,b.jsxs)("span",{className:" div-row ",children:[(0,b.jsxs)("span",{children:[Math.abs(q),"/",R]}),(0,b.jsx)(p.Sm,{placeholder:`max page ${R}`,handleInputChange:e=>{S=parseInt(e)},handlerEnter:()=>{if(S<1||S>R)return void(0,u.zN)("illegal page num");const e=0-S;z(e),Q(e)}}),(0,b.jsx)(d.rA,{icon:"navigate_before",onClick:()=>{const e=q+1;e>-1?(0,u.zN)("max page num"):(z(e),Q(e))},title:"上一页"}),(0,b.jsx)(d.rA,{icon:"navigate_next",onClick:()=>{const e=q-1;Math.abs(e)>R?(0,u.zN)("min page num"):(z(e),Q(e))},title:"下一页"})]}),children:(0,b.jsx)(f.X,{headers:Y,rows:M.map((e,t)=>{let s;s=e.is_running?(0,b.jsxs)("div",{children:[(0,b.jsx)(c.fq,{}),n("正在运行")]}):(0,b.jsxs)("div",{children:[(0,b.jsx)(c.fq,{success:e.is_success}),e.is_success?n("成功"):n("失败")]});const r=[(0,b.jsx)("p",{children:e.index}),(0,b.jsx)("p",{style:{wordWrap:"break-word"},children:e["run-name"]}),s,(0,b.jsx)("span",{children:e.duration}),(0,b.jsx)("span",{children:e.timestamp}),(0,b.jsx)("div",{children:(0,b.jsx)(d.rA,{icon:"details",title:n("详情"),onClick:()=>{(async e=>{if(e.is_running)return;X([]);const n=new j._;n.index=e.index,n.dir_path=`${(0,m.GG)("file",(0,m.vX)())}`;const t=(await l.ws.sendData(o.HK.workflow_get,n)).context,s="string"==typeof t.one_data.data?JSON.parse(t.one_data.data):t.one_data.data;E(s.all_jobs)})(e)}})})];return r}),width:"10rem"})})}),(0,b.jsxs)(h.VP,{children:[(0,b.jsx)(c.Zp,{title:n("Job"),children:(0,b.jsx)(f.X,{headers:L,rows:D.map((e,t)=>[(0,b.jsx)("p",{children:e.name}),(0,b.jsx)(_.W,{item:e}),(0,b.jsx)(c.xP,{children:String(e.cwd)}),(0,b.jsx)("span",{children:e.duration}),(0,b.jsxs)("div",{children:[(0,b.jsx)(d.rA,{icon:"details",title:n("详情"),onClick:()=>{U(e)}}),!!e.message&&(0,b.jsx)(d.rA,{icon:"print",title:n("日志"),onClick:()=>{ee(e.message)}})]})]),width:"10rem"})}),(0,b.jsx)(c.Zp,{title:"Step",children:(0,b.jsx)(g.A,{list:P,click:e=>{(async e=>{if(e?.extra_data?.is_job)await U(e.extra_data.job_data);else if(e?.extra_data?.context)ee(e.extra_data.context);else{if(!e?.extra_data.code)return;ee(e.extra_data.code??"")}})(e)}})})]})]})})})}),(0,b.jsx)("div",{style:{display:F?"":"none"},children:(0,b.jsx)(k,{show:!0,terminal:G,init:()=>{y&&(y(1),y=void 0)}})})]})}},15629(e,n,t){t.d(n,{W:()=>o});t(96540);var s=t(70447),r=t(47071),a=t(86149),i=t(74848);function o({item:e}){const{t:n}=(0,a.B)();let t,o;return null!=e.code?t=0===e.code:e.extra_data?.running_type===r.rl.running&&(o=!0),(0,i.jsxs)("div",{children:[(0,i.jsx)(s.fq,{success:t,running:o}),n(t?"成功":"失败")]})}const l=(e,n,t)=>{if(n)for(const t of n??[]){let n;const r=[];t["use-yml"]?(l(r,void 0,t.use_job_children_list),n=`${t["use-yml"]} ;${t.duration??-1}`):t.runs?n=JSON.stringify(t.runs):t.run?n=t.run:t["run-js"]?n=t["run-js"]:t.sleep&&(n=`sleep ${t.sleep}`),n=(0,i.jsxs)("div",{children:[(0,i.jsx)(s.fq,{success:void 0===t.code?void 0:0===t.code})," ",n+" ;"+(t.duration??"")]}),e.push({name:n,children:r,extra_data:{code:t.code,context:t.message}})}else if(t)for(const n of t??[]){const t=(0,i.jsxs)("div",{children:[(0,i.jsx)(s.fq,{success:void 0===n.code?void 0:0===n.code}),"$",n.name]});e.push({name:t,extra_data:{code:n.code,is_job:!0,job_data:n}})}};t.d(n,["Y",0,l])}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[5308],{65308(e,t,a){a.r(t),a.d(t,{default:()=>w});var o=a(96540),n=a(34843),i=a(82893),s=a(34289),r=a(14284),c=a(38240),l=a(62042),d=a(47022),m=a(78247),p=a(86090),f=a(74848);let u,g=!1;const b=1024e3;function w(){const[e,t]=(0,n.fp)(i.AG.image_editor),a=(0,p.Zp)();(0,p.zy)();return(0,o.useEffect)(()=>((async()=>{if(!g)try{await(0,c.J)("filerobot-image-editor.min.js"),g=!0}catch(e){return void(0,l.zN)("加载资源失败")}const o=(0,s.GG)("file",e.path),n=window.FilerobotImageEditor,{TABS:i,TOOLS:p}=n,f={defaultSavedImageName:e.name,source:r.$M.getDownloadUrl(o),onSave:async(t,a)=>{const n=t.imageBase64.split(",")[1],i=(t.mimeType,t.extension),c=t.name??e.name,p=`base64/save/${encodeURIComponent(`${(0,s.Yp)(o)}${c}.${i}`)}`;if(n.length<=b){const e={base64_context:n,type:d.t7.all};await r.$M.post(p,e)}else{const e=(0,m.L6)(n,b),t={base64_context:e[0],type:d.t7.start};t.type=d.t7.part,await r.$M.post(p+`?type${d.t7.start}`,t);for(let a=1;a<e.length;a++)t.base64_context=e[a],await r.$M.post(p,t)}(0,l.SK)("保存成功")},annotationsCommon:{fill:"#151717",stroke:"#ec0f42",shadowColor:"#151717"},Text:{text:""},Rotate:{angle:90,componentType:"slider"},tabsIds:[Object.values(i)],defaultTabId:i.ANNOTATE,defaultToolId:p.ANNOTATE};u=new n(document.querySelector("#editor_container"),f),u.render({onClose:e=>{u.terminate(),t({}),a((0,s.vX)())}})})(),()=>{u&&u.terminate()}),[]),(0,f.jsx)("div",{id:"image-editor-container",children:(0,f.jsx)("div",{className:"image-editor-context",children:(0,f.jsx)("div",{id:"editor_container",className:"image-editor-context"})})})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6805],{18840(e,n,t){t.d(n,{I:()=>s,gE:()=>l});class s{open;key;option_keys;port}class l{client_name;client_num_id;open=!1;serverIp;serverPort;key="";note;status;is_new;index}t.d(n,["FG",0,{content_max_width:"70%",content_padding:"4%",font_size:"16px",line_height:"1.8"},"mo",0,"\nnode_modules\n.venv\n.gradle\n.cache\nvendor\n"])},47996(e,n,t){t.d(n,{d:()=>l});t(96540);var s=t(74848);function l(e){return(0,s.jsxs)("div",{className:"instance-item",children:[(0,s.jsxs)("div",{className:"instance-item__toolbar",children:[(0,s.jsx)("span",{className:"instance-item__label",children:e.title}),e.toolbar]}),e.children]})}},77481(e,n,t){t.d(n,{S:()=>a,X:()=>r});var s=t(96540),l=t(61443),i=t(74848);function r(e){const[n,t]=s.useState([]),r=(0,s.useRef)(-1),[a,c]=(0,s.useState)(-1),[o,d]=(0,s.useState)(-1);(0,s.useEffect)(()=>{e.children?t(Array.isArray(e.children)?e.children:[e.children]):t(e.rows)},[e.rows,e.children]);const _=()=>{r.current=-1,c(-1),d(-1)};return(0,i.jsxs)("table",{children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:e.headers?.map((n,t)=>{const s=!!e.filter&&(e.filter.column??0)===t;let r=n;if(s){const t=e.filter,s=t.options.find(e=>e.value===t.value);null!=t.value&&s&&(r=`${n} (${s.label})`)}return(0,i.jsx)("th",{className:s?"table-filter-col":"",children:s?(0,i.jsx)(l.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:r}):n},t)})})}),(0,i.jsx)("tbody",{children:n.map((n,t)=>{const s=!!e.onRowDrag;return(0,i.jsx)("tr",{className:s?(a===t?"row-dragging":"")+(o===t?" row-drop-target":""):"",draggable:s,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(n)},onDragStart:e=>{s&&(r.current=t,c(t),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!s||r.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(t))},onDrop:n=>{s&&(n.preventDefault(),(()=>{const n=r.current,t=o;_(),n<0||t<0||n===t||e.onRowDrag?.(n,t)})())},onDragEnd:_,children:n.map((t,s)=>{const l=s===n.length-1?"small":"";return(0,i.jsx)("td",{className:l,style:{width:e.width??"auto"},children:t},s)})},t)})})]})}function a(e){return(0,i.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,n)=>(0,i.jsx)("div",{children:e},n))})}},36805(e,n,t){t.r(n),t.d(n,{default:()=>K});var s=t(96540),l=t(75725),i=t(86149),r=t(70447),a=t(85997),c=t(77481),o=t(61443),d=t(14284),_=t(53459),x=t(7523),h=t(34843),u=t(82893),p=t(62042),j=(t(23430),t(21499),t(14944)),m=t(92275),v=t(6960),f=t(40505),g=t(4412),w=t(24659),y=t(74848);let S={};function C(){const{t:e,i18n:n}=(0,i.B)(),{initUserInfo:t,reloadUserInfo:C}=(0,s.useContext)(x.F),[b,k]=(0,h.fp)(u.AG.user_base_info),[I,A]=(0,s.useState)([]),[P,N]=(0,h.fp)(u.AG.prompt_card),$=(0,w.K)(),[F,K]=(0,s.useState)(),[B,U]=(0,s.useState)(void 0),[E,G]=(0,s.useState)(null),[D,V]=(0,s.useState)([]),[q,z]=(0,s.useState)([]),M=[e("序号"),e("名称"),e("在线状态"),e("时间"),e("备注")],X=[e("序号"),e("服务端口"),e("转发ip"),e("转发端口"),e("开启"),e("备注")],Z=[e("序号"),e("服务端口"),e("fwd_nm"),e("转发ip"),e("转发端口"),e("开启"),e("备注")],H=e=>null==e?"":(0,v.s)(e),O=async e=>{const n=await d.s9.post("server_bridge_get_one_fig",{server_client_num_id:e});if(n.code===_.m.Success){const e=n.data;for(const n of e)n.client_name=S?.[n.client_num_id]?.client_name??"";z(e)}},L=async e=>{const n=void 0===e?E:e,t=await d.s9.get("server_client_get");if(t.code===_.m.Success){const e=t.data,s=[],l=[];S={};for(const t of e)null!==n&&!!t.status!==n||(B?`${t.index}${t.client_name}${t.note}`.includes(B)&&s.push(t):s.push(t),l.push({label:t.client_name,value:t.client_num_id}),S[t.client_num_id]=t);A(s),V(l)}};(0,s.useEffect)(()=>{j.ws.addMsg(m.HK.tcp_forward_server_load,e=>{L()}),L()},[]);return(0,y.jsxs)(s.Fragment,{children:[(0,y.jsx)(g.aZ,{position:"right",children:F&&(0,y.jsx)("span",{children:`${F.client_name}${F.note?`(${F.note})`:""}`})}),(0,y.jsxs)(l.fI,{children:[(0,y.jsx)(l.VP,{widthPer:50,children:(0,y.jsx)(l.xh,{children:(0,y.jsx)(r.uF,{self_title:(0,y.jsx)("span",{className:" div-row ",children:(0,y.jsx)("h2",{children:e("客户端列表")})}),titleCom:(0,y.jsx)(o.Sm,{placeholder:e("过滤"),value:B,handleInputChange:e=>{U(e)},handlerEnter:()=>{L()}}),children:(0,y.jsx)(c.X,{headers:M,filter:{title:e("在线状态"),column:2,value:E,options:[{label:e("全部"),value:null},{label:e("在线"),value:!0},{label:e("离线"),value:!1}],onChange:e=>{G(e),L(e)}},rows:I.map((n,t)=>[(0,y.jsx)("p",{children:t}),(0,y.jsx)(r.xP,{children:n.client_name}),(0,y.jsx)(r.fq,{ok:n.status}),(0,y.jsx)(r.xP,{children:H(n.status?n.online_start_time:n.offline_time)}),(0,y.jsx)(r.xP,{children:n.note}),(0,y.jsxs)("div",{children:[(0,y.jsx)(a.rA,{icon:"edit",title:e("编辑"),onClick:()=>{K({...n}),O(n.client_num_id)}}),(0,y.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>{N({open:!0,title:"share file",confirm:async()=>{N({open:!1}),await(async e=>{(await d.s9.post("server_client_del",{client_num_id:e})).code===_.m.Success&&((0,p.SK)("成功"),L())})(n.client_num_id)},context_div:(0,y.jsx)("div",{className:"card-content",children:e("确定删除这个吗客户端吗?")})})}})]})]),width:"10rem"})})})}),(0,y.jsx)(l.VP,{widthPer:50,children:F?(0,y.jsxs)(l.xh,{children:[(0,y.jsxs)(r.Zp,{self_title:(0,y.jsxs)("span",{className:" div-row ",children:[(0,y.jsx)("h2",{children:e("代理配置")})," "]}),rightBottomCom:(0,y.jsx)("div",{children:(0,y.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await d.s9.post("server_client_save",F)).code===_.m.Success&&(0,p.SK)("成功")}})}),children:[(0,y.jsx)(l.Yh,{left:e("远程地址"),center:F?.client_remote_address??""}),(0,y.jsx)(l.Yh,{left:e(F?.status?"在线时间":"离线时间"),center:H(F?.status?F?.online_start_time:F?.offline_time)}),(0,y.jsx)(o.Sm,{placeholder:"名称",value:F.client_name,handleInputChange:e=>{F.client_name=e,K({...F})}}),(0,y.jsxs)("form",{children:[e("fc_pxy"),":",(0,y.jsx)(c.S,{isFlex:!0,columns:[(0,y.jsx)(o.U6,{value:1,context:e("开启"),selected:F.open_filecat,onchange:()=>{F.open_filecat=!F.open_filecat,K({...F})}}),(0,y.jsx)(o.U6,{value:1,context:e("关闭"),selected:!F.open_filecat,onchange:()=>{F.open_filecat=!F.open_filecat,K({...F})}})]})]}),F.open_filecat&&(0,y.jsxs)(s.Fragment,{children:[(0,y.jsxs)("form",{children:[e("fc_pxyw"),":",(0,y.jsx)(c.S,{isFlex:!0,columns:[(0,y.jsx)(o.U6,{value:1,context:e("开启"),selected:F.filecat_use_local_page,onchange:()=>{F.filecat_use_local_page=!F.filecat_use_local_page,K({...F})}}),(0,y.jsx)(o.U6,{value:1,context:e("关闭"),selected:!F.filecat_use_local_page,onchange:()=>{F.filecat_use_local_page=!F.filecat_use_local_page,K({...F})}})]})]}),(0,y.jsx)(o.Sm,{placeholderOut:e("fc_pxyr"),placeholder:"127.0.0.1:5567",value:F.filecat_proxy_host_port,handleInputChange:e=>{F.filecat_proxy_host_port=e,K({...F})}}),(0,y.jsx)(a.rA,{icon:"content_copy",title:e("复制filecat代理url"),onClick:()=>{const e=`${window.location.origin}?tcp_client_num_id=${F.client_num_id}`;(0,f.lW)(e),(0,p.SK)(e)}})]}),(0,y.jsx)(o.Sm,{placeholder:"备注",value:F.note,handleInputChange:e=>{F.note=e,K({...F})}}),(0,y.jsx)(a.rA,{icon:"add",onClick:()=>{F.proxy_fig_list.push({open:!1}),K({...F})},title:e("添加")}),e("代理"),(0,y.jsx)(c.X,{headers:X,rows:F.proxy_fig_list.map((n,t)=>[(0,y.jsx)("p",{children:t}),(0,y.jsx)(o.Sm,{value:n.server_port,handleInputChange:e=>{n.server_port=parseInt(e)},no_border:!0}),(0,y.jsx)(o.Sm,{value:n.proxy_host,handleInputChange:e=>{n.proxy_host=e},no_border:!0}),(0,y.jsx)(o.Sm,{value:n.proxy_port,handleInputChange:e=>{n.proxy_port=parseInt(e)},no_border:!0}),(0,y.jsx)(o.l6,{value:!!n.open,onChange:e=>{n.open=e,K({...F})},options:$,no_border:!0}),(0,y.jsx)(o.Sm,{value:n.note,handleInputChange:e=>{n.note=e},no_border:!0}),(0,y.jsx)("div",{children:(0,y.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>{const e=[];for(let n=0;n<(F.proxy_fig_list.length??0);n++)n!==t&&e.push(F.proxy_fig_list[n]);F.proxy_fig_list=e,K({...F})}})})]),width:"10rem"})]}),(0,y.jsxs)(r.Zp,{self_title:(0,y.jsxs)("span",{className:" div-row ",children:[(0,y.jsx)("h2",{children:e("桥接配置")})," "]}),children:[(0,y.jsx)(a.rA,{icon:"add",onClick:()=>{q.push({open:!1,server_client_num_id:F.client_num_id}),z([...q])},title:e("添加")}),e("代理"),(0,y.jsx)(c.X,{headers:Z,rows:q.map((n,t)=>[(0,y.jsx)("p",{children:t}),(0,y.jsx)(o.Sm,{value:n.server_port,handleInputChange:e=>{n.server_port=parseInt(e)},no_border:!0}),(0,y.jsx)(o.Sm,{value:n.client_name,options:D,handleInputChange:e=>{const t=(e=>D.find(n=>String(n.value)===String(e)))(e);n.client_num_id=parseInt(String(t.value)),n.client_name=t.label,z([...q])},no_border:!0}),(0,y.jsx)(o.Sm,{value:n.client_proxy_host,handleInputChange:e=>{n.client_proxy_host=e},no_border:!0}),(0,y.jsx)(o.Sm,{value:n.client_proxy_port,handleInputChange:e=>{n.client_proxy_port=parseInt(e)},no_border:!0}),(0,y.jsx)(o.l6,{value:!!n.open,onChange:e=>{n.open=e,z([...q])},options:$,no_border:!0}),(0,y.jsx)(o.Sm,{value:n.note,handleInputChange:e=>{n.note=e},no_border:!0}),(0,y.jsxs)("div",{children:[(0,y.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:async()=>{if(null==n.id){const e=[];for(let n=0;n<(q.length??0);n++)n!==t&&e.push(q[n]);z([...e])}else await(async(e,n)=>{(await d.s9.post("server_bridge_del_fig",{id:e})).code===_.m.Success&&((0,p.SK)("成功"),O(n))})(n.id,n.server_client_num_id)}}),null==n.id?(0,y.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:async()=>{await(async e=>{if(null==e.client_num_id)return void(0,p.zN)("未选择转发送 client");(await d.s9.post("server_bridge_add_fig",e)).code===_.m.Success&&((0,p.SK)("成功"),O(e.server_client_num_id))})(n)}}):(0,y.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{await(async e=>{if(null==e.client_num_id)return void(0,p.zN)("未选择转发送 client");(await d.s9.post("server_bridge_edit_fig",e)).code===_.m.Success&&((0,p.SK)("成功"),O(e.server_client_num_id))})(n)}})]})]),width:"10rem"})]})]}):(0,y.jsx)(l.xh,{})})]})]})}var b=t(18840),k=t(7463);function I(e){const{t:n}=(0,i.B)(),[t,x]=(0,s.useState)([]),[h,u]=(0,s.useState)([]),[v,f]=(0,s.useState)([]),[g,S]=(0,s.useState)([]),C=[n("序号"),n("服务端口"),n("转发客户端名称")],I=[n("序号"),n("原客户端"),n("目标客户端"),n("待同步文件数量")],A=[n("序号"),n("port"),n("host"),n("名称"),n("key"),n("在线"),n("开启"),n("备注")],P=(0,w.K)(),N=async()=>{const e=await d.s9.get("client_get");if(e.code===_.m.Success){const n=e.data;x(n.list)}const n=await d.s9.get("client_bridge_get_all_fig");n.code===_.m.Success&&f(n.data);const t=await d.s9.get("client_sync_task_get");t.code===_.m.Success&&S(t.data)};(0,s.useEffect)(()=>(N(),j.ws.sendData(m.HK.tcp_proxy_client_status,{}).then(()=>{const e=(0,k.sg)(()=>N(),500);j.ws.addMsg(m.HK.tcp_proxy_client_status,e)}),()=>{j.ws.removeMsg(m.HK.tcp_proxy_client_status)}),[]);const $=async e=>{const n=new b.gE;n.index=e.index,n.key=e.key,n.serverIp=e.serverIp,n.serverPort=e.serverPort,n.open=e.open,n.client_name=e.client_name,n.client_num_id=e.client_num_id;(await d.s9.post("client_save",n)).code===_.m.Success?(0,p.SK)("保存成功"):(0,p.zN)("网络错误")};return(0,y.jsxs)("div",{children:[(0,y.jsxs)(l.fI,{children:[(0,y.jsx)(l.VP,{widthPer:33,children:(0,y.jsxs)(r.Zp,{title:"",rightBottomCom:(0,y.jsx)(a.C3,{text:n("保存"),clickFun:()=>{t[0].index=0,$(t[0])}}),titleCom:(0,y.jsxs)("div",{children:[n("连接状态"),(0,y.jsx)(r.fq,{ok:!!t[0]?.status})]}),children:[(0,y.jsx)(o.Sm,{placeholder:`${n("服务器")} ip`,value:t[0]?.serverIp,handleInputChange:e=>{t[0].serverIp=e}}),(0,y.jsx)(o.Sm,{type:"number",placeholder:`${n("服务器")} port`,value:t[0]?.serverPort,handleInputChange:e=>{const n=parseInt(e);!isNaN(n)&&n>=0&&n<=65535&&(t[0].serverPort=n)}}),(0,y.jsx)(o.Sm,{placeholder:n("名称"),value:t[0]?.client_name,handleInputChange:e=>{t[0].client_name=e}}),(0,y.jsx)(o.Sm,{type:"password",placeholder:"key ",value:t[0]?.key,handleInputChange:e=>{t[0].key=e}}),(0,y.jsxs)("form",{children:[n("状态"),(0,y.jsx)(c.S,{isFlex:!0,columns:[(0,y.jsx)(o.U6,{value:1,context:n("开启"),selected:t[0]?.open,onchange:()=>{t[0].open=!t[0].open,x([...t])}}),(0,y.jsx)(o.U6,{value:1,context:n("关闭"),selected:!t[0]?.open,onchange:()=>{t[0].open=!t[0].open,x([...t])}})]})]})]})}),(0,y.jsx)(l.VP,{widthPer:40,children:(0,y.jsxs)(r.Zp,{self_title:(0,y.jsxs)("span",{className:" div-row ",children:[(0,y.jsx)("h2",{children:n("更多服务器")})," "]}),children:[(0,y.jsx)(a.rA,{icon:"add",onClick:()=>{t.push({open:!1,is_new:!0}),x([...t])},title:n("添加")}),n("代理"),(0,y.jsx)(c.X,{headers:A,rows:t.slice(1).map((e,s)=>[(0,y.jsx)("p",{children:s}),(0,y.jsx)(o.Sm,{type:"number",value:e.serverPort,handleInputChange:n=>{const t=parseInt(n);!isNaN(t)&&t>=0&&t<=65535&&(e.serverPort=t)},no_border:!0}),(0,y.jsx)(o.Sm,{value:e.serverIp,handleInputChange:n=>{e.serverIp=n},no_border:!0}),(0,y.jsx)(o.Sm,{value:e.client_name,handleInputChange:n=>{e.client_name=n},no_border:!0}),(0,y.jsx)(o.Sm,{value:e.key,handleInputChange:n=>{e.key=n},no_border:!0}),(0,y.jsx)(r.fq,{ok:!!e.status}),(0,y.jsx)(o.l6,{value:!!e.open,onChange:n=>{e.open=n,x([...t])},options:P,no_border:!0}),(0,y.jsx)(o.Sm,{value:e.note,handleInputChange:n=>{e.note=n},no_border:!0}),(0,y.jsxs)("div",{children:[(0,y.jsx)(a.rA,{icon:"delete",title:n("删除"),onClick:async()=>{if(e.is_new){const e=[];for(let n=0;n<(t.length??0);n++)n!==s&&e.push(t[n]);x([...e])}else await(async e=>{(await d.s9.post("client_del",{index:e})).code===_.m.Success?((0,p.SK)("保存成功"),N()):(0,p.zN)("网络错误")})(s+1)}}),e.is_new?(0,y.jsx)(a.rA,{icon:"add",title:n("添加"),onClick:async()=>{e.index=s+1,await $(e)}}):(0,y.jsx)(a.rA,{icon:"save",title:n("保存"),onClick:async()=>{e.index=s+1,await $(e)}})]})]),width:"10rem"})]})})]}),(0,y.jsxs)(l.fI,{children:[!!v?.length&&(0,y.jsx)(l.VP,{widthPer:40,children:(0,y.jsx)(r.Zp,{title:n("br_port"),children:(0,y.jsx)(c.X,{headers:C,rows:v.map((e,n)=>[(0,y.jsx)("p",{children:n}),(0,y.jsx)(r.xP,{children:e.server_port}),(0,y.jsx)(r.xP,{children:e.client_name})]),width:"10rem"})})}),!!g?.length&&(0,y.jsx)(l.VP,{widthPer:40,children:(0,y.jsx)(r.Zp,{title:n("文件同步列表"),children:(0,y.jsx)(c.X,{headers:I,rows:g.map((e,n)=>[(0,y.jsx)("p",{children:n}),(0,y.jsx)(r.xP,{children:e.source_client_name}),(0,y.jsx)(r.xP,{children:e.target_client_name}),(0,y.jsx)(r.xP,{children:e.running_num})]),width:"10rem"})})})]})]})}function A(){const{t:e,i18n:n}=(0,i.B)(),{initUserInfo:t,reloadUserInfo:v}=(0,s.useContext)(x.F),[f,g]=(0,h.fp)(u.AG.user_base_info),[w,S]=(0,h.fp)(u.AG.prompt_card),[C,k]=(0,s.useState)(!1),[I,A]=(0,s.useState)([]),[P,N]=(0,s.useState)(null),[$,F]=(0,s.useState)([]),[K,B]=(0,s.useState)(void 0),[U,E]=(0,s.useState)(void 0),G=(0,s.useMemo)(()=>{const e=[...I];return null!=P?(e.sort((e,n)=>P?e.server_port-n.server_port:n.server_port-e.server_port),e):e},[I,P]),D=async()=>{const e=await d.s9.get("get_all_open_server_client_proxy_fig");if(e.code===_.m.Success){const n=[];for(const t of e.data)U?`${t.server_port}${t.client_name}${t.proxy_host}${t.server_port}${t.server_port_note}`.includes(U)&&n.push(t):n.push(t);A(n)}},V=async()=>{const e=await d.s9.get("server_get");e.code===_.m.Success&&(B(e.data.port),k(!!e.data.open),F(e.data.option_keys??[])),D()};(0,s.useEffect)(()=>{j.ws.addMsg(m.HK.tcp_forward_server_load,e=>{V()}),V()},[]);const q=async e=>{const n=new b.I;n.port=K,n.open=C,n.option_keys=$;(await d.s9.post("server_save",{fig:n,notice_client:e})).code===_.m.Success&&(0,p.SK)("成功")};return(0,y.jsxs)(l.fI,{children:[(0,y.jsx)(l.VP,{widthPer:33,children:(0,y.jsx)(l.xh,{children:(0,y.jsxs)(r.Zp,{title:e("服务器配置"),rightBottomCom:(0,y.jsxs)("div",{children:[(0,y.jsx)(a.C3,{text:e("sv_ntf"),clickFun:()=>{q(!0)}}),(0,y.jsx)(a.C3,{text:e("保存"),clickFun:()=>{q(!1)}})]}),children:[(0,y.jsx)(o.Sm,{placeholder:"port",value:K,handleInputChange:e=>{B(e)}}),(0,y.jsxs)("label",{children:[(0,y.jsx)(a.rA,{icon:"add",onClick:()=>{F([...$,""])},title:e("添加")}),e("key")]}),($??[]).map((n,t)=>(0,y.jsxs)("div",{style:{display:"flex"},children:[(0,y.jsx)("div",{style:{width:"90%"},children:(0,y.jsx)(o.Sm,{type:"password",value:n,handleInputChange:e=>{$[t]=e,F([...$])}})}),(0,y.jsx)(a.rA,{icon:"delete",onClick:()=>{$.splice(t,1),F([...$])},title:e("删除")})]},t)),(0,y.jsxs)("form",{children:[e("状态"),":",(0,y.jsx)(c.S,{isFlex:!0,columns:[(0,y.jsx)(o.U6,{value:1,context:e("开启"),selected:C,onchange:()=>{k(!C)}}),(0,y.jsx)(o.U6,{value:1,context:e("关闭"),selected:!C,onchange:()=>{k(!C)}})]})]})]})})}),(0,y.jsx)(l.VP,{widthPer:50,children:(0,y.jsx)(l.xh,{children:(0,y.jsx)(r.uF,{self_title:(0,y.jsx)("span",{className:" div-row ",children:(0,y.jsx)("h2",{children:e("服务器")+e("端口映射")})}),titleCom:(0,y.jsx)(o.Sm,{placeholder:e("过滤"),value:U,handleInputChange:e=>{E(e)},handlerEnter:()=>{D()}}),children:(0,y.jsx)(c.X,{headers:[e("序号"),(0,y.jsx)(a.rA,{title:e("服务端口"),onClick:()=>{N(e=>!e)}}),e("转发ip"),e("转发端口"),"client "+e("名称"),e("开启"),e("备注")],rows:G.map((e,n)=>[(0,y.jsx)("p",{children:n}),(0,y.jsx)(r.xP,{children:e.server_port}),(0,y.jsx)(r.xP,{children:e.proxy_host}),(0,y.jsx)(r.xP,{children:e.proxy_port}),(0,y.jsx)(r.xP,{children:e.client_name}),(0,y.jsx)(r.fq,{ok:!!e.open_success}),(0,y.jsx)(r.xP,{children:e.server_port_note})]),width:"10rem"})})})})]})}var P=t(47996),N=t(78247);function $(){const{t:e,i18n:n}=(0,i.B)(),{initUserInfo:t,reloadUserInfo:j}=(0,s.useContext)(x.F),[m,v]=(0,h.fp)(u.AG.user_base_info),[f,g]=(0,h.fp)(u.AG.prompt_card),[,w]=(0,h.fp)(u.AG.confirm),[S,C]=(0,h.fp)(u.AG.editorSetting),[k,I]=(0,s.useState)([]),[A,$]=(0,s.useState)([]),F=[e("编号"),e("原客户端"),e("开启"),e("备注"),e("操作")],[K,B]=(0,s.useState)(null);(0,s.useEffect)(()=>{(async()=>{const e=await d.s9.get("server_client_get");if(e.code===_.m.Success){const n=e.data,t=[];for(const e of n)t.push({label:e.client_name,value:e.client_num_id});$(t),await U()}})()},[]);const U=async()=>{const e=await d.s9.get("sync_task_get");e.code===_.m.Success&&I(e.data)},E=e=>A.find(n=>String(n.value)===String(e))?.label??"",G=e=>A.find(n=>String(n.value)===String(e)),D=(e,n,t)=>{K?.targets&&(K.targets[e]={...K.targets[e],[n]:t},B({...K,targets:[...K.targets]}))},V=async n=>{const t=await d.s9.post("sync_task_save",n);t.code===_.m.Success?((0,p.SK)(e("成功")),await U()):(0,p.zN)(t.message??e("操作失败"))};return(0,y.jsxs)(l.fI,{children:[(0,y.jsx)(l.VP,{widthPer:50,maxWidth:"40rem",children:(0,y.jsx)(l.xh,{children:(0,y.jsx)(r.uF,{self_title:(0,y.jsxs)("span",{className:" div-row ",children:[(0,y.jsx)("h2",{children:e("客户端文件同步")}),(0,y.jsx)(a.rA,{icon:"info",onClick:()=>{g({open:!0,title:"信息",context_div:(0,y.jsx)("div",{children:(0,y.jsxs)("ul",{children:[(0,y.jsx)("li",{children:e("sy_tp1")}),(0,y.jsx)("li",{children:e("sy_tp2")}),(0,y.jsx)("li",{children:e("sy_tp3")})]})})})},title:e("信息")})]}),titleCom:(0,y.jsx)("div",{children:(0,y.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{B({open:!1,source_client_num_id:void 0,source_dir:"",targets:[],delete_missing:!0,is_new:!0})}})}),children:(0,y.jsx)(c.X,{headers:F,rows:k.map((n,t)=>[(0,y.jsx)("p",{children:t}),(0,y.jsx)(r.xP,{children:n.source_client_name}),(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(r.fq,{ok:!!n.open}),n.open?e("开启"):e("关闭")]}),(0,y.jsx)(r.xP,{children:n.note}),(0,y.jsxs)("div",{children:[(0,y.jsx)(a.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{B(JSON.parse(JSON.stringify(e)))})(n)}),(0,y.jsx)(a.rA,{icon:"sync",title:e("立即同步"),onClick:()=>(async n=>{if(!n.id||!n.open)return void(0,p.zN)(e("tsk_off"));const t=await d.s9.post("sync_task_rescan",{id:n.id});t.code===_.m.Success?(0,p.SK)(e("已触发同步")):(0,p.zN)(t.message??e("操作失败"))})(n)}),(0,y.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>{w({open:!0,title:e("确定删除吗"),handle:async()=>{await(async n=>{(await d.s9.post("sync_task_del",{id:n})).code===_.m.Success&&((0,p.SK)(e("成功")),K?.id===n&&B(null),await U())})(n.id),w({open:!1,handle:null})}})}})]})]),width:"10rem"})})})}),(0,y.jsx)(l.VP,{widthPer:50,children:K&&(0,y.jsx)(l.xh,{children:(0,y.jsxs)(r.Zp,{self_title:(0,y.jsx)("span",{className:" div-row ",children:(0,y.jsx)("h2",{children:e(""+(K.is_new?"添加":"编辑"))})}),rightBottomCom:(0,y.jsxs)("div",{children:[(0,y.jsx)(a.rA,{icon:"cancel",title:e("取消"),onClick:()=>B(null)}),(0,y.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{if(!K)return;const n=K,t=await d.s9.post("sync_task_save",n);t.code===_.m.Success?((0,p.SK)(e("成功")),B(null),await U()):(0,p.zN)(t.message??e("操作失败"))}})]}),children:[(0,y.jsx)(o.BC,{label:e("开启"),label_width:"6rem",children:(0,y.jsx)(o.GL,{selected:!!K.open,onchange:()=>{B({...K,open:!K.open})}})}),(0,y.jsx)(o.BC,{label:e("备注"),label_width:"6rem",children:(0,y.jsx)(o.Sm,{value:K.note,handleInputChange:e=>{B({...K,note:e})}})}),(0,y.jsx)(o.BC,{label:e("原客户端"),label_width:"6rem",required:!0,children:(0,y.jsx)(o.Sm,{value:E(K.source_client_num_id),options:A,handleInputChange:e=>{const n=G(e);n&&B({...K,source_client_num_id:parseInt(String(n.value))})}})}),(0,y.jsx)(o.BC,{label:e("原目录"),label_width:"6rem",required:!0,children:(0,y.jsx)(o.Sm,{value:K.source_dir,placeholder:e("被同步的源目录"),handleInputChange:e=>{B({...K,source_dir:e})}})}),(0,y.jsx)("label",{children:e("目标列表")}),(K.targets??[]).map((n,t)=>(0,y.jsxs)(P.d,{title:`${e("目标")}${t+1}`,toolbar:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(o.BC,{label:e("全量同步"),label_width:"6rem",children:(0,y.jsx)(o.GL,{selected:!!n.full_sync,onchange:()=>D(t,"full_sync",!n.full_sync)})}),(0,y.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{if(!K?.targets)return;const n=[...K.targets];n.splice(e,1),B({...K,targets:n})})(t)})]}),children:[(0,y.jsx)(o.BC,{label:e("客户端"),label_width:"6rem",required:!0,children:(0,y.jsx)(o.Sm,{value:E(n.client_num_id),options:A,handleInputChange:e=>{const n=G(e);n&&D(t,"client_num_id",parseInt(String(n.value)))}})}),(0,y.jsx)(o.BC,{label:e("目标目录"),label_width:"6rem",required:!0,children:(0,y.jsx)(o.Sm,{value:n.dir,handleInputChange:e=>D(t,"dir",e)})})]},t)),(0,y.jsxs)("div",{className:"div-row",children:[(0,y.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{if(!K)return;const e=[...K.targets??[],{client_num_id:void 0,dir:"",full_sync:!1}];B({...K,targets:e})}}),(0,y.jsx)(a.rA,{icon:"edit",title:e("忽略目录"),onClick:()=>{var e;e=K,N.xK.set_value_temp(e.ignore_text??b.mo),C({model:"ace/mode/gitignore",open:!0,fileName:"",save:async n=>{e.ignore_text=n,B({...e}),N.xK.set_value_temp(""),await V(e)}})}})]})]})})})]})}var F=t(87361);function K(){const{t:e}=(0,i.B)(),n=[{index:1,name:e("客户端"),rto:"tcp_proxy_client/",component:(0,y.jsx)(I,{})},{index:2,name:e("服务端"),rto:"tcp_proxy_server_info/",component:(0,y.jsx)(A,{})},{index:3,name:e("服务端")+"-"+e("客户端列表"),rto:"tcp_proxy_server_client/",component:(0,y.jsx)(C,{})},{index:4,name:e("服务端")+"-"+e("客户端功能"),rto:"tcp_proxy_server_client_setting/",component:(0,y.jsx)($,{})}];return(0,y.jsx)(l.W1,{optionList:n,father_route:F.o.net_proxy})}},6960(e,n,t){t.d(n,{s:()=>r});var s=t(72635);const l=1440,i=525600;function r(e){e=e>1e12?e:1e3*e;const n=Date.now(),t=Math.abs(n-e)/6e4;return t<1?s.Ay.t("小于一分钟"):t<60?`${t.toFixed(0)} ${s.Ay.t("分钟前")}`:t<l?`${(t/60).toFixed(0)} ${s.Ay.t("小时前")}`:t<43200?`${(t/l).toFixed(0)} ${s.Ay.t("天前")}`:t<i?`${(t/43200).toFixed(0)} ${s.Ay.t("月前")}`:`${(t/i).toFixed(0)} ${s.Ay.t("年前")}`}},24659(e,n,t){var s=t(86149);t.d(n,["K",0,()=>{const{t:e}=(0,s.B)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6966],{18840(e,t,n){n.d(t,{I:()=>r,gE:()=>s});class r{open;key;option_keys;port}class s{client_name;client_num_id;open=!1;serverIp;serverPort;key="";note;status;is_new;index}n.d(t,["FG",0,{content_max_width:"70%",content_padding:"4%",font_size:"16px",line_height:"1.8"},"mo",0,"\nnode_modules\n.venv\n.gradle\n.cache\nvendor\n"])},26966(e,t,n){n.r(t),n.d(t,{default:()=>He});var r=n(96540),s=n(34843),o=n(82893),c=n(78247),a=n(23430),l=n(85997),i=n(57952),u=n(62042),d=n(53459),m=n(14284),h=n(57889),f=n(86149),p=n(42845),g=n(1575),_=n(89781),v=n(61396),k=n(46762),y=n(73337),b=n(89552),w=n(86059),x=n(58903);const M=(0,w.of)({tableGroup:"block",cellContent:"block+",cellAttributes:{}}),$={align:{default:null}},S={doc:{content:"block+"},paragraph:{content:"inline*",group:"block",attrs:$,parseDOM:[{tag:"p"}],toDOM:e=>["p",e.attrs.align?{style:`text-align:${e.attrs.align}`}:{},0]},heading:{content:"inline*",group:"block",attrs:{level:{default:1},...$},defining:!0,parseDOM:[1,2,3,4,5,6].map(e=>({tag:`h${e}`,attrs:{level:e}})),toDOM(e){const t=e.attrs.align?{style:`text-align:${e.attrs.align}`}:{};return[`h${e.attrs.level}`,t,0]}},bullet_list:{group:"block",content:"list_item+",parseDOM:[{tag:"ul"}],toDOM:()=>["ul",0]},ordered_list:{group:"block",content:"list_item+",attrs:{order:{default:1}},parseDOM:[{tag:"ol",getAttrs:e=>({order:Number(e.getAttribute("start")??1)})}],toDOM:e=>1===e.attrs.order?["ol",0]:["ol",{start:e.attrs.order},0]},list_item:{content:"paragraph block*",defining:!0,attrs:{checked:{default:null}},parseDOM:[{tag:"li",getAttrs:e=>{const t=e,n=t.querySelector("input[type=checkbox]");if(n)return{checked:n.checked};const r=t.getAttribute("data-checked");return{checked:null===r?null:"true"===r}}}],toDOM:e=>null!==e.attrs.checked?["li",{"data-checked":String(e.attrs.checked)},0]:["li",0]},blockquote:{content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:()=>["blockquote",0]},code_block:{content:"text*",group:"block",marks:"",defining:!0,attrs:{language:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>{const t=e.querySelector("code"),n=/language-([\w-]+)/.exec(t?.className??"");return{language:n?n[1]:""}}}],toDOM:e=>["pre",{"data-language":e.attrs.language},["code",0]]},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["hr"]},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:()=>["br"]},image:{inline:!0,group:"inline",draggable:!0,attrs:{src:{},alt:{default:null},title:{default:null}},parseDOM:[{tag:"img[src]",getAttrs:e=>{const t=e;return{src:t.getAttribute("src"),alt:t.getAttribute("alt"),title:t.getAttribute("title")}}}],toDOM(e){const{src:t,alt:n,title:r}=e.attrs,s={src:t};return n&&(s.alt=n),r&&(s.title=r),["img",s]}},text:{group:"inline"},...M},j={strong:{parseDOM:[{tag:"strong"},{tag:"b"},{style:"font-weight=bold"}],toDOM:()=>["strong",0]},em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]},strike:{parseDOM:[{tag:"s"},{tag:"del"},{tag:"strike"}],toDOM:()=>["s",0]},code:{parseDOM:[{tag:"code",getAttrs:e=>"PRE"!==e.parentElement?.tagName&&null}],toDOM:()=>["code",0]},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:e=>{const t=e;return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM(e){const{href:t,title:n}=e.attrs;return["a",{href:t,title:n,rel:"noopener noreferrer",target:"_blank"},0]}}},E=new x.Sj({nodes:S,marks:j});const C=new(n(22091).A)({html:!0,linkify:!0,breaks:!1,typographer:!1});function A(e){const t=C.render(e??""),n=document.createElement("div");return n.innerHTML=t,x.S4.fromSchema(E).parse(n)}function D(e){let t="";return e.forEach(e=>{if(e.isText){let n=e.marks.some(e=>"code"===e.type.name)?e.text??"":function(e){return e.replace(/([\\`*_[\]<>])/g,"\\$1")}(e.text??"");for(const t of e.marks)switch(t.type.name){case"code":n=`\`${e.text??""}\``;break;case"strong":n=`**${n}**`;break;case"em":n=`*${n}*`;break;case"strike":n=`~~${n}~~`;break;case"link":n=`[${n}](${t.attrs.href}${t.attrs.title?` "${t.attrs.title}"`:""})`}t+=n}else if("image"===e.type.name){const{src:n,alt:r,title:s}=e.attrs;t+=``}else"hard_break"===e.type.name&&(t+=" \n")}),t}function O(e){const t=[];if(e.forEach(e=>{const n=[],r=[];e.forEach(e=>{var t;n.push((t=e.textContent,t.replace(/\|/g,"\\|").replace(/\n/g," ")).trim()),r.push("table_header"===e.type.name)}),t.push({cells:n,header_flags:r})}),0===t.length)return"";const n=Math.max(...t.map(e=>e.cells.length)),r=t[0].header_flags.some(e=>e),s=Array.from({length:n},(e,n)=>Math.max(3,...t.map(e=>N(e.cells[n]??"")))),o=e=>`| ${Array.from({length:n},(t,n)=>{return r=e[n]??"",o=s[n],r+" ".repeat(Math.max(0,o-N(r)));var r,o}).join(" | ")} |`,c=[];if(r){c.push(o(t[0].cells)),c.push(`| ${s.map(e=>"-".repeat(e)).join(" | ")} |`);for(let e=1;e<t.length;e++)c.push(o(t[e].cells))}else{c.push(o(new Array(n).fill(""))),c.push(`| ${s.map(e=>"-".repeat(e)).join(" | ")} |`);for(const e of t)c.push(o(e.cells))}return c.join("\n")}function N(e){let t=0;for(const n of e){const e=n.codePointAt(0)??0;t+=e>=4352&&e<=4447||e>=11904&&e<=42191||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65072&&e<=65135||e>=65280&&e<=65376||e>=65504&&e<=65510?2:1}return t}function L(e,t=""){switch(e.type.name){case"paragraph":default:return t+D(e);case"heading":return`${t}${"#".repeat(e.attrs.level)} ${D(e)}`;case"blockquote":return R(e,"").split("\n").map(e=>`${t}> ${e}`).join("\n");case"code_block":{const n=e.attrs.language??"";return`${t}\`\`\`${n}\n${e.textContent}\n${t}\`\`\``}case"horizontal_rule":return`${t}---`;case"bullet_list":{const n=[];return e.forEach((e,r,s)=>{n.push(z(e,t,`${t}- `,`${t} `,s))}),n.join("\n")}case"ordered_list":{const n=[],r=e.attrs.order??1;return e.forEach((e,s,o)=>{n.push(z(e,t,`${t}${r+o}. `,`${t} `,o))}),n.join("\n")}case"table":return O(e).split("\n").map(e=>t+e).join("\n")}}function z(e,t,n,r,s){const o=e.attrs.checked,c=null===o?"":o?"[x] ":"[ ] ",a=[];e.forEach((e,t,n)=>{a.push(L(e,0===n?"":r))});const l=a.join("\n").split("\n");return n+c+l[0]+(l.length>1?"\n"+l.slice(1).join("\n"):"")}function R(e,t=""){const n=[];return e.forEach(e=>{n.push(L(e,t))}),n.join("\n\n")}function F(e){return R(e).trim()+"\n"}var G=n(74848);function T(e){const{t}=(0,f.B)(),[n,s]=(0,r.useState)(new Set),o=(0,r.useMemo)(()=>function(e){const t=[],n=[];for(const r of e){const e={...r,children:[]};for(;n.length>0&&n[n.length-1].level>=e.level;)n.pop();0===n.length?t.push(e):n[n.length-1].children.push(e),n.push(e)}return t}(e.items),[e.items]),c=(r,o)=>r.map(r=>{const a=r.children.length>0,l=n.has(r.pos),i=r.pos===e.active_pos;return(0,G.jsxs)("div",{children:[(0,G.jsxs)("div",{className:`md-outline-item md-outline-item--h${r.level}${i?" md-outline-item--active":""}`,style:{paddingLeft:.4+.75*o+"em"},title:r.text,onClick:()=>e.on_click(r),children:[(0,G.jsx)("i",{className:"material-icons md-outline-arrow"+(a?"":" md-outline-arrow--empty"),onClick:a?e=>{return t=r.pos,e.stopPropagation(),void s(e=>{const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n});var t}:void 0,children:a?l?"arrow_right":"arrow_drop_down":""}),(0,G.jsx)("span",{className:"md-outline-text",children:r.text||t("未命名标题")})]}),a&&!l&&c(r.children,o+1)]},r.pos)});return 0===e.items.length?(0,G.jsxs)("div",{className:"md-outline md-outline--empty",children:[(0,G.jsx)("div",{className:"md-outline-header",children:t("大纲")}),(0,G.jsx)("div",{className:"md-outline-tip",children:t("no_head")})]}):(0,G.jsxs)("div",{className:"md-outline",children:[(0,G.jsx)("div",{className:"md-outline-header",children:t("大纲")}),(0,G.jsx)("div",{className:"md-outline-list",children:c(o,0)})]})}var I=n(19878);const P=new p.hs("md_source_highlight");let W=!1;function q(e){W=e}function V(e,t,n){let r=t;for(const t of e){if("string"==typeof t){r+=t.length;continue}const e=r;Array.isArray(t.children)&&(r=V(t.children,r,n)),t.scope&&n.push({from:e,to:r,cls:`hljs-${t.scope}`})}return r}function B(e,t){const n=e.textContent;if(!n)return[];let r;try{r=I.A.highlight(n,{language:"markdown",ignoreIllegals:!0})}catch{return[]}const s=[],o=r._emitter?.rootNode;o?.children&&V(o.children,0,s);const c=t+1,a=[];for(const e of s){const t=Math.min(e.from,n.length),r=Math.min(e.to,n.length);t>=r||a.push(g.NZ.inline(c+t,c+r,{class:e.cls}))}return a}function H(e){const t=[];return e.descendants((e,n)=>"code_block"!==e.type.name||(t.push(...B(e,n)),!1)),g.zF.create(e,t)}var K=n(38341),J=n(3772);function U(e,t){return new K.fV(e,(e,n,r,s)=>{const o=e.schema.marks[t],c=n[1];if(!o||!c)return null;const a=n[0].indexOf(c);if(a<0)return null;const l=r+a,i=l+c.length,u=e.tr;return u.delete(i,s),u.delete(r,l),u.addMark(r,r+c.length,o.create()),u.removeStoredMark(o),u})}function X(){const e=E;return(0,K.sM)({rules:[(0,K.JJ)(/^(#{1,6})\s$/,e.nodes.heading,e=>({level:e[1].length})),(0,K.JJ)(/^#([1-6])\s$/,e.nodes.heading,e=>({level:Number(e[1])})),(0,K.JJ)(/^```([\w-]*)\s$/,e.nodes.code_block,e=>({language:e[1]??""})),(0,K.tG)(/^\s*>\s$/,e.nodes.blockquote),(0,K.tG)(/^\s*([-+*])\s$/,e.nodes.bullet_list),(0,K.tG)(/^(\d+)\.\s$/,e.nodes.ordered_list,e=>({order:Number(e[1])})),U(/(?:\*\*)([^*]+)(?:\*\*)$/,"strong"),U(/(?:__)([^_]+)(?:__)$/,"strong"),U(/(?<![*])\*([^*]+)\*$/,"em"),U(/(?<![_])_([^_]+)_$/,"em"),U(/(?:~~)([^~]+)(?:~~)$/,"strike"),U(/(?:`)([^`]+)(?:`)$/,"code"),...K.Fr,K.gO]})}const Z=(e,t)=>{const{$from:n,empty:r}=e.selection;if(!r||"paragraph"!==n.parent.type.name)return!1;const s=n.parent.textContent;if(!s.trim())return!1;const o=function(e){const t=e.trim(),n=/^#([1-6])$/.exec(t);if(n)return{type:"heading",attrs:{level:Number(n[1])}};const r=/^(#{1,6})$/.exec(t);if(r)return{type:"heading",attrs:{level:r[1].length}};const s=/^```([\w-]*)$/.exec(t);return s?{type:"code_block",attrs:{language:s[1]??""}}:/^(?:-{3,}|\*{3,}|_{3,})$/.test(t.replace(/\s+/g,""))?{type:"horizontal_rule"}:/^>\s*$/.test(t)?{type:"blockquote"}:/^[-+*]\s*$/.test(t)?{type:"bullet_list"}:/^\d+[.)]?$/.test(t)?{type:"ordered_list"}:null}(s);if(!o)return!1;if("blockquote"===o.type&&n.depth>1)return!1;const c=e.schema.nodes[o.type];if(!c)return!1;const a=n.before(n.depth),l=n.after(n.depth);if(t){const n=e.tr,r=c.createAndFill(o.attrs)??c.create(o.attrs);n.replaceWith(a,l,r),n.scrollIntoView(),t(n)}return!0};function Y(e){return(t,n)=>{const r=t.schema.marks[e];return!!r&&(0,k.wh)(r)(t,n)}}function Q(e,t={}){return(n,r)=>{const s=n.schema.nodes[e];if(!s)return!1;const{$from:o,$to:c}=n.selection,a=o.blockRange(c);if(!a)return!1;const l=o.parent,i=l.type===s&&Object.entries(t).every(([e,t])=>l.attrs[e]===t),u=i?n.schema.nodes.paragraph:s,d=i?{}:t;return r&&r(n.tr.setBlockType(a.start,a.end,u,d)),!0}}const ee=(e,t)=>(0,J.Sd)(e.schema.nodes.bullet_list)(e,t),te=(e,t)=>(0,J.Sd)(e.schema.nodes.ordered_list)(e,t),ne=(e,t)=>{const{blockquote:n}=e.schema.nodes,{$from:r,$to:s}=e.selection,o=r.blockRange(s);if(!o)return!1;if(o.parent.type===n&&o.depth>0){const n=r.before(o.depth),s=e.tr.doc.nodeAt(n);if(s&&1===s.childCount)return t&&t(e.tr.replaceWith(n,n+s.nodeSize,s.child(0)).scrollIntoView()),!0;if(t){const n=e.tr,s=r.parent,c=r.after(o.depth);n.delete(o.start,o.end),n.insert(c,s),t(n.scrollIntoView())}return!0}return t&&t(e.tr.wrap(o,[{type:n}]).scrollIntoView()),!0},re={sink:(0,J.$B)(E.nodes.list_item),lift:(0,J.T2)(E.nodes.list_item),split:(0,J.wn)(E.nodes.list_item),wrap_bullet:ee,wrap_ordered:te};n(41631),n(50576),n(70432);function se(e){return 0===e?Q("paragraph"):Q("heading",{level:e})}function oe(e){return!(!e.ctrlKey&&!e.metaKey)}function ce(e,t){return(0,w.D8)(1)(e,t)}function ae(e){if(1!==e.childCount)return!1;const t=e.firstChild;return!!t&&"code_block"===t.type.name&&"markdown"===t.attrs.language}const le=r.forwardRef(function(e,t){const n=(0,r.useRef)(null),s=(0,r.useRef)(null),o=(0,r.useRef)(e.on_change),c=(0,r.useRef)(e.on_save),a=(0,r.useRef)(e.on_selection_change),l=(0,r.useRef)(e.on_source_mode_change);return(0,r.useEffect)(()=>{o.current=e.on_change,c.current=e.on_save,a.current=e.on_selection_change,l.current=e.on_source_mode_change}),(0,r.useEffect)(()=>{if(!n.current)return;const r=p.$t.create({doc:A(e.value??""),plugins:[(0,_.b6)(),new p.k_({key:P,state:{init:(e,t)=>g.zF.empty,apply:(e,t,n,r)=>W?e.docChanged?H(r.doc):P.getState(r)??g.zF.empty:g.zF.empty},props:{decorations(e){if(!W)return null;const t=P.getState(e);return t&&t.find().length?t:H(e.doc)}}}),X(),(0,v.w)({"Mod-z":_.tN,"Mod-y":_.ZS,"Mod-Shift-z":_.ZS,"Mod-b":Y("strong"),"Mod-i":Y("em"),"Mod-Shift-x":Y("strike"),"Mod-`":Y("code"),"Mod-1":(e,t)=>se(1)(e,t),"Mod-2":(e,t)=>se(2)(e,t),"Mod-3":(e,t)=>se(3)(e,t),"Mod-0":(e,t)=>se(0)(e,t),"Mod-Shift-8":ee,"Mod-Shift-9":te,"Mod-Shift-.":ne,Tab:re.sink,"Shift-Tab":re.lift,"Mod-Enter":ce,"Mod-s":()=>(c.current?.(),!0)}),(0,w.LF)({allowTableNodeSelection:!0}),(0,w.AL)(),(0,y.A)({color:"var(--primary, #1a73e8)",width:2}),(0,b.z)(),(0,v.w)({Enter:(0,k.st)(Z,k.pC,re.split,k.Z1,k.iz,k.aw),"Shift-Enter":(e,t)=>{const{hard_break:n}=e.schema.nodes;return t&&t(e.tr.replaceSelectionWith(n.create()).scrollIntoView()),!0},"Mod-Enter":k.I$}),(0,v.w)(k.RV)]}),i=new g.Lz(n.current,{state:r,editable:()=>!1!==e.editable,handleClickOn(e,t,n,r,s){if(!oe(s))return!1;const o=function(e){if(!(e instanceof Element))return null;const t=e.closest("a[href]"),n=t?.getAttribute("href");return n||null}(s.target)??function(e,t){const n=e.doc.content.size,r=Math.max(0,Math.min(t,n));let s;try{s=e.doc.resolve(r)}catch{return null}for(const t of[1,-1]){const s=1===t?r:r-1;if(!(s<0||s>=n))try{const t=e.doc.resolve(s).marks().find(e=>"link"===e.type.name);if(t?.attrs?.href)return t.attrs.href}catch{}}try{const e=s.parent.marks.find(e=>"link"===e.type.name);if(e?.attrs?.href)return e.attrs.href}catch{}return null}(e.state,t);return!!o&&(window.open(o,"_blank","noopener,noreferrer"),!0)},handleDOMEvents:{keydown:(e,t)=>{if(oe(t)&&e.dom.classList.add("md-ctrl-down"),ae(e.state.doc)&&"Enter"===t.key&&!t.ctrlKey&&!t.metaKey&&!t.altKey){t.preventDefault();const{from:n,to:r}=e.state.selection;return e.dispatch(e.state.tr.insertText("\n",n,r).scrollIntoView()),!0}return!1},keyup:(e,t)=>(oe(t)||e.dom.classList.remove("md-ctrl-down"),!1),blur:e=>(e.dom.classList.remove("md-ctrl-down"),!1),beforeinput:(e,t)=>{if(!ae(e.state.doc))return!1;const n=t;if("insertText"!==n.inputType)return!1;const r=n.data;if(null==r)return!1;n.preventDefault();const{from:s,to:o}=e.state.selection;return e.dispatch(e.state.tr.insertText(r.replace(/\r\n?/g,"\n"),s,o).scrollIntoView()),!0}},dispatchTransaction(e){const t=i.state.apply(e);i.updateState(t);const n=ae(t.doc);q(n),n?i.dom.classList.add("md-source-mode"):i.dom.classList.remove("md-source-mode"),n!==ae(e.before)&&l.current?.(n),e.docChanged&&o.current?.(n?t.doc.textContent:F(t.doc)),(e.selectionSet||e.docChanged)&&a.current?.()},attributes:{class:"md-wysiwyg-content",spellcheck:"false"}});if(s.current=i,e.initial_source_mode&&!ae(i.state.doc)){const e=F(i.state.doc),t=i.state.schema.nodes.code_block.create({language:"markdown"},e?i.state.schema.text(e):null),n=i.state.tr;n.replaceWith(0,i.state.doc.content.size,t),n.setMeta("addToHistory",!1),i.dispatch(n)}const u={get_markdown:()=>ae(i.state.doc)?i.state.doc.textContent:F(i.state.doc),set_markdown:e=>{const t=A(e);i.dispatch(i.state.tr.replaceWith(0,i.state.doc.content.size,t.content))},focus:()=>i.focus(),get_view:()=>s.current,in_table:()=>function(e){const{$from:t}=e.selection;for(let e=t.depth;e>0;e--){if("table"===t.node(e).type.name)return!0}return!1}(i.state),active_marks:()=>(i.state.storedMarks??i.state.selection.$from.marks()).map(e=>e.type.name),active_block:()=>{const{$from:e}=i.state.selection;for(let t=e.depth;t>0;t--){const n=e.node(t);if("heading"===n.type.name)return{name:"heading",level:n.attrs.level};if("paragraph"===n.type.name)return{name:"paragraph"}}return{name:"paragraph"}},insert_table:(e=3,t=3)=>{const n=function(e,t,n){const r=(0,w.e)(e),s=r.table,o=r.row,c=r.cell,a=r.header_cell??r.cell;if(!s||!o||!c)return null;const l=e=>o.create(null,Array.from({length:t},()=>e.createAndFill())),i=l(a),u=Array.from({length:n},()=>l(c));return s.create(null,[i,...u])}(i.state.schema,e,t);if(!n)return;const{from:r}=i.state.selection,s=i.state.doc.resolve(r);let o=r;for(let e=s.depth;e>0;e--)if("table"===s.node(e).type.name){o=s.after(e);break}const c=i.state.tr;o===r?c.replaceSelectionWith(n):c.insert(o,n),i.dispatch(c.scrollIntoView());const a=i.state.doc.resolve(Math.min(o+3,i.state.doc.content.size));try{i.dispatch(i.state.tr.setSelection(i.state.selection.constructor.near(a)))}catch{}},get_headings:()=>function(e){const t=[];return e.doc.descendants((e,n)=>("heading"!==e.type.name||t.push({level:e.attrs.level,text:e.textContent,pos:n}),!0)),t}(i.state),scroll_to_pos:e=>{const t=i.state.doc.content.size,n=Math.max(0,Math.min(e,t)),r=i.state.doc.nodeAt(n);let s;try{s=r?p.U3.near(i.state.doc.resolve(n+1),1):p.U3.near(i.state.doc.resolve(n),1)}catch{s=p.U3.near(i.state.doc.resolve(0),1)}i.dispatch(i.state.tr.setSelection(s).scrollIntoView()),i.focus()},is_source_mode:()=>ae(i.state.doc),enter_source_mode:()=>{if(ae(i.state.doc))return;const e=F(i.state.doc),t=i.state.schema.nodes.code_block.create({language:"markdown"},e?i.state.schema.text(e):null),n=i.state.tr;n.replaceWith(0,i.state.doc.content.size,t),q(!0),i.dispatch(n),i.dom.classList.add("md-source-mode")},exit_source_mode:()=>{if(!ae(i.state.doc))return;const e=A(i.state.doc.textContent),t=i.state.tr;t.replaceWith(0,i.state.doc.content.size,e.content),q(!1),i.dispatch(t),i.dom.classList.remove("md-source-mode")}};return"function"==typeof t?t(u):t&&(t.current=u),e.on_ready?.(u),()=>{i.destroy(),s.current=null}},[]),(0,G.jsx)("div",{className:"md-wysiwyg",ref:n})});function ie(e){const{t}=(0,f.B)(),n=(0,r.useRef)(null),[s,o]=(0,r.useState)({marks:[],block:{name:"paragraph"}}),[c,a]=(0,r.useState)(null),l=(0,r.useCallback)(()=>{const t=e.get_view();if(!t)return;const n=t.state.selection,r=t.state.storedMarks??n.$from.marks();if(o({marks:r.map(e=>e.type.name),block:ue(n.$from)}),n.empty)return void a(null);const s=t.coordsAtPos(n.from),c=t.coordsAtPos(n.to),l=(Math.min(s.left,c.left)+Math.max(s.right,c.right))/2,i=Math.min(s.top,c.top),u=Math.max(s.bottom,c.bottom);a({top:i,bottom:u,left:l})},[e.get_view]);(0,r.useEffect)(()=>{l();const t=e.get_view();if(!t)return;const n=()=>l();t.dom.addEventListener("keyup",n),t.dom.addEventListener("mouseup",n),document.addEventListener("selectionchange",n);const r=t.dom.closest(".md-editor-context");return r?.addEventListener("scroll",n,{passive:!0}),window.addEventListener("resize",n),()=>{t.dom.removeEventListener("keyup",n),t.dom.removeEventListener("mouseup",n),document.removeEventListener("selectionchange",n),r?.removeEventListener("scroll",n),window.removeEventListener("resize",n)}},[l,e.get_view,e.refresh_key]);const i=t=>{const n=e.get_view();n&&(t(n.state,n.dispatch),n.focus(),l())},u=e=>s.marks.includes(e),d=e=>"heading"===s.block.name&&s.block.level===e,[m,h]=(0,r.useState)({w:0,h:36});if((0,r.useLayoutEffect)(()=>{if(!c||!n.current)return;const e=n.current.offsetWidth,t=n.current.offsetHeight;h(n=>n.w===e&&n.h===t?n:{w:e,h:t})},[c,e.refresh_key]),!c)return null;const p=(e,n,r,s,o=!1)=>(0,G.jsx)("button",{className:"mdtb__btn"+(o?" mdtb__btn--on":""),title:t(r),onMouseDown:e=>e.preventDefault(),onClick:s,children:n},e),g=m.w/2,_=g+4,v=Math.max(_,window.innerWidth-g-4),k=document.querySelector(".header")?.getBoundingClientRect().bottom??0,y=c.top-m.h-8,b=y<k+4,w={top:b?Math.min(c.bottom+8,window.innerHeight-m.h-4):y,left:Math.min(v,Math.max(_,c.left))};return(0,G.jsxs)("div",{className:"mdtb mdtb--floating"+(b?" mdtb--below":""),ref:n,style:w,children:[p("h1","H1","一级标题",()=>i(Q("heading",{level:1})),d(1)),p("h2","H2","二级标题",()=>i(Q("heading",{level:2})),d(2)),p("h3","H3","三级标题",()=>i(Q("heading",{level:3})),d(3)),(0,G.jsx)("span",{className:"mdtb__sep"}),p("b","B","加粗",()=>i(Y("strong")),u("strong")),p("i","I","斜体",()=>i(Y("em")),u("em")),p("s","S","删除线",()=>i(Y("strike")),u("strike")),p("code","</>","行内代码",()=>i(Y("code")),u("code")),(0,G.jsx)("span",{className:"mdtb__sep"}),p("ul","≔","无序列表",()=>i(ee)),p("ol","1.","有序列表",()=>i(te)),p("quote","❝","引用",()=>i(ne))]})}function ue(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.name;if("heading"===n)return{name:"heading",level:e.node(t).attrs.level};if("paragraph"===n)return{name:"paragraph"}}return{name:"paragraph"}}var de=n(75725);const me="cut",he="copy",fe="paste",pe="strong",ge="em",_e="strike",ve="code",ke="h1",ye="h2",be="h3",we="paragraph",xe="bullet",Me="ordered",$e="quote",Se="code_block",je="clean",Ee="row_before",Ce="row_after",Ae="row_delete",De="col_before",Oe="col_after",Ne="col_delete",Le="header_toggle",ze="cell_merge",Re="cell_split",Fe="table_delete",Ge="table_insert",Te="select_all";function Ie(e){const{t}=(0,f.B)(),[n,s]=(0,r.useState)(null),o=(0,r.useRef)(e.get_view);o.current=e.get_view,(0,r.useEffect)(()=>{const e=e=>{const t=o.current();if(!t)return;const n=e.target;if(!n||!n.closest(".md-wysiwyg-content"))return;e.preventDefault();const r=t.posAtCoords({left:e.clientX,top:e.clientY});if(r){const e=t.state.selection;if(r.pos<e.from||r.pos>e.to){const{TextSelection:e}=t.state.selection.constructor;try{t.dispatch(t.state.tr.setSelection(e.near(t.state.doc.resolve(r.pos))))}catch{}}}const c=!!n.closest("td, th");s({x:e.clientX,y:e.clientY,in_table:c||(0,w.aH)(t.state)})};return document.addEventListener("contextmenu",e,!0),()=>document.removeEventListener("contextmenu",e,!0)},[]);const c=()=>s(null),a=(0,r.useCallback)(e=>{const t=o.current();t&&(e(t.state,t.dispatch),t.focus(),c())},[]),l=e=>{const t=o.current();t?.focus(),document.execCommand(e),c()};if(!n)return null;const i=n.in_table?[{r:t("上方插入行"),v:Ee},{r:t("下方插入行"),v:Ce},{r:t("左侧插入列"),v:De},{r:t("右侧插入列"),v:Oe},{r:t("删除行"),v:Ae},{r:t("删除列"),v:Ne},{r:t("切换表头行"),v:Le},{r:t("合并单元格"),v:ze},{r:t("拆分单元格"),v:Re},{r:t("删除表格"),v:Fe}]:[],u=[{r:t("剪切"),v:me},{r:t("复制"),v:he},{r:t("粘贴"),v:fe},{r:t("格式"),v:"format",items:[{r:t("加粗"),v:pe},{r:t("斜体"),v:ge},{r:t("删除线"),v:_e},{r:t("行内代码"),v:ve}]},{r:t("段落"),v:"block",items:[{r:t("一级标题"),v:ke},{r:t("二级标题"),v:ye},{r:t("三级标题"),v:be},{r:t("正文"),v:we}]},{r:t("插入"),v:"insert",items:[{r:t("无序列表"),v:xe},{r:t("有序列表"),v:Me},{r:t("引用"),v:$e},{r:t("代码块"),v:Se},{r:t("插入表格"),v:Ge}]},...i.length?[{r:t("表格"),v:"table",items:i}]:[],{r:t("清除格式"),v:je},{r:t("全选"),v:Te}];return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(de.rY,{click:c}),(0,G.jsx)(de.Pu,{x:n.x,y:n.y,items:u,click:t=>{switch(t){case me:return l("cut");case he:return l("copy");case fe:return l("paste");case pe:return a(Y("strong"));case ge:return a(Y("em"));case _e:return a(Y("strike"));case ve:return a(Y("code"));case ke:return a(Q("heading",{level:1}));case ye:return a(Q("heading",{level:2}));case be:return a(Q("heading",{level:3}));case we:return a(Q("paragraph"));case xe:return a(ee);case Me:return a(te);case $e:return a(ne);case Se:return a(Q("code_block"));case Ge:return c(),void e.on_insert_table?.();case Ee:return a(w.JD);case Ce:return a(w.gC);case De:return a(w.RC);case Oe:return a(w.GU);case Ae:return a(w.aR);case Ne:return a(w.gR);case Le:return a(w.uC);case ze:return a(w.w7);case Re:return a(w.L0);case Fe:return a(w.kG);case je:return a((e,t)=>{const{from:n,to:r}=e.selection;let s=e.tr;return e.doc.nodesBetween(n,r,(e,t)=>{if(e.isText)for(const n of e.marks)s=s.removeMark(t,t+e.nodeSize,n.type)}),t?.(s),!0});case Te:return a((e,t)=>{const{TextSelection:n}=e.selection.constructor;return t?.(e.tr.setSelection(n.create(e.doc,0,e.doc.content.size))),!0})}}})]})}function Pe(e){const t=[];if(!e)return t;const n=e.split(/(\n)/);let r=null,s=0;for(let e=0;e<n.length;e+=2){const o=n[e],c=s;s+=o.length+(n[e+1]?.length??0);const a=o.endsWith("\r")?o.slice(0,-1):o,l=a.trimStart(),i=/^(`{3,}|~{3,})/.exec(l);if(i){const e=i[1][0];null===r?r=e:r===e&&(r=null);continue}if(null!==r)continue;const u=/^ {0,3}(#{1,6})\s+(.*)$/.exec(a);if(!u)continue;const d=u[1].length,m=u[2].replace(/\s+#+\s*$/,"").trim();t.push({level:d,text:m,pos:c})}return t}var We=n(69918),qe=n(2543),Ve=n(86090),Be=n(87361);function He(){const{t:e}=(0,f.B)(),t=(0,Ve.Zp)(),{check_user_auth:n}=(0,c.MH)(),p=n(a.oV.md_editor_setting),[g,_]=(0,s.fp)(o.AG.md_editor),[v,k]=(0,r.useState)(null),[y,b]=(0,r.useState)(!1),[w,x]=(0,r.useState)(!1),[M,$]=(0,r.useState)(0),S=(0,r.useRef)(null),[j,E]=(0,r.useState)([]),[C,A]=(0,r.useState)(-1),[D,O]=(0,r.useState)(15),[N,L]=(0,r.useState)(!1),z=(0,r.useRef)(null),R=(0,r.useRef)(null),[F,I]=(0,s.fp)(o.AG.md_editor_show_outline),[P,W]=(0,s.fp)(o.AG.md_editor_mode),q=(0,r.useCallback)(()=>{const e="wysiwyg"===P?"source":"wysiwyg",t=S.current;t&&("source"===e?t.enter_source_mode():t.exit_source_mode(),W(e))},[P]),[V,B]=(0,r.useState)(We.FG),H=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=!1;return(0,We.gC)().then(t=>{e||B(t)}),()=>{e=!0}},[]),(0,r.useEffect)(()=>{(0,We.Ce)(H.current,V)},[V]);const K=(0,r.useRef)([]),J=(0,r.useCallback)(()=>{const e=S.current;if(!e)return;const t=e.is_source_mode()?Pe(e.get_markdown()):e.get_headings();K.current=t,E(t)},[]),U=(0,r.useCallback)(()=>{const e=S.current,t=e?.get_view();if(!e||!t)return;const n=e.is_source_mode()?t.state.selection.from-1:t.state.selection.from;let r=-1;for(const e of K.current){if(!(e.pos<=n))break;r=e.pos}A(r)},[]);(0,r.useEffect)(()=>{let t=!1;if(g?.url)return x(!1),b(!0),h.l.get(g.url).then(e=>{if(t)return;k(e??"")}).catch(()=>{t||((0,u.zN)(e("打开失败")),k(""))}).finally(()=>{t||b(!1)}),()=>{t=!0};k(null)},[g?.url]),(0,r.useEffect)(()=>{const e=()=>$(e=>e+1);return document.addEventListener("selectionchange",e),()=>document.removeEventListener("selectionchange",e)},[]);const X=(0,r.useRef)(q);X.current=q,(0,r.useEffect)(()=>{const e=e=>{(e.ctrlKey||e.metaKey)&&"/"===e.key&&(e.preventDefault(),e.stopPropagation(),X.current())};return document.addEventListener("keydown",e,!0),()=>document.removeEventListener("keydown",e,!0)},[]),(0,r.useEffect)(()=>{J(),U()},[M,P,J,U]);const Z=(0,r.useCallback)(qe.throttle(e=>{if(!z.current||!R.current)return;const t=parseFloat(getComputedStyle(z.current).fontSize),n=e.clientX/t,r=window.innerWidth/t-4,s=2.25+R.current.offsetWidth/t;n<=r&&n>=s&&O(parseFloat(n.toFixed(2)))},32),[]),Y=()=>{L(!1),z.current?.removeEventListener("pointermove",Z)},Q=async()=>{if(!g?.name||!g?.path)return;const t=S.current?.get_markdown();if(void 0===t)return;const n=g.path.slice(0,g.path.length-g.name.length),r=`${encodeURIComponent(n)}${g.name}`;(await m.$M.post(`save/${r}`,{context:t})).code===d.m.Success?(x(!1),(0,u.SK)(e("保存成功"))):(0,u.zN)(e("保存失败"))},ee=(0,r.useRef)(Q);ee.current=Q;const te=()=>{_({}),x(!1),k(null),S.current=null,g?.close?.()},ne=(0,r.useMemo)(()=>g?.url??"md_editor",[g?.url]);return g?.name?(0,G.jsxs)("div",{id:"md-editor-container",ref:H,children:[(0,G.jsx)(i.A,{ignore_tags:!0,left_children:[(0,G.jsx)(l.rA,{title:e("关闭"),icon:"close",onClick:te},1),(0,G.jsx)("div",{className:"md-editor-title",children:g.name},3),...w?[(0,G.jsx)(l.rA,{title:e("保存"),icon:"save",onClick:Q},2)]:[],(0,G.jsx)(l.rA,{title:e("大纲"),icon:"list",onClick:()=>I(e=>!e),selected:F},4),(0,G.jsx)(l.rA,{title:e("wysiwyg"===P?"源码模式":"实时编辑模式"),icon:"wysiwyg"===P?"code":"edit",onClick:q},5),...p?[(0,G.jsx)(l.rA,{title:e("编辑器设置"),icon:"settings",onClick:()=>{te(),t(Be.o.md_editor_setting_page)}},6)]:[]]}),(0,G.jsxs)("div",{className:"md-editor-context",ref:z,children:[y&&(0,G.jsxs)("div",{className:"common-box common-box-center",children:[e("加载中"),"..."]}),!y&&null!==v&&(0,G.jsxs)(r.Fragment,{children:[F&&(0,G.jsx)("div",{className:"md-outline-panel",style:{width:`${D}em`},children:(0,G.jsx)(T,{items:j,active_pos:C,on_click:e=>{const t=S.current;t&&(t.scroll_to_pos(t.is_source_mode()?e.pos+1:e.pos),A(e.pos))}})}),F&&(0,G.jsx)("div",{className:"md-editor-divider",ref:R,onPointerDown:()=>{L(!0),z.current?.addEventListener("pointermove",Z)},onPointerUp:Y}),N&&(0,G.jsx)("div",{className:"md-editor-drag-overlay",onPointerUp:Y}),(0,G.jsx)("div",{className:"md-editor-scroll",children:(0,G.jsxs)("div",{className:"md-editor-sheet",children:["wysiwyg"===P&&(0,G.jsx)(ie,{get_view:()=>S.current?.get_view()??null,refresh_key:M}),(0,G.jsx)(le,{value:v,ref:S,initial_source_mode:"source"===P,on_ready:e=>{const t=e.is_source_mode()?Pe(e.get_markdown()):e.get_headings();K.current=t,E(t),A(-1)},on_change:()=>{w||x(!0)},on_save:()=>ee.current(),on_selection_change:()=>$(e=>e+1),on_source_mode_change:e=>{W(e?"source":"wysiwyg"),$(e=>e+1)}},ne),"wysiwyg"===P&&(0,G.jsx)(Ie,{get_view:()=>S.current?.get_view()??null,on_insert_table:()=>{S.current?.insert_table(3,3),x(!0)}})]})})]})]})]}):null}},69918(e,t,n){n.d(t,{Ce:()=>l,FG:()=>r.FG,fy:()=>a,gC:()=>c});var r=n(18840),s=n(14284),o=n(53459);async function c(){try{const e=await s.XO.get("md_editor_setting/get");return{...r.FG,...e?.data??{}}}catch(e){return{...r.FG}}}async function a(e){const t=await s.XO.post("md_editor_setting/save",e);return t?.code!==o.m.Success?null:{...r.FG,...t.data??e}}function l(e,t){e&&(e.style.setProperty("--md-editor-max-width",t.content_max_width),e.style.setProperty("--md-editor-padding",t.content_padding),e.style.setProperty("--md-editor-font-size",t.font_size),e.style.setProperty("--md-editor-line-height",t.line_height))}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[8603],{58603(e,t,i){i.r(t),i.d(t,{default:()=>$});var n=i(96540),s=i(75725),r=i(70447),a=i(34843),o=i(82893),l=i(60096),c=i(85997),d=i(34251),m=i(34289),h=i(87361),_=i(14284),u=i(53459),x=i(61443),f=i(86149),p=i(62042),j=(i(47022),i(4412)),k=i(99214),g=i(6960),w=i(88815),v=i(78247),z=i(40505),F=i(23430),b=i(64694),C=i(86090),N=i(74848);function $(){const[e,t]=(0,n.useState)(null),i=(0,n.useRef)(""),$=(0,n.useRef)(""),[y,S]=(0,a.fp)(o.AG.prompt_card),[M,A]=(0,a.fp)(o.AG.share_sort_type),{t:G}=(0,f.B)(),[I,U]=(0,a.fp)(o.AG.selectedFileList),[V,W]=(0,a.fp)(o.AG.clickFileList),{click_file:D}=(0,v.kZ)(),[L]=(0,C.ok)(),R=(0,k.oT)(),Z=(0,k.xp)(),B=(0,k.Vs)(!0),H=(0,n.useMemo)(()=>{const t=[...e?.items??[]],i=e=>Number(e.mtime??0);return M===F.t8.time_minx_max?t.sort((e,t)=>i(e)-i(t)):M===F.t8.time_max_min&&t.sort((e,t)=>i(t)-i(e)),t},[e?.items,M]),T=async()=>{const e=await _.$M.post("share",{id:i.current,token:$.current});if(e.code===u.m.Success){const n={is_dir:e.data.is_dir};n.items=e.data.files??[];for(const e of n.items)e.origin_size=e.size,e.show_mtime=e.mtime?(0,g.s)(e.mtime):"",e.size=(0,w.v7)(e.size);if(!n.is_dir){const t=e.data.files[0];n.name=t.name,n.size=t.size,n.show_mtime=t.show_mtime}localStorage.setItem(`file_share_token_${i.current}`,$.current);const s=L.get("share_preview_file_name");if(s)try{const t=e.data.files.find(e=>e.name===s);D({file_path:t.path,file_url:_.$M.getDownloadUrlV2(t.path,"share_download",{share_id:i.current,share_token:$.current}),name:t.name,size:t.origin_size,opt_shell:!0,mtime:t.mtime,not_type_tip:G("未知类型,请下载查看"),close:()=>{R("share_preview_file_name",null)}})}catch(e){(0,p.zN)(e?.message||e)}else t(n)}else e.code===u.m.need_token_share&&(localStorage.removeItem(`file_share_token_${i.current}`),(0,p.zN)("需要正确的访问token"),S({open:!0,title:"share file",confirm:()=>{S({open:!1}),T()},context_div:(0,N.jsx)("div",{className:"card-content",children:(0,N.jsx)(x.Sm,{placeholderOut:G("请输入访问token"),value:"",handleInputChange:e=>{$.current=e}})})}))};if((0,n.useEffect)(()=>{const e=(0,m.oW)(`${(0,m.GG)(h.o.share,(0,m.vX)())}`);i.current=e,$.current=localStorage.getItem(`file_share_token_${e}`),T()},[L]),!e)return(0,N.jsx)(s.jW,{isFull:!0,children:(0,N.jsx)("div",{className:"common-box common-box-center",children:"Loading..."})});return(0,N.jsxs)(n.Fragment,{children:[(0,N.jsx)(j.aZ,{children:(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)("h2",{children:["Share ",e.is_dir?"Folder":"File"]})})}),(0,N.jsxs)(j.aZ,{position:"right",children:[I.length>0&&(0,N.jsx)(c.rA,{icon:"download",title:G("下载"),onClick:function(){const e=[];for(let t=0;t<I.length;t++){const i=H[I[t]];e.push(encodeURIComponent(i.path))}const t=_.$M.getDownloadUrlV2(e,"share_download",{share_id:i.current,share_token:$.current});window.open(t)}}),e.is_dir&&(0,N.jsx)(c.rA,{icon:"grid_view",title:G("切换样式"),onClick:B}),e.is_dir&&(0,N.jsx)(c.rA,{icon:"schedule",title:M===F.t8.time_minx_max?G("时间逆序"):G("时间顺序"),onClick:()=>{const e=(0,b.jH)([F.t8.time_max_min,F.t8.time_minx_max,F.t8.defualt],M);A(e),U([]),W([])}})]}),(0,N.jsx)(s.xh,{children:(0,N.jsx)(s.jW,{isFull:!0,children:(0,N.jsx)("div",{className:"common-box ",children:e.is_dir?(0,N.jsx)(l.QW,{share:{share_id:i.current,share_token:$.current},handleContextMenu:()=>{},file_list:H,clickBlank:e=>{e.target===e.currentTarget&&(U([]),W([]))}}):(0,N.jsx)(r.uF,{children:(0,N.jsxs)("div",{style:{height:"25rem"},className:"common-box common-box-center",children:[(0,N.jsx)("div",{className:"file-icons",children:(0,N.jsx)("div",{"data-type":(0,d.uL)(e.name),"data-dir":e.is_dir,"aria-label":e.name,children:(0,N.jsx)(c.In,{icon:"",style:{fontSize:"10rem",display:"inline-block",lineHeight:1},aria_label:e.name})})}),(0,N.jsx)("div",{className:"",children:e.name}),(0,N.jsx)("div",{className:"",children:e.size}),(0,N.jsx)("div",{className:"",children:e.show_mtime}),(0,N.jsx)(c.C3,{text:"download",clickFun:()=>{const e=H[0],t=_.$M.getDownloadUrlV2(e.path,"share_download",{share_id:i.current,share_token:$.current});window.open(t)}}),(0,N.jsx)(c.C3,{text:"copy url",clickFun:()=>{const e=H[0],t=_.$M.getDownloadUrlV2(e.path,"share_download",{share_id:i.current,share_token:$.current}),n=_.$M.get_full_url(t);(0,z.lW)(n),(0,p.SK)(n)}}),(0,N.jsx)(c.C3,{text:"preview",clickFun:()=>{const e=H[0];Z(e.name)}})]})})})})})]})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[8714],{47374(e,t,i){i.d(t,{e:()=>d});var n=i(96540),o=i(86090),s=i(64694),a=i(34289),l=i(61443),r=i(75725),c=i(86149),_=i(85997),f=i(74848);function d(e){let t=(0,o.zy)();const[i,d]=(0,n.useState)([]),[p,m]=(0,n.useState)("/"),[u,h]=(0,n.useState)(void 0),{t:w,i18n:y}=(0,c.B)();n.useEffect(()=>{let t="",i=(0,a.vX)().split("/");i=i.filter(e=>e);const n=i.indexOf(e.baseRoute),o=[];if(-1!=n){t=(0,s.IO)(i.slice(0,n),e.baseRoute);const a=i.slice(n+1);for(let e=0;e<a.length;e++){const i=a[e];o.push({value:i,href:0===e?`${t}${i}/`:(0,s.IO)(o[e-1].href,i)})}m(t),d(o)}},[t]);const v=t=>{t.stopPropagation(),e.clickFun(t)};return(0,f.jsx)("div",{className:"breadcrumbs",onClick:e=>{h(void 0!==u?void 0:"")},children:(0,f.jsx)(n.Fragment,{children:void 0===u?(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)("span",{className:"chevron",children:(0,f.jsx)(o.N_,{to:p,onClick:v,children:(0,f.jsx)(_.In,{icon:"home"})})}),i.map((e,t)=>(0,f.jsxs)("span",{className:"chevron",children:[(0,f.jsx)(_.In,{icon:"keyboard_arrow_right"}),(0,f.jsx)(o.N_,{to:e.href,onClick:v,children:decodeURIComponent(e.value)})]},t))]}):(0,f.jsx)(r.QM,{click:()=>{h(void 0)},children:(0,f.jsx)(l.Sm,{width:"100%",placeholder:w("输入跳转的目录"),handlerEnter:t=>{e.input_path_enter&&e.input_path_enter(t),h(void 0)}})})})})}},78714(e,t,i){i.r(t),i.d(t,{default:()=>W});var n=i(96540),o=i(47374),s=i(34843),a=i(82893),l=i(14284),r=i(86090),c=i(4412),_=i(83529),f=i(34289),d=i(53459),p=i(99214),m=i(61443),u=i(47022),h=i(62042),w=i(86149),y=i(7523),v=i(78247),g=i(88815),x=i(6960),k=i(47071),j=i(14944),G=i(92275),A=i(23430);var C=i(34251),b=i(60096),z=i(85997),M=i(23496),P=i(12730),F=i(75725),$=i(70447),S=i(87361),X=i(40505),E=i(74848);let D={};function I(){const{t:e}=(0,w.B)();let t=(0,r.zy)();const i=(0,r.Zp)(),{check_user_auth:o}=(0,v.MH)(),[c,d]=(0,s.fp)(a.AG.nowFileList),[m,g]=(0,s.fp)(a.AG.uploadFiles),[x,k]=(0,s.fp)(a.AG.showPrompt),[b,M]=(0,s.fp)(a.AG.selectedFileList),[X,I]=(0,s.fp)(a.AG.copyedFileList),[K,N]=(0,s.fp)(a.AG.cutedFileList),[L,R]=(0,s.fp)(a.AG.selectedFileList),[Y,H]=(0,s.fp)(a.AG.clickFileList),[B,U]=(0,s.fp)(a.AG.fileShellShow),[W]=(0,s.fp)(a.AG.current_mount),[Z,O]=(0,s.fp)(a.AG.file_root_list),[q,V]=(0,s.fp)(a.AG.file_root_index),[T,J]=(0,n.useState)(void 0),[Q,ee]=(0,n.useState)(""),[te,ie]=(0,s.fp)(a.AG.workflow_show),[ne,oe]=(0,s.fp)(a.AG.workflow_realtime_show),[se,ae]=(0,s.fp)(a.AG.work_flow_show),{initUserInfo:le}=(0,n.useContext)(y.F),[re,ce]=(0,s.fp)(a.AG.user_base_info),{click_file:_e}=(0,v.kZ)(),[fe,de]=(0,s.fp)(a.AG.prompt_card),pe=(0,n.useMemo)(()=>c.files.reduce((e,t)=>e+(t.type!==u.Iw.folder?1:0),0),[c]),me=(0,n.useMemo)(()=>c.files.reduce((e,t)=>e+(t.type===u.Iw.folder?1:0),0)+(c.folders?.length??0),[c]);function ue(e){(0,h.SK)(e)}(0,n.useEffect)(()=>{D={}},[t]),(0,n.useEffect)(()=>()=>{U({show:!1,path:""})},[]);const he=(0,p.Vs)(),we=t=>{de({open:!0,title:e("信息"),context_div:(0,E.jsxs)("div",{style:{maxWidth:"25rem"},children:[(0,E.jsx)(F.Yh,{left:e("挂载位置磁盘"),right:t?.total_size}),(0,E.jsx)(F.Yh,{left:`${e("磁盘剩余")}`,right:t?.left_size}),(0,E.jsx)(F.Yh,{left:`${e("文件系统")}`,right:t?.fs_type}),(0,E.jsx)(F.Yh,{left:`${e("文件夹数")}`,right:me}),(0,E.jsx)(F.Yh,{left:`${e("文件数")}`,right:pe}),(0,E.jsx)(F.Yh,{left:`${e("当前位置")}`,right:(0,E.jsx)($.xP,{context:t?.now_absolute_path})})]}),cancel:()=>{j.ws.removeMsg(G.HK.file_info)}})};return(0,E.jsxs)(n.Fragment,{children:[b.length>0&&(0,E.jsx)(z.rA,{icon:"delete",title:e("删除"),onClick:()=>{k({show:!0,type:_.PromptEnum.FilesDelete,overlay:!0,data:{}})}}),b.length>0&&(0,E.jsx)(z.rA,{icon:"content_copy",title:e("复制"),onClick:function(){const e=(0,p.ib)(c,b);I(e.map(e=>(0,p.Ok)(e.name))),N([]),ue("已复制")}}),b.length>0&&(0,E.jsx)(z.rA,{icon:"content_cut",title:e("剪切"),onClick:function(){const e=(0,p.ib)(c,b);N(e.map(e=>(0,p.Ok)(e.name))),I([]),ue("已剪切")}}),(X.length>0||K.length>0)&&(0,E.jsx)(z.rA,{onClick:function(){k({show:!0,type:_.PromptEnum.Confirm,overlay:!0,data:{}})},icon:"content_paste",title:e("粘贴到此处"),tip:X.length+K.length}),b.length>0&&(0,E.jsx)(z.rA,{icon:"download",title:e("下载"),onClick:function(){const e=(0,p.ib)(c,b);for(let t=0;t<e.length;t++){const i=e[t];e[t]=encodeURIComponent((0,p.Ok)(i.name))}const t=l.$M.getDownloadUrl(e);window.open(t)}}),b.length>0&&(0,E.jsx)(z.rA,{icon:"compress",title:e("压缩"),onClick:function(){const e=(0,p.ib)(c,b);for(let t=0;t<e.length;t++){const i=e[t];e[t]=(0,p.Ok)(i.name)}e&&0!==e.length?k({show:!0,type:_.PromptEnum.Compress,overlay:!0,data:{files:e}}):(0,h.zN)("没有选中")}}),1===b.length&&(0,E.jsx)(z.rA,{icon:"edit_attributes",title:e("重命名"),onClick:function(){k({show:!0,type:_.PromptEnum.FileRename,overlay:!0,data:{}})}}),se&&(0,E.jsx)(z.rA,{icon:"api",title:"workflow",onClick:()=>{ie(!te)}}),!W&&(0,E.jsx)(z.rA,{icon:"terminal",title:"shell",onClick:function(){B.show?U({show:!1,path:""}):U({show:!0,path:(0,f.GG)("file",(0,f.vX)())})}}),o(A.oV.share_file)&&(0,E.jsx)(z.rA,{icon:"share",title:e("文件分享"),onClick:()=>{i(`${S.o.share_list_setting_page}`)}}),(0,E.jsx)(z.rA,{icon:"grid_view",title:e("切换样式"),onClick:he}),(0,E.jsx)(z.rA,{icon:"create_new_folder",title:e("创建文件夹"),onClick:function(){k({show:!0,type:_.PromptEnum.DirNew,overlay:!0,data:{dir:(0,f.GG)("file",(0,f.vX)())}})}}),(0,E.jsx)(z.rA,{icon:"note_add",title:e("创建文本文件"),onClick:function(){k({show:!0,type:_.PromptEnum.FileNew,overlay:!0,data:{dir:(0,f.GG)("file",(0,f.vX)())}})}}),(0,E.jsx)(z.rA,{icon:"upload_file",title:e("上传"),onClick:()=>{k({show:!0,type:_.PromptEnum.UploadFile,overlay:!0,data:{call:e=>{let t=e.currentTarget?.files;if(!t)return;let i=!!t[0].webkitRelativePath;const n=[],o=new Set;for(let e=0;e<t.length;e++){const s=t[e],a=i?s.webkitRelativePath:`${s.webkitRelativePath}${s.name}`;s.fullPath=a,i&&o.add((0,P.S)(a)),n.push(s)}const s=[];if(i)for(const e of o)s.push({isDir:!0,fullPath:e,name:e});s.push(...n),g(s),k({show:!0,type:_.PromptEnum.FilesUpload,overlay:!1,data:{}})}}})}}),(0,E.jsx)(z.rA,{icon:"info",title:e("信息"),onClick:async()=>{let e;if(!D.now_absolute_path){j.ws.addMsg(G.HK.file_info,t=>{const i=t.context;e&&(D={...D,...i},j.ws.removeMsg(G.HK.file_info),we(D))});const t=await j.ws.sendData(G.HK.file_info,{type:u.Iw.folder,path:(0,f.GG)("file",(0,f.vX)())});e=t.context,D=e,we(D)}we(D)}}),(0,E.jsx)(z.rA,{icon:"more_vert",title:e("切换目录"),onClick:t=>{const n=new C.ik;n.x=t.clientX,n.y=t.clientY,n.type=u.Iw.directory,n.items=Z,n.item_pre_value=q,n.textClick=async t=>{if(-1===t)return i(`${S.o.setting_private_env_setting}`),k({data:void 0,overlay:!1,type:"",show:!1}),void(0,h.N9)(e("请配置 文件夹路径"));(async e=>{V(e),await l.$M.post("base_switch",{root_index:e}),await le(),i("/file/"),R([]),H([])})(t),k({data:void 0,overlay:!1,type:"",show:!1})},k({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:n})}})]})}var K=i(2543),N=i(21499),L=i(64694),R=i(17903);const Y=n.lazy(()=>Promise.all([i.e(7856),i.e(6349),i.e(3659)]).then(()=>i(63659))),H=n.lazy(()=>Promise.all([i.e(7856),i.e(1636)]).then(()=>i(81636)));let B,U="";function W(){const[e,t]=(0,s.fp)(a.AG.editorSetting),[i,h]=(0,s.fp)(a.AG.file_preview),{t:P}=(0,w.B)();let F=(0,r.zy)();const $=(0,r.Zp)(),[D,W]=(0,s.fp)(a.AG.nowFileList),[Z]=(0,s.fp)(a.AG.file_list_refresh),[O]=(0,s.fp)(a.AG.mount_enabled),[q,V]=(0,s.fp)(a.AG.current_mount),[T,J]=(0,s.fp)(a.AG.showPrompt),[Q,ee]=(0,s.fp)(a.AG.selectedFileList),[te,ie]=(0,s.fp)(a.AG.clickFileList),[ne,oe]=(0,s.fp)(a.AG.fileShellShow),[se,ae]=(0,n.useState)(""),[le,re]=(0,s.fp)(a.AG.workflow_show),[ce,_e]=(0,s.fp)(a.AG.workflow_realtime_show),[fe,de]=(0,s.fp)(a.AG.work_flow_show),{initUserInfo:pe}=(0,n.useContext)(y.F),[me,ue]=(0,s.fp)(a.AG.user_base_info),{click_file:he}=(0,v.kZ)(),[we,ye]=(0,s.fp)(a.AG.to_running_files),[ve,ge]=(0,s.fp)(a.AG.file_page),[xe]=(0,s.fp)(a.AG.blank_search_mode),[ke,je]=(0,s.fp)(a.AG.blank_search_mode_for_temp),Ge=function(){const[e,t]=(0,s.fp)(a.AG.user_base_info),{t:i}=(0,w.B)(),{check_user_auth:o}=(0,v.MH)(),[c,d]=(0,s.fp)(a.AG.router_jump),m=(0,r.Zp)(),{initUserInfo:h}=(0,n.useContext)(y.F),[g,x]=(0,s.fp)(a.AG.nowFileList),[k,b]=(0,s.fp)(a.AG.showPrompt),[z,P]=(0,s.fp)(a.AG.fileShellShow),[F,$]=(0,s.fp)(a.AG.blank_search_mode);return t=>{t.preventDefault(),t.stopPropagation();const n=new C.ik;n.x=t.clientX,n.y=t.clientY,n.type=u.Iw.directory;const s=[{r:(0,E.jsx)("span",{style:(0,X.ok)(e.user_data.dir_show_type===A.t8.time_minx_max),children:i("时间逆序")}),v:A.t8.time_minx_max},{r:(0,E.jsx)("span",{style:(0,X.ok)(e.user_data.dir_show_type===A.t8.time_max_min),children:i("时间顺序")}),v:A.t8.time_max_min}],a=[{r:(0,E.jsx)("span",{style:(0,X.ok)(e.user_data.dir_show_type===A.t8.size_min_max),children:i("大小顺序")}),v:A.t8.size_min_max},{r:(0,E.jsx)("span",{style:(0,X.ok)(e.user_data.dir_show_type===A.t8.size_max_min),children:i("大小逆序")}),v:A.t8.size_max_min}],r=[{r:(0,E.jsx)("span",{style:(0,X.ok)(!e.user_data.file_list_pagination_mode||e.user_data.file_list_pagination_mode===A.yM.all),children:i("全部加载文件")}),v:A.yM.all},{r:(0,E.jsx)("span",{style:(0,X.ok)(e.user_data.file_list_pagination_mode===A.yM.pagination),children:i("scrll_l")}),v:A.yM.pagination}],c=[{r:(0,E.jsx)("span",{style:(0,X.ok)(!e.user_data.file_time_show_type||e.user_data.file_time_show_type===A.KD.current),children:i("最近时间")}),v:A.KD.current},{r:(0,E.jsx)("span",{style:(0,X.ok)(e.user_data.file_time_show_type===A.KD.time),children:i("准确时间")}),v:A.KD.time}],w=[{r:i("文件列表展示"),items:[{r:i("文件排序"),v:"",items:[{r:(0,E.jsx)("span",{style:(0,X.ok)(!e.user_data.dir_show_type),children:i("系统默认")}),v:A.t8.defualt},{r:(0,E.jsx)("span",{style:(0,X.ok)(e.user_data.dir_show_type===A.t8.name),children:i("名字")}),v:A.t8.name},{r:(0,E.jsx)("span",{style:(0,X.ok)(e.user_data.dir_show_type===A.t8.time_minx_max||e.user_data.dir_show_type===A.t8.time_max_min),children:i("修改时间")}),v:!1,items:s},{r:(0,E.jsx)("span",{style:(0,X.ok)(e.user_data.dir_show_type===A.t8.size_min_max||e.user_data.dir_show_type===A.t8.size_max_min),children:i("文件大小")}),v:!1,items:a}]},{r:i("文件加载方式"),v:"",items:r},{r:i("时间展示"),v:"",items:c},{r:i("缩放调整"),v:"zoom_adjust"},{r:(0,E.jsx)("span",{style:(0,X.ok)(F),children:i("srchbln")}),v:"blank_search_mode"}]},{r:i("以配置表方式打开目录"),v:"gcfg_dir_config"}];g?.folders?.find(e=>".git"===e.name)&&w.push({r:i("查看Git提交"),v:"git_page"}),o(A.oV.code_resource)&&w.push({r:i("add_rot"),v:"code_resource"}),o(A.oV.http_proxy)&&w.push({r:i("dl_here"),v:"http_resource"}),e?.user_data?.quick_cmd&&(0,p.LL)([...e.user_data.quick_cmd],w),n.items=w,n.textClick=async e=>{if(console.log(e),!1===e)return;const t={};if("gcfg_dir_config"===e){const e=(0,f.GG)("file",(0,f.vX)());return b({data:void 0,overlay:!1,type:"",show:!1}),void m(`${S.o.gcfg_page}/${encodeURIComponent(e)}`)}if("git_page"===e){const e=(0,f.GG)("file",(0,f.vX)());return b({data:void 0,overlay:!1,type:"",show:!1}),void m(`${S.o.git_page}/${encodeURIComponent(e)}`)}if("code_resource"===e){const e=await j.ws.sendData(G.HK.file_info,{path:(0,f.GG)("file",(0,f.vX)())});return d({page_self_router_api_data:[`/api/${Date.now()}`,e.context.now_absolute_path]}),b({data:void 0,overlay:!1,type:"",show:!1}),void m("/setting/customer_router/")}if("http_resource"===e){const e=await j.ws.sendData(G.HK.file_info,{path:(0,f.GG)("file",(0,f.vX)())});return d({http_download_map_path:e.context.now_absolute_path}),b({data:void 0,overlay:!1,type:"",show:!1}),void m("/proxy/http/")}if("zoom_adjust"===e)return b({data:void 0,overlay:!1,type:"",show:!1}),void setTimeout(()=>{b({show:!0,type:_.PromptEnum.ZoomAdjust,overlay:!1,data:{}})},0);if("object"==typeof e&&"quick_cmd"===e.tag){let t=e.cmd;t&&(t.endsWith("\r")||(t+="\r",P({show:!0,path:(0,f.GG)("file",(0,f.vX)()),cmd:t})))}else{if("blank_search_mode"===e)return $(!F),void b({data:void 0,overlay:!1,type:"",show:!1});if(e===A.yM.all||e===A.yM.pagination)t.is_pagination_mode=!0;else if(e===A.KD.current||e===A.KD.time)t.is_file_show_type=!0;else{if(e!==A.t8.defualt&&e!==A.t8.name&&e!==A.t8.size_max_min&&e!==A.t8.size_min_max&&e!==A.t8.time_max_min&&e!==A.t8.time_minx_max)return;t.is_dir_list_type=!0}}await l.wm.post(M.s.user_save_private_attr,{type:e,...t}),await h(),b({data:void 0,overlay:!1,type:"",show:!1}),m((0,f.vX)())},b({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:n})}}(),Ae=async()=>{const e=new k.Nd;e.dir_path=`${(0,f.GG)("file",(0,f.vX)())}`,j.ws.addMsg(G.HK.workflow_realtime,e=>{const t=e.context;if(e.context){for(const e of t.sucess_file_list)(0,p.Ys)(e);for(const e of t.failed_file_list)(0,p.V$)(e);ye(new Set(t.running_file_list))}}),await j.ws.sendData(G.HK.workflow_realtime,e)},Ce=async e=>{let t=!1;for(const i of e.files??[])i.origin_size=i.size,i.size=(0,g.v7)(i.size),me.user_data.file_time_show_type===A.KD.time?i.show_mtime=i.mtime?(0,N.Yq)(i.mtime):"":i.show_mtime=i.mtime?(0,x.s)(i.mtime):"",t||!i.name.endsWith(".workflow.yml")&&!i.name.endsWith(".act")||(t=!0,Promise.resolve().then(()=>{Ae()})),i.name===k.SB&&(t=!0);for(const i of e.folders??[])me.user_data.file_time_show_type===A.KD.time?i.show_mtime=i.mtime?(0,N.Yq)(i.mtime):"":i.show_mtime=i.mtime?(0,x.s)(i.mtime):"",i.name===k.SB&&(t=!0);de(t)},be=n.useRef(null),ze=async e=>{if(!0===O){if(be.current!==e){be.current=e;try{const t=await l.$M.post("file/mount_info",{param_path:e});V(t?.data??null)}catch(e){V(null)}}}else V(null)},Me=async()=>{const e=(0,f.GG)("file",(0,f.vX)());if(xe||ke)return;let t;if(ze(e),me.user_data.file_list_pagination_mode===A.yM.pagination){if(U!==e){if(U=e,1!==ve.page_num)return void ge({page_size:ve.page_size,page_num:1})}else if(ve.page_num<0)return;if(t=await l.$M.post("file_get_page",{param_path:e,page_num:ve.page_num,page_size:ve.page_size}),t.code!==d.m.Success)return;const i=t.data;return Ce(i),i.files?.length?(W(e=>{const t=(0,K.cloneDeep)(1===ve.page_num?i.files:[...e?.files??[],...i.files]),n={...e,files:t};return(0,p.yC)(n,me.user_data.dir_show_type),n}),void(B=t.data)):void ge({page_size:ve.page_size,page_num:-1})}if(t=await l.$M.get(e),t.code!==d.m.Success)return;const i=t.data;(0,p.yC)(i,me.user_data.dir_show_type),Ce(t.data),W(t.data),B=t.data};(0,n.useEffect)(()=>async()=>{ye(new Set)},[]);(0,n.useEffect)(()=>{Me(),t({open:!1}),h({open:!1}),de(!1)},[F,ve]),(0,n.useEffect)(()=>{Z>0&&Me()},[Z]);const Pe=n.useRef(!1);(0,n.useEffect)(()=>{if(null!==O)return Pe.current?void(!0===O?ze((0,f.GG)("file",(0,f.vX)())):V(null)):(Pe.current=!0,void(!0===O&&null===q&&ze((0,f.GG)("file",(0,f.vX)()))))},[O]);const Fe=e=>{e.target===e.currentTarget&&(ee([]),ie([]))};return(0,E.jsxs)(n.Fragment,{children:[(0,E.jsx)(c.aZ,{children:(0,E.jsx)(m.$Z,{handleEnterPress:async()=>{if(xe||ke){if(ee([]),ie([]),!se||!se.trim())return void W({files:[],folders:[]});const e=(0,f.GG)("file",(0,f.vX)()),t=await l.$M.post("file_get_page",{param_path:e,page_num:1,page_size:1e4,search:se.trim()});if(t.code!==d.m.Success)return;const i=t.data;return(0,p.yC)(i,me.user_data.dir_show_type),Ce(i),W(i),void(B=i)}if(!B)return;ee([]),ie([]);const e=[],t=[];for(const t of B.files??[])t.name.includes(se)&&e.push(t);for(const e of B.folders??[])e.name.includes(se)&&t.push(e);W({files:e,folders:t})},placeholder:P("搜索当前目录"),icon:"search",value:"",mobile_hidden:!0,handleInputChange:e=>{ae(e)},max_width:"25em"})}),(0,E.jsxs)(c.aZ,{position:"right",children:[(0,E.jsx)("div",{className:"mobile-context-btn",children:(0,E.jsx)(z.rA,{icon:"more_horiz",title:P("右键"),onClick:()=>{const e=Q[Q.length-1];if(void 0!==e){const t=[...D.folders??[],...D.files??[]][e];if(t){const i=document.querySelectorAll(".item")[e],n=i?i.getBoundingClientRect():{left:window.innerWidth/2,bottom:100},o={preventDefault:()=>{},stopPropagation:()=>{},clientX:n.left+10,clientY:n.bottom??100},s=new C.ik;s.path=(0,L.IO)((0,f.vX)(),t.name),s.filename=t.name,s.x=o.clientX,s.y=o.clientY,s.type=t.type===u.Iw.folder?u.Iw.folder:(0,C.uL)(t.name),s.size=t.origin_size,J({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:s})}}else{const e={preventDefault:()=>{},stopPropagation:()=>{},clientX:window.innerWidth/2,clientY:window.innerHeight/2};Ge(e)}}})}),(0,E.jsx)(I,{})]}),(0,E.jsx)(o.e,{baseRoute:"file",clickFun:function(){if(ee([]),ie([]),me.user_data.file_list_pagination_mode===A.yM.pagination){const e=document.getElementById("listing");e&&(e.scrollTop=0),ge({page_size:ve.page_size,page_num:1})}},input_path_enter:e=>{var t;ee([]),ie([]),W({files:[],folders:[]}),!function(e){return"string"==typeof e&&0!==e.length&&(/^[a-zA-Z]:[\\\/]/.test(e)||/^\\\\[^\\/]+[\\/]/.test(e)||/^\//.test(e))}(e)?$(function(e,t){let i=function(e){let t="\\";for(const i of e)if("/"===i||"\\"===i){t=i;break}return t}(e);if("."===t)return e;if(".."===t){if(e.length>1){let t=e[e.length-1]===i?1:0;for(let n=e.length-1-t;n>=0;n--)if(e[n]===i)return e.substring(0,n+1)}return e}return e.endsWith(i)&&t.startsWith(i)?e.slice(0,-1)+t:e.endsWith(i)||t.startsWith(i)?e+t:e+i+t}((0,f.vX)(),e)):(e=e.replace(0===(t=me.user_data).folder_item_now||void 0===t.folder_item_now?t.cwd:t.folder_items[t.folder_item_now-1].path,""),$(e))}}),q&&(0,E.jsxs)("div",{className:"mount-tip-bar",style:{borderLeftColor:q.color},children:[(0,E.jsx)("span",{className:"material-icons",style:{color:q.color},children:"cloud"}),(0,E.jsxs)("span",{children:[P("当前为挂载目录"),":",q.name]}),(0,E.jsx)("span",{className:"mount-driver-tag",children:R.C1.find(e=>e.value===q.driver)?.title??q.driver}),q.readonly&&(0,E.jsx)("span",{className:"mount-readonly-tag",children:P("只读")})]}),me.user_data.file_list_pagination_mode===A.yM.pagination?(0,E.jsx)(b.$J,{handleContextMenu:Ge,clickBlank:Fe,list:D.files}):(0,E.jsx)(b.t$,{handleContextMenu:Ge,file_list:D.files,folder_list:D.folders,clickBlank:Fe}),le&&(0,E.jsx)(Y,{}),ce.open&&(0,E.jsx)(H,{})]})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[8765],{60096(e,i,t){t.d(i,{QW:()=>z,Ic:()=>b,t$:()=>F,$J:()=>$});var n=t(96540),s=t(47022),l=t(34843),o=t(82893),a=t(86090),r=t(64694),d=t(14284),c=t(34289),m=t(23430),f=t(62042),h=t(99214),p=t(85997),u=t(86149),_=t(74848);function x(e){const[i,t]=(0,l.fp)(o.AG.selectedFileList),[n,a]=(0,l.fp)(o.AG.nowFileList),[c,x]=(0,l.fp)(o.AG.confirm),[g,y]=(0,l.fp)(o.AG.user_base_info),{t:w}=(0,u.B)();return(0,_.jsxs)("div",{...e.extraAttr,onClick:()=>{!async function(i){e.click&&e.click(i,e.name)}(e.index)},className:e.mount?"item mount-item":"item",role:"button","data-type":e.isLink?"invalid_link":e.type,"data-dir":!e.type||e.type===s.Iw.folder,"data-mount":e.mount?"true":void 0,"aria-selected":null!==(0,r.kW)(i,e.index),"aria-label":e.name,style:{"--filewidth":e.itemWidth??"33%"},onDragStart:n=>{return s=e.index,void(i.find(e=>e===s)||t([...i,s]));var s},onDrop:t=>((t,l)=>{const o=t.dataTransfer;let a,r=!1;for(let e=0;e<o.items.length;e++)if("file"===o.items[e].kind){r=!0;break}if(r)return;if(g?.user_data?.file_list_pagination_mode===m.yM.pagination){if(a=n.files[l],n.files[l]?.type!==s.Iw.folder)return}else if(a=n.folders[l],n.folders.length<=l)return;(0,h.ib)(n,i).some(e=>e?.name===a?.name)?(0,f.zN)(w("mv_self")):x({open:!0,title:`确定将文件移动并覆盖到${a?.name}吗?`,handle:async()=>{await e.draggable_handle(a?.name)}})})(t,e.index),draggable:void 0!==e.draggable_handle,children:[void 0===e.icon&&(0,_.jsx)("div",{children:e.type!==s.Iw.image||null==e.path||g?.user_data?.not_pre_show_image?(0,_.jsx)(p.In,{icon:""}):(0,_.jsx)("img",{loading:"lazy",src:d.$M.getDownloadUrl(e.path,{mtime:e.mtime,cache:1}),alt:e.name})}),void 0!==e.icon&&(0,_.jsx)("div",{className:"rotating-div",children:(0,_.jsx)("span",{className:"material-icons",children:e.icon})}),(0,_.jsxs)("div",{children:[(0,_.jsxs)("p",{className:"name",children:[(0,_.jsx)("span",{children:e.name}),e.mount_readonly&&(0,_.jsx)("span",{className:"mount-readonly-tag",children:w("只读")})]}),e.size?(0,_.jsx)("p",{children:e.size}):(0,_.jsx)("p",{children:"—"}),(0,_.jsx)("p",{children:e.show_mtime})]}),e.children]})}var g=t(83529),y=t(34251),w=t(78247);function k(e){const[i,t]=(0,l.fp)(o.AG.selectedFileList),[n,m]=(0,l.fp)(o.AG.nowFileList),[f,p]=(0,l.fp)(o.AG.confirm),[k,v]=(0,l.fp)(o.AG.file_page),[j,A]=(0,l.fp)(o.AG.enterKey),{click_file:G}=(0,w.kZ)(),{t:z}=(0,u.B)(),b=(0,a.Zp)();(0,a.zy)();const F=(0,h.A9)(),{clickDouble:$}=(0,h.xI)(),[C,I]=(0,l.fp)(o.AG.showPrompt);return(0,_.jsx)(x,{extraAttr:{onContextMenu:t=>{((t,n,l,o)=>{t.preventDefault(),t.stopPropagation();const a=new y.ik;a.path=(0,r.IO)((0,c.vX)(),n),a.filename=n,a.x=t.clientX,a.y=t.clientY,a.type=l?s.Iw.folder:(0,y.uL)(n),a.size=o,a.useSelectedList=i.includes(e.index),I({show:!0,type:g.PromptEnum.FileMenu,overlay:!1,data:a})})(t,e.name,e.type===s.Iw.folder,e.origin_size)}},draggable_handle:async e=>{const s=(0,h.ib)(n,i).map(e=>(0,h.Ok)(e.name));await d.$M.post("cut",{files:s,to:`${(0,c.GG)("file",(0,c.vX)())}/${e}`});t([]),p({open:!1,handle:null}),b((0,c.vX)())},name:e.name,index:e.index,mtime:e.mtime,size:e.size,type:e.type,isLink:e.isLink,path:e.path,icon:e.icon,show_mtime:e.show_mtime,mount:e.mount,mount_driver:e.mount_driver,mount_color:e.mount_color,mount_readonly:e.mount_readonly,click:(n,l)=>{if($(n,()=>{e.type===s.Iw.folder?F(l):G({name:l,size:e.origin_size,opt_shell:!0,mtime:e.mtime})}))return;if(null!==(0,r.kW)(i,n))t((0,r.P1)(i,n));else if("ctrl"===j)t([...i,n]);else if("shift"===j){const{max:e,min:s}=(0,r.a7)(i),l=[];if(n>=e)for(let i=e;i<=n;i++)l.push(i);else for(let e=s;e>=n;e--)l.push(e);t(l)}else t([n])},itemWidth:e.itemWidth})}t(38240);var v=t(64405),j=t(88815);function A(e){const[i,t]=(0,l.fp)(o.AG.selectedFileList),[n,m]=(0,l.fp)(o.AG.editorSetting),[p,g]=(0,l.fp)(o.AG.shellNowDir),[y,k]=(0,l.fp)(o.AG.sshInfo),[A,G]=(0,l.fp)(o.AG.nowFileList),[z,b]=(0,l.fp)(o.AG.enterKey),[F,$]=(0,l.fp)(o.AG.confirm),C=(0,a.Zp)(),{t:I}=(0,u.B)(),{clickDouble:W}=(0,h.xI)();return(0,_.jsx)(x,{draggable_handle:async n=>{const s=new v.x;Object.assign(s,y),s.target=(0,r.HS)(...p,n);const l=(0,h.ib)(A,i).map(e=>(0,r.HS)(...p,e.name));for(const e of l)if(s.source=e,!await d.Fg.post("move",s))return!1;t([]),$({open:!1,handle:null}),await e.fileHandler()},name:e.name,index:e.index,mtime:e.mtime,size:e.size,type:e.type,itemWidth:e.itemWidth,show_mtime:e.show_mtime,click:(n,l)=>{if(W(n,()=>{if(e.type===s.Iw.folder){const e=new v.x;return e.key=y.key,e.dir=`/${(0,c.GG)("remoteShell",(0,c.vX)())}${l}`,C((0,r.IO)((0,c.vX)(),l)),t([]),void G({files:[],folders:[]})}const i=async()=>{const i=new v.x;i.key=y.key,i.file=`/${(0,c.GG)("remoteShell",(0,c.vX)())}${l}`;const t=await d.Fg.post("get/file/text",i);let n;l.endsWith(s.Iw.workflow_act)?n="ace/mode/yaml":(l.endsWith(s.Iw.draw)||l.endsWith(s.Iw.excalidraw))&&(n="ace/mode/json"),m({model:n,open:!0,fileName:e.name,save:async e=>{i.context=e;0===(await d.Fg.post("update/file/text",i)).code&&(w.xK.set_value_temp(""),(0,f.SK)("success"))}}),w.xK.set_value_temp(t.data)};"number"==typeof e.origin_size&&e.origin_size>j.o5?$({open:!0,title:I("提示"),sub_title:"文件超过20MB了确定要打开吗?",handle:async()=>{$({open:!1,handle:null}),await i()}}):i()}))return;if(null!==(0,r.kW)(i,n))t((0,r.P1)(i,n));else if("ctrl"===z)t([...i,n]);else if("shift"===z){const{max:e,min:s}=(0,r.a7)(i),l=[];if(n>=e)for(let i=e;i<=n;i++)l.push(i);else for(let e=s;e>=n;e--)l.push(e);t(l)}else t([n])}})}function G(e){const[i,t]=(0,l.fp)(o.AG.selectedFileList),[n,a]=(0,l.fp)(o.AG.enterKey),{click_file:c}=(0,w.kZ)(),[m,f]=(0,l.fp)(o.AG.nowFileList),{t:p}=(0,u.B)(),[k,v]=(0,l.fp)(o.AG.showPrompt),j=((0,h.oT)(),(0,h.xp)()),{clickDouble:A}=(0,h.xI)();return(0,_.jsx)(x,{extraAttr:{onContextMenu:i=>{((i,t,n,l)=>{i.preventDefault(),i.stopPropagation();const o=new y.ik,a=e.item_list;for(const e of a)if(e.name===t){o.path=e.path;break}o.is_share=!0,o.filename=t,o.x=i.clientX,o.y=i.clientY,o.type=n?s.Iw.folder:(0,y.uL)(t),o.size=l,o.share_token=e.share.share_token,o.share_id=e.share.share_id,v({show:!0,type:g.PromptEnum.FileMenu,overlay:!1,data:o})})(i,e.name,e.type===s.Iw.folder,e.origin_size)}},name:e.name,index:e.index,mtime:e.mtime,size:e.size,type:e.type,itemWidth:e.itemWidth,show_mtime:e.show_mtime,click:(l,o)=>{if(A(l,()=>{e.type!==s.Iw.folder&&(j(o)||c({file_path:e.item_list[l].path,file_url:d.$M.getDownloadUrlV2(e.item_list[l].path,"share_download",{share_id:e.share.share_id,share_token:e.share.share_token}),name:o,size:e.origin_size,opt_shell:!0,mtime:e.mtime,not_type_tip:p("未知类型,请下载查看")}))}))return;if(null!==(0,r.kW)(i,l))t((0,r.P1)(i,l));else if("ctrl"===n)t([...i,l]);else if("shift"===n){const{max:e,min:n}=(0,r.a7)(i),s=[];if(l>=e)for(let i=e;i<=l;i++)s.push(i);else for(let e=n;e>=l;e--)s.push(e);t(s)}else t([l])}})}function z({handleContextMenu:e,file_list:i,clickBlank:t,share:s}){const[a,r]=(0,l.fp)(o.AG.user_base_info),d=(0,n.useRef)(null),{t:c}=(0,u.B)(),m=(0,h.OJ)(),{file_is_running:f}=(0,w.hg)();return(0,h.UK)(i,[],d),(0,_.jsx)("div",{onContextMenu:e,id:"listing",style:{paddingBottom:"10rem"},className:`mosaic file-icons ${a?.user_data?.file_list_show_type??""}`,ref:d,children:(0,_.jsx)("div",{onClick:t,children:i.map((e,t)=>(0,_.jsx)(n.Fragment,{children:(0,_.jsx)(G,{share:s,item_list:i,icon:f(e.name)?"refresh":void 0,itemWidth:m,index:t+0,...e})},t+0))})})}function b({handleContextMenu:e,file_list:i,folder_list:t,clickBlank:s,fileHandler:a}){const[r,d]=(0,l.fp)(o.AG.user_base_info),c=(0,n.useRef)(null),{t:m}=(0,u.B)(),f=(0,h.OJ)(),{file_is_running:p}=(0,w.hg)(),[x,y]=(0,l.fp)(o.AG.fileShellShow),k=(0,n.useMemo)(()=>t?.length??0,[t]);return(0,h.ei)(c,g.PromptEnum.SshUpload),(0,h.UK)(i,t,c),(0,n.useEffect)(()=>()=>{x.show&&y({show:!1,path:""})},[]),(0,_.jsxs)("div",{onContextMenu:e,id:"listing",style:{paddingBottom:"10rem"},className:`mosaic file-icons ${r?.user_data?.file_list_show_type??""}`,ref:c,children:[t&&t.length>0&&(0,_.jsx)("h2",{children:m("文件夹")}),t&&(0,_.jsx)("div",{onClick:s,children:t.map((e,i)=>(0,_.jsx)(n.Fragment,{children:(0,_.jsx)(A,{fileHandler:a,itemWidth:f,index:i,...e})},i))}),i&&i.length>0&&(0,_.jsx)("h2",{onClick:s,children:m("文件")}),i&&(0,_.jsx)("div",{onClick:s,children:i.map((e,i)=>(0,_.jsx)(n.Fragment,{children:(0,_.jsx)(A,{fileHandler:a,icon:p(e.name)?"refresh":void 0,itemWidth:f,index:i+k,...e})},i+k))})]})}function F({handleContextMenu:e,file_list:i,folder_list:t,clickBlank:s}){const[a,r]=(0,l.fp)(o.AG.user_base_info),d=(0,n.useRef)(null),{t:c}=(0,u.B)(),[m]=(0,l.fp)(o.AG.zoom_style_by_percent),f=(0,h.OJ)(),{file_is_running:p}=(0,w.hg)(),[x,y]=(0,l.fp)(o.AG.fileShellShow),v=(0,n.useMemo)(()=>t?.length??0,[t]),j=(0,h.pi)(m);return(0,h.ei)(d,g.PromptEnum.FilesUpload),(0,h.UK)(i,t,d),(0,n.useEffect)(()=>()=>{x.show&&y({show:!1,path:""})},[]),(0,_.jsxs)("div",{onContextMenu:e,id:"listing",style:{paddingBottom:"10rem",fontSize:j.fontSize},className:`mosaic file-icons ${a?.user_data?.file_list_show_type??""}`,ref:d,children:[t&&t.length>0&&(0,_.jsx)("h2",{children:c("文件夹")}),t&&(0,_.jsx)("div",{onClick:s,children:t.map((e,i)=>(0,_.jsx)(n.Fragment,{children:(0,_.jsx)(k,{itemWidth:f,index:i,...e})},i))}),i&&i.length>0&&(0,_.jsx)("h2",{onClick:s,children:c("文件")}),i&&(0,_.jsx)("div",{onClick:s,children:i.map((e,i)=>(0,_.jsx)(n.Fragment,{children:(0,_.jsx)(k,{icon:p(e.name)?"refresh":void 0,itemWidth:f,index:i+v,...e})},i+v))})]})}function $({handleContextMenu:e,list:i,clickBlank:t}){const[s,a]=(0,l.fp)(o.AG.user_base_info),r=(0,n.useRef)(null),{t:d}=(0,u.B)(),[c]=(0,l.fp)(o.AG.zoom_style_by_percent),m=(0,h.OJ)(),{file_is_running:f}=(0,w.hg)(),[p,x]=(0,l.fp)(o.AG.fileShellShow),[y,v]=(0,l.fp)(o.AG.enterKey),[j,A]=(0,l.fp)(o.AG.selectedFileList),[G,z]=(0,l.fp)(o.AG.file_page),b=(0,h.pi)(c);return(0,h.UK)(i,[],r),(0,h.ei)(r,g.PromptEnum.FilesUpload),(0,h.SQ)(r,()=>{z(e=>e.page_num<0?e:{page_size:e.page_size,page_num:e.page_num+1})},()=>{}),(0,n.useEffect)(()=>()=>{p.show&&x({show:!1,path:""})},[]),(0,_.jsx)("div",{onContextMenu:e,id:"listing",style:{paddingBottom:"10rem",fontSize:b.fontSize},className:`mosaic file-icons ${s?.user_data?.file_list_show_type??""}`,ref:r,children:i&&(0,_.jsx)("div",{onClick:t,children:i.map((e,i)=>(0,_.jsx)(n.Fragment,{children:(0,_.jsx)(k,{icon:f(e.name)?"refresh":void 0,itemWidth:m,index:i,...e})},i))})})}},6960(e,i,t){t.d(i,{s:()=>o});var n=t(72635);const s=1440,l=525600;function o(e){e=e>1e12?e:1e3*e;const i=Date.now(),t=Math.abs(i-e)/6e4;return t<1?n.Ay.t("小于一分钟"):t<60?`${t.toFixed(0)} ${n.Ay.t("分钟前")}`:t<s?`${(t/60).toFixed(0)} ${n.Ay.t("小时前")}`:t<43200?`${(t/s).toFixed(0)} ${n.Ay.t("天前")}`:t<l?`${(t/43200).toFixed(0)} ${n.Ay.t("月前")}`:`${(t/l).toFixed(0)} ${n.Ay.t("年前")}`}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[9546],{75007(e,t,s){s.d(t,{h:()=>r});s(96540);var n=s(85997),i=s(74848);function r(e){return(0,i.jsxs)("h2",{className:"message",children:[(0,i.jsx)(n.In,{icon:"sentiment_dissatisfied"}),(0,i.jsx)("span",{children:e.context})]})}},22081(e,t,s){var n=s(96540),i=s(16349),r=s(74848);const o=({percentage:e})=>{const t=(0,n.useRef)(null),[s,o]=(0,n.useState)(null);return(0,n.useEffect)(()=>{const s=t.current.getContext("2d"),n=new i.Ay(s,{type:"doughnut",data:{labels:["use","left"],datasets:[{data:[e,100-e],backgroundColor:["#007bff","#f0f0f0"],borderWidth:0}]},options:{plugins:{legend:{display:!1},tooltip:{enabled:!1}},elements:{arc:{borderWidth:0}}}});return o(n),()=>{n.destroy()}},[]),(0,n.useEffect)(()=>{s&&(s.data.datasets[0].data=[e,100-e],s.update())},[e]),(0,r.jsx)("div",{style:{width:"8rem",overflow:"hidden"},children:(0,r.jsx)("canvas",{ref:t})})};s.d(t,["A",0,o])},77481(e,t,s){s.d(t,{S:()=>c,X:()=>o});var n=s(96540),i=s(61443),r=s(74848);function o(e){const[t,s]=n.useState([]),o=(0,n.useRef)(-1),[c,l]=(0,n.useState)(-1),[a,d]=(0,n.useState)(-1);(0,n.useEffect)(()=>{e.children?s(Array.isArray(e.children)?e.children:[e.children]):s(e.rows)},[e.rows,e.children]);const u=()=>{o.current=-1,l(-1),d(-1)};return(0,r.jsxs)("table",{children:[(0,r.jsx)("thead",{children:(0,r.jsx)("tr",{children:e.headers?.map((t,s)=>{const n=!!e.filter&&(e.filter.column??0)===s;let o=t;if(n){const s=e.filter,n=s.options.find(e=>e.value===s.value);null!=s.value&&n&&(o=`${t} (${n.label})`)}return(0,r.jsx)("th",{className:n?"table-filter-col":"",children:n?(0,r.jsx)(i.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:o}):t},s)})})}),(0,r.jsx)("tbody",{children:t.map((t,s)=>{const n=!!e.onRowDrag;return(0,r.jsx)("tr",{className:n?(c===s?"row-dragging":"")+(a===s?" row-drop-target":""):"",draggable:n,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{n&&(o.current=s,l(s),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!n||o.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(s))},onDrop:t=>{n&&(t.preventDefault(),(()=>{const t=o.current,s=a;u(),t<0||s<0||t===s||e.onRowDrag?.(t,s)})())},onDragEnd:u,children:t.map((s,n)=>{const i=n===t.length-1?"small":"";return(0,r.jsx)("td",{className:i,style:{width:e.width??"auto"},children:s},n)})},s)})})]})}function c(e){return(0,r.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,r.jsx)("div",{children:e},t))})}},88062(e,t,s){s(96540),s(47022);var n=s(74848);function i(e){return(0,n.jsx)("div",{className:"black-tip",onClick:()=>{e.click&&e.click(e)},onContextMenu:t=>{t.stopPropagation(),t.nativeEvent.stopImmediatePropagation(),e.onContextMenu&&e.onContextMenu(t,e)},children:e.name})}const r=e=>(0,n.jsxs)("li",{children:[e.click?(0,n.jsx)(i,{...e.node,name:e.render?e.render(e.node):e.node.name,click:e.click,onContextMenu:e.onContextMenu}):(0,n.jsx)("div",{children:e.render?e.render(e.node):e.node.name}),e.node.children&&e.node.children.length>0&&(0,n.jsx)("ul",{children:e.node.children.map((t,s)=>(0,n.jsx)(r,{node:t,click:e.click,onContextMenu:e.onContextMenu,render:e.render},s))})]}),o=e=>(0,n.jsx)("div",{className:"card-tree-view",children:(0,n.jsx)("ul",{children:e.list&&e.list.map((t,s)=>(0,n.jsx)(r,{node:t,click:e.click,onContextMenu:e.onContextMenu,render:e.render},s))})});s.d(t,["A",0,o])},59546(e,t,s){s.r(t),s.d(t,{default:()=>ce});var n=s(96540),i=s(75725),r=s(70447),o=s(22081),c=s(92275),l=s(14944),a=s(14284),d=s(4412),u=s(85997),h=s(77481),x=s(53459),p=s(86149),m=s(34843),j=s(82893),f=s(74777),_=s(62042),g=s(61443),w=s(74848);function y(e){const{t}=(0,p.B)(),[s,o]=(0,m.fp)(j.AG.disk),[c,l]=(0,n.useState)({}),[f,_]=(0,n.useState)([]),g=[t("名字"),t("当前值"),t("历史最低"),t("临界值")];return(0,n.useEffect)(()=>{(async()=>{const s=await a.Yu.post("sys/disk/info",{name:e.name});if(s.code===x.m.Success){const e=[];for(const n of s.data.ata_smart_attributes??[]){let s;n[1]>=n[2]?s="var(--icon-green)":n[1]<=n[3]&&(s="var(--icon-red)"),n[0]=(0,w.jsx)("span",{style:{color:s},children:t(n[0])}),e.push(n)}_(s.data.ata_smart_attributes),l(s.data)}})()},[]),(0,w.jsxs)("div",{children:[(0,w.jsx)(d.aZ,{position:"right",children:(0,w.jsx)(u.rA,{icon:"close",title:t("关闭"),onClick:()=>{o({})}})}),(0,w.jsx)(i.jW,{isFull:!0,more:!0,children:(0,w.jsx)(i.NN,{children:(0,w.jsxs)(i.fI,{children:[(0,w.jsxs)(i.VP,{widthPer:30,children:[(0,w.jsx)(i.xh,{children:(0,w.jsxs)(r.Zp,{title:t("基本信息"),children:[(0,w.jsx)(i.Yh,{left:t("名字"),right:e.name}),(0,w.jsx)(i.Yh,{left:t("厂商名称"),right:e.typeName}),(0,w.jsx)(i.Yh,{left:t("类型"),right:e.type}),(0,w.jsx)(i.Yh,{left:t("容量"),right:e.total})]})}),(0,w.jsx)(i.xh,{children:(0,w.jsxs)(r.Zp,{title:t("物理信息"),children:[(0,w.jsx)(i.Yh,{left:t("是否健康"),right:!0===c.smart_status?"是":"否"}),(0,w.jsx)(i.Yh,{left:t("设备型号"),right:c.model_name}),(0,w.jsx)(i.Yh,{left:t("序列号"),right:c.serial_number}),(0,w.jsx)(i.Yh,{left:t("固件版本"),right:c.firmware_version}),(0,w.jsx)(i.Yh,{left:t("转速(每分钟)"),right:c.rotation_rate}),(0,w.jsx)(i.Yh,{left:t("通电时长(小时)"),right:c.power_on_time_hours}),(0,w.jsx)(i.Yh,{left:t("通电次数"),right:c.power_cycle_count}),(0,w.jsx)(i.Yh,{left:t("温度(°C)"),right:c.temperature}),(0,w.jsx)(i.Yh,{left:t("通信协议"),right:c.device_protocol})]})})]}),(0,w.jsx)(i.VP,{widthPer:50,children:(0,w.jsxs)(i.xh,{children:[f?.length?(0,w.jsx)(r.uF,{title:t("ATA/SATA详细信息"),children:(0,w.jsx)(h.X,{headers:g,rows:f,width:"10rem"})}):(0,w.jsx)(w.Fragment,{}),c.nvme_smart?(0,w.jsxs)(r.Zp,{title:t("NVME详细信息"),children:[(0,w.jsx)(i.Yh,{left:t("NVMe 可用备用块(%)"),right:c.nvme_smart.available_spare}),(0,w.jsx)(i.Yh,{left:t("NVMe 已使用寿命(%)"),right:c.nvme_smart.percentage_used}),(0,w.jsx)(i.Yh,{left:t("NVMe 读取量"),right:c.nvme_smart.data_units_read}),(0,w.jsx)(i.Yh,{left:t("NVMe 写入量"),right:c.nvme_smart.data_units_written}),(0,w.jsx)(i.Yh,{left:t("NVMe 通电次数"),right:c.nvme_smart.power_cycles}),(0,w.jsx)(i.Yh,{left:t("NVMe 通电时长(小时)"),right:c.nvme_smart.power_on_hours}),(0,w.jsx)(i.Yh,{left:t("NVMe 非正常关机"),right:c.nvme_smart.unsafe_shutdowns}),(0,w.jsx)(i.Yh,{left:t("NVMe 媒体错误"),right:c.nvme_smart.media_errors}),(0,w.jsx)(i.Yh,{left:t("NVMe 错误日志数"),right:c.nvme_smart.num_err_log_entries})]}):(0,w.jsx)(w.Fragment,{})]})})]})})})]})}let v=function(e){return e[e.mount=0]="mount",e}({});var k=s(88062),S=s(78247),b=s(23430);const C=e=>(0,w.jsxs)("div",{style:{border:"2px solid black",padding:"10px",width:"300px",height:"300px",position:"relative"},children:[e.name,e.lvms.map((e,t)=>(0,w.jsx)("div",{style:{margin:"5px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid "},children:e.name},t))]});function A(){return(0,w.jsx)("div",{style:{position:"relative",height:"300px",margin:"10px",width:"30px",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,w.jsx)("div",{style:{width:0,height:0,borderTop:"10px solid transparent",borderBottom:"10px solid transparent",borderLeft:"10px solid black"}})})}function P(){const{t:e}=(0,p.B)(),[t,s]=(0,m.fp)(j.AG.disk),[o,c]=(0,n.useState)({}),[l,f]=(0,n.useState)([]),[g,y]=(0,n.useState)([]),[P,V]=(0,m.fp)(j.AG.showPrompt),{check_user_auth:Y}=(0,S.MH)(),[$,F]=(0,n.useState)([]),{click_file:I}=(0,S.kZ)(),[M,N]=(0,m.fp)(j.AG.prompt_card),E=[e("挂载点"),"uuid",e("类型"),e("文件系统类型"),e("文件系统容量"),e("卷容量"),e("设备路径"),e("分区表类型")],K=async()=>{const e=await a.Yu.get("disk/blk");return e.code===x.m.Success&&f(e.data),e.code};(0,n.useEffect)(()=>{(async()=>{K()})()},[]);const B=[(0,w.jsx)(u.rA,{icon:"info",title:e("提示"),onClick:async()=>{N({open:!0,title:"信息",context_div:(0,w.jsx)("div",{children:(0,w.jsxs)("ul",{children:[(0,w.jsxs)("li",{children:["通用格式:","<文件系统> <挂载点> <类型> <挂载选项> <dump> <fsck> "]}),(0,w.jsxs)("li",{children:["文件系统,有多种格式",(0,w.jsxs)("ul",{children:[(0,w.jsx)("li",{children:"1(usb口默认名称)./dev/sda1"}),(0,w.jsx)("li",{children:"2(唯一Id).UUID=123e4567-e89b-12d3-a456-426614174000"}),(0,w.jsx)("li",{children:"3.LABEL=DATA"})]})]}),(0,w.jsx)("li",{children:"挂载点,就是文件路径,例如 /mnt/data ,这个目录要提前创建,且为空"}),(0,w.jsx)("li",{children:"类型,就是文件系统类型,对于系统不支持的类型,例如ntfs需要额外前提安装ntfs-3g(linux 5.15内核以后自带 ntfs)"}),(0,w.jsxs)("li",{children:['挂载选项的值只能是以下这些,可以用 "," 同时使用多个选项',(0,w.jsxs)("ul",{children:[(0,w.jsx)("li",{children:"defaults:使用默认挂载选项"}),(0,w.jsx)("li",{children:"noatime:不更新访问时间,提高性能"}),(0,w.jsx)("li",{children:"auto:系统启动时自动挂载"}),(0,w.jsx)("li",{children:"rw:以读写方式挂载"}),(0,w.jsx)("li",{children:"nofail:防止启动阻塞,挂载失败系统继续执行"}),(0,w.jsx)("li",{children:"...等"})]})]}),(0,w.jsx)("li",{children:"dump 0是需要备份 1是不需要备份"}),(0,w.jsx)("li",{children:"Fsck 整数值0是不检查,文件系统检查顺序越小越先检查"}),(0,w.jsx)("li",{children:"提示:只有含有文件系统的逻辑卷,或者分区才可以进行挂载。"})]})})})}}),(0,w.jsx)(u.rA,{icon:"update",title:e("更新挂载"),onClick:async()=>{(await a.Yu.post("cmd/exe",{type:v.mount})).code===x.m.Success&&(0,_.SK)("挂载文件已生效")}},1)],H=async()=>(await a.Yu.get("get_fstab")).data,Z=async e=>{await a.Yu.post("save_fstab",{content:e})};return(0,w.jsxs)("div",{children:[(0,w.jsx)(d.aZ,{position:"right",children:(0,w.jsx)(u.rA,{icon:"close",title:e("关闭"),onClick:()=>{s({})}})}),(0,w.jsx)(i.jW,{isFull:!0,more:!0,children:(0,w.jsx)(i.NN,{children:(0,w.jsxs)(i.fI,{children:[(0,w.jsx)(i.VP,{widthPer:40,children:(0,w.jsxs)(r.Zp,{title:e("物理块(硬盘)设备、逻辑卷、物理卷"),titleCom:(0,w.jsxs)("div",{children:[Y(b.oV.sys_disk_mount)&&(0,w.jsx)(u.rA,{icon:"file_open",title:e("打开挂载文件"),onClick:async()=>{I({name:"fstab(谨慎修改,内容错误会导致系统无法启动)",model:"text",get_file_fun:H,save_file_fun:Z,menu_list:B})}}),(0,w.jsx)(u.rA,{icon:"update",title:e("刷新"),onClick:async()=>{await K()===x.m.Success&&(0,_.SK)("刷新成功")}})]}),children:[(0,w.jsx)(h.X,{headers:E,rows:g,width:"10rem"}),(0,w.jsx)(k.A,{list:l,render:e=>{let t=e.name;return e.label&&(t+=`(${e.label})`),e.mountpoint?(0,w.jsxs)("span",{children:[t,(0,w.jsx)("span",{style:{color:"green"},children:"(已挂载)"})]}):t},onContextMenu:(e,t)=>{e.preventDefault()},click:t=>{let s="";if(t.mountpoint)for(let e=0;e<t.mountpoints.length;e++)s+=t.mountpoints[e]+";";y([[(0,w.jsx)(r.xP,{children:s}),(0,w.jsx)(r.xP,{children:t.uuid}),e(t.type),e(t.fstype),t.fssize,t.size,(0,w.jsx)(r.xP,{children:t.path}),t.pttype]])}})]})}),(0,w.jsx)(i.VP,{widthPer:60,children:$.map((t,s)=>{const n=[];for(const e of t.pv_list)n.push({name:`${e.name}---(${e.size})---(${e.free_size})`});const o=[];for(const e of t.lv_list)o.push({name:`${e.name}---(${e.size})`});return(0,w.jsx)(r.Zp,{children:(0,w.jsxs)(i.n5,{children:[(0,w.jsx)(C,{name:e("物理卷"),lvms:n}),(0,w.jsx)(A,{}),(0,w.jsx)(C,{name:`${e("逻辑卷")}---(${t.name})---size(${t.size})`,lvms:[]}),(0,w.jsx)(A,{}),(0,w.jsx)(C,{name:e("逻辑卷"),lvms:o})]})},s)})})]})})})]})}var V=s(88815);let Y=!0;function $(e){const{t}=(0,p.B)(),s=[t("名字"),t("厂商名称"),t("类型"),t("容量")],g=[t("名字"),t("物理硬盘"),t("文件系统类型"),t("挂载位置"),t("总容量"),t("剩余容量")],[v,k]=(0,m.fp)(j.AG.user_base_info),[S,C]=(0,n.useState)(0),[A,$]=(0,n.useState)(0),[F,I]=(0,n.useState)(0),[M,N]=(0,n.useState)(0),[E,K]=(0,n.useState)(0),[B,H]=(0,n.useState)({}),[Z,G]=(0,n.useState)(!1),[D,z]=(0,n.useState)(!1),[W,T]=(0,n.useState)(!1),[X,U]=(0,n.useState)(Y),[q,L]=(0,n.useState)(null),[R,O]=(0,n.useState)([]),[J,Q]=(0,n.useState)([]),[ee,te]=(0,m.fp)(j.AG.user_base_info),[se,ne]=(0,m.fp)(j.AG.disk),ie=async()=>{if(!Y)return;const e=new c.hf(c.HK.sys_get);await l.ws.send(e),l.ws.addMsg(c.HK.sys_getting,e=>{N(e.context?.cpu_currentLoad);const t=e.context?.memLeft,s=e.context?.memTotal;$(t),I(s),C((s-t)/s*100),L(e.context?.node_memory_usage),K(e.context?.node_cpu_usage)})};return(0,n.useEffect)(()=>((async()=>{await ie()})(),()=>{l.ws.sendData(c.HK.sys_cancel,{})}),[]),(0,w.jsxs)("div",{children:[(0,w.jsxs)(d.aZ,{position:"right",children:[v.sys===b.XM.linux&&(0,w.jsx)(u.rA,{icon:"sd_card",title:"硬盘挂载",onClick:()=>{ne({type:"mount"})}}),(0,w.jsx)(u.Z$,{defaultStatus:!1,text:t("基本信息"),clickFun:e=>{G(e),e&&(async()=>{const e=await a.Yu.get("base");if(e.code===x.m.Success){const t=e.data;H(t)}})()}}),(0,w.jsx)(u.Z$,{defaultStatus:!1,text:t("物理硬盘"),clickFun:e=>{z(e),e&&(async()=>{const e=await a.Yu.get("disk");if(e.code===x.m.Success){const s=e.data,n=[];let i=!0;ee.sysSoftWare&&ee.sysSoftWare[f.jk.smartmontools]&&ee.sysSoftWare[f.jk.smartmontools].installed||(i=!1);for(const e of s??[])n.push([(0,w.jsx)(r.xP,{context:e.name}),e.typeName,e.type,e.total,(0,w.jsx)(u.rA,{icon:"health_and_safety",title:t("查看健康信息"),onClick:()=>{i?ne({type:"check",data:e}):(0,_.zN)("没有安装smartmontools")}})]);O(n)}})()}}),(0,w.jsx)(u.Z$,{defaultStatus:!1,text:t("文件硬盘"),clickFun:e=>{T(e),e&&(async()=>{const e=await a.Yu.get("filedisk");if(e.code===x.m.Success){const t=e.data,s=[];for(const e of t??[])s.push([(0,w.jsx)(r.xP,{context:e.name}),(0,w.jsx)(r.xP,{context:e.device_name}),e.fsType,(0,w.jsx)(r.xP,{context:e.mount}),e.total,e.available]);Q(s)}})()}}),(0,w.jsx)(u.Z$,{defaultStatus:X,text:t("实时信息"),clickFun:e=>{U(e),Y=e,ie()}})]}),(0,w.jsxs)(i.xh,{children:[X&&(0,w.jsxs)(i.fI,{children:[(0,w.jsx)(i.VP,{widthPer:33,maxWidth:"30rem",children:(0,w.jsx)(r.Zp,{title:"Sys "+t("内存"),children:(0,w.jsxs)(i.fI,{children:[(0,w.jsx)(i.VP,{children:(0,w.jsx)(o.A,{percentage:S})}),(0,w.jsx)(i.VP,{children:(0,w.jsxs)(i.fI,{children:[(0,w.jsx)(i.VP,{widthPer:100,children:(0,w.jsx)("div",{children:(0,w.jsx)(i.Yh,{left:t("总容量"),center:`${F}G`})})}),(0,w.jsx)(i.VP,{widthPer:100,children:(0,w.jsx)(i.Yh,{left:t("剩余"),center:`${A}G`})})]})})]})})}),(0,w.jsx)(i.VP,{widthPer:33,maxWidth:"30rem",children:(0,w.jsx)(r.Zp,{title:"Sys cpu",children:(0,w.jsxs)(i.fI,{children:[(0,w.jsx)(i.VP,{children:(0,w.jsx)(o.A,{percentage:M})}),(0,w.jsx)(i.VP,{children:(0,w.jsx)(i.fI,{children:(0,w.jsx)(i.Yh,{left:t("使用率"),center:M})})})]})})}),(0,w.jsx)(i.VP,{widthPer:33,maxWidth:"30rem",children:(0,w.jsx)(r.Zp,{title:"FileCat",children:(0,w.jsxs)(i.fI,{children:[(0,w.jsxs)(i.VP,{children:[(0,w.jsx)(i.qV,{content:t("内存")}),(0,w.jsx)(i.qV,{content:"total: "+(0,V.v7)(q?.rss)}),(0,w.jsx)(i.qV,{content:"object: "+(0,V.v7)(q?.heapTotal)}),(0,w.jsx)(i.qV,{content:"obj-use: "+(0,V.v7)(q?.heapUsed)}),(0,w.jsx)(i.qV,{content:"external: "+(0,V.v7)(q?.external)}),(0,w.jsx)(i.qV,{content:"buffer: "+(0,V.v7)(q?.arrayBuffers)})]}),(0,w.jsx)(i.VP,{children:(0,w.jsx)(i.qV,{content:"cpu growth rate: "+E})})]})})})]}),(0,w.jsxs)(i.fI,{children:[Z&&(0,w.jsx)(i.VP,{children:(0,w.jsxs)(r.Zp,{title:t("基本信息"),children:[(0,w.jsx)(i.Yh,{left:t("总内存"),right:B.mem_total}),(0,w.jsx)(i.Yh,{left:`cpu ${t("制造商")}`,right:B.cpu_manufacturer}),(0,w.jsx)(i.Yh,{left:`cpu ${t("品牌")}`,right:B.cpu_brand}),(0,w.jsx)(i.Yh,{left:`cpu ${t("逻辑核心")}`,right:B.cpu_core_num}),(0,w.jsx)(i.Yh,{left:`cpu ${t("物理核心")}`,right:B.cpu_phy_core_num}),(0,w.jsx)(i.Yh,{left:`cpu ${t("最大")}hz`,right:B.cpu_speed_hz}),(0,w.jsx)(i.Yh,{left:`${t("当前系统")}:pid;ppid`,right:B.pid_ppid}),(0,w.jsx)(i.Yh,{left:t("运行用户"),right:B.user})]})}),D&&(0,w.jsx)(i.VP,{children:(0,w.jsx)(r.uF,{title:t("物理硬盘"),children:(0,w.jsx)(h.X,{headers:s,rows:R,width:"10rem"})})}),W&&(0,w.jsx)(i.VP,{children:(0,w.jsx)(r.uF,{title:t("文件硬盘"),children:(0,w.jsx)(h.X,{headers:g,rows:J,width:"10rem"})})})]})]}),se&&"check"===se.type&&(0,w.jsx)(y,{...se.data}),se&&"mount"===se.type&&(0,w.jsx)(P,{})]})}var F=s(75007),I=s(97856),M=s(64405);const N=n.lazy(()=>Promise.all([s.e(2543),s.e(5614)]).then(()=>s(85614)));function E(e){const[t,s]=(0,n.useState)(null),[i,r]=(0,m.fp)(j.AG.dockerShellShow),[o,a]=(0,m.fp)(j.AG.user_base_info),d=o.user_data.theme?.includes("dark")?"#FFFFFF":"#000000",u=()=>{(async()=>{t&&(t.writeln("[38;2;29;153;243mclose![0m "),t.dispose(),s(null))})()};(0,n.useEffect)(()=>{i.show?(async()=>{const e=new I.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:d,cursor:d,selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4,convertEol:!0});let t;l.ws.subscribeUnconnect(u);const n=t=>{e.write(t)};t=s=>{e.clear(),e.write(s),t=n},l.ws.addMsg("logs"===i.type?c.HK.docker_shell_logs_getting:c.HK.docker_shell_exec_getting,e=>{"error"===e.context&&u(),t(e.context)}),"exec"===i.type&&e.onData(async e=>{const t=new c.hf(c.HK.docker_shell_exec);t.context=e,await l.ws.send(t)}),s(e)})():u()},[i]),(0,n.useEffect)(()=>()=>{u()},[]);return(0,w.jsx)(N,{show:i.show,terminal:t,init:(e,s)=>{t.writeln("[38;2;29;153;243mconnect...[0m ");const n=new M.n;let r;n.rows=e,n.cols=s,n.dockerId=i.dockerId,r="logs"===i.type?new c.hf(c.HK.docker_shell_logs):new c.hf(c.HK.docker_shell_exec_open),r.context=n,l.ws.send(r)}})}var K=s(83529),B=s(86090),H=s(87361);let Z="",G=[],D=!1;function z(e){const{t}=(0,p.B)(),s=(0,B.Zp)(),[o]=(0,m.fp)(j.AG.user_base_info),[f,y]=(0,n.useState)({}),[v,k]=(0,n.useState)([]),[C,A]=(0,n.useState)([]),{check_user_auth:P}=(0,S.MH)(),[V,Y]=(0,m.fp)(j.AG.dockerShellShow),[$,I]=(0,m.fp)(j.AG.showPrompt),[M,N]=(0,m.fp)(j.AG.confirm),[z,W]=(0,n.useState)(Z),[T,X]=(0,n.useState)(["id",t("名字"),t("镜像"),t("命令"),t("状态"),t("内存"),"cpu%",t("选择")]),[U,q]=(0,n.useState)([]),[L,R]=(0,n.useState)(void 0),[O,J]=(0,n.useState)(!1),Q=["id",t("name"),t("create时间"),t("大小"),(0,w.jsxs)("span",{children:["选中",(0,w.jsx)(u.rA,{icon:"check_box",title:"全选",onClick:()=>{D=!D;const e={};for(let t=0;t<C.length&&D;t++)e[C[t][0].props.context]=1;y(e)}})]})],ee=async()=>{k([]),q([]);const e=new c.hf(c.HK.docker_get);await l.ws.send(e),l.ws.addMsg(c.HK.docker_getting,e=>{const t=[];if(Z){for(const s of e.context)for(const e of s)if(`${e}`.includes(Z)){t.push(s);break}}else t.push(...e.context);k(t.map(e=>{const t=e.map(e=>(0,w.jsx)(r.xP,{context:e}));return t.push((0,w.jsx)(u.rA,{icon:"place",title:"选中",onClick:()=>{q(t)}})),t}))})};(0,n.useEffect)(()=>(W(Z),ee(),()=>{(async()=>{Y({show:!1,type:"",dockerId:""})})()}),[]),(0,n.useEffect)(()=>{Z=z},[z]);const te=()=>{const e=new c.hf("logs"===V.type?c.HK.docker_shell_logs_cancel:c.HK.docker_shell_exec_cancel);e.context="",l.ws.send(e)},se=e=>{const t=new c.hf(c.HK.docker_switch);t.context={type:e,dockerId:U[0].props.context},q([]),l.ws.send(t)},ne=async()=>{const e=await a.Yu.get("docker/images");if(e.code===x.m.Success){const t=e.data??[],s=[];for(let e=0;e<t.length;e++){const n=t[e],i=[(0,w.jsx)(r.xP,{context:n[0]}),(0,w.jsx)(r.xP,{context:n[1]}),n[2],n[3],""];s.push(i)}G=s,A(s)}};return(0,w.jsxs)("div",{children:[(0,w.jsx)(d.aZ,{children:(0,w.jsx)(u.Z$,{defaultStatus:!1,text:t("doc_img"),clickFun:e=>{J(e),e?(ne(),q([])):(ee(),A([]),y({}))}})}),(0,w.jsxs)(d.aZ,{position:"right",children:[o.sys===b.XM.linux&&(0,w.jsx)(u.rA,{icon:"settings",title:t("doc_cfg"),onClick:()=>s(H.o.docker_setting_page)}),Object.keys(f).length>0&&(0,w.jsx)(u.rA,{icon:"delete",title:t("删除镜像"),onClick:async()=>{N({open:!0,title:t("doc_icf"),handle:async()=>{const e=Object.keys(f),t=await a.Yu.post("docker/check/delete",{ids:e});if(t.code===x.m.Success)if(0===t.data.length){(await a.Yu.post("docker/delete",{ids:e})).code===x.m.Success&&((0,_.SK)("删除完成"),ne(),N({open:!1,handle:null}))}else(0,_.N9)(`有镜像正在运行${JSON.stringify(t.data)}`)}})}}),U.length>0&&(0,w.jsx)("div",{children:U[1].props.context}),U.length>0&&(0,w.jsxs)("div",{children:[P(b.oV.docker_container_update)&&(0,w.jsx)(u.rA,{icon:"delete",title:t("删除容器"),onClick:()=>{I({show:!0,overlay:!0,type:K.PromptEnum.DockerDel,data:{dockerId:U[0].props.context,name:U[1].props.context}})}}),(0,w.jsx)(u.rA,{icon:"print",title:t("打印日志"),onClick:()=>{V.show?(Y({show:!1,type:"",dockerId:""}),te()):Y({show:!0,dockerId:U[0].props.context,type:"logs"})}}),P(b.oV.docker_container_update)&&(0,w.jsx)(u.rA,{icon:"personal_video",title:t("执行命令"),onClick:()=>{V.show?(Y({show:!1,type:"",dockerId:""}),te()):Y({show:!0,dockerId:U[0].props.context,type:"exec"})}}),P(b.oV.docker_container_update)&&U[4].props.context.includes("Up")&&(0,w.jsx)(u.rA,{icon:"stop",title:t("停止"),onClick:()=>se("stop")}),P(b.oV.docker_container_update)&&!U[4].props.context.includes("Up")&&(0,w.jsx)(u.rA,{icon:"play_arrow",title:t("开启"),onClick:()=>{se("start")}})]}),(0!==v.length||z)&&!O&&(0,w.jsx)(u.rA,{icon:"refresh",title:t("列表更新"),onClick:async()=>{const e=new c.hf(c.HK.docker_get);await l.ws.send(e)}})]}),(0,w.jsxs)(i.xh,{children:[O&&(0,w.jsx)(i.fI,{children:(0,w.jsx)(i.VP,{widthPer:80,children:(0,w.jsx)(r.uF,{title:`${t("镜像")} (${C.length})`,titleCom:(0,w.jsx)(g.Sm,{placeholder:t("过滤镜像"),value:L,handleInputChange:e=>{R(e)},handlerEnter:()=>{const e=[];if(L){for(const t of C)(t[0].props.context.includes(L)||t[1].props.context.includes(L))&&e.push(t);A(e)}else A(G)}}),children:(0,w.jsx)(h.X,{headers:Q,rows:C.map((e,s)=>(e[4]=(0,w.jsx)(g.GL,{context:t(""),selected:f[e[0].props.context],onchange:()=>{(e=>{const t={};Object.assign(t,f),t[e]?delete t[e]:t[e]=1,y(t)})(e[0].props.context)}}),e)),width:"10rem"})})})}),0===v.length&&!z&&!O&&(0,w.jsx)(F.h,{context:t("dc_nne")}),(0!==v.length||z)&&!O&&(0,w.jsx)(i.fI,{children:(0,w.jsx)(i.VP,{widthPer:80,children:(0,w.jsx)(r.uF,{title:`${t("容器")} (${v.length})`,titleCom:(0,w.jsx)(g.Sm,{placeholder:t("过滤"),value:z,handleInputChange:e=>{W(e)}}),children:(0,w.jsx)(h.X,{headers:T,rows:v,width:"10rem"})})})})]}),(0,w.jsx)(E,{})]})}var W=s(64694);let T="",X=!1,U=!1;function q(e){const{t}=(0,p.B)(),[s,o]=(0,n.useState)([]),[a,x]=(0,n.useState)([]),[m,j]=(0,n.useState)(0),[f,_]=(0,n.useState)(""),[y,v]=(0,n.useState)(["pid",t("名字"),t("创建用户"),(0,w.jsxs)("span",{children:[t("内存"),(0,w.jsx)(u.rA,{icon:"sort",title:t("升序"),onClick:()=>{X=!X}})]}),(0,w.jsxs)("span",{children:["cpu%",(0,w.jsx)(u.rA,{icon:"sort",title:t("升序"),onClick:()=>{U=!U}})]}),t("选择")]),{check_user_auth:k}=(0,S.MH)();(0,n.useEffect)(()=>{_(T),(async()=>{o([]),j(0),x([]);const e=new c.hf(c.HK.process_get);await l.ws.send(e),l.ws.addMsg(c.HK.process_getting,e=>{const s=[];if(T){for(const t of e.context)for(const e of t)if(`${e}`.includes(T)){s.push(t);break}}else s.push(...e.context);X&&(0,W.di)(s,e=>e[3],!1),U&&(0,W.di)(s,e=>e[4],!1);const n=s.map(e=>{const s=e.map((e,t)=>(0,w.jsx)(r.xP,{context:3===t?(0,V.v7)(e):e}));return s.push((0,w.jsx)(u.rA,{icon:"place",title:t("选中"),onClick:()=>{x(s)}})),s});j(s.length),o(n)})})()},[]),(0,n.useEffect)(()=>{T=f},[f]);return(0,w.jsxs)("div",{children:[(0,w.jsxs)(d.aZ,{position:"right",children:[a.length>0&&(0,w.jsx)("div",{children:a[1].props.context}),a.length>0&&k(b.oV.sys_process_close)&&(0,w.jsx)("div",{children:(0,w.jsx)(u.rA,{icon:"stop",title:t("停止"),onClick:()=>{const e=new c.hf(c.HK.process_close);e.context={pid:a[0].props.context},x([]),l.ws.send(e)}})})]}),(0,w.jsx)(i.xh,{children:0!==s.length||T?(0,w.jsx)(i.fI,{children:(0,w.jsx)(i.VP,{widthPer:80,children:(0,w.jsx)(r.uF,{title:`${t("进程")} (${m})`,titleCom:(0,w.jsx)(g.Sm,{placeholder:t("过滤"),value:f,handleInputChange:e=>{_(e)}}),children:(0,w.jsx)(h.X,{headers:y,rows:s,width:"10rem"})})})}):(0,w.jsx)(F.h,{context:t("ld_wait")})})]})}const L=n.lazy(()=>Promise.all([s.e(2543),s.e(5614)]).then(()=>s(85614)));function R(e){const[t,s]=(0,n.useState)(null),[i,r]=(0,m.fp)(j.AG.systemd_shell_show),[o,a]=(0,m.fp)(j.AG.user_base_info),d=o.user_data.theme?.includes("dark")?"#FFFFFF":"#000000",u=()=>{(async()=>{t&&(t.writeln("[38;2;29;153;243mclose![0m "),t.dispose(),s(null))})()};(0,n.useEffect)(()=>{if(!i.show)return void u();(async()=>{const e=new I.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:d,cursor:d,selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4,convertEol:!0});l.ws.subscribeUnconnect(u),l.ws.addMsg(c.HK.systemd_logs_getting,t=>{"error"===t.context&&u(),e.write(t.context)}),s(e)})();const e=e=>{};return document.addEventListener("cancel_systemd_logs",e),()=>{document.removeEventListener("cancel_systemd_logs",e)}},[i]),(0,n.useEffect)(()=>()=>{u()},[]);return(0,w.jsx)(L,{show:i.show,terminal:t,init:(e,s)=>{t.writeln("[38;2;29;153;243mconnect...[0m ");const n={unit_name:i.unit_name},r=new c.hf(c.HK.systemd_logs_get);r.context=n,l.ws.send(r)}})}const O=[{title:"no(不自动重启)",value:"no"},{title:"always(总是重启)",value:"always"},{title:"on-failure(失败才重启)",value:"on-failure"},{title:"on-abnormal(异常才重启)",value:"on-abnormal"}],J=[{title:"simple",value:"simple"},{title:"forking",value:"forking"},{title:"oneshot",value:"oneshot"},{title:"notify",value:"notify"}],Q=[{title:"multi-user.target",value:"multi-user.target"},{title:"network.target",value:"network.target"}];function ee(e,t){const s=[];return s.push("[Unit]"),t.description.trim()?s.push(`Description=${t.description.trim()}`):s.push(`Description=${e}`),s.push(""),s.push("[Service]"),s.push(`Type=${t.type.trim()||"simple"}`),t.exec_start.trim()&&s.push(`ExecStart=${t.exec_start.trim()}`),t.working_dir.trim()&&s.push(`WorkingDirectory=${t.working_dir.trim()}`),t.user_.trim()&&s.push(`User=${t.user_.trim()}`),t.restart&&"no"!==t.restart&&s.push(`Restart=${t.restart.trim()}`),s.push(""),s.push("[Install]"),s.push(`WantedBy=${t.wanted.trim()||"multi-user.target"}`),s.push(""),s.join("\n")}function te(e){const t={description:"",type:"simple",exec_start:"",working_dir:"",user_:"root",restart:"no",wanted:"multi-user.target"},s=(t,s)=>{const n=e.split(/\r?\n/);let i=!1;for(const e of n){const n=e.trim(),r=n.match(/^\[(.*)\]$/);if(r){i=(r[1]||"").trim()===t;continue}if(!i)continue;const o=n.match(new RegExp(`^${s}\\s*=\\s*(.*)$`,"i"));if(o)return o[1].trim()}return""};return t.description=s("Unit","Description"),t.type=s("Service","Type")||"simple",t.exec_start=s("Service","ExecStart"),t.working_dir=s("Service","WorkingDirectory"),t.user_=s("Service","User"),t.restart=s("Service","Restart")||"no",t.wanted=s("Install","WantedBy")||"multi-user.target",t}function se(e){const{t}=(0,p.B)(),[s,i]=(0,n.useState)("form"),[r,o]=(0,n.useState)(()=>(e.unit_name||"").replace(/\.service$/i,"")),[c,l]=(0,n.useState)({description:"",type:"simple",exec_start:"",working_dir:"",user_:"root",restart:"no",wanted:"multi-user.target"}),[d,u]=(0,n.useState)(""),[h,m]=(0,n.useState)(""),[j,f]=(0,n.useState)(!1);(0,n.useEffect)(()=>{"edit"===e.mode&&e.unit_name&&(async()=>{f(!0);try{const t=await a.Yu.post("systemd/get/context",{unit_name:e.unit_name});if(t.code!==x.m.Success)return;const s=t.data.context??"",n=t.data.path??"";m(n),u(s),l(te(s))}finally{f(!1)}})()},[e.mode,e.unit_name]);const y=e=>{e!==s&&("text"===e?u(ee(r,c)):l(te(d)),i(e))},v=e=>t=>{l(s=>({...s,[e]:t}))};return(0,w.jsxs)("div",{children:[(0,w.jsxs)("div",{style:{display:"flex",gap:"0.4rem",marginBottom:"0.6rem"},children:[(0,w.jsx)("button",{className:"button button--flat "+("form"===s?"":"button--grey"),onClick:()=>y("form"),children:t("表单")}),(0,w.jsx)("button",{className:"button button--flat "+("text"===s?"":"button--grey"),onClick:()=>y("text"),children:t("文本")})]}),j?(0,w.jsx)("div",{children:t("加载中...")}):"form"===s?(0,w.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"0.6rem"},children:[(0,w.jsx)(g.BC,{label:t("服务名称"),children:(0,w.jsx)(g.Sm,{placeholder:t("服务名称"),value:r,disabled:"edit"===e.mode,handleInputChange:e=>o(e),width:"100%"})}),(0,w.jsx)(g.BC,{label:t("服务描述"),children:(0,w.jsx)(g.Sm,{placeholder:t("服务描述"),value:c.description,handleInputChange:v("description"),width:"100%"})}),(0,w.jsx)(g.BC,{label:t("启动命令"),required:!0,children:(0,w.jsx)(g.Sm,{placeholder:t("ExecStart 启动命令,必填"),value:c.exec_start,handleInputChange:v("exec_start"),width:"100%"})}),(0,w.jsx)(g.BC,{label:t("运行类型"),children:(0,w.jsx)(g.l6,{options:J,value:c.type,onChange:v("type")})}),(0,w.jsx)(g.BC,{label:t("工作目录"),children:(0,w.jsx)(g.Sm,{placeholder:t("工作目录(可选)"),value:c.working_dir,handleInputChange:v("working_dir"),width:"100%"})}),(0,w.jsx)(g.BC,{label:t("运行用户"),children:(0,w.jsx)(g.Sm,{placeholder:t("运行用户(可选)"),value:c.user_,handleInputChange:v("user_"),width:"100%"})}),(0,w.jsx)(g.BC,{label:t("重启策略"),children:(0,w.jsx)(g.l6,{options:O,value:c.restart,onChange:v("restart")})}),(0,w.jsx)(g.BC,{label:t("安装目标"),children:(0,w.jsx)(g.l6,{options:Q,value:c.wanted,onChange:v("wanted")})})]}):(0,w.jsx)("textarea",{className:"input--textarea input--no_border",style:{width:"100%",minHeight:"16rem",fontFamily:"monospace",fontSize:"0.85rem",boxSizing:"border-box"},value:d,onChange:e=>u(e.target.value),spellCheck:!1}),(0,w.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.4rem",marginTop:"0.6rem"},children:[(0,w.jsx)("button",{className:"button button--flat button--grey",disabled:j,onClick:e.onClose,children:t("取消")}),(0,w.jsx)("button",{className:"button button--flat",disabled:j,onClick:async()=>{if(!r.trim())return void(0,_.zN)(t("请填写服务名称"));const n=(i=r).trim().endsWith(".service")?i.trim():`${i.trim()}.service`;var i;const o="text"===s?d:ee(n,c);if(o.includes("ExecStart=")){f(!0);try{if("create"===e.mode){const e=`/etc/systemd/system/${n}`;await a.Yu.post("systemd/sys/save",{unit_name:n,path:e,context:o}),await a.Yu.post("systemd/sys/enable",{unit_name:n}),await a.Yu.post("systemd/add",{unit_name:n}),(0,_.SK)(t("添加成功"))}else await a.Yu.post("systemd/sys/save",{unit_name:n,path:h,context:o}),(0,_.SK)(t("保存成功"));e.onClose(),e.onDone?.()}catch(e){console.error("systemd 保存失败",e)}finally{f(!1)}}else(0,_.zN)(t("请至少填写 ExecStart 启动命令"))},children:t("保存")})]})]})}let ne,ie="";function re(e){const{t}=(0,p.B)(),{check_user_auth:s}=(0,S.MH)(),[o,f]=(0,m.fp)(j.AG.systemd_shell_show),[y,v]=(0,m.fp)(j.AG.confirm),[k,C]=(0,n.useState)(["pid","name","process",t("创建用户"),t("内存"),t("cpu%"),t("active状态"),t("选择")]),[A,P]=(0,n.useState)(["单元名字","加载状态",t("active(sub)状态"),t("描述"),t("选择")]),[Y,$]=(0,n.useState)([]),[I,M]=(0,n.useState)([]),[N,E]=(0,n.useState)([]),[K,B]=(0,n.useState)(!1),[H,Z]=(0,n.useState)([]),[G,D]=(0,n.useState)(""),[z,W]=(0,n.useState)(""),[T,X]=(0,n.useState)(new Set),[U,q]=(0,m.fp)(j.AG.editorSetting),[L,O]=(0,m.fp)(j.AG.prompt_card);(0,n.useEffect)(()=>{W(ie),(async()=>{$([]),E([]);const e=new c.hf(c.HK.systemd_inside_get);await l.ws.send(e),l.ws.addMsg(c.HK.systemd_inside_getting,e=>{const t=[];if(ie){for(const s of e.context)for(const e of s)if(`${e}`.includes(ie)){t.push(s);break}}else t.push(...e.context);$(t.map(e=>{const t=e.map((e,t)=>(0,w.jsx)(r.xP,{context:4===t?(0,V.v7)(e):e}));return t.push((0,w.jsx)(u.rA,{icon:"place",title:"选中",onClick:()=>{E(t)}})),t}))})})()},[]),(0,n.useEffect)(()=>{ie=z},[z]);const J=e=>{if(o.show){f({show:!1,unit_name:""});const e=new CustomEvent("cancel_systemd_logs",{detail:{}});document.dispatchEvent(e)}else f({show:!0,unit_name:e})},Q=async()=>{M([]),Z([]);const e=await a.Yu.get("systemd/inside/all");if(e.code!==x.m.Success)return;X(new Set(e.data));const t=await a.Yu.get("systemd/allget");if(t.code===x.m.Success){const e=t.data,s=[];for(const t of e??[]){const e=[(0,w.jsx)(r.xP,{context:t.unit}),t.load,`${t.active}(${t.sub})`,(0,w.jsx)(r.xP,{context:t.description})];s.push([...e,(0,w.jsx)(u.rA,{icon:"place",title:"添加",onClick:()=>{Z([...e])}})])}ne=s,M(s)}},ee=(e,s)=>{O({open:!0,title:t("create"===e?"新建 systemd 服务":"编辑 systemd 服务"),context_div:(0,w.jsx)(se,{mode:e,unit_name:s,onClose:()=>O({open:!1}),onDone:()=>{O({open:!1}),l.ws.send(new c.hf(c.HK.systemd_inside_get)),K&&Q(),E([]),Z([])}})})};return(0,w.jsxs)("div",{children:[(0,w.jsx)(d.aZ,{children:(0,w.jsx)(u.Z$,{defaultStatus:!1,text:t("系统systemd单元"),clickFun:e=>{B(e),e?(Q(),E([])):Z([])}})}),(0,w.jsxs)(d.aZ,{position:"right",children:[s(b.oV.systemd)&&(0,w.jsx)("div",{children:(0,w.jsx)(u.rA,{icon:"add_circle",title:t("添加 systemd"),onClick:()=>{ee("create")}})}),N.length>0&&(0,w.jsx)("div",{children:N[1].props.context}),H.length>0&&(0,w.jsx)("div",{children:H[0].props.context}),N.length>0&&(0,w.jsxs)("div",{children:[s(b.oV.systemd)&&(0,w.jsx)(u.rA,{icon:"remove",title:"从实时监控删除",onClick:()=>{(async e=>{v({open:!0,handle:async()=>{(await a.Yu.post("systemd/delete",{unit_name:e})).code===x.m.Success&&((0,_.SK)("删除成功"),v({open:!1,handle:null}))}})})(N[1].props.context)}}),s(b.oV.systemd)&&(0,w.jsx)(u.rA,{icon:"edit",title:"可视化编辑",onClick:()=>{ee("edit",N[1].props.context)}}),(0,w.jsx)(u.rA,{icon:"print",title:"打印日志",onClick:()=>{J(N[1].props.context)}})]}),H.length>0&&(0,w.jsxs)("div",{children:[s(b.oV.systemd)&&(0,w.jsx)(u.rA,{icon:"delete",title:"删除系统上的sytemd",onClick:()=>{(async e=>{v({open:!0,handle:async()=>{(await a.Yu.post("systemd/sys/delete",{unit_name:e})).code===x.m.Success&&((0,_.SK)("删除成功"),v({open:!1,handle:null}))}})})(H[0].props.context)}}),(0,w.jsx)(u.rA,{icon:"print",title:"打印日志",onClick:()=>{J(H[0].props.context)}}),s(b.oV.systemd)&&(0,w.jsx)(u.rA,{icon:"text_fields",title:"sytemd文件内容",onClick:()=>{(async t=>{const s=await a.Yu.post("systemd/get/context",{unit_name:t});s.code===x.m.Success&&(q({model:"text",open:!0,fileName:e.name,save:async e=>{const n={unit_name:t,path:s.data.path,context:e};(await a.Yu.post("systemd/sys/save",n)).code===x.m.Success&&(S.xK.set_value_temp(""),q({open:!1,model:"",fileName:"",save:null}))}}),S.xK.set_value_temp(s.data.context))})(H[0].props.context)}}),s(b.oV.systemd)&&!T.has(H[0].props.context)&&(0,w.jsx)(u.rA,{icon:"plus_one",title:"添加到管理",onClick:()=>(async e=>{const t=await a.Yu.post("systemd/add",{unit_name:e});t.code===x.m.Success&&(X(new Set(t.data)),(0,_.SK)("添加成功"))})(H[0].props.context)})]})]}),(0,w.jsxs)(i.xh,{children:[K&&(0,w.jsx)(i.fI,{children:(0,w.jsx)(i.VP,{widthPer:80,children:(0,w.jsx)(r.uF,{title:`systemd系统单元(${I.length})`,titleCom:(0,w.jsx)(g.Sm,{placeholder:"过滤单元",value:G,handleInputChange:e=>{D(e)},handlerEnter:()=>{const e=[];if(G){for(const t of ne)(t[0].props.context.includes(G)||t[3].props.context.includes(G))&&e.push(t);M(e)}else M(ne)}}),children:(0,w.jsx)(h.X,{headers:A,rows:I,width:"10rem"})})})}),0===Y.length&&!K&&(0,w.jsx)(F.h,{context:"没有管理的单元 or 加载中请等待..."}),0!==Y.length&&!K&&(0,w.jsx)(i.fI,{children:(0,w.jsx)(i.VP,{widthPer:80,children:(0,w.jsx)(r.uF,{title:`filecat监控单元(${Y.length})`,titleCom:(0,w.jsx)(g.Sm,{placeholder:"过滤单元",value:z,handleInputChange:e=>{W(e)}}),children:(0,w.jsx)(h.X,{headers:k,rows:Y,width:"10rem"})})})})]}),(0,w.jsx)(R,{})]})}function oe(){const{t:e}=(0,p.B)(),t=[{title:e("放行"),value:"allow"},{title:e("拒绝"),value:"deny"},{title:e("限速"),value:"limit"},{title:e("拒绝响应"),value:"reject"}],s=[{title:e("入站"),value:"in"},{title:e("出站"),value:"out"}],[o,c]=(0,n.useState)(null),[l,f]=(0,n.useState)("allow"),[y,v]=(0,n.useState)("in"),[k,S]=(0,n.useState)("tcp"),[b,C]=(0,n.useState)(""),[A,P]=(0,n.useState)(""),[V,Y]=(0,n.useState)("list"),[$,I]=(0,n.useState)([]),[M,N]=(0,n.useState)(""),[E,K]=(0,n.useState)(!1),[B,H]=(0,m.fp)(j.AG.confirm),Z=async()=>{try{const e=await a.V_.get("status");e.code===x.m.Success&&c(e.data)}catch(e){}},G=async()=>{K(!0);try{const e=await a.V_.get("rules");if(e.code===x.m.Success){const t=e.data;I(t?.rules??[]),N(t?.raw??"")}}catch(e){I([]),N("")}finally{K(!1)}};(0,n.useEffect)(()=>{Z(),G()},[]);const D=!0===o?.installed,z=!0===o?.active;return(0,w.jsxs)("div",{children:[(0,w.jsxs)(d.aZ,{position:"right",children:[(0,w.jsxs)("div",{children:[e("已安装"),": ",D?(0,w.jsx)("span",{style:{color:"green"},children:"✓"}):(0,w.jsx)("span",{style:{color:"red"},children:"✗"})]}),(0,w.jsxs)("div",{children:[e("已启用"),": ",z?(0,w.jsx)("span",{style:{color:"green"},children:"✓"}):(0,w.jsx)("span",{style:{color:"gray"},children:"✗"})]}),D&&(0,w.jsx)(u.rA,{icon:"power_settings_new",title:e(z?"停用":"启用"),onClick:()=>(async t=>{try{const s=await a.V_.post("enable",{enabled:t});if(s.code!==x.m.Success)return void(0,_.zN)(s.message||e("操作失败"));(0,_.SK)(s.data||e(t?"已启用":"已停用")),Z(),G()}catch(e){}})(!z)}),(0,w.jsx)(u.rA,{icon:"refresh",title:e("刷新规则"),onClick:G})]}),(0,w.jsxs)(i.xh,{children:[(0,w.jsx)(i.fI,{children:(0,w.jsx)(i.VP,{widthPer:35,children:(0,w.jsxs)(r.uF,{title:e("添加ufw规则"),titleCom:(0,w.jsx)(u.rA,{icon:"add",title:e("添加"),onClick:async()=>{if(b.trim())try{const t=await a.V_.post("rule/add",{action:l,direction:y,proto:k,port:b.trim(),from:"in"===y&&A.trim()||void 0});if(t.code!==x.m.Success)return void(0,_.zN)(t.message||e("操作失败"));(0,_.SK)(t.data||e("已添加")),G()}catch(e){}else(0,_.zN)(e("请填写端口号"))}}),children:[(0,w.jsx)(g.BC,{label:e("动作"),label_width:"4rem",input_max_width:"8rem",children:(0,w.jsx)(g.l6,{options:t,value:l,onChange:e=>f(e),defaultValue:"allow"})}),(0,w.jsx)(g.BC,{label:e("方向"),label_width:"4rem",input_max_width:"8rem",children:(0,w.jsx)(g.l6,{options:s,value:y,onChange:e=>v(e),defaultValue:"in"})}),(0,w.jsx)(g.BC,{label:e("协议"),label_width:"4rem",input_max_width:"8rem",children:(0,w.jsx)(g.l6,{options:[{title:"tcp",value:"tcp"},{title:"udp",value:"udp"}],value:k,onChange:e=>S(e),defaultValue:"tcp"})}),(0,w.jsx)(g.BC,{label:e("端口"),label_width:"4rem",required:!0,children:(0,w.jsx)(g.Sm,{maxWidth:"20rem",placeholder:e("可填范围如 1000:2000"),value:b,handleInputChange:e=>C(e)})}),"in"===y&&(0,w.jsx)(g.BC,{label:e("来源"),label_width:"4rem",children:(0,w.jsx)(g.Sm,{maxWidth:"20rem",placeholder:e("IP/网段,可选"),value:A,handleInputChange:e=>P(e)})})]})})}),(0,w.jsx)(i.fI,{children:(0,w.jsx)(i.VP,{widthPer:80,children:(0,w.jsxs)(r.uF,{title:e("规则列表"),titleCom:(0,w.jsxs)("div",{style:{display:"flex",gap:"0.4rem"},children:[(0,w.jsx)(u.C3,{text:e("名单视图"),clickFun:()=>Y("list")}),(0,w.jsx)(u.C3,{text:e("文本视图"),clickFun:()=>Y("text")})]}),children:[E&&(0,w.jsx)(F.h,{context:e("加载中...")}),!E&&"list"===V&&(0===$.length?(0,w.jsx)(F.h,{context:e("暂无规则")}):(0,w.jsx)(h.X,{headers:[e("编号"),e("目标(To)"),e("动作"),e("fw_from"),e("备注"),e("操作")],rows:$.map(t=>[t.number,(0,w.jsx)(r.xP,{context:t.to,tip_context:t.to}),t.action,t.from?(0,w.jsx)(r.xP,{context:t.from,tip_context:t.from}):"",t.description||"",(0,w.jsx)(u.rA,{icon:"delete",title:e("删除规则"),onClick:()=>(async(t,s,n)=>{H({open:!0,title:e("确定删除吗?"),sub_title:e(`${s} ${n}`),handle:async()=>{try{const s=await a.V_.post("ufw/rule/del",{number:t});if(s.code!==x.m.Success)return void(0,_.zN)(s.message||e("操作失败"));(0,_.SK)(s.data||e("规则已删除")),H({open:!1,handle:null}),G()}catch(e){}}})})(t.number,t.to,t.from)})]),width:"8rem"})),!E&&"text"===V&&(M?(0,w.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",fontSize:"0.85rem",margin:0},children:M}):(0,w.jsx)(F.h,{context:e("暂无规则")}))]})})})]})]})}function ce(e){const{t}=(0,p.B)(),[s,n]=(0,m.fp)(j.AG.user_base_info),r=[{index:1,name:t("系统性能"),rto:"sys/",component:(0,w.jsx)($,{})},{index:2,name:t("系统进程"),rto:"process/",component:(0,w.jsx)(q,{})},{index:3,name:t("doc_ct"),rto:"docker/",component:(0,w.jsx)(z,{})}];if(s.sys===b.XM.linux){(s.user_data?.is_root||(s.user_data?.auth_list??[]).includes(b.oV.systemd))&&r.push({index:4,name:t("systemd"),rto:"systemd/",component:(0,w.jsx)(re,{})});(s.user_data?.is_root||(s.user_data?.auth_list??[]).includes(b.oV.firewall))&&s.sysSoftWare?.[f.jk.ufw]?.installed&&r.push({index:5,name:t("防火墙"),rto:"firewall/",component:(0,w.jsx)(oe,{})})}return(0,w.jsx)(i.W1,{optionList:r,father_route:H.o.info})}}}]);
|