filecat 6.67.1 → 6.67.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dist/1384.161648dee57d2dc24774.js +1 -0
- package/build/dist/{1472.9e05a1e9497ac2d82d6f.js → 1472.de2b1c3a9e8fda0034d4.js} +1 -1
- package/build/dist/2351.4e4083ef34e56b749945.js +1 -0
- package/build/dist/2851.299da14729933754cb28.js +1 -0
- package/build/dist/4091.c5fe7b19156391f0531f.js +1 -0
- package/build/dist/676.b8b34f9a4887c29ce00d.js +1 -0
- package/build/dist/7181.266e5f360fd66da27dda.js +1 -0
- package/build/dist/index.html +1 -1
- package/build/dist/main.8c116bf496e7441faee5.js +2 -0
- package/build/main.js +1 -1
- package/package.json +1 -1
- package/build/dist/1384.3138b56fd880b4ef6b5a.js +0 -1
- package/build/dist/2851.6570385ed3b21d196648.js +0 -1
- package/build/dist/3345.9c2f5ecefdb4d58ac3c1.js +0 -1
- package/build/dist/4091.98a37edf8f05b8b8a0e7.js +0 -1
- package/build/dist/676.59a6aae24e044a731ead.js +0 -1
- package/build/dist/7181.830061f438f0682ad112.js +0 -1
- package/build/dist/main.ab70755b677fb8e89fe8.js +0 -2
- /package/build/dist/{main.ab70755b677fb8e89fe8.js.LICENSE.txt → main.8c116bf496e7441faee5.js.LICENSE.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[1472],{77481(e,t,s){s.d(t,{S:()=>a,X:()=>o});var n=s(96540),i=s(61443),l=s(74848);function o(e){const[t,s]=n.useState([]),o=(0,n.useRef)(-1),[a,r]=(0,n.useState)(-1),[c,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 h=()=>{o.current=-1,r(-1),d(-1)};return(0,l.jsxs)("table",{children:[(0,l.jsx)("thead",{children:(0,l.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,l.jsx)("th",{className:n?"table-filter-col":"",children:n?(0,l.jsx)(i.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:o}):t},s)})})}),(0,l.jsx)("tbody",{children:t.map((t,s)=>{const n=!!e.onRowDrag;return(0,l.jsx)("tr",{className:n?(a===s?"row-dragging":"")+(c===s?" row-drop-target":""):"",draggable:n,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{n&&(o.current=s,r(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=c;h(),t<0||s<0||t===s||e.onRowDrag?.(t,s)})())},onDragEnd:h,children:t.map((s,n)=>{const i=n===t.length-1?"small":"";return(0,l.jsx)("td",{className:i,style:{width:e.width??"auto"},children:s},n)})},s)})})]})}function a(e){return(0,l.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,l.jsx)("div",{children:e},t))})}},61472(e,t,s){s.r(t),s.d(t,{default:()=>D});var n=s(96540),i=s(75725),l=s(23430),o=s(70447),a=s(85997),r=s(61443),c=s(14284),d=s(53459),h=s(77481),u=s(86149),p=s(82893),_=s(40505),x=s(62042),m=s(21499),j=s(21469),v=s(64694),f=s(74848);function g(e){const{t}=(0,u.B)(),[s,l]=(0,n.useState)([]);(0,n.useEffect)(()=>{(async()=>{if(e.getItems){const t=await e.getItems();l(t)}})()},[]);return(0,f.jsx)(i.xh,{children:(0,f.jsx)(o.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e.title}),e.info_click&&(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{e.info_click()},title:"信息"})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"add",title:t("添加"),onClick:()=>{const t=[];for(let s=0;s<e.headers.length-1;s++)t.push("");l([t,...s])}}),(0,f.jsx)(a.rA,{icon:"save",title:t("保存"),onClick:async()=>{e.save&&await e.save(s)}})]}),children:(0,f.jsx)(h.X,{headers:e.headers,rows:s.map((n,i)=>{const o=[];for(let t=0;t<e.headers.length;t++)o.push((0,f.jsx)(r.Sm,{value:n[t],handleInputChange:e=>{n[t]=e,l([...s])},no_border:!0}));return o.push((0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"delete",title:t("删除"),onClick:()=>(e=>{s.splice(e,1),l([...s])})(i)}),n[0]&&(0,f.jsx)(a.rA,{icon:"content_copy",title:t("复制地址"),onClick:()=>{const e=(0,m.bi)(`${window.location.origin}${j.m.base_url}`,n[0]);(0,_.lW)(e),(0,x.SK)(e)}}),n[0]&&e.need_copy&&(0,f.jsx)(a.rA,{icon:"open_in_new",title:t("打开新页面"),onClick:()=>{const e=(0,m.bi)(`${window.location.origin}${j.m.base_url}`,n[0]);window.open(e)}})]})),o}),width:"10rem",onRowDrag:(e,t)=>{l((0,v.TI)(s,e,t))}})})})}var w=s(34843),S=s(78247),C=s(24659);function y(){const{t:e}=(0,u.B)(),[t,s]=(0,w.fp)(p.AG.prompt_card),l=(0,C.K)(),g=[e("路由"),e("auth"),e("备注")],[y,k]=(0,w.fp)(p.AG.editorSetting),[b,A]=(0,n.useState)([]);(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("api/customer_router");e.code===d.m.Success&&A(e.data)})()},[]);return(0,f.jsx)(i.xh,{children:(0,f.jsx)(o.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("自定义api路由")})," ",(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{(()=>{let e=(0,f.jsx)("div",{children:'默认需要以 "/api" 开头的路由。'});s({open:!0,title:"信息",context_div:(0,f.jsx)("div",{children:e})})})()},title:"信息"})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{A([{note:"",needAuth:!1,router:""},...b])}}),(0,f.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("api/customer_router/save",b)).code===d.m.Success&&(0,x.SK)("保存成功")}})]}),children:(0,f.jsx)(h.X,{headers:g,rows:b.map((t,s)=>{const n=[(0,f.jsx)(r.Sm,{value:t.router,handleInputChange:e=>{t.router=e,A([...b])},no_border:!0}),(0,f.jsx)(r.l6,{defaultValue:t.needAuth,onChange:e=>{t.needAuth=e,A([...b])},options:l,no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e,A([...b])},no_border:!0}),(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{b.splice(e,1),A([...b])})(s)}),(0,f.jsx)(a.rA,{icon:"edit",title:e("编辑"),onClick:()=>(async e=>{if(!e.router)return void(0,x.zN)("路由不能为空");const t=await c.XO.get(`jscode/${encodeURIComponent(e.router)}`);k({model:"ace/mode/javascript",open:!0,fileName:e.router,save:async t=>{const s={context:t,router:e.router};(await c.XO.post("jscode/save",s)).code===d.m.Success&&(S.xK.set_value_temp(""),k({open:!1,model:"",fileName:"",save:null}),(0,x.SK)("成功"))}}),S.xK.set_value_temp(t.data)})(t)}),t.router&&(0,f.jsx)(a.rA,{icon:"content_copy",title:e("复制地址"),onClick:()=>{(0,_.lW)((0,m.bi)(window.location.origin+j.m.base_url,t.router)),(0,x.SK)(e("已复制"))}})]})];return n}),width:"10rem",onRowDrag:(e,t)=>{A((0,v.TI)(b,e,t))}})})})}var k=s(23496),b=s(4412);function A(){const{t:e}=(0,u.B)(),[t,s]=(0,w.fp)(p.AG.prompt_card),[l,o]=(0,w.fp)(p.AG.router_jump),a=[e("路由"),e("路径"),e("过期时间(s)"),e("备注")],r=[e("路由"),e("文件路径"),"token","user id",e("备注")];return(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(b.aZ,{position:"right"}),(0,f.jsxs)(i.fI,{children:[(0,f.jsxs)(i.VP,{children:[(0,f.jsx)(g,{title:e("页面资源路由"),headers:a,getItems:async()=>{const e=await c.XO.get(k.s.setting_customer_router);if(e.code===d.m.Success){if(l?.page_self_router_api_data){for(const t of e.data)t[1]===l?.page_self_router_api_data[1]&&(0,x.N9)("已经存在的页面资源路由配置目录设置");const t={};Object.assign(t,l?.page_self_router_api_data),e.data=[t,...e.data],o({})}return e.data}return[]},save:async e=>{(await c.XO.post(k.s.setting_customer_router_save,e)).code===d.m.Success&&(0,x.SK)("success")},info_click:()=>{let e=(0,f.jsx)("div",{children:'默认需要以 "/api" 开头的路由,会自动识别地址,将页面转到对应结果。路径支持文件路径(如果是文件夹路径的最后最后一个名字将会成为资源实际地址,整个目录将会变成一个http目录),http地址。'});s({open:!0,title:"信息",context_div:(0,f.jsx)("div",{children:e})})},need_copy:!0}),(0,f.jsx)(g,{title:e("workflow触发路由"),headers:r,getItems:async()=>{const e=await c.XO.get(k.s.setting_customer_workflow_router);return e.code===d.m.Success?e.data:[]},save:async e=>{(await c.XO.post(k.s.setting_customer_workflow_router_save,e)).code===d.m.Success&&(0,x.SK)("保存成功")},info_click:()=>{let e=(0,f.jsx)("div",{children:'默认需要以 "/api" 开头的路由,文件路径是有效的workflow路径。token也可以是文件绝对路径,请求的时候请设置同样的authorization请求头字段。'});s({open:!0,title:"信息",context_div:(0,f.jsx)("div",{children:e})})}})]}),(0,f.jsx)(i.VP,{children:(0,f.jsx)(y,{})})]})]})}var I=s(74777),V=s(6960),X=s(7523);function N(){const{t:e}=(0,u.B)(),{check_user_auth:t}=(0,S.MH)(),[s,i]=(0,n.useState)(!1),[h,_]=(0,n.useState)("https://registry.npmjs.org"),[m,j]=(0,n.useState)(""),[v,g]=(0,n.useState)(180),[C,y]=(0,n.useState)(!1),[k,b]=(0,w.fp)(p.AG.prompt_card);(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("auto_upgrade_setting");if(e.code===d.m.Success){const t=e.data;i(t.open||!1),_(t.version_check_url||"https://registry.npmjs.org"),j(t.exe_download_url||""),g(t.check_interval_seconds||180)}})()},[]);return t(l.oV.sys_setting_page)?(0,f.jsxs)(o.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("自动升级")}),(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{b({open:!0,title:e("信息"),context_div:(0,f.jsx)("div",{children:e("自动升级在 windows 下目前可能不稳定")})})},title:e("信息")})]}),rightBottomCom:(0,f.jsx)(a.C3,{text:e("保存"),clickFun:async()=>{if(!h)return void(0,x.zN)(e("版本检测地址不能为空"));if(s&&(!v||v<10))return void(0,x.zN)(e("检测间隔不能小于10秒"));const t=new I.Mm;t.open=s,t.version_check_url=h,t.exe_download_url=m,t.check_interval_seconds=v;(await c.XO.post("auto_upgrade_setting/save",t)).code===d.m.Success&&(0,x.SK)(e("保存成功"))}}),children:[(0,f.jsx)("div",{children:e("系统版本检测地址")}),(0,f.jsx)(r.Sm,{placeholder:"https://registry.npmjs.org",value:h,handleInputChange:e=>{_(e)}}),(0,f.jsx)(r.l6,{value:s,onChange:e=>{i(e)},options:[{title:e("开启"),value:!0},{title:e("关闭"),value:!1}]}),s&&(0,f.jsxs)(f.Fragment,{children:[!1,(0,f.jsx)("div",{children:e("检测频率(秒)")}),(0,f.jsx)(r.Sm,{placeholder:e("默认180秒(3分钟)"),value:v,handleInputChange:e=>{g(Number(e)||180)}}),(0,f.jsx)("div",{style:{marginTop:"12px"},children:(0,f.jsx)(a.C3,{text:e(C?"升级检测中...":"立即升级"),clickFun:async()=>{y(!0);try{(await c.XO.post("auto_upgrade_setting/upgrade_now",{})).code===d.m.Success&&(0,x.SK)(e("已触发升级检测,请查看服务端日志"))}catch(t){(0,x.zN)(e("触发升级失败"))}finally{y(!1)}}})})]})]}):null}function O(){const[e,t]=(0,n.useState)(""),[s,l]=(0,n.useState)(""),[_,m]=(0,n.useState)(!1),[j,v]=(0,n.useState)(""),[g,C]=(0,n.useState)(!1),[y,A]=(0,n.useState)(""),[O,F]=(0,w.fp)(p.AG.prompt_card),[K,z]=(0,n.useState)(!1),[P,B]=(0,n.useState)(""),[T,M]=(0,n.useState)(""),[$,D]=(0,n.useState)(I.aM.close),[E,G]=(0,n.useState)(!1),[H,R]=(0,n.useState)(void 0),{t:q,i18n:U}=(0,u.B)(),[Z,W]=(0,w.fp)(p.AG.user_base_info),{check_user_auth:L}=(0,S.MH)(),{initUserInfo:Q}=(0,n.useContext)(X.F);(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("sys_option/status");if(e.code===d.m.Success){C(e.data.recycle_open),A(e.data.recycle_dir);const s=e.data.sys_env;t(s?.web_site_title),l(s?.logo||""),m(s?.show_login_user_info),v(s?.http_proxy||"");const n=e.data.https_setting;n&&(z(n.open),B(n.cert_path||""),M(n.key_path||""))}const s=await c.XO.get("token");if(s.code===d.m.Success){const e=s.data;if(!e)return;e.length&&R(e.length),e.mode&&D(e.mode),void 0!==e.persist&&G(e.persist)}})()},[]);return(0,f.jsxs)("div",{children:[(0,f.jsx)(b.aZ,{children:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("span",{className:"credits",children:[q("系统运行于"),": ",(0,V.s)(Z.runing_time_length)]}),(0,f.jsx)("span",{className:"credits",children:(0,f.jsxs)("a",{href:"https://github.com/xiaobaidadada/filecat",target:"_blank",children:["version:6.67.1",null!=Z.latest_version&&"6.67.1"!==Z.latest_version?` -> ${Z.latest_version}`:""]})}),(0,f.jsx)("span",{className:"credits",children:(0,f.jsx)("a",{href:q("官网地址"),target:"_blank",children:`filecat ${q("功能文档")}`})}),(0,f.jsxs)("span",{className:"credits",children:[q("安装方式")," :",Z.process_env_run_env]})]})}),(0,f.jsx)(i.xh,{children:(0,f.jsxs)(i.fI,{children:[(0,f.jsxs)(i.VP,{widthPer:33,children:[(0,f.jsxs)(o.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:q("通用设置")})," ",(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{F({open:!0,title:q("信息"),context_div:(0,f.jsx)("div",{children:q("HTTP 代理说明")})})},title:q("信息")})]}),rightBottomCom:(0,f.jsx)(a.C3,{text:q("确定修改"),clickFun:async()=>{(await c.XO.post(k.s.setting_sys_option_status_save,{type:I.Mu.sys_env,value:{web_site_title:e,show_login_user_info:_,http_proxy:j,logo:s}})).code===d.m.Success&&((0,x.SK)("修改成功"),Q())}}),children:[q("网站标题"),(0,f.jsx)(r.Sm,{value:e,handleInputChange:e=>{t(e)}}),q("网站 Logo"),(0,f.jsx)(r.Sm,{placeholder:q("本地文件路径或 http(s) 图片地址"),value:s,handleInputChange:e=>{l(e)}}),(0,f.jsx)("div",{children:q("HTTP 代理地址")}),(0,f.jsx)(r.Sm,{placeholder:"http://127.0.0.1:7890",value:j,handleInputChange:e=>{v(e)}}),q("登陆展示用户信息"),(0,f.jsx)("input",{type:"checkbox",checked:_,onChange:()=>{m(!_)}})]}),(0,f.jsxs)(o.Zp,{title:q("HTTPS 设置"),rightBottomCom:(0,f.jsx)(a.C3,{text:q("确定修改"),clickFun:async()=>{if(K){if(!P)return void(0,x.zN)("证书路径不能为空");if(!T)return void(0,x.zN)("私钥路径不能为空")}const e=new I.CH;e.open=K,e.cert_path=P,e.key_path=T;(await c.XO.post(k.s.setting_sys_option_status_save,{type:I.Mu.https,value:e,open:K})).code===d.m.Success&&(0,x.SK)("HTTPS 设置已保存,需重启服务器才能生效")}}),children:[(0,f.jsx)(r.l6,{value:K,onChange:e=>{z(e)},options:[{title:q("开启"),value:!0},{title:q("关闭"),value:!1}]}),K&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{children:q("SSL 证书路径")}),(0,f.jsx)(r.Sm,{placeholder:q("证书文件路径(cert.pem/fullchain.pem)"),value:P,handleInputChange:e=>{B(e)}}),(0,f.jsx)("div",{children:q("SSL 私钥路径")}),(0,f.jsx)(r.Sm,{placeholder:q("私钥文件路径(privkey.pem)"),value:T,handleInputChange:e=>{M(e)}})]})]}),(0,f.jsx)(N,{})]}),(0,f.jsxs)(i.VP,{widthPer:33,children:[(0,f.jsxs)(o.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:q("文件回收站")})," ",(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{F({open:!0,title:q("信息"),context_div:(0,f.jsx)("div",{children:q("格式:[被删除的文件所在父目录] 回收站目录 [; ...]")})})},title:q("信息")})]}),rightBottomCom:(0,f.jsx)(a.C3,{text:q("确定修改"),clickFun:async()=>{if(g&&!y)return void(0,x.zN)("目录不能为空");(await c.XO.post(k.s.setting_sys_option_status_save,{type:I.Mu.cyc,value:y,open:g})).code===d.m.Success&&(0,x.SK)("修改成功")}}),children:[(0,f.jsx)(r.Sm,{placeholder:q("目录"),value:y,handleInputChange:e=>{A(e)}}),(0,f.jsx)(r.l6,{value:g,onChange:e=>{C(e)},options:[{title:q("开启"),value:!0},{title:q("关闭"),value:!1}]})]}),(0,f.jsxs)(o.Zp,{title:q("token过期时间"),rightBottomCom:(0,f.jsx)(h.S,{isFlex:!0,columns:[(0,f.jsx)(a.C3,{text:q("清空token"),clickFun:async()=>{(await c.XO.get("token/clear")).code===d.m.Success&&(0,x.SK)("清理完成,重新登录")}}),(0,f.jsx)(a.C3,{text:q("保存"),clickFun:async()=>{const e=new I.Gd;e.mode=$,e.persist=E,I.aM.length!==e.mode||H||(0,x.zN)("秒数不能为空"),e.length=parseInt(H);(await c.XO.post("token/save",e)).code===d.m.Success&&(0,x.SK)("保存成功")}})]}),children:[(0,f.jsx)(h.S,{isFlex:!0,columns:[(0,f.jsx)(r.U6,{value:1,context:q("关闭"),selected:$===I.aM.close,onchange:()=>{D(I.aM.close)}}),(0,f.jsx)(r.U6,{value:1,context:q("指定时间"),selected:$===I.aM.length,onchange:()=>{D(I.aM.length)}}),(0,f.jsx)(r.U6,{value:1,context:q("永不过期"),selected:$===I.aM.forver,onchange:()=>{D(I.aM.forver)}})]}),$===I.aM.length&&(0,f.jsx)(r.Sm,{placeholder:q("秒"),value:H,handleInputChange:e=>{R(e)}}),(0,f.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:6,marginTop:8,whiteSpace:"nowrap"},children:[(0,f.jsx)("input",{type:"checkbox",checked:E,onChange:()=>G(!E)}),q("持久化")]})]})]})]})})]})}var F=s(92350);function K(){const{t:e,i18n:t}=(0,u.B)(),{initUserInfo:s,reloadUserInfo:l}=(0,n.useContext)(X.F),[_,m]=(0,n.useState)([]),[j,g]=(0,n.useState)([]),[y,k]=(0,w.fp)(p.AG.prompt_card),[,b]=(0,w.fp)(p.AG.editorSetting),[A,I]=(0,n.useState)([]),[V,N]=(0,n.useState)([]),[O,K]=(0,n.useState)([]),[z,P]=(0,n.useState)([]),[B,T]=(0,n.useState)(""),[M,$]=(0,n.useState)([]),D=(0,C.K)(),E=[e("软件"),e("是否安装"),e("路径")],G=[e("编号"),e("路径"),e("备注")],H=[e("编号"),e("路径"),e("是否开启"),e("备注")],R=[e("编号"),e("文件路径"),e("是否开启"),e("系统启动执行"),e("corn表达式"),e("用户id"),e("备注")],q=[e("编号"),e("路径"),e("单用户并发数量"),e("系统并发数量"),e("是否开启大文件断点"),e("大文件判断大小MB"),e("大文件并发数量"),e("大文件分块大小MB"),e("备注")],U=[e("编号"),e("名称"),e("路径"),e("是否开启"),e("params"),e("备注")],{check_user_auth:Z}=(0,S.MH)(),W=async()=>{const e=await c.XO.get("env/path/get");e.code===d.m.Success&&K(e.data)},L=async()=>{const e=await c.XO.get("workflow_setting_get");e.code===d.m.Success&&P(e.data)};(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("outside/software/get");e.code===d.m.Success&&g(e.data);const t=await c.XO.get("pty_cmd");t.code===d.m.Success&&T(t.data),W(),L();const s=await c.XO.get("protection_dir/sys");s.code===d.m.Success&&I(s.data??[]);const n=await c.XO.get("dir_upload_max_num");n.code===d.m.Success&&N(n.data??[]);const i=await c.XO.get("plugin/list");i.code===d.m.Success&&$(i.data??[])})()},[]);const Q=(0,F.Q)(),J=async()=>{(await c.XO.post("plugin/list/save",M)).code===d.m.Success&&(0,x.SK)(e("保存成功"))};return(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(i.J,{widthPer:100,children:(0,f.jsx)(o.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("文件上传最大并发限制")})," ",(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{Q("文件上传")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{N([...V,{path:"",note:"",user_upload_num:2,sys_upload_num:6,ws_file_standard_size:52428800,ws_file_parallel_num:2,ws_file_block_mb_size:524288}])}}),(0,f.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{for(const e of V)if(e.open_ws_file){if("number"!=typeof e.ws_file_block_mb_size)return void(0,x.zN)(`编号:${e.index??""} 文件块的大小设置有问题`);if("number"!=typeof e.ws_file_parallel_num)return void(0,x.zN)(`编号:${e.index??""} 并发数量设置有问题`);if("number"!=typeof e.ws_file_standard_size)return void(0,x.zN)(`编号:${e.index??""} 大文件size设置有问题`)}(0,v.di)(V,e=>e.index??0);(await c.XO.post("dir_upload_max_num/save",V)).code===d.m.Success&&((0,x.SK)("保存成功"),l())}})]}),children:(0,f.jsx)(h.X,{headers:q,rows:V.map((t,s)=>{const n=[(0,f.jsx)(r.Sm,{value:t.index,placeholder:s,handleInputChange:e=>{t.index=parseInt(e)},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.user_upload_num,handleInputChange:e=>{t.user_upload_num=parseInt(e)},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.sys_upload_num,handleInputChange:e=>{t.sys_upload_num=parseInt(e)},no_border:!0}),(0,f.jsx)(r.l6,{value:!0===t.open_ws_file,onChange:e=>{t.open_ws_file=e,N([...V])},options:D,no_border:!0}),(0,f.jsx)(r.Sm,{value:"number"==typeof t.ws_file_standard_size?t.ws_file_standard_size/1024/1024:void 0,handleInputChange:e=>{t.ws_file_standard_size=1024*parseInt(e)*1024},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.ws_file_parallel_num,handleInputChange:e=>{t.ws_file_parallel_num=parseInt(e)},no_border:!0}),(0,f.jsx)(r.Sm,{value:"number"==typeof t.ws_file_block_mb_size?t.ws_file_block_mb_size/1024/1024:void 0,handleInputChange:e=>{t.ws_file_block_mb_size=1024*parseInt(e)*1024},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{V.splice(e,1),N([...V])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{N((0,v.TI)(V,e,t))}})})}),(0,f.jsxs)(i.fI,{children:[(0,f.jsx)(i.VP,{widthPer:50,children:(0,f.jsxs)(i.xh,{children:[(0,f.jsx)(o.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("PATH")}),(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{Q("环境路径")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"list",title:e("查看"),onClick:async()=>{const t=await c.XO.get("env/process/view");t.code===d.m.Success?k({open:!0,title:e("进程环境变量"),context_div:(0,f.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",maxHeight:"60vh",overflow:"auto",margin:0,fontSize:"0.85rem",lineHeight:"1.5"},children:t.data})}):(0,x.zN)(e("获取失败"))}}),(0,f.jsx)(a.rA,{icon:"edit",title:e("编辑"),onClick:async()=>{const t=await c.XO.get("env/process/get");t.code===d.m.Success?(S.xK.set_value_temp(t.data??""),b({model:"ace/mode/ini",open:!0,fileName:"",save:async t=>{(await c.XO.post("env/process/save",{text:t})).code===d.m.Success?(0,x.SK)(e("保存成功")):(0,x.zN)(e("保存失败")),S.xK.set_value_temp("")}})):(0,x.zN)(e("获取失败"))}}),(0,f.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{K([...O,{path:"",note:""}])}}),(0,f.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("env/path/save",{paths:O})).code===d.m.Success&&((0,x.SK)("保存成功"),W(),s())}})]}),children:(0,f.jsx)(h.X,{headers:H,rows:O.map((t,s)=>{const n=[(0,f.jsx)("div",{children:s}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,f.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,K([...O])},options:D,no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{O.splice(e,1),K([...O])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{K((0,v.TI)(O,e,t))}})}),(0,f.jsx)(o.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("PTY CMD")}),(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{Q("pty")},title:e("信息")})]}),rightBottomCom:(0,f.jsx)(a.C3,{text:e("更新"),clickFun:async()=>{(await c.XO.post("pty_cmd/save",{str:B})).code===d.m.Success&&((0,x.SK)("保存成功"),l())}}),children:(0,f.jsx)(r.Sm,{placeholder:e("cmd need pty env"),value:B,handleInputChange:e=>{T(e)}})}),(0,f.jsx)(o.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("Workflow Job")}),(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{Q("Workflow")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{P([...z,{open:!1}])}}),(0,f.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("workflow_setting_save",z)).code===d.m.Success&&((0,x.SK)("ok"),L())}})]}),children:(0,f.jsx)(h.X,{headers:R,rows:z.map((t,s)=>{const n=[(0,f.jsx)("div",{children:s}),(0,f.jsx)(r.Sm,{value:t.file_path,handleInputChange:e=>{t.file_path=e},no_border:!0}),(0,f.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,P([...z])},options:D,no_border:!0}),(0,f.jsx)(r.l6,{value:!!t.sys_power_on,onChange:e=>{t.sys_power_on=e,P([...z])},options:D,no_border:!0}),(0,f.jsx)(r.Sm,{value:t.cron_str,handleInputChange:e=>{t.cron_str=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.user_id,handleInputChange:e=>{t.user_id=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{z.splice(e,1),P([...z])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{P((0,v.TI)(z,e,t))}})}),(0,f.jsx)(o.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("插件配置")}),(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{Q("插件配置")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{$([...M,{name:"",path:"",note:"",open:!1}])}}),(0,f.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:J})]}),children:(0,f.jsx)(h.X,{headers:U,rows:M.map((t,s)=>{const n=[s,(0,f.jsx)(r.Sm,{value:t.name,handleInputChange:e=>{t.name=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,f.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,$([...M])},options:D,no_border:!0}),(0,f.jsx)(a.mu,{icon:"edit",save:async e=>{t.params=e,await J()},title:""}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{M.splice(e,1),$([...M])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{$((0,v.TI)(M,e,t))}})})]})}),(0,f.jsx)(i.VP,{children:(0,f.jsxs)(i.xh,{children:[(0,f.jsx)(o.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("系统保护路径")})," ",(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{Q("保护目录")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{I([...A,{path:"",note:""}])}}),(0,f.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("protection_dir/sys/save",A)).code===d.m.Success&&((0,x.SK)("保存成功"),l())}})]}),children:(0,f.jsx)(h.X,{headers:G,rows:A.map((t,s)=>{const n=[(0,f.jsx)("div",{children:s}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{A.splice(e,1),I([...A])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{I((0,v.TI)(A,e,t))}})}),(0,f.jsx)(o.uF,{title:e("外部软件"),titleCom:(0,f.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("outside/software/save",j)).code===d.m.Success&&((0,x.SK)("保存成功"),s())}}),children:(0,f.jsx)(h.X,{headers:E,rows:j.map((t,s)=>[(0,f.jsx)("div",{children:t.id}),(0,f.jsx)(o.fq,{ok:t.installed}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0,placeholder:e("默认使用环境变量")}),(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{Q(t.id)},title:e("信息")})]),width:"10rem"})})]})})]})]})}function z(e){const{t,i18n:s}=(0,u.B)(),[i,o]=(0,w.fp)(p.AG.user_base_info),a=[{title:t("用户权限"),list:[{title:t("用户管理"),permission:l.oV.user_manage},{title:t("角色管理"),permission:l.oV.role_manage}]},{title:t("系统管理权限"),list:[{title:t("系统信息"),permission:l.oV.all_sys},{title:t("系统进程关闭"),permission:l.oV.sys_process_close},{title:t("docker容器停止、删除"),permission:l.oV.docker_container_update},{title:t("docker镜像删除"),permission:l.oV.docker_images_delete},{title:t("systemd管理"),permission:l.oV.systemd},{title:t("防火墙管理"),permission:l.oV.firewall}]},{title:t("网络功能权限"),list:[{title:t("系统网络"),permission:l.oV.vir_net},{title:t("内网穿透"),permission:l.oV.tcp_proxy},{title:"ddns",permission:l.oV.ddns}]},{title:t("Ai 设置权限"),list:[{title:t("Ai 配置"),permission:l.oV.ai_agent_setting},{title:t("Ai Chat Page"),permission:l.oV.ai_agent_page},{title:t("允许切换 AI 模型"),permission:l.oV.ai_model_switch}]},{title:t("文件权限"),list:[{title:t("文件删除、剪切、重命名"),permission:l.oV.filecat_file_delete_cut_rename},{title:t("文件创建、上传、内容更新、解压缩"),permission:l.oV.filecat_file_context_update_upload_created_copy_decompression},{title:t("内容更新"),permission:l.oV.filecat_file_context_update},{title:t("文件回收站修改"),permission:l.oV.recycle_file_save},{title:t("文件分享"),permission:l.oV.share_file}]},{title:t("系统设置权限"),list:[{title:t("系统页面"),permission:l.oV.sys_setting_page},{title:t("htts"),permission:l.oV.https_file},{title:t("token时间修改"),permission:l.oV.token_update},{title:t("修改密码"),permission:l.oV.update_password},{title:t("磁盘挂载"),permission:l.oV.sys_disk_mount},{title:t("通用设置"),permission:l.oV.sys_env_setting_key},{title:t("MD 编辑器设置"),permission:l.oV.md_editor_setting}]},{title:t("系统环境设置"),list:[{title:t("系统环境设置页面"),permission:l.oV.sys_env_page},{title:t("目录文件上传数量限制修改"),permission:l.oV.dir_upload_max_num},{title:t("PATH路径修改"),permission:l.oV.env_path_update},{title:"pty cmd "+t("更新"),permission:l.oV.pty_cmd_update},{title:"workflow job",permission:l.oV.workflow_job},{title:t("系统保护路径更新"),permission:l.oV.sys_protection_dir},{title:t("外部软件路径"),permission:l.oV.outside_software_path}]},{title:t("个人环境设置"),list:[{title:t("个性化设置"),permission:l.oV.private_sys_env}]},{title:t("自定义路由"),list:[{title:t("自定义路由页面"),permission:l.oV.auth_router_page},{title:t("workflow触发api 修改"),permission:l.oV.workflow_api},{title:t("自定义资源路由"),permission:l.oV.code_resource},{title:t("自定义api路由"),permission:l.oV.code_api}]},{title:t("标签编辑权限"),list:[{title:t("ssh代理"),permission:l.oV.ssh_proxy_tag_update},{title:t("http代理"),permission:l.oV.http_proxy_tag_update},{title:t("浏览器代理"),permission:l.oV.browser_proxy_tag_update},{title:t("rdp代理"),permission:l.oV.rdp_proxy_tag_update},{title:t("网络唤醒"),permission:l.oV.wol_proxy_tag_update},{title:t("rtsp播放器"),permission:l.oV.rtsp_proxy_tag_update}]},{title:t("代理功能"),list:[{title:t("ssh代理"),permission:l.oV.ssh_proxy},{title:t("http代理"),permission:l.oV.http_proxy},{title:t("http代理下载关闭"),permission:l.oV.http_proxy_download_cancel},{title:t("浏览器代理"),permission:l.oV.browser_proxy},{title:t("rdp代理"),permission:l.oV.rdp_proxy}]},{title:t("其他功能"),list:[{title:t("workflow 执行"),permission:l.oV.workflow_exe},{title:t("workflow 执行用户"),permission:l.oV.workflow_exe_user,noDisable:!0},{title:t("网络唤醒"),permission:l.oV.wol_proxy},{title:t("端口扫描"),permission:l.oV.port_scan},{title:t("rtsp播放器"),permission:l.oV.rtsp_proxy},{title:t("ssh密钥保存到磁盘"),permission:l.oV.crypto_ssh_file},{title:t("filecat-restart重启命令"),permission:l.oV.shell_cmd_filecat_restart},{title:t("filecat-upgrade升级命令"),permission:l.oV.shell_cmd_filecat_upgrade},{title:t("filecat-down关闭主进程命令"),permission:l.oV.shell_cmd_filecat_kill_self},{title:t("ai 命令(Ai 聊天)"),permission:l.oV.ai_chat_cmd}]}];return(0,f.jsx)(n.Fragment,{children:a.map((t,s)=>(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{children:t.title}),t.list.map((t,s)=>(0,f.jsxs)("div",{children:[(0,f.jsx)("input",{type:"checkbox",disabled:!t.noDisable&&e.is_disable(t.permission),checked:e.is_selected(t.permission,t.noDisable),onChange:()=>{e.select_auth(t.permission)}}),t.title]},s))]},s))})}const P=new Map;function B(){const{t:e,i18n:t}=(0,u.B)(),{initUserInfo:s,reloadUserInfo:_}=(0,n.useContext)(X.F),[j,g]=(0,w.fp)(p.AG.user_base_info),[S,C]=(0,n.useState)([]),[y,k]=(0,w.fp)(p.AG.prompt_card),[b,A]=(0,n.useState)(!1),[I,V]=(0,n.useState)(!1),[N,O]=(0,w.fp)(p.AG.confirm),[K,B]=(0,n.useState)(""),[T,M]=(0,n.useState)(""),[$,D]=(0,n.useState)(""),[E,G]=(0,n.useState)([]),[H,R]=(0,n.useState)([]),[q,U]=(0,n.useState)([]),[Z,W]=(0,n.useState)(""),[L,Q]=(0,n.useState)(""),[J,Y]=(0,n.useState)("en"),[ee,te]=(0,n.useState)(""),[se,ne]=(0,n.useState)([]),[ie,le]=(0,n.useState)(""),[oe,ae]=(0,n.useState)(!1),[re,ce]=(0,n.useState)(""),[de,he]=(0,n.useState)(""),[ue,pe]=(0,n.useState)({}),_e=(0,F.o)(),[xe,me]=(0,n.useState)([]),[je,ve]=(0,n.useState)(void 0),fe=[e("用户id"),e("用户名"),e("目录范围"),e("备注")],ge=async()=>{const e=await c.wm.get("all_users");if(e.code===d.m.Success){const t=e.data??[];if(je){const e=[];for(const s of t)`${s.id}${s.username}${s.cwd}${s.note}`.includes(je)&&e.push(s);C(e)}else C(t)}const t=await c.wm.get("all_roles");if(t.code===d.m.Success){me(t.data),P.clear();for(const e of t.data)P.set(e.role_id,e)}},we=e=>{B(e?.username??""),M(e?.password??""),D(e?.cwd??""),G(e?.access_dirs??[]),R(e?.not_access_dirs??[]),U(e?.only_read_dirs??[]),W(e?.access_cmd??""),Q(e?.not_access_cmd??""),Y(e?.language??""),te(e?.theme??""),ne(e?.auth_list??[]),le(e?.note??""),ae(e?.is_root??!1),ce(e?.id??""),e?.bind_role_id?Se(e.bind_role_id,e.auth_list??[]):(he(""),pe({}))};(0,n.useEffect)(()=>{ge()},[]);const Se=(e,t=[])=>{if(!e)return he(""),void pe({});const s=P.get(e);if(s){if(s.cwd&&D(s.cwd),s.access_dirs&&s.access_dirs.length>0&&G(s.access_dirs),s.not_access_dirs&&s.not_access_dirs.length>0&&R(s.not_access_dirs),s.only_read_dirs&&s.only_read_dirs.length>0&&U(s.only_read_dirs),s.access_cmd&&W(s.access_cmd),s.not_access_cmd&&Q(s.not_access_cmd),s.language&&Y(s.language),s.theme&&te(s.theme),s.auth_list&&s.auth_list.length>0){const e=new Set(s.auth_list);for(const s of t)e.add(s);ne(Array.from(e))}he(e),pe(s)}},Ce=()=>{if(!K)return void(0,x.zN)("username not empty");if((0,m.CB)(K))return void(0,x.zN)("username not empty char");if(!$)return void(0,x.zN)("cwd not empty");const e=new l.E0;return e.language=J,e.theme=ee,e.access_dirs=E,e.username=K,e.password=T,e.not_access_dirs=H,e.only_read_dirs=q,e.cwd=$,e.note=ie,e.access_cmd=Z,e.not_access_cmd=L,e.auth_list=se,e.bind_role_id=de,e};return(0,f.jsxs)(i.fI,{children:[(0,f.jsx)(i.VP,{widthPer:50,children:(0,f.jsx)(i.xh,{children:(0,f.jsx)(o.uF,{self_title:(0,f.jsx)("span",{className:" div-row ",children:(0,f.jsx)("h2",{children:e("用户")})}),titleCom:(0,f.jsxs)("div",{className:"div-row",style:{gap:"0.5rem"},children:[(0,f.jsx)(r.Sm,{placeholder:e("过滤"),value:je,handleInputChange:e=>{ve(e)},handlerEnter:()=>{ge()}}),(0,f.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{A(!0),V(!1),we(void 0)}})]}),children:(0,f.jsx)(h.X,{headers:fe,rows:S.map((t,s)=>{const n=[(0,f.jsx)("p",{children:t.id}),(0,f.jsx)(o.xP,{children:t.username}),(0,f.jsx)(o.xP,{children:t.cwd}),(0,f.jsx)(o.xP,{children:t.note}),(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{A(!1),V(!0),we(e)})(t)}),!t.is_root&&(0,f.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(async t=>{O({open:!0,title:e("确定删除吗"),handle:async()=>{const e=new l.E0;e.username=t,(await c.wm.post("delete_user",e)).code===d.m.Success&&((0,x.SK)("删除完成"),ge(),O({open:!1,handle:null}))}})})(t.username)})]})];return n}),width:"10rem"})})})}),(0,f.jsx)(i.VP,{widthPer:50,children:(b||I)&&(0,f.jsx)(i.xh,{children:(0,f.jsxs)(o.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e(""+(b?"添加":"编辑"))})," "]}),rightBottomCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"cancel",title:e("取消"),onClick:()=>{A(!1),V(!1),we(void 0)}}),b&&(0,f.jsx)(a.rA,{icon:"add_circle",title:e("添加"),onClick:async()=>{if(!T)return void(0,x.zN)("password not empty");if((0,m.CB)(T))return void(0,x.zN)("username not empty char");const e=Ce(),t=await c.wm.post("create_user",e);ge(),t.code===d.m.Success&&((0,x.SK)("创建完成"),ge(),A(!1),V(!1),we(void 0))}}),I&&(0,f.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{const e=Ce();if(!e)return;e.id=re;(await c.wm.post("save_user",e)).code===d.m.Success&&((0,x.SK)("保存完成"),ge())}})]}),children:[(0,f.jsx)("label",{children:e("用户名")}),(0,f.jsx)(r.Sm,{value:K,handleInputChange:e=>B(e)}),(0,f.jsx)("label",{children:e("密码")}),(0,f.jsx)(r.Sm,{type:"password",value:T,handleInputChange:e=>M(e)}),(0,f.jsxs)("label",{children:[!ue?.access_dirs?.length&&(0,f.jsx)(a.rA,{icon:"add",onClick:()=>{G([...E,""])},title:"添加"}),e("目录范围")]}),(0,f.jsx)(r.Sm,{disabled:""!==ue.cwd&&void 0!==ue.cwd,value:$,handleInputChange:e=>D(e)}),(E??[]).map((t,s)=>(0,f.jsxs)("div",{style:{display:"flex"},children:[(0,f.jsx)("div",{style:{width:"90%"},children:(0,f.jsx)(r.Sm,{disabled:0!==ue?.access_dirs?.length&&void 0!==ue?.access_dirs?.length,value:t,handleInputChange:e=>{E[s]=e,G([...E])}})}),0===ue?.access_dirs?.length||void 0===ue?.access_dirs?.length&&(0,f.jsx)(a.rA,{icon:"delete",onClick:()=>{E.splice(s,1),G([...E])},title:e("删除")})]},s)),(0,f.jsxs)("label",{children:[!ue?.not_access_dirs?.length&&(0,f.jsx)(a.rA,{icon:"add",onClick:()=>{R([...H,""])},title:e("添加")}),e("禁止目录范围")]}),(H??[]).map((t,s)=>(0,f.jsxs)("div",{style:{display:"flex"},children:[(0,f.jsx)("div",{style:{width:"90%"},children:(0,f.jsx)(r.Sm,{disabled:0!==ue?.not_access_dirs?.length&&void 0!==ue?.not_access_dirs?.length,value:t,handleInputChange:e=>{H[s]=e,R([...H])}})}),0===ue?.not_access_dirs?.length||void 0===ue?.not_access_dirs?.length&&(0,f.jsx)(a.rA,{icon:"delete",onClick:()=>{H.splice(s,1),R([...H])},title:e("删除")})]},s)),(0,f.jsxs)("label",{children:[!ue?.only_read_dirs?.length&&(0,f.jsx)(a.rA,{icon:"add",onClick:()=>{U([...q,""])},title:e("添加")}),e("只读目录范围")]}),(q??[]).map((t,s)=>(0,f.jsxs)("div",{style:{display:"flex"},children:[(0,f.jsx)("div",{style:{width:"90%"},children:(0,f.jsx)(r.Sm,{disabled:0!==ue?.only_read_dirs?.length&&void 0!==ue?.only_read_dirs?.length,value:t,handleInputChange:e=>{q[s]=e,U([...q])}})}),0===ue?.only_read_dirs?.length||void 0===ue?.only_read_dirs?.length&&(0,f.jsx)(a.rA,{icon:"delete",onClick:()=>{q.splice(s,1),U([...q])},title:e("删除")})]},s)),(0,f.jsx)("label",{children:e("可执行的命令")}),(0,f.jsx)(r.Sm,{disabled:""!==ue.access_cmd&&void 0!==ue.access_cmd,value:Z,placeholder:"use blank split",handleInputChange:e=>W(e)}),(0,f.jsx)("label",{children:e("禁止执行的命令")}),(0,f.jsx)(r.Sm,{disabled:""!==ue.not_access_cmd&&void 0!==ue.not_access_cmd,value:L,placeholder:"use blank split",handleInputChange:e=>Q(e)}),!oe&&(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)("label",{children:e("角色")}),(0,f.jsx)(r.l6,{value:de,onChange:e=>{Se(e)},options:(()=>{const e=[];e.push({title:"NOT",value:""});for(let t of xe)e.push({title:t.role_name,value:t.role_id});return e})()})]}),(0,f.jsx)("label",{children:e("语言")}),(0,f.jsx)(r.l6,{disabled:""!==ue.language&&void 0!==ue.language,value:J,onChange:e=>{Y(e)},options:[{title:e("跟随系统"),value:"sys"},{title:"English",value:"en"},{title:"中文",value:"zh"}]}),(0,f.jsx)("label",{children:e("主题")}),(0,f.jsx)(r.l6,{disabled:""!==ue.theme&&void 0!==ue.theme,value:ee,onChange:e=>{te(e)},options:_e}),(0,f.jsx)(z,{is_disable:e=>{if(!0===oe)return!0;if(de){const t=P.get(de);if(t)return(t.auth_list??[]).includes(e)}return!1},is_selected:(e,t)=>!t&&!0===oe||void 0!==se?.find(t=>t===e),select_auth:e=>{se?se.includes(e)?((0,v.I)(se,t=>t===e),ne([...se])):ne([...se,e]):ne([e])}}),(0,f.jsx)("label",{children:e("备注")}),(0,f.jsx)(r.Sm,{value:ie,handleInputChange:e=>le(e)})]})})})]})}function T(){const{t:e,i18n:t}=(0,u.B)(),{initUserInfo:s}=(0,n.useContext)(X.F),[_,m]=(0,n.useState)([]),[j,g]=(0,w.fp)(p.AG.prompt_card),[S,C]=(0,n.useState)(!1),[y,k]=(0,n.useState)(!1),[b,A]=(0,w.fp)(p.AG.confirm),[I,V]=(0,n.useState)(""),[N,O]=(0,n.useState)(""),[K,P]=(0,n.useState)([]),[B,T]=(0,n.useState)([]),[M,$]=(0,n.useState)([]),[D,E]=(0,n.useState)(""),[G,H]=(0,n.useState)(""),[R,q]=(0,n.useState)(""),[U,Z]=(0,n.useState)(""),[W,L]=(0,n.useState)([]),[Q,J]=(0,n.useState)(""),[Y,ee]=(0,n.useState)(""),te=(0,F.o)(),se=[e("角色id"),e("角色名"),e("备注")],ne=async()=>{const e=await c.wm.get("all_roles");e.code===d.m.Success&&m(e.data)},ie=e=>{V(e?.role_name??""),O(e?.cwd??""),P(e?.access_dirs??[]),T(e?.not_access_dirs??[]),$(e?.only_read_dirs??[]),E(e?.access_cmd??""),H(e?.not_access_cmd??""),q(e?.language??""),Z(e?.theme??""),L(e?.auth_list??[]),J(e?.role_id??""),ee(e?.role_note??"")};(0,n.useEffect)(()=>{ne()},[]);const le=()=>{if(!I)return void(0,x.zN)("role_name not empty");const e=new l.E0;return e.language=R,e.theme=U,e.access_dirs=K,e.role_name=I,e.not_access_dirs=B,e.only_read_dirs=M,e.cwd=N,e.access_cmd=D,e.not_access_cmd=G,e.auth_list=W,e.role_note=Y,e};return(0,f.jsxs)(i.fI,{children:[(0,f.jsx)(i.VP,{widthPer:50,children:(0,f.jsx)(i.xh,{children:(0,f.jsx)(o.uF,{self_title:(0,f.jsx)("span",{className:" div-row ",children:(0,f.jsx)("h2",{children:e("角色")})}),titleCom:(0,f.jsx)("div",{children:(0,f.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{C(!0),k(!1),ie(void 0)}})}),children:(0,f.jsx)(h.X,{headers:se,rows:_.map((t,s)=>{const n=[(0,f.jsx)("p",{children:t.role_id}),(0,f.jsx)(o.xP,{children:t.role_name}),(0,f.jsx)(o.xP,{children:t.role_note}),(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{C(!1),k(!0),ie(e)})(t)}),!t.is_root&&(0,f.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(async t=>{A({open:!0,title:e("确定删除吗"),handle:async()=>{const e=new l.E0;e.role_id=t,(await c.wm.post("delete_role",e)).code===d.m.Success&&((0,x.SK)("删除完成"),ne(),A({open:!1,handle:null}))}})})(t.role_id)})]})];return n}),width:"10rem"})})})}),(0,f.jsx)(i.VP,{widthPer:50,children:(S||y)&&(0,f.jsx)(i.xh,{children:(0,f.jsxs)(o.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e(""+(S?"添加":"编辑"))})," "]}),rightBottomCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"cancel",title:e("取消"),onClick:()=>{C(!1),k(!1),ie(void 0)}}),S&&(0,f.jsx)(a.rA,{icon:"add_circle",title:e("添加"),onClick:async()=>{const e=le();if(!e)return;const t=await c.wm.post("create_role",e);ne(),t.code===d.m.Success&&((0,x.SK)("创建完成"),ne(),C(!1),k(!1),ie(void 0))}}),y&&(0,f.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{const e=le();if(!e)return;e.role_id=Q;(await c.wm.post("save_role",e)).code===d.m.Success&&((0,x.SK)("保存完成"),ne())}})]}),children:[(0,f.jsx)("label",{children:e("角色名")}),(0,f.jsx)(r.Sm,{value:I,handleInputChange:e=>V(e)}),(0,f.jsx)("label",{children:e("角色备注")}),(0,f.jsx)(r.Sm,{value:Y,handleInputChange:e=>ee(e)}),(0,f.jsxs)("label",{children:[(0,f.jsx)(a.rA,{icon:"add",onClick:()=>{P([...K,""])},title:"添加"}),e("目录范围")]}),(0,f.jsx)(r.Sm,{value:N,handleInputChange:e=>O(e)}),(K??[]).map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex"},children:[(0,f.jsx)("div",{style:{width:"90%"},children:(0,f.jsx)(r.Sm,{value:e,handleInputChange:e=>{K[t]=e,P([...K])}})}),(0,f.jsx)(a.rA,{icon:"delete",onClick:()=>{K.splice(t,1),P([...K])},title:"删除"})]},t)),(0,f.jsxs)("label",{children:[(0,f.jsx)(a.rA,{icon:"add",onClick:()=>{T([...B,""])},title:"添加"}),e("禁止目录范围")]}),(B??[]).map((t,s)=>(0,f.jsxs)("div",{style:{display:"flex"},children:[(0,f.jsx)("div",{style:{width:"90%"},children:(0,f.jsx)(r.Sm,{value:t,handleInputChange:e=>{B[s]=e,T([...B])}})}),(0,f.jsx)(a.rA,{icon:"delete",onClick:()=>{B.splice(s,1),T([...B])},title:e("删除")})]},s)),(0,f.jsxs)("label",{children:[(0,f.jsx)(a.rA,{icon:"add",onClick:()=>{$([...M,""])},title:e("添加")}),e("只读目录范围")]}),(M??[]).map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex"},children:[(0,f.jsx)("div",{style:{width:"90%"},children:(0,f.jsx)(r.Sm,{value:e,handleInputChange:e=>{M[t]=e,$([...M])}})}),(0,f.jsx)(a.rA,{icon:"delete",onClick:()=>{M.splice(t,1),$([...M])},title:"删除"})]},t)),(0,f.jsx)("label",{children:e("可执行的命令")}),(0,f.jsx)(r.Sm,{value:D,placeholder:"use blank split",handleInputChange:e=>E(e)}),(0,f.jsx)("label",{children:e("禁止执行的命令")}),(0,f.jsx)(r.Sm,{value:G,placeholder:"use blank split",handleInputChange:e=>H(e)}),(0,f.jsx)("label",{children:e("语言")}),(0,f.jsx)(r.l6,{value:R,onChange:e=>{q(e)},options:[{title:e("跟随系统"),value:"sys"},{title:"NOT",value:""},{title:"English",value:"en"},{title:"中文",value:"zh"}]}),(0,f.jsx)("label",{children:e("主题")}),(0,f.jsx)(r.l6,{value:U,onChange:e=>{Z(e)},options:te}),(0,f.jsx)(z,{is_disable:()=>!1,is_selected:(e,t)=>void 0!==W?.find(t=>t===e),select_auth:e=>{W?(W.find(t=>t==e)?(0,v.I)(W,t=>t===e):W.push(e),L([...W])):L([e])}})]})})})]})}function M(){const{t:e,i18n:t}=(0,u.B)(),{initUserInfo:s,reloadUserInfo:_}=(0,n.useContext)(X.F),[m,j]=(0,n.useState)([]),[g,S]=(0,w.fp)(p.AG.prompt_card),[y,b]=(0,n.useState)([]),[A,V]=(0,n.useState)([]),[N,O]=(0,n.useState)([]),[K,z]=(0,w.fp)(p.AG.user_base_info),P=(0,C.K)(),B=(0,F.o)(),T=[e("编号"),e("路径"),e("是否默认"),e("备注")],M=[e("编号"),e("路径"),e("备注")],$=[e("编号"),e("命令"),e("父编号"),e("备注")],D=[e("文件后缀"),e("命令"),e("其他参数"),e("备注")],[E,G]=(0,n.useState)(""),[H,R]=(0,n.useState)(""),[q,U]=(0,n.useState)(""),[Z,W]=(0,n.useState)(!1),[L,Q]=(0,n.useState)(""),[J,Y]=(0,n.useState)(""),[ee,te]=(0,n.useState)("");(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("filesSetting");e.code===d.m.Success&&(j(e.data.dirs),V(e.data.quick_cmd),O(e.data.file_quick_cmd));const t=await c.XO.get("protection_dir");t.code===d.m.Success&&b(t.data??[])})(),Q(K?.user_data?.language),Y(K?.user_data?.theme),te(K?.user_data?.upload_file_ignore)},[]);const se=(0,F.Q)();return(0,f.jsx)(n.Fragment,{children:(0,f.jsxs)(i.fI,{children:[(0,f.jsxs)(i.VP,{widthPer:33,children:[(0,f.jsx)(i.xh,{children:(0,f.jsxs)(o.Zp,{title:e("修改密码"),rightBottomCom:(0,f.jsx)(a.C3,{text:e("确定修改"),clickFun:async()=>{if(!E||!H)return void(0,x.zN)("账号密码不能为空");if(H!==q)return void(0,x.zN)("两次密码不一样");const e=new l.tl;e.username=E,e.password=H,e.confirm_password=q,e.user_id=K.user_data.id;(await c.wm.post("updatePassword",e)).code===d.m.Success&&(0,x.SK)("修改成功")}}),children:[(0,f.jsx)(r.Sm,{placeholder:e("新账号"),value:E,handleInputChange:e=>{G(e)}}),(0,f.jsx)(r.cA,{placeholder:e("新密码"),handleInputChange:e=>{R(e)}}),(0,f.jsx)(r.cA,{placeholder:e("确认密码"),handleInputChange:e=>{U(e)}})]})}),(0,f.jsx)(i.xh,{children:(0,f.jsxs)(o.Zp,{title:e("个性化设置"),rightBottomCom:(0,f.jsx)(a.C3,{text:e("确定修改"),clickFun:async()=>{(await c.XO.post(k.s.setting_sys_option_status_save,{type:I.Mu.private_sys_env,value:{language:L,theme:J,upload_file_ignore:ee}})).code===d.m.Success&&((0,x.SK)("修改成功"),s())}}),children:[e("语言"),(0,f.jsx)(r.l6,{value:L,onChange:e=>{Q(e)},options:[{title:e("跟随系统"),value:"sys"},{title:"English",value:"en"},{title:"中文",value:"zh"},{title:"Deutsch",value:"de"},{title:"ドイツ語",value:"ja"},{title:"독일어",value:"ko"},{title:"Немецкий язык",value:"ru"},{title:"Allemand",value:"fr"},{title:"Alemán",value:"es"}]}),e("主题"),(0,f.jsx)(r.l6,{value:J,onChange:e=>{Y(e)},options:B}),(0,f.jsx)(r.Sm,{value:ee,handleInputChange:e=>{te(e)},placeholderOut:e("拖拽文件上传忽略列表"),placeholder:"node_modules *.js",no_border:!0})]})})]}),(0,f.jsxs)(i.VP,{children:[(0,f.jsxs)(i.xh,{children:[(0,f.jsx)(o.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("文件夹路径")})," ",(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{se("文件夹路径")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{j([...m,{note:"",default:!1,path:""}])}}),(0,f.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{for(let e=0;e<m.length;e++)m[e].index=e;(await c.XO.post("filesSetting/save",{dirs:m})).code===d.m.Success&&((0,x.SK)("保存成功"),_(),s())}})]}),children:(0,f.jsx)(h.X,{headers:T,rows:m.map((t,s)=>{const n=[(0,f.jsx)("div",{children:s}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,f.jsx)(r.l6,{value:t.default,onChange:e=>{((e,t,s)=>{const n=[];for(let e=0;e<m.length;e++)m[e].default=e===s&&t,n.push(m[e]);j(n)})(0,e,s)},options:P,no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)("div",{children:0!==s&&(0,f.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{m.splice(e,1),j([...m])})(s)})})];return n}),width:"10rem",onRowDrag:(e,t)=>{0!==e&&0!==t&&j((0,v.TI)(m,e,t))}})}),(0,f.jsx)(o.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("个人保护路径")})," ",(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{se("保护目录")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{b([...y,{path:"",note:""}])}}),(0,f.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("protection_dir/save",y)).code===d.m.Success&&((0,x.SK)("保存成功"),_())}})]}),children:(0,f.jsx)(h.X,{headers:M,rows:y.map((t,s)=>{const n=[(0,f.jsx)("div",{children:s}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{y.splice(e,1),b([...y])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{b((0,v.TI)(y,e,t))}})})]}),(0,f.jsxs)(i.xh,{children:[(0,f.jsx)(o.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("目录快捷命令")}),(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{se("目录快捷命令")},title:"info"})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{V([...A,{cmd:"",note:""}])}}),(0,f.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("filesSetting/save",{quick_cmd:A})).code===d.m.Success&&((0,x.SK)("保存成功"),s())}})]}),children:(0,f.jsx)(h.X,{headers:$,rows:A.map((t,s)=>{const n=[(0,f.jsx)(r.Sm,{value:t.index,handleInputChange:e=>{t.index=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.cmd,handleInputChange:e=>{t.cmd=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.father_index,handleInputChange:e=>{t.father_index=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{A.splice(e,1),V([...A])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{V((0,v.TI)(A,e,t))}})}),(0,f.jsx)(o.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("文件快捷命令")}),(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{se("文件快捷命令")},title:"info"})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{O([...N,{cmd:"",note:"",file_suffix:"",params:""}])}}),(0,f.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("filesSetting/save",{file_quick_cmd:N})).code===d.m.Success&&((0,x.SK)("保存成功"),s())}})]}),children:(0,f.jsx)(h.X,{headers:D,rows:N.map((t,s)=>{const n=[(0,f.jsx)(r.Sm,{value:t.file_suffix,handleInputChange:e=>{t.file_suffix=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.cmd,handleInputChange:e=>{t.cmd=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.params,handleInputChange:e=>{t.params=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{N.splice(e,1),O([...N])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{O((0,v.TI)(N,e,t))}})})]})]})]})})}var $=s(87361);function D(){const{t:e}=(0,u.B)(),{check_user_auth:t}=(0,S.MH)(),s=[{index:1,name:`${e("个人环境")}`,rto:"private_env_setting",component:(0,f.jsx)(M,{})}];return t(l.oV.sys_setting_page)&&s.unshift({index:1,name:e("系统"),rto:"password",component:(0,f.jsx)(O,{})}),t(l.oV.sys_env_page)&&s.push({index:1,name:`${e("系统环境")}`,rto:"env_setting/",component:(0,f.jsx)(K,{})}),t(l.oV.auth_router_page)&&s.push({index:1,name:e("自定义路由"),rto:"customer_router/",component:(0,f.jsx)(A,{})}),t(l.oV.user_manage)&&s.push({index:1,name:e("用户管理"),rto:"user_manager/",component:(0,f.jsx)(B,{})}),t(l.oV.role_manage)&&s.push({index:1,name:e("角色管理"),rto:"role_manager/",component:(0,f.jsx)(T,{})}),(0,f.jsx)(i.W1,{optionList:s,father_route:$.o.setting})}},92350(e,t,s){s.d(t,{Q:()=>h,o:()=>p});var n=s(34843),i=s(82893),l=s(74777),o=s(96540),a=s(86149),r=s(23430),c=s(14284),d=s(74848);function h(){const[e,t]=(0,n.fp)(i.AG.prompt_card),{t:s,i18n:o}=(0,a.B)();return e=>{let n;e===l.jk.ffmpeg?n=(0,d.jsx)("div",{children:"视频转换,rtsp播放器等媒体功能都需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置"}):e===l.jk.smartmontools?n=(0,d.jsx)("div",{children:"磁盘检查需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置。"}):"保护目录"===e?n=(0,d.jsxs)("div",{children:["在删除的时候保护目录会拒绝删除。",(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:"可以使用 /* 来表达该目录下所有文件都禁止删除"}),(0,d.jsx)("li",{children:"可以使用 /** 来表达该目录下所有子目录文件都禁止删除"})]})]}):"文件夹路径"===e?n=(0,d.jsx)("div",{children:"用于在文件夹下切换根目录"}):"环境路径"===e?n=(0,d.jsx)("div",{children:"当在不同用户环境下运行的时候由于没有执行终端去加载PATH,这里可以添加额外的PATH路径,点击这里的保存还会更新系统上的path路径"}):"pty"===e?n=(0,d.jsx)("div",{children:"一些需要Pty环境的命令"}):"文件上传"===e?n=(0,d.jsx)("div",{children:(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:"对于不同的目录(包括所有子目录),可能是机械或者固态硬盘,机械硬盘在处理多个小文件的时候会做随机i/o,由于一般只有一个盘头所以会影响整体效率,特别是写操作,这里提供了上传时候的最大数量限制,对于下载数量目前不做限制."}),(0,d.jsx)("li",{children:"大文件支持断点和分块并发传输,建议并发数量设置为2,分块大小设置为10MB,大文件判断为500MB,设置过大的话会上传的时候会占据较大内存"})]})}):"目录快捷命令"===e?n=(0,d.jsx)("div",{children:"右键文件夹空白处用于,打开终端快捷执行命令"}):"文件快捷命令"===e?n=(0,d.jsx)("div",{children:"用于右键特定后缀的文件,执行一些快捷命令,文件后缀可以是多个,用空格分割"}):"Workflow"===e?n=(0,d.jsx)("div",{children:(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:"在特定的时间启动系统中的workflow任务"}),(0,d.jsx)("li",{children:"cron表达式是定时器 格式为: 秒 分 时 日 月 星期"}),(0,d.jsxs)("li",{children:[(0,d.jsx)("li",{children:'1. "*"(通配符,所有值)'}),(0,d.jsx)("li",{children:'2. "," 是枚举: 0 0 1,15 * * *'}),(0,d.jsx)("li",{children:'3. "-" 是范围: 0 0 1-5 * * *'}),(0,d.jsx)("li",{children:'4. "/" 是步长,标识每隔n执行 */3 * * * * * 每隔三秒,必须配合 * 使用 ,/ 只能写一次 ,有了/就成了定时器,而不是指定时间执行'})]})]})}):"插件配置"===e?n=(0,d.jsx)("div",{children:s("路径可以是一个 js 文件也可以是一个node 项目目录")}):"机器人配置"===e&&(n=(0,d.jsxs)("div",{children:[(0,d.jsx)("dv",{children:"机器人功能用于开通各种第三方支持的机器人,让第三方机器人接入本地的 AI 模型。"}),(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:" 1. qq 机器人需要先在手机 app 中添加,然后在https://q.qq.com/qqbot/ 登录机器人配置页面,在开发管理中复制机器人的 appId,appSecret 到这里就完成了配置了。目前 qq 机器人不稳定,且创建后无法删除(2026.07.05)"}),(0,d.jsx)("li",{children:" 2. https://opensource.dingtalk.com/developerpedia/docs/explore/tutorials/stream/bot/nodejs/create-bot 这个是钉钉机器人开通教程,注意复制钉钉的 clientId 的是时候不要复制成appId 了。"}),(0,d.jsx)("li",{children:" 3. 企业微信机器人的开通甚至不需要 pc 操作,在通讯录中点击智能机器人,选择 api 模式,就创建完成了,手机上直接复制 id 和密钥。"}),(0,d.jsx)("li",{children:" 4. 飞书https://open.feishu.cn/document/develop-an-echo-bot/introduction?from=banner 登录这个开发者后台,按照这个地址教程创建机器人,使用的时候这个机器人是作为一个应用,可以在工作台内搜索你的这个机器人的名字。"})]})]})),t({open:!0,title:"信息",context_div:(0,d.jsx)("div",{children:n})})}}let u=r.Ky;function p(){const[e,t]=(0,o.useState)([]);return(0,o.useEffect)(()=>{(async()=>{try{const e=await c.XO.get("themes");if(0===e.code){const s=e.data||[];u=[...r.Ky,...s],t(u)}else console.warn("获取主题列表失败,使用默认列表"),t(u)}catch(e){t(u)}})()},[]),e}},6960(e,t,s){s.d(t,{s:()=>o});var n=s(72635);const i=1440,l=525600;function o(e){e=e>1e12?e:1e3*e;const t=Date.now(),s=Math.abs(t-e)/6e4;return s<1?n.Ay.t("小于一分钟"):s<60?`${s.toFixed(0)} ${n.Ay.t("分钟前")}`:s<i?`${(s/60).toFixed(0)} ${n.Ay.t("小时前")}`:s<43200?`${(s/i).toFixed(0)} ${n.Ay.t("天前")}`:s<l?`${(s/43200).toFixed(0)} ${n.Ay.t("月前")}`:`${(s/l).toFixed(0)} ${n.Ay.t("年前")}`}},24659(e,t,s){var n=s(86149);s.d(t,["K",0,()=>{const{t:e}=(0,n.B)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])}}]);
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[1472],{77481(e,t,s){s.d(t,{S:()=>a,X:()=>o});var n=s(96540),i=s(61443),l=s(74848);function o(e){const[t,s]=n.useState([]),o=(0,n.useRef)(-1),[a,r]=(0,n.useState)(-1),[c,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 h=()=>{o.current=-1,r(-1),d(-1)};return(0,l.jsxs)("table",{children:[(0,l.jsx)("thead",{children:(0,l.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,l.jsx)("th",{className:n?"table-filter-col":"",children:n?(0,l.jsx)(i.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:o}):t},s)})})}),(0,l.jsx)("tbody",{children:t.map((t,s)=>{const n=!!e.onRowDrag;return(0,l.jsx)("tr",{className:n?(a===s?"row-dragging":"")+(c===s?" row-drop-target":""):"",draggable:n,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{n&&(o.current=s,r(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=c;h(),t<0||s<0||t===s||e.onRowDrag?.(t,s)})())},onDragEnd:h,children:t.map((s,n)=>{const i=n===t.length-1?"small":"";return(0,l.jsx)("td",{className:i,style:{width:e.width??"auto"},children:s},n)})},s)})})]})}function a(e){return(0,l.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,l.jsx)("div",{children:e},t))})}},61472(e,t,s){s.r(t),s.d(t,{default:()=>D});var n=s(96540),i=s(75725),l=s(23430),o=s(70447),a=s(85997),r=s(61443),c=s(14284),d=s(53459),h=s(77481),u=s(86149),p=s(82893),_=s(40505),x=s(62042),m=s(21499),j=s(21469),v=s(64694),f=s(74848);function g(e){const{t}=(0,u.B)(),[s,l]=(0,n.useState)([]);(0,n.useEffect)(()=>{(async()=>{if(e.getItems){const t=await e.getItems();l(t)}})()},[]);return(0,f.jsx)(i.xh,{children:(0,f.jsx)(o.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e.title}),e.info_click&&(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{e.info_click()},title:"信息"})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"add",title:t("添加"),onClick:()=>{const t=[];for(let s=0;s<e.headers.length-1;s++)t.push("");l([t,...s])}}),(0,f.jsx)(a.rA,{icon:"save",title:t("保存"),onClick:async()=>{e.save&&await e.save(s)}})]}),children:(0,f.jsx)(h.X,{headers:e.headers,rows:s.map((n,i)=>{const o=[];for(let t=0;t<e.headers.length;t++)o.push((0,f.jsx)(r.Sm,{value:n[t],handleInputChange:e=>{n[t]=e,l([...s])},no_border:!0}));return o.push((0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"delete",title:t("删除"),onClick:()=>(e=>{s.splice(e,1),l([...s])})(i)}),n[0]&&(0,f.jsx)(a.rA,{icon:"content_copy",title:t("复制地址"),onClick:()=>{const e=(0,m.bi)(`${window.location.origin}${j.m.base_url}`,n[0]);(0,_.lW)(e),(0,x.SK)(e)}}),n[0]&&e.need_copy&&(0,f.jsx)(a.rA,{icon:"open_in_new",title:t("打开新页面"),onClick:()=>{const e=(0,m.bi)(`${window.location.origin}${j.m.base_url}`,n[0]);window.open(e)}})]})),o}),width:"10rem",onRowDrag:(e,t)=>{l((0,v.TI)(s,e,t))}})})})}var w=s(34843),S=s(78247),C=s(24659);function y(){const{t:e}=(0,u.B)(),[t,s]=(0,w.fp)(p.AG.prompt_card),l=(0,C.K)(),g=[e("路由"),e("auth"),e("备注")],[y,k]=(0,w.fp)(p.AG.editorSetting),[b,A]=(0,n.useState)([]);(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("api/customer_router");e.code===d.m.Success&&A(e.data)})()},[]);return(0,f.jsx)(i.xh,{children:(0,f.jsx)(o.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("自定义api路由")})," ",(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{(()=>{let e=(0,f.jsx)("div",{children:'默认需要以 "/api" 开头的路由。'});s({open:!0,title:"信息",context_div:(0,f.jsx)("div",{children:e})})})()},title:"信息"})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{A([{note:"",needAuth:!1,router:""},...b])}}),(0,f.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("api/customer_router/save",b)).code===d.m.Success&&(0,x.SK)("保存成功")}})]}),children:(0,f.jsx)(h.X,{headers:g,rows:b.map((t,s)=>{const n=[(0,f.jsx)(r.Sm,{value:t.router,handleInputChange:e=>{t.router=e,A([...b])},no_border:!0}),(0,f.jsx)(r.l6,{defaultValue:t.needAuth,onChange:e=>{t.needAuth=e,A([...b])},options:l,no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e,A([...b])},no_border:!0}),(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{b.splice(e,1),A([...b])})(s)}),(0,f.jsx)(a.rA,{icon:"edit",title:e("编辑"),onClick:()=>(async e=>{if(!e.router)return void(0,x.zN)("路由不能为空");const t=await c.XO.get(`jscode/${encodeURIComponent(e.router)}`);k({model:"ace/mode/javascript",open:!0,fileName:e.router,save:async t=>{const s={context:t,router:e.router};(await c.XO.post("jscode/save",s)).code===d.m.Success&&(S.xK.set_value_temp(""),k({open:!1,model:"",fileName:"",save:null}),(0,x.SK)("成功"))}}),S.xK.set_value_temp(t.data)})(t)}),t.router&&(0,f.jsx)(a.rA,{icon:"content_copy",title:e("复制地址"),onClick:()=>{(0,_.lW)((0,m.bi)(window.location.origin+j.m.base_url,t.router)),(0,x.SK)(e("已复制"))}})]})];return n}),width:"10rem",onRowDrag:(e,t)=>{A((0,v.TI)(b,e,t))}})})})}var k=s(23496),b=s(4412);function A(){const{t:e}=(0,u.B)(),[t,s]=(0,w.fp)(p.AG.prompt_card),[l,o]=(0,w.fp)(p.AG.router_jump),a=[e("路由"),e("路径"),e("过期时间(s)"),e("备注")],r=[e("路由"),e("文件路径"),"token","user id",e("备注")];return(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(b.aZ,{position:"right"}),(0,f.jsxs)(i.fI,{children:[(0,f.jsxs)(i.VP,{children:[(0,f.jsx)(g,{title:e("页面资源路由"),headers:a,getItems:async()=>{const e=await c.XO.get(k.s.setting_customer_router);if(e.code===d.m.Success){if(l?.page_self_router_api_data){for(const t of e.data)t[1]===l?.page_self_router_api_data[1]&&(0,x.N9)("已经存在的页面资源路由配置目录设置");const t={};Object.assign(t,l?.page_self_router_api_data),e.data=[t,...e.data],o({})}return e.data}return[]},save:async e=>{(await c.XO.post(k.s.setting_customer_router_save,e)).code===d.m.Success&&(0,x.SK)("success")},info_click:()=>{let e=(0,f.jsx)("div",{children:'默认需要以 "/api" 开头的路由,会自动识别地址,将页面转到对应结果。路径支持文件路径(如果是文件夹路径的最后最后一个名字将会成为资源实际地址,整个目录将会变成一个http目录),http地址。'});s({open:!0,title:"信息",context_div:(0,f.jsx)("div",{children:e})})},need_copy:!0}),(0,f.jsx)(g,{title:e("workflow触发路由"),headers:r,getItems:async()=>{const e=await c.XO.get(k.s.setting_customer_workflow_router);return e.code===d.m.Success?e.data:[]},save:async e=>{(await c.XO.post(k.s.setting_customer_workflow_router_save,e)).code===d.m.Success&&(0,x.SK)("保存成功")},info_click:()=>{let e=(0,f.jsx)("div",{children:'默认需要以 "/api" 开头的路由,文件路径是有效的workflow路径。token也可以是文件绝对路径,请求的时候请设置同样的authorization请求头字段。'});s({open:!0,title:"信息",context_div:(0,f.jsx)("div",{children:e})})}})]}),(0,f.jsx)(i.VP,{children:(0,f.jsx)(y,{})})]})]})}var I=s(74777),V=s(6960),X=s(7523);function N(){const{t:e}=(0,u.B)(),{check_user_auth:t}=(0,S.MH)(),[s,i]=(0,n.useState)(!1),[h,_]=(0,n.useState)("https://registry.npmjs.org"),[m,j]=(0,n.useState)(""),[v,g]=(0,n.useState)(180),[C,y]=(0,n.useState)(!1),[k,b]=(0,w.fp)(p.AG.prompt_card);(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("auto_upgrade_setting");if(e.code===d.m.Success){const t=e.data;i(t.open||!1),_(t.version_check_url||"https://registry.npmjs.org"),j(t.exe_download_url||""),g(t.check_interval_seconds||180)}})()},[]);return t(l.oV.sys_setting_page)?(0,f.jsxs)(o.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("自动升级")}),(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{b({open:!0,title:e("信息"),context_div:(0,f.jsx)("div",{children:e("自动升级在 windows 下目前可能不稳定")})})},title:e("信息")})]}),rightBottomCom:(0,f.jsx)(a.C3,{text:e("保存"),clickFun:async()=>{if(!h)return void(0,x.zN)(e("版本检测地址不能为空"));if(s&&(!v||v<10))return void(0,x.zN)(e("检测间隔不能小于10秒"));const t=new I.Mm;t.open=s,t.version_check_url=h,t.exe_download_url=m,t.check_interval_seconds=v;(await c.XO.post("auto_upgrade_setting/save",t)).code===d.m.Success&&(0,x.SK)(e("保存成功"))}}),children:[(0,f.jsx)("div",{children:e("系统版本检测地址")}),(0,f.jsx)(r.Sm,{placeholder:"https://registry.npmjs.org",value:h,handleInputChange:e=>{_(e)}}),(0,f.jsx)(r.l6,{value:s,onChange:e=>{i(e)},options:[{title:e("开启"),value:!0},{title:e("关闭"),value:!1}]}),s&&(0,f.jsxs)(f.Fragment,{children:[!1,(0,f.jsx)("div",{children:e("检测频率(秒)")}),(0,f.jsx)(r.Sm,{placeholder:e("默认180秒(3分钟)"),value:v,handleInputChange:e=>{g(Number(e)||180)}}),(0,f.jsx)("div",{style:{marginTop:"12px"},children:(0,f.jsx)(a.C3,{text:e(C?"升级检测中...":"立即升级"),clickFun:async()=>{y(!0);try{(await c.XO.post("auto_upgrade_setting/upgrade_now",{})).code===d.m.Success&&(0,x.SK)(e("已触发升级检测,请查看服务端日志"))}catch(t){(0,x.zN)(e("触发升级失败"))}finally{y(!1)}}})})]})]}):null}function O(){const[e,t]=(0,n.useState)(""),[s,l]=(0,n.useState)(""),[_,m]=(0,n.useState)(!1),[j,v]=(0,n.useState)(""),[g,C]=(0,n.useState)(!1),[y,A]=(0,n.useState)(""),[O,F]=(0,w.fp)(p.AG.prompt_card),[K,z]=(0,n.useState)(!1),[P,B]=(0,n.useState)(""),[T,M]=(0,n.useState)(""),[$,D]=(0,n.useState)(I.aM.close),[E,G]=(0,n.useState)(!1),[H,R]=(0,n.useState)(void 0),{t:q,i18n:U}=(0,u.B)(),[Z,W]=(0,w.fp)(p.AG.user_base_info),{check_user_auth:L}=(0,S.MH)(),{initUserInfo:Q}=(0,n.useContext)(X.F);(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("sys_option/status");if(e.code===d.m.Success){C(e.data.recycle_open),A(e.data.recycle_dir);const s=e.data.sys_env;t(s?.web_site_title),l(s?.logo||""),m(s?.show_login_user_info),v(s?.http_proxy||"");const n=e.data.https_setting;n&&(z(n.open),B(n.cert_path||""),M(n.key_path||""))}const s=await c.XO.get("token");if(s.code===d.m.Success){const e=s.data;if(!e)return;e.length&&R(e.length),e.mode&&D(e.mode),void 0!==e.persist&&G(e.persist)}})()},[]);return(0,f.jsxs)("div",{children:[(0,f.jsx)(b.aZ,{children:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("span",{className:"credits",children:[q("系统运行于"),": ",(0,V.s)(Z.runing_time_length)]}),(0,f.jsx)("span",{className:"credits",children:(0,f.jsxs)("a",{href:"https://github.com/xiaobaidadada/filecat",target:"_blank",children:["version:6.67.4",null!=Z.latest_version&&"6.67.4"!==Z.latest_version?` -> ${Z.latest_version}`:""]})}),(0,f.jsx)("span",{className:"credits",children:(0,f.jsx)("a",{href:q("官网地址"),target:"_blank",children:`filecat ${q("功能文档")}`})}),(0,f.jsxs)("span",{className:"credits",children:[q("安装方式")," :",Z.process_env_run_env]})]})}),(0,f.jsx)(i.xh,{children:(0,f.jsxs)(i.fI,{children:[(0,f.jsxs)(i.VP,{widthPer:33,children:[(0,f.jsxs)(o.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:q("通用设置")})," ",(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{F({open:!0,title:q("信息"),context_div:(0,f.jsx)("div",{children:q("HTTP 代理说明")})})},title:q("信息")})]}),rightBottomCom:(0,f.jsx)(a.C3,{text:q("确定修改"),clickFun:async()=>{(await c.XO.post(k.s.setting_sys_option_status_save,{type:I.Mu.sys_env,value:{web_site_title:e,show_login_user_info:_,http_proxy:j,logo:s}})).code===d.m.Success&&((0,x.SK)("修改成功"),Q())}}),children:[q("网站标题"),(0,f.jsx)(r.Sm,{value:e,handleInputChange:e=>{t(e)}}),q("网站 Logo"),(0,f.jsx)(r.Sm,{placeholder:q("本地文件路径或 http(s) 图片地址"),value:s,handleInputChange:e=>{l(e)}}),(0,f.jsx)("div",{children:q("HTTP 代理地址")}),(0,f.jsx)(r.Sm,{placeholder:"http://127.0.0.1:7890",value:j,handleInputChange:e=>{v(e)}}),q("登陆展示用户信息"),(0,f.jsx)("input",{type:"checkbox",checked:_,onChange:()=>{m(!_)}})]}),(0,f.jsxs)(o.Zp,{title:q("HTTPS 设置"),rightBottomCom:(0,f.jsx)(a.C3,{text:q("确定修改"),clickFun:async()=>{if(K){if(!P)return void(0,x.zN)("证书路径不能为空");if(!T)return void(0,x.zN)("私钥路径不能为空")}const e=new I.CH;e.open=K,e.cert_path=P,e.key_path=T;(await c.XO.post(k.s.setting_sys_option_status_save,{type:I.Mu.https,value:e,open:K})).code===d.m.Success&&(0,x.SK)("HTTPS 设置已保存,需重启服务器才能生效")}}),children:[(0,f.jsx)(r.l6,{value:K,onChange:e=>{z(e)},options:[{title:q("开启"),value:!0},{title:q("关闭"),value:!1}]}),K&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{children:q("SSL 证书路径")}),(0,f.jsx)(r.Sm,{placeholder:q("证书文件路径(cert.pem/fullchain.pem)"),value:P,handleInputChange:e=>{B(e)}}),(0,f.jsx)("div",{children:q("SSL 私钥路径")}),(0,f.jsx)(r.Sm,{placeholder:q("私钥文件路径(privkey.pem)"),value:T,handleInputChange:e=>{M(e)}})]})]}),(0,f.jsx)(N,{})]}),(0,f.jsxs)(i.VP,{widthPer:33,children:[(0,f.jsxs)(o.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:q("文件回收站")})," ",(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{F({open:!0,title:q("信息"),context_div:(0,f.jsx)("div",{children:q("格式:[被删除的文件所在父目录] 回收站目录 [; ...]")})})},title:q("信息")})]}),rightBottomCom:(0,f.jsx)(a.C3,{text:q("确定修改"),clickFun:async()=>{if(g&&!y)return void(0,x.zN)("目录不能为空");(await c.XO.post(k.s.setting_sys_option_status_save,{type:I.Mu.cyc,value:y,open:g})).code===d.m.Success&&(0,x.SK)("修改成功")}}),children:[(0,f.jsx)(r.Sm,{placeholder:q("目录"),value:y,handleInputChange:e=>{A(e)}}),(0,f.jsx)(r.l6,{value:g,onChange:e=>{C(e)},options:[{title:q("开启"),value:!0},{title:q("关闭"),value:!1}]})]}),(0,f.jsxs)(o.Zp,{title:q("token过期时间"),rightBottomCom:(0,f.jsx)(h.S,{isFlex:!0,columns:[(0,f.jsx)(a.C3,{text:q("清空token"),clickFun:async()=>{(await c.XO.get("token/clear")).code===d.m.Success&&(0,x.SK)("清理完成,重新登录")}}),(0,f.jsx)(a.C3,{text:q("保存"),clickFun:async()=>{const e=new I.Gd;e.mode=$,e.persist=E,I.aM.length!==e.mode||H||(0,x.zN)("秒数不能为空"),e.length=parseInt(H);(await c.XO.post("token/save",e)).code===d.m.Success&&(0,x.SK)("保存成功")}})]}),children:[(0,f.jsx)(h.S,{isFlex:!0,columns:[(0,f.jsx)(r.U6,{value:1,context:q("关闭"),selected:$===I.aM.close,onchange:()=>{D(I.aM.close)}}),(0,f.jsx)(r.U6,{value:1,context:q("指定时间"),selected:$===I.aM.length,onchange:()=>{D(I.aM.length)}}),(0,f.jsx)(r.U6,{value:1,context:q("永不过期"),selected:$===I.aM.forver,onchange:()=>{D(I.aM.forver)}})]}),$===I.aM.length&&(0,f.jsx)(r.Sm,{placeholder:q("秒"),value:H,handleInputChange:e=>{R(e)}}),(0,f.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:6,marginTop:8,whiteSpace:"nowrap"},children:[(0,f.jsx)("input",{type:"checkbox",checked:E,onChange:()=>G(!E)}),q("持久化")]})]})]})]})})]})}var F=s(92350);function K(){const{t:e,i18n:t}=(0,u.B)(),{initUserInfo:s,reloadUserInfo:l}=(0,n.useContext)(X.F),[_,m]=(0,n.useState)([]),[j,g]=(0,n.useState)([]),[y,k]=(0,w.fp)(p.AG.prompt_card),[,b]=(0,w.fp)(p.AG.editorSetting),[A,I]=(0,n.useState)([]),[V,N]=(0,n.useState)([]),[O,K]=(0,n.useState)([]),[z,P]=(0,n.useState)([]),[B,T]=(0,n.useState)(""),[M,$]=(0,n.useState)([]),D=(0,C.K)(),E=[e("软件"),e("是否安装"),e("路径")],G=[e("编号"),e("路径"),e("备注")],H=[e("编号"),e("路径"),e("是否开启"),e("备注")],R=[e("编号"),e("文件路径"),e("是否开启"),e("系统启动执行"),e("corn表达式"),e("用户id"),e("备注")],q=[e("编号"),e("路径"),e("单用户并发数量"),e("系统并发数量"),e("是否开启大文件断点"),e("大文件判断大小MB"),e("大文件并发数量"),e("大文件分块大小MB"),e("备注")],U=[e("编号"),e("名称"),e("路径"),e("是否开启"),e("params"),e("备注")],{check_user_auth:Z}=(0,S.MH)(),W=async()=>{const e=await c.XO.get("env/path/get");e.code===d.m.Success&&K(e.data)},L=async()=>{const e=await c.XO.get("workflow_setting_get");e.code===d.m.Success&&P(e.data)};(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("outside/software/get");e.code===d.m.Success&&g(e.data);const t=await c.XO.get("pty_cmd");t.code===d.m.Success&&T(t.data),W(),L();const s=await c.XO.get("protection_dir/sys");s.code===d.m.Success&&I(s.data??[]);const n=await c.XO.get("dir_upload_max_num");n.code===d.m.Success&&N(n.data??[]);const i=await c.XO.get("plugin/list");i.code===d.m.Success&&$(i.data??[])})()},[]);const Q=(0,F.Q)(),J=async()=>{(await c.XO.post("plugin/list/save",M)).code===d.m.Success&&(0,x.SK)(e("保存成功"))};return(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(i.J,{widthPer:100,children:(0,f.jsx)(o.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("文件上传最大并发限制")})," ",(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{Q("文件上传")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{N([...V,{path:"",note:"",user_upload_num:2,sys_upload_num:6,ws_file_standard_size:52428800,ws_file_parallel_num:2,ws_file_block_mb_size:524288}])}}),(0,f.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{for(const e of V)if(e.open_ws_file){if("number"!=typeof e.ws_file_block_mb_size)return void(0,x.zN)(`编号:${e.index??""} 文件块的大小设置有问题`);if("number"!=typeof e.ws_file_parallel_num)return void(0,x.zN)(`编号:${e.index??""} 并发数量设置有问题`);if("number"!=typeof e.ws_file_standard_size)return void(0,x.zN)(`编号:${e.index??""} 大文件size设置有问题`)}(0,v.di)(V,e=>e.index??0);(await c.XO.post("dir_upload_max_num/save",V)).code===d.m.Success&&((0,x.SK)("保存成功"),l())}})]}),children:(0,f.jsx)(h.X,{headers:q,rows:V.map((t,s)=>{const n=[(0,f.jsx)(r.Sm,{value:t.index,placeholder:s,handleInputChange:e=>{t.index=parseInt(e)},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.user_upload_num,handleInputChange:e=>{t.user_upload_num=parseInt(e)},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.sys_upload_num,handleInputChange:e=>{t.sys_upload_num=parseInt(e)},no_border:!0}),(0,f.jsx)(r.l6,{value:!0===t.open_ws_file,onChange:e=>{t.open_ws_file=e,N([...V])},options:D,no_border:!0}),(0,f.jsx)(r.Sm,{value:"number"==typeof t.ws_file_standard_size?t.ws_file_standard_size/1024/1024:void 0,handleInputChange:e=>{t.ws_file_standard_size=1024*parseInt(e)*1024},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.ws_file_parallel_num,handleInputChange:e=>{t.ws_file_parallel_num=parseInt(e)},no_border:!0}),(0,f.jsx)(r.Sm,{value:"number"==typeof t.ws_file_block_mb_size?t.ws_file_block_mb_size/1024/1024:void 0,handleInputChange:e=>{t.ws_file_block_mb_size=1024*parseInt(e)*1024},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{V.splice(e,1),N([...V])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{N((0,v.TI)(V,e,t))}})})}),(0,f.jsxs)(i.fI,{children:[(0,f.jsx)(i.VP,{widthPer:50,children:(0,f.jsxs)(i.xh,{children:[(0,f.jsx)(o.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("PATH")}),(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{Q("环境路径")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"list",title:e("查看"),onClick:async()=>{const t=await c.XO.get("env/process/view");t.code===d.m.Success?k({open:!0,title:e("进程环境变量"),context_div:(0,f.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",maxHeight:"60vh",overflow:"auto",margin:0,fontSize:"0.85rem",lineHeight:"1.5"},children:t.data})}):(0,x.zN)(e("获取失败"))}}),(0,f.jsx)(a.rA,{icon:"edit",title:e("编辑"),onClick:async()=>{const t=await c.XO.get("env/process/get");t.code===d.m.Success?(S.xK.set_value_temp(t.data??""),b({model:"ace/mode/ini",open:!0,fileName:"",save:async t=>{(await c.XO.post("env/process/save",{text:t})).code===d.m.Success?(0,x.SK)(e("保存成功")):(0,x.zN)(e("保存失败")),S.xK.set_value_temp("")}})):(0,x.zN)(e("获取失败"))}}),(0,f.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{K([...O,{path:"",note:""}])}}),(0,f.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("env/path/save",{paths:O})).code===d.m.Success&&((0,x.SK)("保存成功"),W(),s())}})]}),children:(0,f.jsx)(h.X,{headers:H,rows:O.map((t,s)=>{const n=[(0,f.jsx)("div",{children:s}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,f.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,K([...O])},options:D,no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{O.splice(e,1),K([...O])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{K((0,v.TI)(O,e,t))}})}),(0,f.jsx)(o.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("PTY CMD")}),(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{Q("pty")},title:e("信息")})]}),rightBottomCom:(0,f.jsx)(a.C3,{text:e("更新"),clickFun:async()=>{(await c.XO.post("pty_cmd/save",{str:B})).code===d.m.Success&&((0,x.SK)("保存成功"),l())}}),children:(0,f.jsx)(r.Sm,{placeholder:e("cmd need pty env"),value:B,handleInputChange:e=>{T(e)}})}),(0,f.jsx)(o.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("Workflow Job")}),(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{Q("Workflow")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{P([...z,{open:!1}])}}),(0,f.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("workflow_setting_save",z)).code===d.m.Success&&((0,x.SK)("ok"),L())}})]}),children:(0,f.jsx)(h.X,{headers:R,rows:z.map((t,s)=>{const n=[(0,f.jsx)("div",{children:s}),(0,f.jsx)(r.Sm,{value:t.file_path,handleInputChange:e=>{t.file_path=e},no_border:!0}),(0,f.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,P([...z])},options:D,no_border:!0}),(0,f.jsx)(r.l6,{value:!!t.sys_power_on,onChange:e=>{t.sys_power_on=e,P([...z])},options:D,no_border:!0}),(0,f.jsx)(r.Sm,{value:t.cron_str,handleInputChange:e=>{t.cron_str=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.user_id,handleInputChange:e=>{t.user_id=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{z.splice(e,1),P([...z])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{P((0,v.TI)(z,e,t))}})}),(0,f.jsx)(o.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("插件配置")}),(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{Q("插件配置")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{$([...M,{name:"",path:"",note:"",open:!1}])}}),(0,f.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:J})]}),children:(0,f.jsx)(h.X,{headers:U,rows:M.map((t,s)=>{const n=[s,(0,f.jsx)(r.Sm,{value:t.name,handleInputChange:e=>{t.name=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,f.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,$([...M])},options:D,no_border:!0}),(0,f.jsx)(a.mu,{icon:"edit",save:async e=>{t.params=e,await J()},title:""}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{M.splice(e,1),$([...M])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{$((0,v.TI)(M,e,t))}})})]})}),(0,f.jsx)(i.VP,{children:(0,f.jsxs)(i.xh,{children:[(0,f.jsx)(o.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("系统保护路径")})," ",(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{Q("保护目录")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{I([...A,{path:"",note:""}])}}),(0,f.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("protection_dir/sys/save",A)).code===d.m.Success&&((0,x.SK)("保存成功"),l())}})]}),children:(0,f.jsx)(h.X,{headers:G,rows:A.map((t,s)=>{const n=[(0,f.jsx)("div",{children:s}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{A.splice(e,1),I([...A])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{I((0,v.TI)(A,e,t))}})}),(0,f.jsx)(o.uF,{title:e("外部软件"),titleCom:(0,f.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("outside/software/save",j)).code===d.m.Success&&((0,x.SK)("保存成功"),s())}}),children:(0,f.jsx)(h.X,{headers:E,rows:j.map((t,s)=>[(0,f.jsx)("div",{children:t.id}),(0,f.jsx)(o.fq,{ok:t.installed}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0,placeholder:e("默认使用环境变量")}),(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{Q(t.id)},title:e("信息")})]),width:"10rem"})})]})})]})]})}function z(e){const{t,i18n:s}=(0,u.B)(),[i,o]=(0,w.fp)(p.AG.user_base_info),a=[{title:t("用户权限"),list:[{title:t("用户管理"),permission:l.oV.user_manage},{title:t("角色管理"),permission:l.oV.role_manage}]},{title:t("系统管理权限"),list:[{title:t("系统信息"),permission:l.oV.all_sys},{title:t("系统进程关闭"),permission:l.oV.sys_process_close},{title:t("docker容器停止、删除"),permission:l.oV.docker_container_update},{title:t("docker镜像删除"),permission:l.oV.docker_images_delete},{title:t("systemd管理"),permission:l.oV.systemd},{title:t("防火墙管理"),permission:l.oV.firewall}]},{title:t("网络功能权限"),list:[{title:t("系统网络"),permission:l.oV.vir_net},{title:t("内网穿透"),permission:l.oV.tcp_proxy},{title:"ddns",permission:l.oV.ddns}]},{title:t("Ai 设置权限"),list:[{title:t("Ai 配置"),permission:l.oV.ai_agent_setting},{title:t("Ai Chat Page"),permission:l.oV.ai_agent_page},{title:t("允许切换 AI 模型"),permission:l.oV.ai_model_switch}]},{title:t("文件权限"),list:[{title:t("文件删除、剪切、重命名"),permission:l.oV.filecat_file_delete_cut_rename},{title:t("文件创建、上传、内容更新、解压缩"),permission:l.oV.filecat_file_context_update_upload_created_copy_decompression},{title:t("内容更新"),permission:l.oV.filecat_file_context_update},{title:t("文件回收站修改"),permission:l.oV.recycle_file_save},{title:t("文件分享"),permission:l.oV.share_file}]},{title:t("系统设置权限"),list:[{title:t("系统页面"),permission:l.oV.sys_setting_page},{title:t("htts"),permission:l.oV.https_file},{title:t("token时间修改"),permission:l.oV.token_update},{title:t("修改密码"),permission:l.oV.update_password},{title:t("磁盘挂载"),permission:l.oV.sys_disk_mount},{title:t("通用设置"),permission:l.oV.sys_env_setting_key},{title:t("MD 编辑器设置"),permission:l.oV.md_editor_setting}]},{title:t("系统环境设置"),list:[{title:t("系统环境设置页面"),permission:l.oV.sys_env_page},{title:t("目录文件上传数量限制修改"),permission:l.oV.dir_upload_max_num},{title:t("PATH路径修改"),permission:l.oV.env_path_update},{title:"pty cmd "+t("更新"),permission:l.oV.pty_cmd_update},{title:"workflow job",permission:l.oV.workflow_job},{title:t("系统保护路径更新"),permission:l.oV.sys_protection_dir},{title:t("外部软件路径"),permission:l.oV.outside_software_path}]},{title:t("个人环境设置"),list:[{title:t("个性化设置"),permission:l.oV.private_sys_env}]},{title:t("自定义路由"),list:[{title:t("自定义路由页面"),permission:l.oV.auth_router_page},{title:t("workflow触发api 修改"),permission:l.oV.workflow_api},{title:t("自定义资源路由"),permission:l.oV.code_resource},{title:t("自定义api路由"),permission:l.oV.code_api}]},{title:t("标签编辑权限"),list:[{title:t("ssh代理"),permission:l.oV.ssh_proxy_tag_update},{title:t("http代理"),permission:l.oV.http_proxy_tag_update},{title:t("浏览器代理"),permission:l.oV.browser_proxy_tag_update},{title:t("rdp代理"),permission:l.oV.rdp_proxy_tag_update},{title:t("网络唤醒"),permission:l.oV.wol_proxy_tag_update},{title:t("rtsp播放器"),permission:l.oV.rtsp_proxy_tag_update}]},{title:t("代理功能"),list:[{title:t("ssh代理"),permission:l.oV.ssh_proxy},{title:t("http代理"),permission:l.oV.http_proxy},{title:t("http代理下载关闭"),permission:l.oV.http_proxy_download_cancel},{title:t("浏览器代理"),permission:l.oV.browser_proxy},{title:t("rdp代理"),permission:l.oV.rdp_proxy}]},{title:t("其他功能"),list:[{title:t("workflow 执行"),permission:l.oV.workflow_exe},{title:t("workflow 执行用户"),permission:l.oV.workflow_exe_user,noDisable:!0},{title:t("网络唤醒"),permission:l.oV.wol_proxy},{title:t("端口扫描"),permission:l.oV.port_scan},{title:t("rtsp播放器"),permission:l.oV.rtsp_proxy},{title:t("ssh密钥保存到磁盘"),permission:l.oV.crypto_ssh_file},{title:t("filecat-restart重启命令"),permission:l.oV.shell_cmd_filecat_restart},{title:t("filecat-upgrade升级命令"),permission:l.oV.shell_cmd_filecat_upgrade},{title:t("filecat-down关闭主进程命令"),permission:l.oV.shell_cmd_filecat_kill_self},{title:t("ai 命令(Ai 聊天)"),permission:l.oV.ai_chat_cmd}]}];return(0,f.jsx)(n.Fragment,{children:a.map((t,s)=>(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{children:t.title}),t.list.map((t,s)=>(0,f.jsxs)("div",{children:[(0,f.jsx)("input",{type:"checkbox",disabled:!t.noDisable&&e.is_disable(t.permission),checked:e.is_selected(t.permission,t.noDisable),onChange:()=>{e.select_auth(t.permission)}}),t.title]},s))]},s))})}const P=new Map;function B(){const{t:e,i18n:t}=(0,u.B)(),{initUserInfo:s,reloadUserInfo:_}=(0,n.useContext)(X.F),[j,g]=(0,w.fp)(p.AG.user_base_info),[S,C]=(0,n.useState)([]),[y,k]=(0,w.fp)(p.AG.prompt_card),[b,A]=(0,n.useState)(!1),[I,V]=(0,n.useState)(!1),[N,O]=(0,w.fp)(p.AG.confirm),[K,B]=(0,n.useState)(""),[T,M]=(0,n.useState)(""),[$,D]=(0,n.useState)(""),[E,G]=(0,n.useState)([]),[H,R]=(0,n.useState)([]),[q,U]=(0,n.useState)([]),[Z,W]=(0,n.useState)(""),[L,Q]=(0,n.useState)(""),[J,Y]=(0,n.useState)("en"),[ee,te]=(0,n.useState)(""),[se,ne]=(0,n.useState)([]),[ie,le]=(0,n.useState)(""),[oe,ae]=(0,n.useState)(!1),[re,ce]=(0,n.useState)(""),[de,he]=(0,n.useState)(""),[ue,pe]=(0,n.useState)({}),_e=(0,F.o)(),[xe,me]=(0,n.useState)([]),[je,ve]=(0,n.useState)(void 0),fe=[e("用户id"),e("用户名"),e("目录范围"),e("备注")],ge=async()=>{const e=await c.wm.get("all_users");if(e.code===d.m.Success){const t=e.data??[];if(je){const e=[];for(const s of t)`${s.id}${s.username}${s.cwd}${s.note}`.includes(je)&&e.push(s);C(e)}else C(t)}const t=await c.wm.get("all_roles");if(t.code===d.m.Success){me(t.data),P.clear();for(const e of t.data)P.set(e.role_id,e)}},we=e=>{B(e?.username??""),M(e?.password??""),D(e?.cwd??""),G(e?.access_dirs??[]),R(e?.not_access_dirs??[]),U(e?.only_read_dirs??[]),W(e?.access_cmd??""),Q(e?.not_access_cmd??""),Y(e?.language??""),te(e?.theme??""),ne(e?.auth_list??[]),le(e?.note??""),ae(e?.is_root??!1),ce(e?.id??""),e?.bind_role_id?Se(e.bind_role_id,e.auth_list??[]):(he(""),pe({}))};(0,n.useEffect)(()=>{ge()},[]);const Se=(e,t=[])=>{if(!e)return he(""),void pe({});const s=P.get(e);if(s){if(s.cwd&&D(s.cwd),s.access_dirs&&s.access_dirs.length>0&&G(s.access_dirs),s.not_access_dirs&&s.not_access_dirs.length>0&&R(s.not_access_dirs),s.only_read_dirs&&s.only_read_dirs.length>0&&U(s.only_read_dirs),s.access_cmd&&W(s.access_cmd),s.not_access_cmd&&Q(s.not_access_cmd),s.language&&Y(s.language),s.theme&&te(s.theme),s.auth_list&&s.auth_list.length>0){const e=new Set(s.auth_list);for(const s of t)e.add(s);ne(Array.from(e))}he(e),pe(s)}},Ce=()=>{if(!K)return void(0,x.zN)("username not empty");if((0,m.CB)(K))return void(0,x.zN)("username not empty char");if(!$)return void(0,x.zN)("cwd not empty");const e=new l.E0;return e.language=J,e.theme=ee,e.access_dirs=E,e.username=K,e.password=T,e.not_access_dirs=H,e.only_read_dirs=q,e.cwd=$,e.note=ie,e.access_cmd=Z,e.not_access_cmd=L,e.auth_list=se,e.bind_role_id=de,e};return(0,f.jsxs)(i.fI,{children:[(0,f.jsx)(i.VP,{widthPer:50,children:(0,f.jsx)(i.xh,{children:(0,f.jsx)(o.uF,{self_title:(0,f.jsx)("span",{className:" div-row ",children:(0,f.jsx)("h2",{children:e("用户")})}),titleCom:(0,f.jsxs)("div",{className:"div-row",style:{gap:"0.5rem"},children:[(0,f.jsx)(r.Sm,{placeholder:e("过滤"),value:je,handleInputChange:e=>{ve(e)},handlerEnter:()=>{ge()}}),(0,f.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{A(!0),V(!1),we(void 0)}})]}),children:(0,f.jsx)(h.X,{headers:fe,rows:S.map((t,s)=>{const n=[(0,f.jsx)("p",{children:t.id}),(0,f.jsx)(o.xP,{children:t.username}),(0,f.jsx)(o.xP,{children:t.cwd}),(0,f.jsx)(o.xP,{children:t.note}),(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{A(!1),V(!0),we(e)})(t)}),!t.is_root&&(0,f.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(async t=>{O({open:!0,title:e("确定删除吗"),handle:async()=>{const e=new l.E0;e.username=t,(await c.wm.post("delete_user",e)).code===d.m.Success&&((0,x.SK)("删除完成"),ge(),O({open:!1,handle:null}))}})})(t.username)})]})];return n}),width:"10rem"})})})}),(0,f.jsx)(i.VP,{widthPer:50,children:(b||I)&&(0,f.jsx)(i.xh,{children:(0,f.jsxs)(o.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e(""+(b?"添加":"编辑"))})," "]}),rightBottomCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"cancel",title:e("取消"),onClick:()=>{A(!1),V(!1),we(void 0)}}),b&&(0,f.jsx)(a.rA,{icon:"add_circle",title:e("添加"),onClick:async()=>{if(!T)return void(0,x.zN)("password not empty");if((0,m.CB)(T))return void(0,x.zN)("username not empty char");const e=Ce(),t=await c.wm.post("create_user",e);ge(),t.code===d.m.Success&&((0,x.SK)("创建完成"),ge(),A(!1),V(!1),we(void 0))}}),I&&(0,f.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{const e=Ce();if(!e)return;e.id=re;(await c.wm.post("save_user",e)).code===d.m.Success&&((0,x.SK)("保存完成"),ge())}})]}),children:[(0,f.jsx)("label",{children:e("用户名")}),(0,f.jsx)(r.Sm,{value:K,handleInputChange:e=>B(e)}),(0,f.jsx)("label",{children:e("密码")}),(0,f.jsx)(r.Sm,{type:"password",value:T,handleInputChange:e=>M(e)}),(0,f.jsxs)("label",{children:[!ue?.access_dirs?.length&&(0,f.jsx)(a.rA,{icon:"add",onClick:()=>{G([...E,""])},title:"添加"}),e("目录范围")]}),(0,f.jsx)(r.Sm,{disabled:""!==ue.cwd&&void 0!==ue.cwd,value:$,handleInputChange:e=>D(e)}),(E??[]).map((t,s)=>(0,f.jsxs)("div",{style:{display:"flex"},children:[(0,f.jsx)("div",{style:{width:"90%"},children:(0,f.jsx)(r.Sm,{disabled:0!==ue?.access_dirs?.length&&void 0!==ue?.access_dirs?.length,value:t,handleInputChange:e=>{E[s]=e,G([...E])}})}),0===ue?.access_dirs?.length||void 0===ue?.access_dirs?.length&&(0,f.jsx)(a.rA,{icon:"delete",onClick:()=>{E.splice(s,1),G([...E])},title:e("删除")})]},s)),(0,f.jsxs)("label",{children:[!ue?.not_access_dirs?.length&&(0,f.jsx)(a.rA,{icon:"add",onClick:()=>{R([...H,""])},title:e("添加")}),e("禁止目录范围")]}),(H??[]).map((t,s)=>(0,f.jsxs)("div",{style:{display:"flex"},children:[(0,f.jsx)("div",{style:{width:"90%"},children:(0,f.jsx)(r.Sm,{disabled:0!==ue?.not_access_dirs?.length&&void 0!==ue?.not_access_dirs?.length,value:t,handleInputChange:e=>{H[s]=e,R([...H])}})}),0===ue?.not_access_dirs?.length||void 0===ue?.not_access_dirs?.length&&(0,f.jsx)(a.rA,{icon:"delete",onClick:()=>{H.splice(s,1),R([...H])},title:e("删除")})]},s)),(0,f.jsxs)("label",{children:[!ue?.only_read_dirs?.length&&(0,f.jsx)(a.rA,{icon:"add",onClick:()=>{U([...q,""])},title:e("添加")}),e("只读目录范围")]}),(q??[]).map((t,s)=>(0,f.jsxs)("div",{style:{display:"flex"},children:[(0,f.jsx)("div",{style:{width:"90%"},children:(0,f.jsx)(r.Sm,{disabled:0!==ue?.only_read_dirs?.length&&void 0!==ue?.only_read_dirs?.length,value:t,handleInputChange:e=>{q[s]=e,U([...q])}})}),0===ue?.only_read_dirs?.length||void 0===ue?.only_read_dirs?.length&&(0,f.jsx)(a.rA,{icon:"delete",onClick:()=>{q.splice(s,1),U([...q])},title:e("删除")})]},s)),(0,f.jsx)("label",{children:e("可执行的命令")}),(0,f.jsx)(r.Sm,{disabled:""!==ue.access_cmd&&void 0!==ue.access_cmd,value:Z,placeholder:"use blank split",handleInputChange:e=>W(e)}),(0,f.jsx)("label",{children:e("禁止执行的命令")}),(0,f.jsx)(r.Sm,{disabled:""!==ue.not_access_cmd&&void 0!==ue.not_access_cmd,value:L,placeholder:"use blank split",handleInputChange:e=>Q(e)}),!oe&&(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)("label",{children:e("角色")}),(0,f.jsx)(r.l6,{value:de,onChange:e=>{Se(e)},options:(()=>{const e=[];e.push({title:"NOT",value:""});for(let t of xe)e.push({title:t.role_name,value:t.role_id});return e})()})]}),(0,f.jsx)("label",{children:e("语言")}),(0,f.jsx)(r.l6,{disabled:""!==ue.language&&void 0!==ue.language,value:J,onChange:e=>{Y(e)},options:[{title:e("跟随系统"),value:"sys"},{title:"English",value:"en"},{title:"中文",value:"zh"}]}),(0,f.jsx)("label",{children:e("主题")}),(0,f.jsx)(r.l6,{disabled:""!==ue.theme&&void 0!==ue.theme,value:ee,onChange:e=>{te(e)},options:_e}),(0,f.jsx)(z,{is_disable:e=>{if(!0===oe)return!0;if(de){const t=P.get(de);if(t)return(t.auth_list??[]).includes(e)}return!1},is_selected:(e,t)=>!t&&!0===oe||void 0!==se?.find(t=>t===e),select_auth:e=>{se?se.includes(e)?((0,v.I)(se,t=>t===e),ne([...se])):ne([...se,e]):ne([e])}}),(0,f.jsx)("label",{children:e("备注")}),(0,f.jsx)(r.Sm,{value:ie,handleInputChange:e=>le(e)})]})})})]})}function T(){const{t:e,i18n:t}=(0,u.B)(),{initUserInfo:s}=(0,n.useContext)(X.F),[_,m]=(0,n.useState)([]),[j,g]=(0,w.fp)(p.AG.prompt_card),[S,C]=(0,n.useState)(!1),[y,k]=(0,n.useState)(!1),[b,A]=(0,w.fp)(p.AG.confirm),[I,V]=(0,n.useState)(""),[N,O]=(0,n.useState)(""),[K,P]=(0,n.useState)([]),[B,T]=(0,n.useState)([]),[M,$]=(0,n.useState)([]),[D,E]=(0,n.useState)(""),[G,H]=(0,n.useState)(""),[R,q]=(0,n.useState)(""),[U,Z]=(0,n.useState)(""),[W,L]=(0,n.useState)([]),[Q,J]=(0,n.useState)(""),[Y,ee]=(0,n.useState)(""),te=(0,F.o)(),se=[e("角色id"),e("角色名"),e("备注")],ne=async()=>{const e=await c.wm.get("all_roles");e.code===d.m.Success&&m(e.data)},ie=e=>{V(e?.role_name??""),O(e?.cwd??""),P(e?.access_dirs??[]),T(e?.not_access_dirs??[]),$(e?.only_read_dirs??[]),E(e?.access_cmd??""),H(e?.not_access_cmd??""),q(e?.language??""),Z(e?.theme??""),L(e?.auth_list??[]),J(e?.role_id??""),ee(e?.role_note??"")};(0,n.useEffect)(()=>{ne()},[]);const le=()=>{if(!I)return void(0,x.zN)("role_name not empty");const e=new l.E0;return e.language=R,e.theme=U,e.access_dirs=K,e.role_name=I,e.not_access_dirs=B,e.only_read_dirs=M,e.cwd=N,e.access_cmd=D,e.not_access_cmd=G,e.auth_list=W,e.role_note=Y,e};return(0,f.jsxs)(i.fI,{children:[(0,f.jsx)(i.VP,{widthPer:50,children:(0,f.jsx)(i.xh,{children:(0,f.jsx)(o.uF,{self_title:(0,f.jsx)("span",{className:" div-row ",children:(0,f.jsx)("h2",{children:e("角色")})}),titleCom:(0,f.jsx)("div",{children:(0,f.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{C(!0),k(!1),ie(void 0)}})}),children:(0,f.jsx)(h.X,{headers:se,rows:_.map((t,s)=>{const n=[(0,f.jsx)("p",{children:t.role_id}),(0,f.jsx)(o.xP,{children:t.role_name}),(0,f.jsx)(o.xP,{children:t.role_note}),(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{C(!1),k(!0),ie(e)})(t)}),!t.is_root&&(0,f.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(async t=>{A({open:!0,title:e("确定删除吗"),handle:async()=>{const e=new l.E0;e.role_id=t,(await c.wm.post("delete_role",e)).code===d.m.Success&&((0,x.SK)("删除完成"),ne(),A({open:!1,handle:null}))}})})(t.role_id)})]})];return n}),width:"10rem"})})})}),(0,f.jsx)(i.VP,{widthPer:50,children:(S||y)&&(0,f.jsx)(i.xh,{children:(0,f.jsxs)(o.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e(""+(S?"添加":"编辑"))})," "]}),rightBottomCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"cancel",title:e("取消"),onClick:()=>{C(!1),k(!1),ie(void 0)}}),S&&(0,f.jsx)(a.rA,{icon:"add_circle",title:e("添加"),onClick:async()=>{const e=le();if(!e)return;const t=await c.wm.post("create_role",e);ne(),t.code===d.m.Success&&((0,x.SK)("创建完成"),ne(),C(!1),k(!1),ie(void 0))}}),y&&(0,f.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{const e=le();if(!e)return;e.role_id=Q;(await c.wm.post("save_role",e)).code===d.m.Success&&((0,x.SK)("保存完成"),ne())}})]}),children:[(0,f.jsx)("label",{children:e("角色名")}),(0,f.jsx)(r.Sm,{value:I,handleInputChange:e=>V(e)}),(0,f.jsx)("label",{children:e("角色备注")}),(0,f.jsx)(r.Sm,{value:Y,handleInputChange:e=>ee(e)}),(0,f.jsxs)("label",{children:[(0,f.jsx)(a.rA,{icon:"add",onClick:()=>{P([...K,""])},title:"添加"}),e("目录范围")]}),(0,f.jsx)(r.Sm,{value:N,handleInputChange:e=>O(e)}),(K??[]).map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex"},children:[(0,f.jsx)("div",{style:{width:"90%"},children:(0,f.jsx)(r.Sm,{value:e,handleInputChange:e=>{K[t]=e,P([...K])}})}),(0,f.jsx)(a.rA,{icon:"delete",onClick:()=>{K.splice(t,1),P([...K])},title:"删除"})]},t)),(0,f.jsxs)("label",{children:[(0,f.jsx)(a.rA,{icon:"add",onClick:()=>{T([...B,""])},title:"添加"}),e("禁止目录范围")]}),(B??[]).map((t,s)=>(0,f.jsxs)("div",{style:{display:"flex"},children:[(0,f.jsx)("div",{style:{width:"90%"},children:(0,f.jsx)(r.Sm,{value:t,handleInputChange:e=>{B[s]=e,T([...B])}})}),(0,f.jsx)(a.rA,{icon:"delete",onClick:()=>{B.splice(s,1),T([...B])},title:e("删除")})]},s)),(0,f.jsxs)("label",{children:[(0,f.jsx)(a.rA,{icon:"add",onClick:()=>{$([...M,""])},title:e("添加")}),e("只读目录范围")]}),(M??[]).map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex"},children:[(0,f.jsx)("div",{style:{width:"90%"},children:(0,f.jsx)(r.Sm,{value:e,handleInputChange:e=>{M[t]=e,$([...M])}})}),(0,f.jsx)(a.rA,{icon:"delete",onClick:()=>{M.splice(t,1),$([...M])},title:"删除"})]},t)),(0,f.jsx)("label",{children:e("可执行的命令")}),(0,f.jsx)(r.Sm,{value:D,placeholder:"use blank split",handleInputChange:e=>E(e)}),(0,f.jsx)("label",{children:e("禁止执行的命令")}),(0,f.jsx)(r.Sm,{value:G,placeholder:"use blank split",handleInputChange:e=>H(e)}),(0,f.jsx)("label",{children:e("语言")}),(0,f.jsx)(r.l6,{value:R,onChange:e=>{q(e)},options:[{title:e("跟随系统"),value:"sys"},{title:"NOT",value:""},{title:"English",value:"en"},{title:"中文",value:"zh"}]}),(0,f.jsx)("label",{children:e("主题")}),(0,f.jsx)(r.l6,{value:U,onChange:e=>{Z(e)},options:te}),(0,f.jsx)(z,{is_disable:()=>!1,is_selected:(e,t)=>void 0!==W?.find(t=>t===e),select_auth:e=>{W?(W.find(t=>t==e)?(0,v.I)(W,t=>t===e):W.push(e),L([...W])):L([e])}})]})})})]})}function M(){const{t:e,i18n:t}=(0,u.B)(),{initUserInfo:s,reloadUserInfo:_}=(0,n.useContext)(X.F),[m,j]=(0,n.useState)([]),[g,S]=(0,w.fp)(p.AG.prompt_card),[y,b]=(0,n.useState)([]),[A,V]=(0,n.useState)([]),[N,O]=(0,n.useState)([]),[K,z]=(0,w.fp)(p.AG.user_base_info),P=(0,C.K)(),B=(0,F.o)(),T=[e("编号"),e("路径"),e("是否默认"),e("备注")],M=[e("编号"),e("路径"),e("备注")],$=[e("编号"),e("命令"),e("父编号"),e("备注")],D=[e("文件后缀"),e("命令"),e("其他参数"),e("备注")],[E,G]=(0,n.useState)(""),[H,R]=(0,n.useState)(""),[q,U]=(0,n.useState)(""),[Z,W]=(0,n.useState)(!1),[L,Q]=(0,n.useState)(""),[J,Y]=(0,n.useState)(""),[ee,te]=(0,n.useState)("");(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("filesSetting");e.code===d.m.Success&&(j(e.data.dirs),V(e.data.quick_cmd),O(e.data.file_quick_cmd));const t=await c.XO.get("protection_dir");t.code===d.m.Success&&b(t.data??[])})(),Q(K?.user_data?.language),Y(K?.user_data?.theme),te(K?.user_data?.upload_file_ignore)},[]);const se=(0,F.Q)();return(0,f.jsx)(n.Fragment,{children:(0,f.jsxs)(i.fI,{children:[(0,f.jsxs)(i.VP,{widthPer:33,children:[(0,f.jsx)(i.xh,{children:(0,f.jsxs)(o.Zp,{title:e("修改密码"),rightBottomCom:(0,f.jsx)(a.C3,{text:e("确定修改"),clickFun:async()=>{if(!E||!H)return void(0,x.zN)("账号密码不能为空");if(H!==q)return void(0,x.zN)("两次密码不一样");const e=new l.tl;e.username=E,e.password=H,e.confirm_password=q,e.user_id=K.user_data.id;(await c.wm.post("updatePassword",e)).code===d.m.Success&&(0,x.SK)("修改成功")}}),children:[(0,f.jsx)(r.Sm,{placeholder:e("新账号"),value:E,handleInputChange:e=>{G(e)}}),(0,f.jsx)(r.cA,{placeholder:e("新密码"),handleInputChange:e=>{R(e)}}),(0,f.jsx)(r.cA,{placeholder:e("确认密码"),handleInputChange:e=>{U(e)}})]})}),(0,f.jsx)(i.xh,{children:(0,f.jsxs)(o.Zp,{title:e("个性化设置"),rightBottomCom:(0,f.jsx)(a.C3,{text:e("确定修改"),clickFun:async()=>{(await c.XO.post(k.s.setting_sys_option_status_save,{type:I.Mu.private_sys_env,value:{language:L,theme:J,upload_file_ignore:ee}})).code===d.m.Success&&((0,x.SK)("修改成功"),s())}}),children:[e("语言"),(0,f.jsx)(r.l6,{value:L,onChange:e=>{Q(e)},options:[{title:e("跟随系统"),value:"sys"},{title:"English",value:"en"},{title:"中文",value:"zh"},{title:"Deutsch",value:"de"},{title:"ドイツ語",value:"ja"},{title:"독일어",value:"ko"},{title:"Немецкий язык",value:"ru"},{title:"Allemand",value:"fr"},{title:"Alemán",value:"es"}]}),e("主题"),(0,f.jsx)(r.l6,{value:J,onChange:e=>{Y(e)},options:B}),(0,f.jsx)(r.Sm,{value:ee,handleInputChange:e=>{te(e)},placeholderOut:e("拖拽文件上传忽略列表"),placeholder:"node_modules *.js",no_border:!0})]})})]}),(0,f.jsxs)(i.VP,{children:[(0,f.jsxs)(i.xh,{children:[(0,f.jsx)(o.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("文件夹路径")})," ",(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{se("文件夹路径")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{j([...m,{note:"",default:!1,path:""}])}}),(0,f.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{for(let e=0;e<m.length;e++)m[e].index=e;(await c.XO.post("filesSetting/save",{dirs:m})).code===d.m.Success&&((0,x.SK)("保存成功"),_(),s())}})]}),children:(0,f.jsx)(h.X,{headers:T,rows:m.map((t,s)=>{const n=[(0,f.jsx)("div",{children:s}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,f.jsx)(r.l6,{value:t.default,onChange:e=>{((e,t,s)=>{const n=[];for(let e=0;e<m.length;e++)m[e].default=e===s&&t,n.push(m[e]);j(n)})(0,e,s)},options:P,no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)("div",{children:0!==s&&(0,f.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{m.splice(e,1),j([...m])})(s)})})];return n}),width:"10rem",onRowDrag:(e,t)=>{0!==e&&0!==t&&j((0,v.TI)(m,e,t))}})}),(0,f.jsx)(o.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("个人保护路径")})," ",(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{se("保护目录")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{b([...y,{path:"",note:""}])}}),(0,f.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("protection_dir/save",y)).code===d.m.Success&&((0,x.SK)("保存成功"),_())}})]}),children:(0,f.jsx)(h.X,{headers:M,rows:y.map((t,s)=>{const n=[(0,f.jsx)("div",{children:s}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{y.splice(e,1),b([...y])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{b((0,v.TI)(y,e,t))}})})]}),(0,f.jsxs)(i.xh,{children:[(0,f.jsx)(o.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("目录快捷命令")}),(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{se("目录快捷命令")},title:"info"})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{V([...A,{cmd:"",note:""}])}}),(0,f.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("filesSetting/save",{quick_cmd:A})).code===d.m.Success&&((0,x.SK)("保存成功"),s())}})]}),children:(0,f.jsx)(h.X,{headers:$,rows:A.map((t,s)=>{const n=[(0,f.jsx)(r.Sm,{value:t.index,handleInputChange:e=>{t.index=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.cmd,handleInputChange:e=>{t.cmd=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.father_index,handleInputChange:e=>{t.father_index=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{A.splice(e,1),V([...A])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{V((0,v.TI)(A,e,t))}})}),(0,f.jsx)(o.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("文件快捷命令")}),(0,f.jsx)(a.rA,{icon:"info",onClick:()=>{se("文件快捷命令")},title:"info"})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{O([...N,{cmd:"",note:"",file_suffix:"",params:""}])}}),(0,f.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("filesSetting/save",{file_quick_cmd:N})).code===d.m.Success&&((0,x.SK)("保存成功"),s())}})]}),children:(0,f.jsx)(h.X,{headers:D,rows:N.map((t,s)=>{const n=[(0,f.jsx)(r.Sm,{value:t.file_suffix,handleInputChange:e=>{t.file_suffix=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.cmd,handleInputChange:e=>{t.cmd=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.params,handleInputChange:e=>{t.params=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{N.splice(e,1),O([...N])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{O((0,v.TI)(N,e,t))}})})]})]})]})})}var $=s(87361);function D(){const{t:e}=(0,u.B)(),{check_user_auth:t}=(0,S.MH)(),s=[{index:1,name:`${e("个人环境")}`,rto:"private_env_setting",component:(0,f.jsx)(M,{})}];return t(l.oV.sys_setting_page)&&s.unshift({index:1,name:e("系统"),rto:"password",component:(0,f.jsx)(O,{})}),t(l.oV.sys_env_page)&&s.push({index:1,name:`${e("系统环境")}`,rto:"env_setting/",component:(0,f.jsx)(K,{})}),t(l.oV.auth_router_page)&&s.push({index:1,name:e("自定义路由"),rto:"customer_router/",component:(0,f.jsx)(A,{})}),t(l.oV.user_manage)&&s.push({index:1,name:e("用户管理"),rto:"user_manager/",component:(0,f.jsx)(B,{})}),t(l.oV.role_manage)&&s.push({index:1,name:e("角色管理"),rto:"role_manager/",component:(0,f.jsx)(T,{})}),(0,f.jsx)(i.W1,{optionList:s,father_route:$.o.setting})}},92350(e,t,s){s.d(t,{Q:()=>h,o:()=>p});var n=s(34843),i=s(82893),l=s(74777),o=s(96540),a=s(86149),r=s(23430),c=s(14284),d=s(74848);function h(){const[e,t]=(0,n.fp)(i.AG.prompt_card),{t:s,i18n:o}=(0,a.B)();return e=>{let n;e===l.jk.ffmpeg?n=(0,d.jsx)("div",{children:"视频转换,rtsp播放器等媒体功能都需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置"}):e===l.jk.smartmontools?n=(0,d.jsx)("div",{children:"磁盘检查需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置。"}):"保护目录"===e?n=(0,d.jsxs)("div",{children:["在删除的时候保护目录会拒绝删除。",(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:"可以使用 /* 来表达该目录下所有文件都禁止删除"}),(0,d.jsx)("li",{children:"可以使用 /** 来表达该目录下所有子目录文件都禁止删除"})]})]}):"文件夹路径"===e?n=(0,d.jsx)("div",{children:"用于在文件夹下切换根目录"}):"环境路径"===e?n=(0,d.jsx)("div",{children:"当在不同用户环境下运行的时候由于没有执行终端去加载PATH,这里可以添加额外的PATH路径,点击这里的保存还会更新系统上的path路径"}):"pty"===e?n=(0,d.jsx)("div",{children:"一些需要Pty环境的命令"}):"文件上传"===e?n=(0,d.jsx)("div",{children:(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:"对于不同的目录(包括所有子目录),可能是机械或者固态硬盘,机械硬盘在处理多个小文件的时候会做随机i/o,由于一般只有一个盘头所以会影响整体效率,特别是写操作,这里提供了上传时候的最大数量限制,对于下载数量目前不做限制."}),(0,d.jsx)("li",{children:"大文件支持断点和分块并发传输,建议并发数量设置为2,分块大小设置为10MB,大文件判断为500MB,设置过大的话会上传的时候会占据较大内存"})]})}):"目录快捷命令"===e?n=(0,d.jsx)("div",{children:"右键文件夹空白处用于,打开终端快捷执行命令"}):"文件快捷命令"===e?n=(0,d.jsx)("div",{children:"用于右键特定后缀的文件,执行一些快捷命令,文件后缀可以是多个,用空格分割"}):"Workflow"===e?n=(0,d.jsx)("div",{children:(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:"在特定的时间启动系统中的workflow任务"}),(0,d.jsx)("li",{children:"cron表达式是定时器 格式为: 秒 分 时 日 月 星期"}),(0,d.jsxs)("li",{children:[(0,d.jsx)("li",{children:'1. "*"(通配符,所有值)'}),(0,d.jsx)("li",{children:'2. "," 是枚举: 0 0 1,15 * * *'}),(0,d.jsx)("li",{children:'3. "-" 是范围: 0 0 1-5 * * *'}),(0,d.jsx)("li",{children:'4. "/" 是步长,标识每隔n执行 */3 * * * * * 每隔三秒,必须配合 * 使用 ,/ 只能写一次 ,有了/就成了定时器,而不是指定时间执行'})]})]})}):"插件配置"===e?n=(0,d.jsx)("div",{children:s("路径可以是一个 js 文件也可以是一个node 项目目录")}):"机器人配置"===e&&(n=(0,d.jsxs)("div",{children:[(0,d.jsx)("dv",{children:"机器人功能用于开通各种第三方支持的机器人,让第三方机器人接入本地的 AI 模型。"}),(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:" 1. qq 机器人需要先在手机 app 中添加,然后在https://q.qq.com/qqbot/ 登录机器人配置页面,在开发管理中复制机器人的 appId,appSecret 到这里就完成了配置了。目前 qq 机器人不稳定,且创建后无法删除(2026.07.05)"}),(0,d.jsx)("li",{children:" 2. https://opensource.dingtalk.com/developerpedia/docs/explore/tutorials/stream/bot/nodejs/create-bot 这个是钉钉机器人开通教程,注意复制钉钉的 clientId 的是时候不要复制成appId 了。"}),(0,d.jsx)("li",{children:" 3. 企业微信机器人的开通甚至不需要 pc 操作,在通讯录中点击智能机器人,选择 api 模式,就创建完成了,手机上直接复制 id 和密钥。"}),(0,d.jsx)("li",{children:" 4. 飞书https://open.feishu.cn/document/develop-an-echo-bot/introduction?from=banner 登录这个开发者后台,按照这个地址教程创建机器人,使用的时候这个机器人是作为一个应用,可以在工作台内搜索你的这个机器人的名字。"})]})]})),t({open:!0,title:"信息",context_div:(0,d.jsx)("div",{children:n})})}}let u=r.Ky;function p(){const[e,t]=(0,o.useState)([]);return(0,o.useEffect)(()=>{(async()=>{try{const e=await c.XO.get("themes");if(0===e.code){const s=e.data||[];u=[...r.Ky,...s],t(u)}else console.warn("获取主题列表失败,使用默认列表"),t(u)}catch(e){t(u)}})()},[]),e}},6960(e,t,s){s.d(t,{s:()=>o});var n=s(72635);const i=1440,l=525600;function o(e){e=e>1e12?e:1e3*e;const t=Date.now(),s=Math.abs(t-e)/6e4;return s<1?n.Ay.t("小于一分钟"):s<60?`${s.toFixed(0)} ${n.Ay.t("分钟前")}`:s<i?`${(s/60).toFixed(0)} ${n.Ay.t("小时前")}`:s<43200?`${(s/i).toFixed(0)} ${n.Ay.t("天前")}`:s<l?`${(s/43200).toFixed(0)} ${n.Ay.t("月前")}`:`${(s/l).toFixed(0)} ${n.Ay.t("年前")}`}},24659(e,t,s){var n=s(86149);s.d(t,["K",0,()=>{const{t:e}=(0,n.B)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2351],{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"])},48890(e,t,n){n.d(t,{Kw:()=>r,Tt:()=>s});var r=n(80952),s=(n(82327),n(1766),n(24854),n(90008),n(90846),n(40975),n(44286),n(30766),n(14973),n(69687),n(1234),n(47507),n(87268),n(24522));const o=`https://gcore.jsdelivr.net/npm/ace-builds@${r.version}/src-min-noconflict/`;r.config.set("basePath",o),r.config.set("modePath",o),r.config.set("themePath",o),r.config.set("workerPath",o)},12351(e,t,n){n.r(t),n.d(t,{default:()=>Pe});var r=n(96540),s=n(34843),o=n(82893),a=n(78247),c=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),v=n(89781),_=n(61396),k=n(46762),b=n(73337),w=n(89552),y=n(86059),x=n(58903);const M=(0,y.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},C={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]}}},j=new x.Sj({nodes:S,marks:C});const E=new(n(22091).A)({html:!0,linkify:!0,breaks:!1,typographer:!1});function O(e){const t=E.render(e??""),n=document.createElement("div");return n.innerHTML=t,x.S4.fromSchema(j).parse(n)}function A(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 D(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(" | ")} |`,a=[];if(r){a.push(o(t[0].cells)),a.push(`| ${s.map(e=>"-".repeat(e)).join(" | ")} |`);for(let e=1;e<t.length;e++)a.push(o(t[e].cells))}else{a.push(o(new Array(n).fill(""))),a.push(`| ${s.map(e=>"-".repeat(e)).join(" | ")} |`);for(const e of t)a.push(o(e.cells))}return a.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+A(e);case"heading":return`${t}${"#".repeat(e.attrs.level)} ${A(e)}`;case"blockquote":return z(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(R(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(R(e,t,`${t}${r+o}. `,`${t} `,o))}),n.join("\n")}case"table":return D(e).split("\n").map(e=>t+e).join("\n")}}function R(e,t,n,r,s){const o=e.attrs.checked,a=null===o?"":o?"[x] ":"[ ] ",c=[];e.forEach((e,t,n)=>{c.push(L(e,0===n?"":r))});const l=c.join("\n").split("\n");return n+a+l[0]+(l.length>1?"\n"+l.slice(1).join("\n"):"")}function z(e,t=""){const n=[];return e.forEach(e=>{n.push(L(e,t))}),n.join("\n\n")}function P(e){return z(e).trim()+"\n"}var G=n(74848);function F(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]),a=(r,o)=>r.map(r=>{const c=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"+(c?"":" md-outline-arrow--empty"),onClick:c?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:c?l?"arrow_right":"arrow_drop_down":""}),(0,G.jsx)("span",{className:"md-outline-text",children:r.text||t("未命名标题")})]}),c&&!l&&a(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("正文里还没有标题")})]}):(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:a(o,0)})]})}var T=n(38341),V=n(3772);function I(){const e=j;return(0,T.sM)({rules:[(0,T.JJ)(/^(#{1,6})\s$/,e.nodes.heading,e=>({level:e[1].length})),(0,T.JJ)(/^```([\w-]*)\s$/,e.nodes.code_block,e=>({language:e[1]??""})),(0,T.tG)(/^\s*>\s$/,e.nodes.blockquote),(0,T.tG)(/^\s*([-+*])\s$/,e.nodes.bullet_list),(0,T.tG)(/^(\d+)\.\s$/,e.nodes.ordered_list,e=>({order:Number(e[1])})),...T.Fr,T.gO]})}function q(e){return(t,n)=>{const r=t.schema.marks[e];return!!r&&(0,k.wh)(r)(t,n)}}function W(e,t={}){return(n,r)=>{const s=n.schema.nodes[e];if(!s)return!1;const{$from:o,$to:a}=n.selection,c=o.blockRange(a);if(!c)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(c.start,c.end,u,d)),!0}}const B=(e,t)=>(0,V.Sd)(e.schema.nodes.bullet_list)(e,t),H=(e,t)=>(0,V.Sd)(e.schema.nodes.ordered_list)(e,t),K=(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,a=r.after(o.depth);n.delete(o.start,o.end),n.insert(a,s),t(n.scrollIntoView())}return!0}return t&&t(e.tr.wrap(o,[{type:n}]).scrollIntoView()),!0},U={sink:(0,V.$B)(j.nodes.list_item),lift:(0,V.T2)(j.nodes.list_item),split:(0,V.wn)(j.nodes.list_item),wrap_bullet:B,wrap_ordered:H};n(41631),n(50576),n(70432);function J(e){return 0===e?W("paragraph"):W("heading",{level:e})}function X(e){return!(!e.ctrlKey&&!e.metaKey)}function Z(e,t){return(0,y.D8)(1)(e,t)}const Y=r.forwardRef(function(e,t){const n=(0,r.useRef)(null),s=(0,r.useRef)(null),o=(0,r.useRef)(e.on_change),a=(0,r.useRef)(e.on_save),c=(0,r.useRef)(e.on_selection_change);return(0,r.useEffect)(()=>{o.current=e.on_change,a.current=e.on_save,c.current=e.on_selection_change}),(0,r.useEffect)(()=>{if(!n.current)return;const r=p.$t.create({doc:O(e.value??""),plugins:[(0,v.b6)(),I(),(0,_.w)({"Mod-z":v.tN,"Mod-y":v.ZS,"Mod-Shift-z":v.ZS,"Mod-b":q("strong"),"Mod-i":q("em"),"Mod-Shift-x":q("strike"),"Mod-`":q("code"),"Mod-1":(e,t)=>J(1)(e,t),"Mod-2":(e,t)=>J(2)(e,t),"Mod-3":(e,t)=>J(3)(e,t),"Mod-0":(e,t)=>J(0)(e,t),"Mod-Shift-8":B,"Mod-Shift-9":H,"Mod-Shift-.":K,Tab:U.sink,"Shift-Tab":U.lift,"Mod-Enter":Z,"Mod-s":()=>(a.current?.(),!0)}),(0,y.LF)({allowTableNodeSelection:!0}),(0,y.AL)(),(0,b.A)({color:"var(--primary, #1a73e8)",width:2}),(0,w.z)(),(0,_.w)({Enter:(0,k.st)(k.pC,U.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,_.w)(k.RV)]}),l=new g.Lz(n.current,{state:r,editable:()=>!1!==e.editable,handleClickOn(e,t,n,r,s){if(!X(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)=>(X(t)&&e.dom.classList.add("md-ctrl-down"),!1),keyup:(e,t)=>(X(t)||e.dom.classList.remove("md-ctrl-down"),!1),blur:e=>(e.dom.classList.remove("md-ctrl-down"),!1)},dispatchTransaction(e){const t=l.state.apply(e);l.updateState(t),e.docChanged&&o.current?.(P(t.doc)),(e.selectionSet||e.docChanged)&&c.current?.()},attributes:{class:"md-wysiwyg-content",spellcheck:"false"}});s.current=l;const i={get_markdown:()=>P(l.state.doc),set_markdown:e=>{const t=O(e);l.dispatch(l.state.tr.replaceWith(0,l.state.doc.content.size,t.content))},focus:()=>l.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}(l.state),active_marks:()=>(l.state.storedMarks??l.state.selection.$from.marks()).map(e=>e.type.name),active_block:()=>{const{$from:e}=l.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,y.e)(e),s=r.table,o=r.row,a=r.cell,c=r.header_cell??r.cell;if(!s||!o||!a)return null;const l=e=>o.create(null,Array.from({length:t},()=>e.createAndFill())),i=l(c),u=Array.from({length:n},()=>l(a));return s.create(null,[i,...u])}(l.state.schema,e,t);if(!n)return;const{from:r}=l.state.selection,s=l.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 a=l.state.tr;o===r?a.replaceSelectionWith(n):a.insert(o,n),l.dispatch(a.scrollIntoView());const c=l.state.doc.resolve(Math.min(o+3,l.state.doc.content.size));try{l.dispatch(l.state.tr.setSelection(l.state.selection.constructor.near(c)))}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}(l.state),scroll_to_pos:e=>{const t=l.state.doc.content.size,n=Math.max(0,Math.min(e,t)),r=l.state.doc.nodeAt(n);let s;try{s=r?p.U3.near(l.state.doc.resolve(n+1),1):p.U3.near(l.state.doc.resolve(n),1)}catch{s=p.U3.near(l.state.doc.resolve(0),1)}l.dispatch(l.state.tr.setSelection(s).scrollIntoView()),l.focus()}};return"function"==typeof t?t(i):t&&(t.current=i),e.on_ready?.(i),()=>{l.destroy(),s.current=null}},[]),(0,G.jsx)("div",{className:"md-wysiwyg",ref:n})});function Q(e){const{t}=(0,f.B)(),n=(0,r.useRef)(null),[s,o]=(0,r.useState)({marks:[],block:{name:"paragraph"}}),[a,c]=(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:ee(n.$from)}),n.empty)return void c(null);const s=t.coordsAtPos(n.from),a=t.coordsAtPos(n.to),l=(Math.min(s.left,a.left)+Math.max(s.right,a.right))/2,i=Math.min(s.top,a.top),u=Math.max(s.bottom,a.bottom);c({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(!a||!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})},[a,e.refresh_key]),!a)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,v=g+4,_=Math.max(v,window.innerWidth-g-4),k=document.querySelector(".header")?.getBoundingClientRect().bottom??0,b=a.top-m.h-8,w=b<k+4,y={top:w?Math.min(a.bottom+8,window.innerHeight-m.h-4):b,left:Math.min(_,Math.max(v,a.left))};return(0,G.jsxs)("div",{className:"mdtb mdtb--floating"+(w?" mdtb--below":""),ref:n,style:y,children:[p("h1","H1","一级标题",()=>i(W("heading",{level:1})),d(1)),p("h2","H2","二级标题",()=>i(W("heading",{level:2})),d(2)),p("h3","H3","三级标题",()=>i(W("heading",{level:3})),d(3)),(0,G.jsx)("span",{className:"mdtb__sep"}),p("b","B","加粗",()=>i(q("strong")),u("strong")),p("i","I","斜体",()=>i(q("em")),u("em")),p("s","S","删除线",()=>i(q("strike")),u("strike")),p("code","</>","行内代码",()=>i(q("code")),u("code")),(0,G.jsx)("span",{className:"mdtb__sep"}),p("ul","≔","无序列表",()=>i(B)),p("ol","1.","有序列表",()=>i(H)),p("quote","❝","引用",()=>i(K))]})}function ee(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 te=n(75725);const ne="cut",re="copy",se="paste",oe="strong",ae="em",ce="strike",le="code",ie="h1",ue="h2",de="h3",me="paragraph",he="bullet",fe="ordered",pe="quote",ge="code_block",ve="clean",_e="row_before",ke="row_after",be="row_delete",we="col_before",ye="col_after",xe="col_delete",Me="header_toggle",$e="cell_merge",Se="cell_split",Ce="table_delete",je="table_insert",Ee="select_all";function Oe(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 a=!!n.closest("td, th");s({x:e.clientX,y:e.clientY,in_table:a||(0,y.aH)(t.state)})};return document.addEventListener("contextmenu",e,!0),()=>document.removeEventListener("contextmenu",e,!0)},[]);const a=()=>s(null),c=(0,r.useCallback)(e=>{const t=o.current();t&&(e(t.state,t.dispatch),t.focus(),a())},[]),l=e=>{const t=o.current();t?.focus(),document.execCommand(e),a()};if(!n)return null;const i=n.in_table?[{r:t("上方插入行"),v:_e},{r:t("下方插入行"),v:ke},{r:t("左侧插入列"),v:we},{r:t("右侧插入列"),v:ye},{r:t("删除行"),v:be},{r:t("删除列"),v:xe},{r:t("切换表头行"),v:Me},{r:t("合并单元格"),v:$e},{r:t("拆分单元格"),v:Se},{r:t("删除表格"),v:Ce}]:[],u=[{r:t("剪切"),v:ne},{r:t("复制"),v:re},{r:t("粘贴"),v:se},{r:t("格式"),v:"format",items:[{r:t("加粗"),v:oe},{r:t("斜体"),v:ae},{r:t("删除线"),v:ce},{r:t("行内代码"),v:le}]},{r:t("段落"),v:"block",items:[{r:t("一级标题"),v:ie},{r:t("二级标题"),v:ue},{r:t("三级标题"),v:de},{r:t("正文"),v:me}]},{r:t("插入"),v:"insert",items:[{r:t("无序列表"),v:he},{r:t("有序列表"),v:fe},{r:t("引用"),v:pe},{r:t("代码块"),v:ge},{r:t("插入表格"),v:je}]},...i.length?[{r:t("表格"),v:"table",items:i}]:[],{r:t("清除格式"),v:ve},{r:t("全选"),v:Ee}];return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(te.rY,{click:a}),(0,G.jsx)(te.Pu,{x:n.x,y:n.y,items:u,click:t=>{switch(t){case ne:return l("cut");case re:return l("copy");case se:return l("paste");case oe:return c(q("strong"));case ae:return c(q("em"));case ce:return c(q("strike"));case le:return c(q("code"));case ie:return c(W("heading",{level:1}));case ue:return c(W("heading",{level:2}));case de:return c(W("heading",{level:3}));case me:return c(W("paragraph"));case he:return c(B);case fe:return c(H);case pe:return c(K);case ge:return c(W("code_block"));case je:return a(),void e.on_insert_table?.();case _e:return c(y.JD);case ke:return c(y.gC);case we:return c(y.RC);case ye:return c(y.GU);case be:return c(y.aR);case xe:return c(y.gR);case Me:return c(y.uC);case $e:return c(y.w7);case Se:return c(y.L0);case Ce:return c(y.kG);case ve:return c((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 Ee:return c((e,t)=>{const{TextSelection:n}=e.selection.constructor;return t?.(e.tr.setSelection(n.create(e.doc,0,e.doc.content.size))),!0})}}})]})}var Ae=n(48890);const De=(0,r.forwardRef)(function({value:e="",mode:t="plain_text",showLineNumbers:n=!0,wrap:a=!1,readOnly:c=!1,onChange:l,onCursorChange:i,onSave:u,className:d,style:m,options:h},f){const p=(0,r.useRef)(null),g=(0,r.useRef)(null),[v]=(0,s.fp)(o.AG.user_base_info),_=v.user_data.theme?.includes("dark")?"cloud_editor_dark":"cloud9_day",k=(0,r.useRef)({onChange:l,onCursorChange:i,onSave:u});return k.current={onChange:l,onCursorChange:i,onSave:u},(0,r.useImperativeHandle)(f,()=>({getValue:()=>g.current?.getValue()??"",setValue:(e,t=!1)=>{const n=g.current;if(n&&(n.setValue(e,-1),t)){const e=n.getSession();e.indentAll?.()}},getEditor:()=>g.current,getCursorOffset:()=>{const e=g.current;return e?e.session.doc.positionToIndex(e.getCursorPosition(),0):0},setCursorOffset:e=>{const t=g.current;if(!t)return;const n=t.session.doc.indexToPosition(Math.max(0,e),0);t.selection.moveCursorTo(n.row,n.column),t.selection.clearSelection(),t.scrollToLine(n.row,!0,!1,()=>{})},focus:()=>g.current?.focus()}),[]),(0,r.useEffect)(()=>{const r=p.current;if(!r)return;const s=Ae.Kw.edit(r,{value:e,mode:`ace/mode/${t}`,theme:`ace/theme/${_}`,showPrintMargin:!1,highlightActiveLine:!1,fontSize:14,readOnly:c,showLineNumbers:n,showGutter:n,wrap:a,useWorker:!1,...h});return s.on("change",()=>{k.current.onChange?.(s.getValue())}),s.selection.on("changeCursor",()=>{k.current.onCursorChange?.()}),s.commands.addCommand({name:"filecat_save",bindKey:{win:"Ctrl-S",mac:"Command-S"},exec:()=>{k.current.onSave?.()},readOnly:!0}),g.current=s,()=>{s.destroy(),g.current=null}},[]),(0,G.jsx)("div",{ref:p,className:d,style:m})});var Ne=n(69918),Le=n(2543),Re=n(86090),ze=n(87361);function Pe(){const{t:e}=(0,f.B)(),t=(0,Re.Zp)(),{check_user_auth:n}=(0,a.MH)(),p=n(c.oV.md_editor_setting),[g,v]=(0,s.fp)(o.AG.md_editor),[_,k]=(0,r.useState)(null),[b,w]=(0,r.useState)(!1),[y,x]=(0,r.useState)(!1),[M,$]=(0,r.useState)(0),S=(0,r.useRef)(null),[C,j]=(0,r.useState)([]),[E,O]=(0,r.useState)(-1),[A,D]=(0,r.useState)(15),[N,L]=(0,r.useState)(!1),R=(0,r.useRef)(null),z=(0,r.useRef)(null),[P,T]=(0,s.fp)(o.AG.md_editor_show_outline),[V,I]=(0,s.fp)(o.AG.md_editor_mode),[q,W]=(0,r.useState)(""),B=(0,r.useRef)(null),H=(0,r.useCallback)(()=>{const e="wysiwyg"===V?"source":"wysiwyg";if("source"===e){const e=S.current?.get_markdown();void 0!==e&&(W(e),B.current?.setValue(e))}else k(q),U(e=>e+1);I(e)},[V,q]),[K,U]=(0,r.useState)(0),[J,X]=(0,r.useState)(Ne.FG),Z=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=!1;return(0,Ne.gC)().then(t=>{e||X(t)}),()=>{e=!0}},[]),(0,r.useEffect)(()=>{(0,Ne.Ce)(Z.current,J)},[J]);const ee=(0,r.useRef)([]),te=(0,r.useCallback)(()=>{let e;if("source"===V)e=function(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],a=s;s+=o.length+(n[e+1]?.length??0);const c=o.endsWith("\r")?o.slice(0,-1):o,l=c.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(c);if(!u)continue;const d=u[1].length,m=u[2].replace(/\s+#+\s*$/,"").trim();t.push({level:d,text:m,pos:a})}return t}(q);else{const t=S.current;if(!t)return;e=t.get_headings()}ee.current=e,j(e)},[V,q]),ne=(0,r.useCallback)(()=>{if("source"===V){const e=B.current;if(!e)return;return void O(function(e,t){let n=-1;for(const r of e){if(!(r.pos<=t))break;n=r.pos}return n}(ee.current,e.getCursorOffset()))}const e=S.current?.get_view();if(!e)return;const t=e.state.selection.from;let n=-1;for(const e of ee.current){if(!(e.pos<=t))break;n=e.pos}O(n)},[V]);(0,r.useEffect)(()=>{let t=!1;if(g?.url)return x(!1),w(!0),h.l.get(g.url).then(e=>{if(t)return;const n=e??"";k(n),W(n)}).catch(()=>{t||((0,u.zN)(e("打开失败")),k(""),W(""))}).finally(()=>{t||w(!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 re=(0,r.useRef)(H);re.current=H,(0,r.useEffect)(()=>{const e=e=>{(e.ctrlKey||e.metaKey)&&"/"===e.key&&(e.preventDefault(),e.stopPropagation(),re.current())};return document.addEventListener("keydown",e,!0),()=>document.removeEventListener("keydown",e,!0)},[]),(0,r.useEffect)(()=>{te(),ne()},[M,te,ne]);const se=(0,r.useCallback)(Le.throttle(e=>{if(!R.current||!z.current)return;const t=parseFloat(getComputedStyle(R.current).fontSize),n=e.clientX/t,r=window.innerWidth/t-4,s=2.25+z.current.offsetWidth/t;n<=r&&n>=s&&D(parseFloat(n.toFixed(2)))},32),[]),oe=()=>{L(!1),R.current?.removeEventListener("pointermove",se)},ae=async()=>{if(!g?.name||!g?.path)return;const t="source"===V?B.current?.getValue()??q: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("保存失败"))},ce=(0,r.useRef)(ae);ce.current=ae;const le=()=>{v({}),x(!1),k(null),S.current=null,g?.close?.()},ie=(0,r.useMemo)(()=>g?.url??"md_editor",[g?.url]);return g?.name?(0,G.jsxs)("div",{id:"md-editor-container",ref:Z,children:[(0,G.jsx)(i.A,{ignore_tags:!0,left_children:[(0,G.jsx)(l.rA,{title:e("关闭"),icon:"close",onClick:le},1),(0,G.jsx)("div",{className:"md-editor-title",children:g.name},2),...y?[(0,G.jsx)(l.rA,{title:e("保存"),icon:"save",onClick:ae},2)]:[],(0,G.jsx)(l.rA,{title:e("大纲"),icon:"list",onClick:()=>T(e=>!e),selected:P},4),(0,G.jsx)(l.rA,{title:e("wysiwyg"===V?"源码模式":"实时编辑模式"),icon:"wysiwyg"===V?"code":"edit",onClick:H},5),...p?[(0,G.jsx)(l.rA,{title:e("编辑器设置"),icon:"settings",onClick:()=>{le(),t(ze.o.md_editor_setting_page)}},6)]:[]]}),(0,G.jsxs)("div",{className:"md-editor-context",ref:R,children:[b&&(0,G.jsxs)("div",{className:"common-box common-box-center",children:[e("加载中"),"..."]}),!b&&null!==_&&(0,G.jsxs)(r.Fragment,{children:[P&&(0,G.jsx)("div",{className:"md-outline-panel",style:{width:`${A}em`},children:(0,G.jsx)(F,{items:C,active_pos:E,on_click:e=>{if("source"===V){const t=B.current;if(!t)return;return t.focus(),t.setCursorOffset(e.pos),void O(e.pos)}S.current?.scroll_to_pos(e.pos),O(e.pos)}})}),P&&(0,G.jsx)("div",{className:"md-editor-divider",ref:z,onPointerDown:()=>{L(!0),R.current?.addEventListener("pointermove",se)},onPointerUp:oe}),N&&(0,G.jsx)("div",{className:"md-editor-drag-overlay",onPointerUp:oe}),(0,G.jsx)("div",{className:"md-editor-scroll",children:(0,G.jsx)("div",{className:"md-editor-sheet",children:"wysiwyg"===V?(0,G.jsxs)(r.Fragment,{children:[(0,G.jsx)(Q,{get_view:()=>S.current?.get_view()??null,refresh_key:M}),(0,G.jsx)(Y,{value:_,ref:S,on_ready:e=>{const t=e.get_headings();ee.current=t,j(t),O(-1)},on_change:()=>{y||x(!0)},on_save:()=>ce.current(),on_selection_change:()=>$(e=>e+1)},`${ie}#${K}`),(0,G.jsx)(Oe,{get_view:()=>S.current?.get_view()??null,on_insert_table:()=>{S.current?.insert_table(3,3),x(!0)}})]}):(0,G.jsx)(De,{ref:B,value:q,mode:"markdown",wrap:!0,className:"md-source-editor",onChange:e=>{W(e),y||x(!0)},onSave:()=>ce.current(),onCursorChange:()=>ne()},`source#${ie}#${K}`)})})]})]})]}):null}},69918(e,t,n){n.d(t,{Ce:()=>l,FG:()=>r.FG,fy:()=>c,gC:()=>a});var r=n(18840),s=n(14284),o=n(53459);async function a(){try{const e=await s.XO.get("md_editor_setting/get");return{...r.FG,...e?.data??{}}}catch(e){return{...r.FG}}}async function c(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))}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2851],{8694(e,t,s){s.d(t,{$K:()=>a,RB:()=>r,l5:()=>i,qB:()=>n,vo:()=>c,vr:()=>l});class n{targetProxyUrl;proxyPort;sysProxyPort}let o=function(e){return e[e.tcp=0]="tcp",e[e.udp=1]="udp",e}({});class a{open=!1;port;key="";async_ips=[]}class c{client_num_id;client_name;open=!1;ip;mask;serverIp;serverPort;key="";model=o.udp}let r=function(e){return e[e.row=1]="row",e[e.json=2]="json",e[e.form=3]="form",e}({});class l{body_type;header_type;url;method;headers;data;form_data_list;local_download_path}class i{enabled;ip;port;bypass;useForLocal;type}},77481(e,t,s){s.d(t,{S:()=>r,X:()=>c});var n=s(96540),o=s(61443),a=s(74848);function c(e){const[t,s]=n.useState([]),c=(0,n.useRef)(-1),[r,l]=(0,n.useState)(-1),[i,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 p=()=>{c.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((t,s)=>{const n=!!e.filter&&(e.filter.column??0)===s;let c=t;if(n){const s=e.filter,n=s.options.find(e=>e.value===s.value);null!=s.value&&n&&(c=`${t} (${n.label})`)}return(0,a.jsx)("th",{className:n?"table-filter-col":"",children:n?(0,a.jsx)(o.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:c}):t},s)})})}),(0,a.jsx)("tbody",{children:t.map((t,s)=>{const n=!!e.onRowDrag;return(0,a.jsx)("tr",{className:n?(r===s?"row-dragging":"")+(i===s?" row-drop-target":""):"",draggable:n,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{n&&(c.current=s,l(s),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!n||c.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(s))},onDrop:t=>{n&&(t.preventDefault(),(()=>{const t=c.current,s=i;p(),t<0||s<0||t===s||e.onRowDrag?.(t,s)})())},onDragEnd:p,children:t.map((s,n)=>{const o=n===t.length-1?"small":"";return(0,a.jsx)("td",{className:o,style:{width:e.width??"auto"},children:s},n)})},s)})})]})}function r(e){return(0,a.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,a.jsx)("div",{children:e},t))})}},42851(e,t,s){s.r(t),s.d(t,{default:()=>$});var n=s(96540),o=s(75725),a=s(14284),c=s(62042),r=s(53459),l=s(70447),i=s(61443),d=s(85997),p=s(77481),h=s(8694),u=s(14944),x=s(92275),j=s(86149),m=s(4412),v=s(74848);function g(e){const{t}=(0,j.B)(),[s,g]=(0,n.useState)(void 0),[y,f]=(0,n.useState)(!1),[S,_]=(0,n.useState)(""),[w,C]=(0,n.useState)([t(`${t("名称")}`),t(`${t("虚拟")}ip`),`${t("物理")}`,t("在线状态"),t("选择")]),[k,b]=(0,n.useState)([]),[I,A]=(0,n.useState)({}),[P,U]=(0,n.useState)(!1);(0,n.useEffect)(()=>{(async()=>{const e=new x.hf(x.HK.vir_net_serverIno_get);u.ws.addMsg(x.HK.vir_net_serverIno_get,e=>{(e=>{for(const s of e){const e=s[s.length-1];s[s.length-1]=(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(l.fq,{ok:e}),t(e?"在线":"离线")]}),s[0]=(0,v.jsx)(l.xP,{context:s[0],tip_context:s[0]}),s[2]=(0,v.jsx)(l.xP,{context:s[2],tip_context:s[2]})}})(e.context),b(e.context)}),await u.ws.send(e)})();return(async()=>{const e=await a._U.get("vir/server/get");if(e.code!==r.m.Success)return;const t=e.data;g(t.port),_(t.key),f(t.open)})(),()=>{}},[]);return(0,v.jsxs)("div",{children:[(0,v.jsxs)(m.aZ,{position:"right",children:[!!Object.keys(I).length&&I[0],!!Object.keys(I).length&&(0,v.jsx)(d.rA,{icon:"delete",title:"删除",onClick:async()=>{await a._U.post("vir/server/delete/client",{ips:Object.keys(I)}),A({})}})]}),(0,v.jsx)(o.fI,{children:(0,v.jsxs)(o.VP,{children:[(0,v.jsxs)(l.Zp,{title:"",rightBottomCom:(0,v.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{const e=new h.$K;e.open=y,e.key=S,P&&(e.async_ips=Object.keys(I)),s&&(e.port=parseInt(s));(await a._U.post("vir/server/save",e)).code===r.m.Success?((0,c.SK)("保存成功"),U(!1)):(0,c.zN)("网络错误")}}),children:[(0,v.jsx)(i.Sm,{placeholder:"port",value:s,handleInputChange:e=>{g(e)}}),(0,v.jsx)(i.Sm,{type:"password",placeholder:"key ",value:S,handleInputChange:e=>{_(e)}}),(0,v.jsxs)("form",{children:[t("状态"),":",(0,v.jsx)(p.S,{isFlex:!0,columns:[(0,v.jsx)(i.U6,{value:1,context:t("开启"),selected:y,onchange:()=>{f(!y)}}),(0,v.jsx)(i.U6,{value:1,context:t("关闭"),selected:!y,onchange:()=>{f(!y)}})]})]}),!!Object.keys(I).length&&(0,v.jsx)(i.GL,{context:t("同步信息给选中服务器"),selected:P,onchange:()=>{U(!P)}})]}),(0,v.jsx)(l.Zp,{title:"",children:(0,v.jsx)(p.X,{headers:w,rows:k.map(e=>[...e,(0,v.jsx)(i.GL,{context:t(""),selected:I[e[1]],onchange:()=>{const t={...I};t[e[1]]?delete t[e[1]]:t[e[1]]=e,A(t)}})]),width:"10rem"})})]})})]})}function y(e){const{t}=(0,j.B)(),[s,m]=(0,n.useState)(""),[g,y]=(0,n.useState)(void 0),[f,S]=(0,n.useState)(""),[_,w]=(0,n.useState)(""),[C,k]=(0,n.useState)(void 0),[b,I]=(0,n.useState)(!1),[A,P]=(0,n.useState)(""),[U,K]=(0,n.useState)(!1);(0,n.useEffect)(()=>{(async()=>{const e=await a._U.get("vir/client/get");if(e.code!==r.m.Success)return;const t=e.data;if(k(t.serverPort),S(t.serverIp),m(t.ip),y(t.mask),P(t.key),I(t.open),w(t.client_name),t.open){const e=new x.hf(x.HK.vir_net_client_get),t=(await u.ws.send(e)).context.state;K(t),u.ws.addMsg(x.HK.vir_net_client_get,e=>{K(e.context.state)})}})()},[]);return(0,v.jsx)("div",{children:(0,v.jsx)(o.fI,{children:(0,v.jsxs)(o.VP,{children:[(0,v.jsxs)(l.Zp,{title:"",rightBottomCom:(0,v.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{const e=new h.vo;e.ip=s,e.mask=parseInt(g),e.key=A,e.serverIp=f,e.serverPort=parseInt(C),e.open=b,e.client_name=_;(await a._U.post("vir/client/save",e)).code===r.m.Success?(0,c.SK)("保存成功"):(0,c.zN)("网络错误")}}),titleCom:(0,v.jsxs)("div",{children:[t("连接状态"),(0,v.jsx)(l.fq,{ok:U})]}),children:[(0,v.jsx)(i.Sm,{placeholder:"ip ",value:s,handleInputChange:e=>{m(e)}}),(0,v.jsx)(i.Sm,{placeholder:"mask",value:g,handleInputChange:e=>{y(e)}}),(0,v.jsx)(i.Sm,{placeholder:`${t("服务器")} ip`,value:f,handleInputChange:e=>{S(e)}}),(0,v.jsx)(i.Sm,{placeholder:`${t("服务器")} part`,value:C,handleInputChange:e=>{k(e)}}),(0,v.jsx)(i.Sm,{placeholder:"名称 ",value:_,handleInputChange:e=>{w(e)}}),(0,v.jsx)(i.Sm,{type:"password",placeholder:"key ",value:A,handleInputChange:e=>{P(e)}}),(0,v.jsxs)("form",{children:[t("状态"),(0,v.jsx)(p.S,{isFlex:!0,columns:[(0,v.jsx)(i.U6,{value:1,context:t("开启"),selected:b,onchange:()=>{I(!b)}}),(0,v.jsx)(i.U6,{value:1,context:t("关闭"),selected:!b,onchange:()=>{I(!b)}})]})]})]}),(0,v.jsxs)(l.Zp,{title:"",children:[(0,v.jsx)("div",{children:"ip: 虚拟ip, “10.0.0.0 - 10.255.255.255”和“172.16.0.0 - 172.31.255.255”和“192.168.0.0 - 192.168.255.255”这三个网段属于内网ip"}),(0,v.jsx)("div",{children:"mask: 一些常见的子网掩码网段/8:255.0.0.0;/16:255.255.0.0 ;/24:255.255.255.0"}),(0,v.jsx)("div",{children:"key:用于验证身份信息并加密的和服务器设置的一样"})]})]})})})}var f=s(34843),S=s(82893),_=s(23430),w=s(78247),C=s(21499),k=s(24659),b=s(64694);function I(e){const{t}=(0,j.B)(),[s,u]=(0,n.useState)(""),[x,m]=(0,n.useState)(""),[g,y]=(0,n.useState)(""),[I,A]=(0,n.useState)(!1),[P,U]=(0,n.useState)(!1),[K,F]=(0,n.useState)({list:[]}),[$,H]=(0,f.fp)(S.AG.editorSetting),[N,Z]=(0,f.fp)(S.AG.user_base_info),O=[t("端口"),t("目标地址"),t("目标端口"),t("开启"),t("备注"),t("删除")],[B,D]=(0,n.useState)([]),E=[t("port"),t("ip"),t("type"),t("开启")],[z,V]=(0,n.useState)([]),M=[t("编辑"),t("开启"),t("备注"),t("删除")],T=(0,k.K)(),X=async()=>{const e=[a._U.post("vir/client/tcp_proxy/get"),a._U.post("http/proxy/server/get")];let t;N.sys===_.XM.mac?t=(async()=>{const e=await a._U.post("http/proxy/get/mac");if(e.code!==r.m.Success)return;const t=[],s=[];for(const n of e.data)"Wi-Fi"===n.name?t.push(n):s.push(n);V([...t,...s])})():N.sys===_.XM.win&&(t=(async()=>{const e=await a._U.post("http/proxy/get/win");if(e.code===r.m.Success){const t=e.data;u(t.ip),m(t.port),A(t.enabled),y(t.bypass),U(t.useForLocal)}})()),t&&e.push(t);const[s,n]=await Promise.all(e);s.code===r.m.Success&&D(s.data),n.code===r.m.Success&&F(n.data)};(0,n.useEffect)(()=>{X()},[]);return(0,v.jsx)("div",{children:(0,v.jsxs)(o.fI,{children:[N.sys===_.XM.win&&(0,v.jsx)(o.VP,{widthPer:33,children:(0,v.jsxs)(l.Zp,{title:"Http Proxy",rightBottomCom:(0,v.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{const e=new h.l5;e.port=parseInt(x),e.enabled=I,e.useForLocal=P,e.ip=s,e.bypass=g;(await a._U.post("http/proxy/set/win",e)).code===r.m.Success&&(X(),(0,c.SK)("保存成功"))}}),children:[(0,v.jsx)(i.Sm,{placeholder:"ip (default localhost) ",value:s,handleInputChange:e=>{u(e)}}),(0,v.jsx)(i.Sm,{placeholder:"port ",value:x,handleInputChange:e=>{m(e)}}),(0,v.jsx)(i.Sm,{placeholder:t("忽略ip"),value:g,handleInputChange:e=>{y(e)}}),(0,v.jsxs)("form",{children:[t("请勿将代理服务器用于本地(Intranet)地址"),(0,v.jsx)(p.S,{isFlex:!0,columns:[(0,v.jsx)(i.U6,{value:1,context:t("开启"),selected:P,onchange:()=>{U(!P)}}),(0,v.jsx)(i.U6,{value:1,context:t("关闭"),selected:!P,onchange:()=>{U(!P)}})]})]}),(0,v.jsxs)("form",{children:[t("状态"),(0,v.jsx)(p.S,{isFlex:!0,columns:[(0,v.jsx)(i.U6,{value:1,context:t("开启"),selected:I,onchange:()=>{A(!I)}}),(0,v.jsx)(i.U6,{value:1,context:t("关闭"),selected:!I,onchange:()=>{A(!I)}})]})]})]})}),N.sys===_.XM.mac&&(0,v.jsx)(o.VP,{children:z.map((e,s)=>(0,v.jsxs)(l.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e.name})," "]}),titleCom:(0,v.jsx)("div",{children:(0,v.jsx)(d.rA,{icon:"save",title:t("保存"),onClick:()=>{(async e=>{const t=z[e];(await a._U.post("http/proxy/set/mac",[t])).code===r.m.Success&&(X(),(0,c.SK)("保存成功"))})(s)}})}),children:[(0,v.jsx)(p.X,{headers:E,rows:e.proxies.map((e,t)=>{const n=[(0,v.jsx)(i.Sm,{value:e.port,handleInputChange:t=>{e.port=parseInt(t)},no_border:!0}),(0,v.jsx)(i.Sm,{value:e.ip,handleInputChange:t=>{e.ip=t},no_border:!0}),(0,v.jsx)("div",{children:1===e.type?"http":"https"}),(0,v.jsx)(i.l6,{value:e.enabled,onChange:e=>{((e,t,s)=>{const n=[...z];n[e].proxies[t].enabled=s,V(n)})(s,t,e)},options:T,no_border:!0})];return n}),width:"10rem"}),"ignore ips",(0,v.jsx)(i.Sm,{value:e.bypass,handleInputChange:e=>{z[s].bypass=e},no_border:!0})]},s))}),(0,v.jsxs)(o.VP,{children:[(0,v.jsx)(l.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:t("Tcp Proxy")})," "]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(d.rA,{icon:"add",title:t("添加"),onClick:()=>{D([...B,{note:"",open:!1,port:0,target_port:0,target_ip:""}])}}),(0,v.jsx)(d.rA,{icon:"save",title:t("保存"),onClick:async()=>{const e=[];for(let t=0;t<B.length;t++)B[t].index=t,e.push(B[t]);(await a._U.post("vir/client/tcp_proxy/save",e)).code===r.m.Success&&((0,c.SK)("保存成功"),X())}})]}),children:(0,v.jsx)(p.X,{headers:O,rows:B.map((e,s)=>{const n=[(0,v.jsx)(i.Sm,{value:e.port,handleInputChange:t=>{e.port=parseInt(t)},no_border:!0}),(0,v.jsx)(i.Sm,{value:e.target_ip,handleInputChange:t=>{e.target_ip=t},no_border:!0}),(0,v.jsx)(i.Sm,{value:e.target_port,handleInputChange:t=>{e.target_port=parseInt(t)},no_border:!0}),(0,v.jsx)(i.l6,{value:e.open,onChange:e=>{B[s].open=e,D([...B])},options:T,no_border:!0}),(0,v.jsx)(i.Sm,{value:e.note,handleInputChange:t=>{e.note=t},no_border:!0}),(0,v.jsx)("div",{children:(0,v.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>(e=>{B.splice(e,1),D([...B])})(s)})})];return n}),width:"10rem",onRowDrag:(e,t)=>{D((0,b.TI)(B,e,t))}})}),(0,v.jsx)(l.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:t("Http Proxy Server")})," "]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(d.rA,{icon:"add",title:t("添加端口实例"),onClick:()=>{K.list.push({open:!1,port:0,note:"",list:[]}),F({...K})}}),(0,v.jsx)(d.rA,{icon:"save",title:t("保存"),onClick:async()=>{(await a._U.post("http/proxy/server/save",K)).code===r.m.Success&&(0,c.SK)("保存成功")}})]}),children:K.list.map((e,s)=>(0,v.jsxs)("div",{className:"net-proxy-instance",children:[(0,v.jsxs)("div",{className:"net-proxy-instance__toolbar",children:[(0,v.jsxs)("span",{className:"net-proxy-instance__label",children:[t("端口实例")," #",s+1]}),(0,v.jsx)("span",{children:t("状态")}),(0,v.jsx)(i.l6,{value:e.open,width:"15%",onChange:t=>{e.open=t,F({...K})},options:T,no_border:!0}),(0,v.jsx)("span",{children:t("端口")}),(0,v.jsx)(i.Sm,{value:e.port||"",handleInputChange:t=>{e.port=t?parseInt(t):0,F({...K})},no_border:!0,width:"80px"}),(0,v.jsx)(d.rA,{icon:"add",title:t("添加规则"),onClick:()=>{e.list.push({note:"",open:!1}),F({...K})}}),(0,v.jsx)(d.rA,{icon:"delete",title:t("删除端口实例"),onClick:()=>{K.list.splice(s,1),F({...K})}}),(0,v.jsx)(i.Sm,{placeholder:t("备注"),width:"100%",value:e.note,handleInputChange:t=>{e.note=t,F({...K})},no_border:!0})]}),(0,v.jsx)(p.X,{headers:M,rows:e.list.map((n,o)=>{const c=[(0,v.jsx)("div",{children:(0,v.jsx)(d.rA,{icon:"edit",title:t("编辑"),onClick:()=>{(async(e,t)=>{const s=K.list[e];if(!s)return;const n=s.list[t];if(!n)return;n.random_key||(n.random_key=(0,C.hU)(),F({...K}));const o=await a._U.post("http/proxy/server/code/get",{key:n.random_key,name:n.random_key});H({model:"ace/mode/javascript",open:!0,fileName:"",can_format:!0,save:async e=>{0===(await a._U.post("http/proxy/server/code/save",{context:e,key:n.random_key})).code&&(w.xK.set_value_temp(""),H({open:!1,model:"",fileName:"",save:null}))}}),w.xK.set_value_temp(o.data)})(s,o)}})}),(0,v.jsx)(i.l6,{value:n.open,onChange:t=>{e.list[o].open=t,F({...K})},options:T,no_border:!0}),(0,v.jsx)(i.Sm,{value:n.note,handleInputChange:e=>{n.note=e},no_border:!0}),(0,v.jsx)("div",{children:(0,v.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{e.list.splice(o,1),F({...K})}})})];return c}),width:"10rem"})]},s))})]})]})})}var A=s(87361),P=s(82726),U=s(18538);function K(e){const{t}=(0,j.B)(),[s,h]=(0,n.useState)([]),[u,x]=(0,n.useState)([]),[g,y]=(0,n.useState)(""),[_,w]=(0,n.useState)(""),[C,k]=(0,n.useState)(!1),[b,I]=(0,f.fp)(S.AG.showPrompt),[A,K]=(0,f.fp)(S.AG.confirm);(0,n.useEffect)(()=>{(async()=>{const e=await a.ez.get("ips/dnspod");if(e.code!==r.m.Success)return;const t=e.data,s=[],n=[];for(const e of t.ips)e.isIPv4?s.push(e):n.push(e);h(s),x(n),t.account&&(y(t.account.id),w(t.account.token)),k(t.isOpen)})()},[]);const F=async e=>{K({open:!0,handle:async()=>{0===(await a.ez.post("http/del",e)).code&&(0,c.SK)("删除成功,稍后请刷新"),K({open:!1,handle:null})},title:t("确定删除吗")})};return(0,v.jsxs)("div",{children:[(0,v.jsx)(m.aZ,{position:"right",children:(0,v.jsx)(d.rA,{icon:"add",title:t("添加http获取ip"),onClick:()=>{I({show:!0,type:U.PromptEnum.DdnsAddHttp,overlay:!0,data:{}})}})}),(0,v.jsxs)(o.fI,{children:[(0,v.jsxs)(o.VP,{children:[(0,v.jsx)(l.Zp,{title:"ipv4",children:s.length>0&&s.map((e,s)=>(0,v.jsxs)("div",{children:[`${e.ifaceOrWww}(${e.ip})`,(0,v.jsx)(i.Sm,{right_placeholder:(0,v.jsx)("div",{children:e.source_type===P.tC.http_get&&(0,v.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{F(e)}})}),placeholder:"a.abc.com b.abc.com ...",value:e.ddnsHost,handleInputChange:t=>{e.ddnsHost=t}})]},s))}),(0,v.jsx)(l.Zp,{title:"ipv6",children:u.length>0&&u.map((e,s)=>(0,v.jsxs)("div",{children:[`${e.ifaceOrWww}(${e.ip})`,(0,v.jsx)(i.Sm,{right_placeholder:(0,v.jsx)("div",{children:e.source_type===P.tC.http_get&&(0,v.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{F(e)}})}),placeholder:"a.abc.com b.abc.com ...",value:e.ddnsHost,handleInputChange:t=>{e.ddnsHost=t}})]},s))})]}),(0,v.jsxs)(o.VP,{children:[(0,v.jsxs)(l.Zp,{title:t("账号设置"),rightBottomCom:(0,v.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{if(C&&(!g||!_))return void(0,c.zN)("id和token都不能为空");const e=new P.yL,t=[];for(const e of[...s,...u])e.ddnsHost&&t.push(e);e.ips=t,e.account={id:g,token:_},e.isOpen=C,e.ddnsType=P.E2.dnspod;(await a.ez.post("save",e)).code===r.m.DdnsAuthFail?(0,c.zN)("鉴权失败"):(0,c.SK)("success")}}),children:[(0,v.jsx)(i.Sm,{placeholder:"ID",value:g,handleInputChange:e=>{y(e)}}),(0,v.jsx)(i.cA,{placeholder:"TOKEN",value:_,handleInputChange:e=>{w(e)}}),(0,v.jsx)(p.S,{isFlex:!0,columns:[(0,v.jsx)(i.U6,{value:1,context:t("开启"),selected:C,onchange:()=>{k(!C)}}),(0,v.jsx)(i.U6,{value:1,context:t("关闭"),selected:!C,onchange:()=>{k(!C)}})]})]}),(0,v.jsx)(l.Zp,{title:t("说明"),children:"域名如果不存在会自动创建,空子域名是@,ip6和ipv4可以互相切换。"})]})]})]})}function F(e){const{t}=(0,j.B)(),[s,h]=(0,n.useState)([]),[u,x]=(0,n.useState)([]),[g,y]=(0,n.useState)(""),[_,w]=(0,n.useState)(""),[C,k]=(0,n.useState)(!1),[b,I]=(0,f.fp)(S.AG.showPrompt),[A,K]=(0,f.fp)(S.AG.confirm);(0,n.useEffect)(()=>{(async()=>{const e=await a.ez.get("ips/tx");if(e.code!==r.m.Success)return;const t=e.data,s=[],n=[];for(const e of t.ips)e.isIPv4?s.push(e):n.push(e);h(s),x(n),t.account&&(y(t.account.secretid),w(t.account.secretkey)),k(t.isOpen)})()},[]);const F=async e=>{K({open:!0,handle:async()=>{0===(await a.ez.post("http/del",e)).code&&(0,c.SK)("删除成功,稍后请刷新"),K({open:!1,handle:null})},title:t("确定删除吗")})};return(0,v.jsxs)("div",{children:[(0,v.jsx)(m.aZ,{position:"right",children:(0,v.jsx)(d.rA,{icon:"add",title:t("添加http获取ip"),onClick:()=>{I({show:!0,type:U.PromptEnum.DdnsAddHttp,overlay:!0,data:{}})}})}),(0,v.jsxs)(o.fI,{children:[(0,v.jsxs)(o.VP,{children:[(0,v.jsx)(l.Zp,{title:"ipv4",children:s.length>0&&s.map((e,s)=>(0,v.jsxs)("div",{children:[`${e.ifaceOrWww}(${e.ip})`,(0,v.jsx)(i.Sm,{right_placeholder:(0,v.jsx)("div",{children:e.source_type===P.tC.http_get&&(0,v.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{F(e)}})}),placeholder:"a.abc.com b.abc.com ...",value:e.ddnsHost,handleInputChange:t=>{e.ddnsHost=t}})]},s))}),(0,v.jsx)(l.Zp,{title:"ipv6",children:u.length>0&&u.map((e,s)=>(0,v.jsxs)("div",{children:[`${e.ifaceOrWww}(${e.ip})`,(0,v.jsx)(i.Sm,{right_placeholder:(0,v.jsx)("div",{children:e.source_type===P.tC.http_get&&(0,v.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{F(e)}})}),placeholder:"a.abc.com b.abc.com ...",value:e.ddnsHost,handleInputChange:t=>{e.ddnsHost=t}})]},s))})]}),(0,v.jsxs)(o.VP,{children:[(0,v.jsxs)(l.Zp,{title:t("账号设置"),rightBottomCom:(0,v.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{if(C&&(!g||!_))return void(0,c.zN)("SecretId和SecretKey都不能为空");const e=new P.yL,t=[];for(const e of[...s,...u])e.ddnsHost&&t.push(e);e.ips=t,e.account={secretid:g,secretkey:_},e.isOpen=C,e.ddnsType=P.E2.tengxun;(await a.ez.post("save",e)).code===r.m.DdnsAuthFail?(0,c.zN)("鉴权失败"):(0,c.SK)("成功")}}),children:[(0,v.jsx)(i.Sm,{placeholder:"SecretId",value:g,handleInputChange:e=>{y(e)}}),(0,v.jsx)(i.cA,{placeholder:"SecretKey",value:_,handleInputChange:e=>{w(e)}}),(0,v.jsx)(p.S,{isFlex:!0,columns:[(0,v.jsx)(i.U6,{value:1,context:t("开启"),selected:C,onchange:()=>{k(!C)}}),(0,v.jsx)(i.U6,{value:1,context:t("关闭"),selected:!C,onchange:()=>{k(!C)}})]})]}),(0,v.jsx)(l.Zp,{title:t("说明"),children:"域名如果不存在会自动创建,空子域名是@,ip6和ipv4可以互相切换。"})]})]})]})}function $(){const{t:e}=(0,j.B)(),{check_user_auth:t}=(0,w.MH)(),s=[];return t(_.oV.vir_net)&&s.push({index:1,name:e("系统代理"),rto:"proxy_sys/",component:(0,v.jsx)(I,{})},{index:2,name:"Tun proxy "+e("客户端"),rto:"client/",component:(0,v.jsx)(y,{})},{index:3,name:"Tun proxy "+e("服务端"),rto:"server/",component:(0,v.jsx)(g,{})}),t(_.oV.ddns)&&s.push({index:4,name:`ddns-dnspod(${e("腾讯")})`,rto:"dnspod/",component:(0,v.jsx)(K,{})},{index:5,name:`ddns-${e("腾讯")}${e("云")}`,rto:"tengxun/",component:(0,v.jsx)(F,{})}),(0,v.jsx)(o.W1,{optionList:s,father_route:A.o.net})}},24659(e,t,s){var n=s(86149);s.d(t,["K",0,()=>{const{t:e}=(0,n.B)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[4091],{48890(e,t,n){n.d(t,{Kw:()=>i,Tt:()=>o});var i=n(80952),o=(n(82327),n(1766),n(24854),n(90008),n(90846),n(40975),n(44286),n(30766),n(14973),n(69687),n(1234),n(47507),n(87268),n(24522));const r=`https://gcore.jsdelivr.net/npm/ace-builds@${i.version}/src-min-noconflict/`;i.config.set("basePath",r),i.config.set("modePath",r),i.config.set("themePath",r),i.config.set("workerPath",r)},84091(e,t,n){n.r(t),n.d(t,{default:()=>d});var i=n(96540),o=(n(80952),n(48890)),r=n(34843),s=n(82893),a=n(78247),c=n(74848);function d(e){const t=(0,i.useRef)(null),[n,d]=(0,r.fp)(s.AG.user_base_info),u=n.user_data.theme?.includes("dark")?"cloud_editor_dark":"cloud9_day";return(0,i.useEffect)(()=>{const n=o.Kw.edit(t.current,{value:a.xK.get_value_temp(e.editor_id),showPrintMargin:!1,theme:`ace/theme/${u}`,mode:e.model??o.Tt.getModeForPath(e.name??"").mode,wrap:!1,highlightActiveLine:!1,fontSize:14,...e.options});return n.setOptions({}),n.container.addEventListener("wheel",function(e){e.preventDefault()}),n.focus(),n.on("change",function(t){e.on_change&&e.on_change()}),t.current=n,n.formatCode=()=>{const e=o.Kw.require("ace/ext/beautify"),n=t.current;n&&e.beautify(n.session)},a.xK.set_editor_temp(n,e.editor_id),()=>{a.xK.delete_editor_temp(e.editor_id),n.destroy()}},[]),(0,c.jsx)("div",{ref:t,style:{height:"100%",width:"100%"}})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[676,4091,8319],{77481(e,t,s){s.d(t,{S:()=>l,X:()=>i});var n=s(96540),r=s(61443),a=s(74848);function i(e){const[t,s]=n.useState([]),i=(0,n.useRef)(-1),[l,o]=(0,n.useState)(-1),[c,u]=(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 d=()=>{i.current=-1,o(-1),u(-1)};return(0,a.jsxs)("table",{children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:e.headers?.map((t,s)=>{const n=!!e.filter&&(e.filter.column??0)===s;let i=t;if(n){const s=e.filter,n=s.options.find(e=>e.value===s.value);null!=s.value&&n&&(i=`${t} (${n.label})`)}return(0,a.jsx)("th",{className:n?"table-filter-col":"",children:n?(0,a.jsx)(r.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:i}):t},s)})})}),(0,a.jsx)("tbody",{children:t.map((t,s)=>{const n=!!e.onRowDrag;return(0,a.jsx)("tr",{className:n?(l===s?"row-dragging":"")+(c===s?" row-drop-target":""):"",draggable:n,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{n&&(i.current=s,o(s),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!n||i.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",u(s))},onDrop:t=>{n&&(t.preventDefault(),(()=>{const t=i.current,s=c;d(),t<0||s<0||t===s||e.onRowDrag?.(t,s)})())},onDragEnd:d,children:t.map((s,n)=>{const r=n===t.length-1?"small":"";return(0,a.jsx)("td",{className:r,style:{width:e.width??"auto"},children:s},n)})},s)})})]})}function l(e){return(0,a.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,a.jsx)("div",{children:e},t))})}},48890(e,t,s){s.d(t,{Kw:()=>n,Tt:()=>r});var n=s(80952),r=(s(82327),s(1766),s(24854),s(90008),s(90846),s(40975),s(44286),s(30766),s(14973),s(69687),s(1234),s(47507),s(87268),s(24522));const a=`https://gcore.jsdelivr.net/npm/ace-builds@${n.version}/src-min-noconflict/`;n.config.set("basePath",a),n.config.set("modePath",a),n.config.set("themePath",a),n.config.set("workerPath",a)},84091(e,t,s){s.r(t),s.d(t,{default:()=>c});var n=s(96540),r=(s(80952),s(48890)),a=s(34843),i=s(82893),l=s(78247),o=s(74848);function c(e){const t=(0,n.useRef)(null),[s,c]=(0,a.fp)(i.AG.user_base_info),u=s.user_data.theme?.includes("dark")?"cloud_editor_dark":"cloud9_day";return(0,n.useEffect)(()=>{const s=r.Kw.edit(t.current,{value:l.xK.get_value_temp(e.editor_id),showPrintMargin:!1,theme:`ace/theme/${u}`,mode:e.model??r.Tt.getModeForPath(e.name??"").mode,wrap:!1,highlightActiveLine:!1,fontSize:14,...e.options});return s.setOptions({}),s.container.addEventListener("wheel",function(e){e.preventDefault()}),s.focus(),s.on("change",function(t){e.on_change&&e.on_change()}),t.current=s,s.formatCode=()=>{const e=r.Kw.require("ace/ext/beautify"),s=t.current;s&&e.beautify(s.session)},l.xK.set_editor_temp(s,e.editor_id),()=>{l.xK.delete_editor_temp(e.editor_id),s.destroy()}},[]),(0,o.jsx)("div",{ref:t,style:{height:"100%",width:"100%"}})}},60676(e,t,s){s.r(t),s.d(t,{default:()=>C});var n=s(96540),r=s(57952),a=s(85997),i=s(14284),l=s(86090),o=s(77481),c=s(70447),u=s(34843),d=s(82893),p=s(84091),h=s(78247),f=s(61443),x=s(23496),_=s(62042),m=s(86149),j=s(53459),v=s(7523),g=s(74848);function b(e,t="auto"){return"s"===t||"auto"===t&&e>=1e3?`${(e/1e3).toFixed(2)} s`:`${Math.round(e)} ms`}function S(e){const{running:t=!1,resetKey:s=0,format:r="auto",prefix:a="",onTick:i,className:l}=e,[o,c]=(0,n.useState)(0),u=(0,n.useRef)(0),d=(0,n.useRef)(null),p=(0,n.useRef)(t);p.current=t;const h=(0,n.useCallback)(()=>{null!==d.current&&(cancelAnimationFrame(d.current),d.current=null)},[]),f=(0,n.useCallback)(()=>{h();const e=()=>{const t=performance.now()-u.current;c(t),i?.(t),p.current&&(d.current=requestAnimationFrame(e))};e()},[i,h]);return(0,n.useEffect)(()=>{u.current=performance.now(),c(0),i?.(0),p.current&&f()},[s]),(0,n.useEffect)(()=>{t?f():h()},[t,f,h]),(0,n.useEffect)(()=>()=>h(),[h]),(0,g.jsxs)("span",{className:l,children:[a,b(o,r)]})}var q=s(87361),w=s(28319);function y(e){const[t,s]=(0,n.useState)("");return(0,g.jsxs)("div",{className:"db-query-preset-input",children:[(0,g.jsx)(f.Sm,{placeholder:e.placeholder,value:t,handleInputChange:s}),(0,g.jsx)("div",{className:"db-query-preset-input__actions",children:(0,g.jsx)(a.C3,{text:e.confirmText,clickFun:()=>e.onConfirm(t.trim())})})]})}function C(){const e=(0,l.Zp)(),{t}=(0,m.B)(),{initUserInfo:s}=(0,n.useContext)(v.F),[b]=(0,u.fp)(d.AG.sqlite_query_context),[C]=(0,u.fp)(d.AG.user_base_info),[,k]=(0,u.fp)(d.AG.prompt_card),N=(0,n.useMemo)(()=>b?.path??"",[b?.path]),E=(0,n.useMemo)(()=>b?.path?`${b?.name||"数据库"} | ${b.path}`:"未选择数据库",[b?.name,b?.path]),A=97,[K,L]=(0,n.useState)(""),[F,$]=(0,n.useState)("table"),[R,M]=(0,n.useState)(!1),[Q,O]=(0,n.useState)(""),[D,P]=(0,n.useState)(null),[T,G]=(0,n.useState)(!1),[I,J]=(0,n.useState)(0),[Z,W]=(0,n.useState)(!1),[B,H]=(0,n.useState)([]),[V,X]=(0,n.useState)(-1);(0,n.useEffect)(()=>{const e=C?.user_data?.sql_preset_list;e&&e.length?H([...e]):H([{index:0,note:t("查询全部表"),sql:"SELECT name, type FROM sqlite_master WHERE type='table';"}])},[C?.user_data?.sql_preset_list]);const U=async e=>{const t=e.map((e,t)=>({...e,index:t})),n=await i.wm.post(x.s.user_save_private_attr,{is_sql_preset:!0,sql_preset_list:t});return n?.code===j.m.Success&&(await s(),H(t),!0)},z=async(e,s)=>{const n=[...B,{note:s||t("SQL 预设"),sql:e,env:w.sqlEnvDefault}];await U(n)&&(k({open:!1}),(0,_.SK)(t("创建成功")),X(n.length-1))},Y=(e,t)=>{if(!e)return"";for(const s of e.split("\n")){const e=s.indexOf("=");if(!(e<0)&&s.slice(0,e).trim()===t)return s.slice(e+1).trim()}return""},[ee,te]=(0,n.useState)(""),[se,ne]=(0,n.useState)("");(0,n.useEffect)(()=>{h.xK.set_value_temp(K,A)},[K]),(0,n.useEffect)(()=>{L(""),O(""),P(null),$("table"),G(!1),W(!1),J(0),te(""),ne(""),h.xK.set_value_temp("",A),N||O("请先从文件右键打开一个数据库")},[N,b?.open]);const re=async()=>{const e=(h.xK.get_editor_value(A)??K).trim();if(!N)return O("请先从文件右键打开一个数据库"),void P(null);if(!e)return O("请输入 SQL 语句"),void P(null);M(!0),O(""),W(!0),J(e=>e+1),G(!0);try{const s=(t=e,ee?t.split(ee).join(se):t),n=await i.$M.post("sqlite/query",{path:N,sql:s});P(n.data),$("table")}catch(e){O(e?.message??`${e}`),P(null)}finally{G(!1),M(!1)}var t},ae=D?.columns?.length?D.columns:Object.keys(D?.rows?.[0]??{}),ie=(D?.rows??[]).map(e=>ae.map(t=>{return null==(s=e[t])?"":"object"==typeof s?JSON.stringify(s):`${s}`;var s}));return(0,g.jsxs)("div",{className:"db-query-page",children:[(0,g.jsx)(r.A,{ignore_tags:!0,left_children:[(0,g.jsx)(a.rA,{icon:"arrow_back",title:"返回",onClick:()=>e(-1)},"back"),(0,g.jsx)(a.rA,{icon:"play_arrow",title:"执行",onClick:re},"run"),(0,g.jsx)(a.rA,{icon:"table_chart",title:"表格视图",onClick:()=>$("table")},"table"),(0,g.jsx)(a.rA,{icon:"data_object",title:"原 JSON",onClick:()=>$("json")},"json"),(0,g.jsx)(a.rA,{icon:"settings",title:t("SQL预设设置"),onClick:()=>{e(q.o.sql_preset_setting_page)}},"preset-setting")],children:(0,g.jsx)(c.xP,{context:E,tip_context:"点击复制数据库信息"})}),(0,g.jsxs)("div",{className:"db-query-page__content",children:[(0,g.jsxs)(c.Zp,{title:"SQL 查询",titleCom:(0,g.jsxs)("div",{className:"db-query-page__preset-bar",children:[ee&&(0,g.jsx)(f.Sm,{placeholder:`${t("替换")}: ${ee}`,value:se,handleInputChange:ne,width:"12rem"}),B.length>0&&(0,g.jsx)(f.l6,{width:"16rem",tip:t("SQL预设"),value:V,onChange:e=>{const t=B[e];t&&(X(e),(e=>{h.xK.set_value_temp(e,A);const t=h.xK.get_editor(A);t&&t.setValue(e,-1),L(e)})(t.sql),te(Y(t.env??"","find")),ne(""),O(""))},options:B.map((e,t)=>({value:t,title:`${e.note||e.sql.slice(0,24)}`}))}),(0,g.jsx)(a.C3,{text:t(V>=0?"更新保存":"创建新预选项"),clickFun:async()=>{const e=(h.xK.get_editor_value(A)??K).trim();if(!e)return void O(t("请输入 SQL 语句"));const s=[...B];if(V>=0&&s[V]){s[V].sql=e,s[V].note||(s[V].note=t("SQL 预设"));await U(s)&&(0,_.SK)(t("更新成功"))}else k({open:!0,title:t("创建新预选项"),context_div:(0,g.jsx)(y,{placeholder:t("请输入备注"),confirmText:t("确认"),onConfirm:t=>z(e,t)}),cancel:()=>k({open:!1})})}})]}),rightBottomCom:(0,g.jsxs)("div",{className:"db-query-page__actions",children:[(0,g.jsx)(a.C3,{text:R?"查询中...":"执行查询",clickFun:re}),(0,g.jsx)(a.C3,{text:"清空",clickFun:()=>{h.xK.set_value_temp("",A);const e=h.xK.get_editor(A);e&&e.setValue("",-1),L("")}}),(0,g.jsx)(a.C3,{text:"table"===F?"表格视图":"切换到表格",clickFun:()=>$("table")}),(0,g.jsx)(a.C3,{text:"json"===F?"原 JSON":"切换到 JSON",clickFun:()=>$("json")})]}),children:[(0,g.jsx)("div",{className:"db-query-page__editor",children:(0,g.jsx)(p.default,{name:"sqlite.sql",editor_id:A,model:"ace/mode/sql",on_change:()=>{const e=h.xK.get_editor_value(A)??"";L(e)},options:{showPrintMargin:!1,highlightActiveLine:!0,wrap:!0}})}),Q&&(0,g.jsx)("div",{className:"db-query-page__error",children:Q})]}),(0,g.jsxs)(c.Zp,{title:"查询结果",titleCom:(0,g.jsxs)("span",{className:"db-query-page__result-meta",children:[D?`${D.row_count} 行`:"暂无结果",Z&&(0,g.jsx)("span",{className:"db-query-page__elapsed",children:(0,g.jsx)(S,{running:T,resetKey:I,prefix:`${t("耗时")}: `,format:"auto"})})]}),children:[D&&"table"===F&&(0,g.jsx)(o.X,{headers:ae,rows:ie}),D&&"json"===F&&(0,g.jsx)("pre",{className:"db-query-page__result-json",children:JSON.stringify(D.rows,null,2)}),!D&&!Q&&(0,g.jsx)("div",{className:"db-query-page__hint",children:"先输入查询语句,再执行。支持 `select`、`with`、`pragma`、`explain`。"}),!D&&Q&&(0,g.jsx)("div",{className:"db-query-page__hint",children:Q})]})]})]})}},28319(e,t,s){s.r(t),s.d(t,{default:()=>q,defaultSqlPreset:()=>b});var n=s(96540),r=s(86149),a=s(4412),i=s(85997),l=s(75725),o=s(77481),c=s(70447),u=s(61443),d=s(34843),p=s(82893),h=s(14284),f=s(23496),x=s(53459),_=s(62042),m=s(7523),j=s(78247),v=s(86090),g=s(74848);function b(e){return{index:0,note:e("查询全部表"),sql:"SELECT name, type FROM sqlite_master WHERE type='table';"}}const S='# 可选:设置 SQL 中的"替换词"(在查询页选中该预设后,会显示输入框)\n# 例子:SQL 为 SELECT * FROM t WHERE id = 123456 ,请填写下面的 find=123456\n# 这样查询页输入新值即可把 SQL 中的 123456 替换掉后再查询\nfind=';function q(){const{t:e}=(0,r.B)(),{initUserInfo:t}=(0,n.useContext)(m.F),[,s]=(0,d.fp)(p.AG.editorSetting),[q]=(0,d.fp)(p.AG.user_base_info),w=(0,v.Zp)(),y=n.useRef(-1),[C,k]=(0,n.useState)([]);(0,n.useEffect)(()=>{const t=q?.user_data?.sql_preset_list;k(t?.length?[...t]:[b(e)])},[e,q?.user_data?.sql_preset_list]);const N=async()=>{const s=C.map((e,t)=>({...e,index:t})),n=await h.wm.post(f.s.user_save_private_attr,{is_sql_preset:!0,sql_preset_list:s});n?.code===x.m.Success&&(await t(),(0,_.SK)(e("保存成功")))},E=(e,t)=>{y.current=e;const n=C[e][t]??"";j.xK.set_value_temp(n),s({model:"sql"===t?"ace/mode/sql":"ace/mode/ini",open:!0,fileName:"",save:async e=>{C[y.current][t]=e,k([...C]),j.xK.set_value_temp(""),N()}})},A=[e("编号"),e("备注"),e("SQL代码"),e("env编辑"),e("操作")];return(0,g.jsxs)("div",{children:[(0,g.jsx)(a.aZ,{position:"right",children:(0,g.jsx)(i.rA,{icon:"arrow_back",title:e("返回"),onClick:()=>w(-1)})}),(0,g.jsx)(l.jW,{isFull:!0,more:!0,children:(0,g.jsx)(l.NN,{children:(0,g.jsx)(l.xh,{children:(0,g.jsx)(l.fI,{children:(0,g.jsx)(l.VP,{widthPer:60,children:(0,g.jsx)(c.uF,{self_title:(0,g.jsx)("span",{className:"div-row",children:(0,g.jsx)("h2",{children:e("SQL 预设")})}),titleCom:(0,g.jsxs)("div",{className:"db-query-setting__toolbar",children:[(0,g.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>k([...C,{note:"",sql:"",env:S}])}),(0,g.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:()=>N()})]}),children:(0,g.jsx)(o.X,{headers:A,rows:C.map((t,s)=>[(0,g.jsx)("div",{children:s+1}),(0,g.jsx)(u.Sm,{value:t.note,no_border:!0,placeholder:e("备注"),handleInputChange:e=>{t.note=e,k([...C])}}),(0,g.jsx)("div",{children:(0,g.jsx)(i.rA,{icon:"short_text",title:e("编辑SQL"),onClick:()=>E(s,"sql")})}),(0,g.jsx)("div",{children:(0,g.jsx)(i.rA,{icon:"settings",title:e("env编辑"),onClick:()=>E(s,"env")})}),(0,g.jsx)("div",{children:(0,g.jsx)(i.rA,{icon:"delete",title:e("删除"),onClick:()=>{C.splice(s,1),k([...C])}})})]),width:"8rem"})})})})})})})]})}s.d(t,["sqlEnvDefault",0,S])}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[4091,7181],{48890(e,t,n){n.d(t,{Kw:()=>i,Tt:()=>o});var i=n(80952),o=(n(82327),n(1766),n(24854),n(90008),n(90846),n(40975),n(44286),n(30766),n(14973),n(69687),n(1234),n(47507),n(87268),n(24522));const s=`https://gcore.jsdelivr.net/npm/ace-builds@${i.version}/src-min-noconflict/`;i.config.set("basePath",s),i.config.set("modePath",s),i.config.set("themePath",s),i.config.set("workerPath",s)},84091(e,t,n){n.r(t),n.d(t,{default:()=>l});var i=n(96540),o=(n(80952),n(48890)),s=n(34843),a=n(82893),r=n(78247),c=n(74848);function l(e){const t=(0,i.useRef)(null),[n,l]=(0,s.fp)(a.AG.user_base_info),d=n.user_data.theme?.includes("dark")?"cloud_editor_dark":"cloud9_day";return(0,i.useEffect)(()=>{const n=o.Kw.edit(t.current,{value:r.xK.get_value_temp(e.editor_id),showPrintMargin:!1,theme:`ace/theme/${d}`,mode:e.model??o.Tt.getModeForPath(e.name??"").mode,wrap:!1,highlightActiveLine:!1,fontSize:14,...e.options});return n.setOptions({}),n.container.addEventListener("wheel",function(e){e.preventDefault()}),n.focus(),n.on("change",function(t){e.on_change&&e.on_change()}),t.current=n,n.formatCode=()=>{const e=o.Kw.require("ace/ext/beautify"),n=t.current;n&&e.beautify(n.session)},r.xK.set_editor_temp(n,e.editor_id),()=>{r.xK.delete_editor_temp(e.editor_id),n.destroy()}},[]),(0,c.jsx)("div",{ref:t,style:{height:"100%",width:"100%"}})}},57181(e,t,n){n.r(t),n.d(t,{default:()=>h});var i=n(96540),o=n(85997),s=n(57952),a=n(34843),r=n(82893),c=n(78247),l=(n(62042),n(84091)),d=n(34289),f=n(34251),u=n(74848);function h(){const[e,t]=(0,a.fp)(r.AG.editorSetting),[n,h]=(0,i.useState)(!1),[m,_]=(0,a.fp)(r.AG.fileShellShow),[v,p]=(0,a.fp)(r.AG.file_shell_hidden);async function g(){e.save&&n&&(await e.save(c.xK.get_editor_value()),c.xK.set_value_temp(""),h(!1))}const x=t=>{(t.ctrlKey||t.metaKey)&&"s"===t.key&&(t.preventDefault(),e.save&&n&&g())};return(0,i.useEffect)(()=>()=>{h(!1)},[e]),(0,i.useEffect)(()=>(document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x)}),[n,e]),e.open&&(0,u.jsxs)("div",{id:"editor-container",children:[(0,u.jsxs)(s.A,{ignore_tags:!0,left_children:[(0,u.jsx)(o.rA,{title:"取消",icon:"close",onClick:function(){c.xK.set_value_temp(""),t({open:!1,model:"",fileName:"",save:null}),e?.close?.()}},1),(0,u.jsx)("div",{children:e.fileName},2)],children:[e.menu_list&&e.menu_list,(e.can_format||(0,f.zr)(e.fileName))&&(0,u.jsx)(o.rA,{title:"格式化",icon:"data_object",onClick:function(){c.xK.get_editor()?.formatCode()}}),e.opt_shell&&(0,u.jsx)(o.rA,{icon:"terminal",title:"shell",onClick:function(){m.show?p(!v):_({show:!0,path:(0,d.GG)("file",(0,d.vX)())})}}),n&&(0,u.jsx)(o.rA,{title:"保存",icon:"save",onClick:g}),(0,u.jsx)("title",{children:e.fileName})]}),(0,u.jsx)(l.default,{name:e.fileName,model:e.model,on_change:function(){n||h(!0)}})]})}}}]);
|
package/build/dist/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{{{web_site_title}}}</title><link rel="icon" href="{{{logo_favicon}}}"/><script defer="defer" src="main.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{{{web_site_title}}}</title><link rel="icon" href="{{{logo_favicon}}}"/><script defer="defer" src="main.8c116bf496e7441faee5.js"></script></head><body><div id="root"></div></body><script id="pre_code" type="text/template">return {{{Windows_FileCat}}};</script><script>window.EXCALIDRAW_ASSET_PATH = "/";window.FileCat;</script></html>
|