filecat 7.29.0 → 7.29.1
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/1448.82d4f4b923f523981b07.js +1 -0
- package/build/dist/1636.990a3f2ff89900dded98.js +1 -0
- package/build/dist/2136.b39a58a19d4ac2a5576f.js +1 -0
- package/build/dist/2502.0e9f512987f1214644ce.js +1 -0
- package/build/dist/2547.f05399f9c795bedaa7aa.js +1 -0
- package/build/dist/259.f8c17a36a328425c15fa.js +1 -0
- package/build/dist/3551.704e2e9b4f6cbdf10d19.js +1 -0
- package/build/dist/3659.0789a31dfe6ca2d1e240.js +1 -0
- package/build/dist/{5272.611514ef844840dccbb3.js → 5272.a1a75285ad5fe14a4df6.js} +1 -1
- package/build/dist/6247.f67824d7abd4170c0fbc.js +1 -0
- package/build/dist/6439.ea487c8a5bebd335956f.js +1 -0
- package/build/dist/676.61682e838264c84dacab.js +1 -0
- package/build/dist/6805.06129b472890b825abfe.js +1 -0
- package/build/dist/6919.d048de2bcdec75a3c6d9.js +1 -0
- package/build/dist/{7873.0938199b862e0a30c168.js → 7873.e9f56d6e875e2cec5512.js} +1 -1
- package/build/dist/8319.93ec1e6ae15d07b98704.js +1 -0
- package/build/dist/8603.70880ac558dcfe09f9e0.js +1 -0
- package/build/dist/8649.fc41337cba5ec4e0c513.js +1 -0
- package/build/dist/9546.48d1545833924e3c1bc0.js +1 -0
- package/build/dist/index.html +1 -1
- package/build/dist/main.1c8323266d441fe5313d.js +2 -0
- package/build/main.js +1 -1
- package/package.json +1 -1
- package/build/dist/1448.374f0fb8ecab79f1b6a8.js +0 -1
- package/build/dist/1636.72a76243c352d7b14b86.js +0 -1
- package/build/dist/2136.49957ff61f304afad25f.js +0 -1
- package/build/dist/2502.c8f9f2c98369af4a1a3c.js +0 -1
- package/build/dist/2547.33fc8794c01a9a98acb8.js +0 -1
- package/build/dist/259.73d375f52940d831b517.js +0 -1
- package/build/dist/3551.f0ec20719cd49ad767de.js +0 -1
- package/build/dist/3659.6d636b2698d3b12a31b9.js +0 -1
- package/build/dist/6247.3fcb34a00b0a6e794a64.js +0 -1
- package/build/dist/6439.6ad9e05effce620ca735.js +0 -1
- package/build/dist/676.591751625c1b7f959f6b.js +0 -1
- package/build/dist/6805.3a1b6695ba63b17d39b5.js +0 -1
- package/build/dist/6919.a43ce76cadcdc5759ced.js +0 -1
- package/build/dist/8319.78e87b11f05a2d8f9d18.js +0 -1
- package/build/dist/8603.8fd3023b066ebaf71bfc.js +0 -1
- package/build/dist/8649.72e48164e0d4db52953e.js +0 -1
- package/build/dist/9546.f1c334f1614f2cdcc91b.js +0 -1
- package/build/dist/main.7f86da4174fe9b6d032b.js +0 -2
- /package/build/dist/{main.7f86da4174fe9b6d032b.js.LICENSE.txt → main.1c8323266d441fe5313d.js.LICENSE.txt} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6439],{47996(e,t,s){s.d(t,{d:()=>i});s(96540);var n=s(74848);function i(e){return(0,n.jsxs)("div",{className:"instance-item",children:[(0,n.jsxs)("div",{className:"instance-item__toolbar",children:[(0,n.jsx)("span",{className:"instance-item__label",children:e.title}),e.toolbar]}),e.children]})}},77481(e,t,s){s.d(t,{S:()=>o,X:()=>l});var n=s(96540),i=s(61443),a=s(74848);function l(e){const[t,s]=n.useState([]),l=(0,n.useRef)(-1),[o,r]=(0,n.useState)(-1),[d,c]=(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=()=>{l.current=-1,r(-1),c(-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 l=t;if(n){const s=e.filter,n=s.options.find(e=>e.value===s.value);null!=s.value&&n&&(l=`${t} (${n.label})`)}return(0,a.jsx)("th",{className:n?"table-filter-col":"",children:n?(0,a.jsx)(i.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:l}):t},s)})})}),(0,a.jsx)("tbody",{children:t.map((t,s)=>{const n=!!e.onRowDrag;return(0,a.jsx)("tr",{className:n?(o===s?"row-dragging":"")+(d===s?" row-drop-target":""):"",draggable:n,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{n&&(l.current=s,r(s),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!n||l.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",c(s))},onDrop:t=>{n&&(t.preventDefault(),(()=>{const t=l.current,s=d;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,a.jsx)("td",{className:i,style:{width:e.width??"auto"},children:s},n)})},s)})})]})}function o(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))})}},16439(e,t,s){s.r(t),s.d(t,{default:()=>je});var n=s(96540),i=s(75725),a=s(23430),l=s(70447),o=s(85997),r=s(61443),d=s(14284),c=s(53459),h=s(34843),u=s(82893),p=s(77481),m=s(74777),_=s(22022),x=s(4412),j=s(78247),v=s(62042),f=s(64484),y=s(23496),w=s(18840),g=s(6960),b=s(7523),k=s(74848);function S(){const{t:e}=(0,_.Bd)(),[,t]=(0,h.fp)(u.AG.prompt_card),[s,i]=(0,n.useState)(""),[a,x]=(0,n.useState)(5610),[j,f]=(0,n.useState)(5710);(0,n.useEffect)(()=>{(async()=>{const e=await d.XO.get("sys_option/status");if(e.code===c.m.Success){const t=e.data?.sys_env;i((t?.browser_proxy_allow||[]).join("\n")),x(t?.browser_proxy_port_start||5610),f(t?.browser_proxy_port_end||5710)}})()},[]);return(0,k.jsxs)(l.Zp,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e("网页代理")}),(0,k.jsx)(o.rA,{icon:"info",title:e("信息"),onClick:()=>{t({open:!0,title:e("信息"),context_div:(0,k.jsx)("div",{children:(0,k.jsx)("div",{children:e("wbvpn_tip")})})})}})]}),rightBottomCom:(0,k.jsx)(o.C3,{text:e("确定修改"),clickFun:async()=>{const t=s.split("\n").map(e=>e.trim()).filter(e=>!!e);(await d.XO.post(y.s.setting_sys_option_status_save,{type:m.Mu.sys_env,value:{browser_proxy_allow:t,browser_proxy_port_start:Number(a)||5610,browser_proxy_port_end:Number(j)||5710}})).code===c.m.Success&&(0,v.SK)(e("修改成功"))}}),children:[(0,k.jsx)("div",{children:e("wbvpn_allow")}),(0,k.jsx)(r.Z2,{style:{minHeight:"5rem",resize:"vertical"},placeholder:e("wbvpn_allow_ph"),value:s,onChange:e=>{i(e.target.value)}}),(0,k.jsx)("div",{children:e("wbvpn_port_range")}),(0,k.jsx)(p.S,{isFlex:!0,columns:[(0,k.jsx)(r.Sm,{placeholder:"5610",value:a,handleInputChange:e=>x(e)}),(0,k.jsx)("span",{style:{padding:"0 6px"},children:"-"}),(0,k.jsx)(r.Sm,{placeholder:"5710",value:j,handleInputChange:e=>f(e)})]})]})}function C(){const[e,t]=(0,n.useState)(""),[s,a]=(0,n.useState)(""),[C,A]=(0,n.useState)(!1),[I,N]=(0,n.useState)(""),[$,V]=(0,n.useState)(!1),[B,P]=(0,n.useState)(""),[F,z]=(0,h.fp)(u.AG.prompt_card),[,K]=(0,h.fp)(u.AG.editorSetting),[X,O]=(0,n.useState)(m.aM.close),[T,M]=(0,n.useState)(!1),[q,D]=(0,n.useState)(m.Hb.independent),U=(0,f.T)(),[H,W]=(0,n.useState)(void 0),[E,Z]=(0,n.useState)(""),{t:G,i18n:R}=(0,_.Bd)(),L=[`- ${G("过期策略:默认表示使用系统内置的1小时过期时间;指定时间按填写的秒数过期;永不过期则token一直有效")}`,`- ${G("独立token:每次登录都签发新的token,同一账号可以在多个设备同时登录,互不影响")}`,`- ${G("复用token:该账号已有未过期的token时直接复用它,不会签发新的")}`,`- ${G("单会话:每次登录签发新的token,并让该账号此前的所有token立即失效")}`].join("\n"),[J,Q]=(0,h.fp)(u.AG.user_base_info),{check_user_auth:Y}=(0,j.MH)(),{initUserInfo:ee}=(0,n.useContext)(b.F),te=async()=>{const e=await d.XO.get("sys_option/status");if(e.code===c.m.Success){V(e.data.recycle_open),P(e.data.recycle_dir);const s=e.data.sys_env;t(s?.web_site_title),a(s?.logo||""),A(s?.show_login_user_info),N(s?.http_proxy||""),Z(s?.control_env_str||w.CU)}const s=await d.XO.get("token");if(s.code===c.m.Success){const e=s.data;if(!e)return;e.length&&W(e.length),e.mode&&O(e.mode),void 0!==e.persist&&M(e.persist),void 0!==e.session_mode&&D(e.session_mode)}};(0,n.useEffect)(()=>{te()},[]);return(0,k.jsxs)("div",{children:[(0,k.jsx)(x.aZ,{children:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)("span",{className:"credits",children:[G("系统运行于"),": ",(0,g.s)(J.runing_time_length)]}),(0,k.jsx)("span",{className:"credits",children:(0,k.jsxs)("a",{href:"https://github.com/xiaobaidadada/filecat",target:"_blank",children:["version:7.29.0",null!=J.latest_version&&"7.29.0"!==J.latest_version?` -> ${J.latest_version}`:""]})}),(0,k.jsx)("span",{className:"credits",children:(0,k.jsx)("a",{href:G("官网地址"),target:"_blank",children:`filecat ${G("功能文档")}`})}),(0,k.jsxs)("span",{className:"credits",children:[G("安装方式")," :",J.process_env_run_env]})]})}),(0,k.jsx)(i.xh,{children:(0,k.jsxs)(i.fI,{children:[(0,k.jsxs)(i.VP,{widthPer:33,children:[(0,k.jsxs)(l.Zp,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:G("通用设置")})," ",(0,k.jsx)(o.rA,{icon:"info",onClick:()=>{z({open:!0,title:G("信息"),context_div:(0,k.jsx)("div",{children:(0,k.jsx)("div",{children:G("sys_env_setting_tip")})})})},title:G("信息")})]}),rightBottomCom:(0,k.jsx)(o.C3,{text:G("确定修改"),clickFun:async()=>{(await d.XO.post(y.s.setting_sys_option_status_save,{type:m.Mu.sys_env,value:{web_site_title:e,show_login_user_info:C,http_proxy:I,logo:s}})).code===c.m.Success&&((0,v.SK)(G("修改成功")),ee())}}),rightTopCom:(0,k.jsx)(o.rA,{icon:"tune",title:G("环境控制"),onClick:()=>{j.xK.set_value_temp(E||w.CU),K({model:"ace/mode/yaml",open:!0,fileName:"",not_auto_save:!0,save:async e=>{const t=await d.XO.post(y.s.setting_sys_option_status_save,{type:m.Mu.sys_env,value:{control_env_str:e}});t.code===c.m.Success?(Z(e),(0,v.SK)(G("修改成功")),te()):(0,v.zN)(`${t.message??G("保存失败")}`)}})}}),children:[G("网站标题"),(0,k.jsx)(r.Sm,{value:e,handleInputChange:e=>{t(e)}}),G("网站 Logo"),(0,k.jsx)(r.Sm,{placeholder:G("lclorur"),value:s,handleInputChange:e=>{a(e)}}),G("lgn_usr"),(0,k.jsx)("input",{type:"checkbox",checked:C,onChange:()=>{A(!C)}})]}),(0,k.jsx)(S,{})]}),(0,k.jsxs)(i.VP,{widthPer:33,children:[(0,k.jsxs)(l.Zp,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:G("文件回收站")})," ",(0,k.jsx)(o.rA,{icon:"info",onClick:()=>{z({open:!0,title:G("信息"),context_div:(0,k.jsx)("div",{children:G("格式:[被删除的文件所在父目录] 回收站目录 [; ...]")})})},title:G("信息")})]}),rightBottomCom:(0,k.jsx)(o.C3,{text:G("确定修改"),clickFun:async()=>{if($&&!B)return void(0,v.zN)(G("目录不能为空"));(await d.XO.post(y.s.setting_sys_option_status_save,{type:m.Mu.cyc,value:B,open:$})).code===c.m.Success&&(0,v.SK)(G("修改成功"))}}),children:[(0,k.jsx)(r.Sm,{placeholder:G("目录"),value:B,handleInputChange:e=>{P(e)}}),(0,k.jsx)(r.l6,{value:$,onChange:e=>{V(e)},options:[{title:G("开启"),value:!0},{title:G("关闭"),value:!1}]})]}),(0,k.jsxs)(l.Zp,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:G("会话token设置")}),(0,k.jsx)(o.rA,{icon:"info",title:G("登录会话"),onClick:()=>U(L)})]}),rightBottomCom:(0,k.jsx)(p.S,{isFlex:!0,columns:[(0,k.jsx)(o.C3,{text:G("清空token"),clickFun:async()=>{(await d.XO.get("token/clear")).code===c.m.Success&&(0,v.SK)(G("清理完成,重新登录"))}}),(0,k.jsx)(o.C3,{text:G("保存"),clickFun:async()=>{const e=new m.Gd;e.mode=X,e.persist=T,e.session_mode=q,m.aM.length!==e.mode||H||(0,v.zN)(G("秒数不能为空")),e.length=parseInt(H);(await d.XO.post("token/save",e)).code===c.m.Success&&(0,v.SK)(G("保存成功"))}})]}),children:[(0,k.jsxs)("div",{className:"form_group",children:[(0,k.jsx)("div",{className:"form_label",children:G("过期策略")}),(0,k.jsx)(p.S,{isFlex:!0,columns:[(0,k.jsx)(r.U6,{name:"token_time_mode",value:1,context:G("默认"),selected:X===m.aM.close,onchange:()=>{O(m.aM.close)}}),(0,k.jsx)(r.U6,{name:"token_time_mode",value:1,context:G("指定时间"),selected:X===m.aM.length,onchange:()=>{O(m.aM.length)}}),(0,k.jsx)(r.U6,{name:"token_time_mode",value:1,context:G("永不过期"),selected:X===m.aM.forver,onchange:()=>{O(m.aM.forver)}})]}),X===m.aM.length&&(0,k.jsx)(r.Sm,{placeholder:G("秒"),value:H,handleInputChange:e=>{W(e)}}),(0,k.jsx)(r.GL,{context:G("持久化"),selected:T,onchange:()=>M(!T)})]}),(0,k.jsxs)("div",{className:"form_group",children:[(0,k.jsx)("div",{className:"form_label",children:G("登录会话")}),(0,k.jsx)(p.S,{isFlex:!0,columns:[(0,k.jsx)(r.U6,{name:"token_session_mode",value:m.Hb.independent,context:G("独立token"),selected:q===m.Hb.independent,onchange:()=>D(m.Hb.independent)}),(0,k.jsx)(r.U6,{name:"token_session_mode",value:m.Hb.reuse,context:G("复用token"),selected:q===m.Hb.reuse,onchange:()=>D(m.Hb.reuse)}),(0,k.jsx)(r.U6,{name:"token_session_mode",value:m.Hb.single,context:G("单会话"),selected:q===m.Hb.single,onchange:()=>D(m.Hb.single)})]})]})]})]})]})})]})}var A=s(64694),I=s(92350),N=s(69675),$=s(32361);const V=[{key:"second",min:0,max:59,label:"秒"},{key:"minute",min:0,max:59,label:"分"},{key:"hour",min:0,max:23,label:"时"},{key:"day",min:1,max:31,label:"日"},{key:"month",min:1,max:12,label:"月"},{key:"week",min:0,max:7,label:"星期"}];function B(e){switch(e.mode){case"step":return`*/${e.step??1}`;case"range":return`${e.from??0}-${e.to??0}`;case"list":return(e.values??[]).join(",");default:return"*"}}function P(e){return[B(e.second),B(e.minute),B(e.hour),B(e.day),B(e.month),B(e.week)].join(" ")}function F(e,t,s){const n=(e??"").trim();if(!n)return null;if("*"===n)return{mode:"every"};if(n.startsWith("*/")){const e=Number(n.slice(2));return!Number.isInteger(e)||e<=0?null:{mode:"step",step:e}}if(n.includes("-")&&!n.includes(",")){const[e,i]=n.split("-").map(Number);return Number.isInteger(e)&&Number.isInteger(i)?e<t||i>s||e>i?null:{mode:"range",from:e,to:i}:null}const i=n.split(","),a=[];for(const e of i){const n=Number(e.trim());if(!Number.isInteger(n)||n<t||n>s)return null;a.push(n)}return 0===a.length?null:{mode:"list",values:a}}function z(e){const t=(e??"").trim().split(/\s+/);if(6!==t.length)return null;const s={};for(let e=0;e<6;e++){const n=V[e],i=F(t[e],n.min,n.max);if(!i)return null;s[n.key]=i}return s}function K(e){return e<10?`0${e}`:`${e}`}function X(e,t,s){switch(e.mode){case"step":return`每 ${e.step} ${t}`;case"range":return`${e.from} 到 ${e.to} ${t}`;case"list":return`${(e.values??[]).slice().sort((e,t)=>e-t).join("、")} ${t}`;default:return null}}function O(e){const{second:t,minute:s,hour:n,day:i,month:a,week:l}=e,o=(e,t)=>"list"===e.mode&&1===(e.values??[]).length&&e.values[0]===t,r=[];if("list"===n.mode&&"list"===s.mode&&o(t,0)){const e=(n.values??[]).slice().sort((e,t)=>e-t),t=(s.values??[]).slice().sort((e,t)=>e-t);e.length===t.length&&e.length>1&&t.length>1?r.push(e.map((e,s)=>`${K(e)}:${K(t[s])}`).join("、")):1===e.length&&1===t.length?r.push(`${K(e[0])}:${K(t[0])}`):r.push(`${e.map(K).join("、")} 时 ${t.join("、")} 分`)}else if("list"===n.mode&&"step"===s.mode&&o(t,0))r.push(`${(n.values??[]).map(K).join("、")} 时内每 ${s.step} 分钟`);else if("every"===n.mode&&"list"===s.mode&&o(t,0))r.push(`每小时的 ${(s.values??[]).join("、")} 分`);else if("every"===n.mode&&"step"===s.mode&&o(t,0))r.push(`每 ${s.step} 分钟`);else if("every"===n.mode&&"every"===s.mode&&o(t,0))r.push("每分钟");else if("every"===n.mode&&"every"===s.mode&&"step"===t.mode)r.push(`每 ${t.step} 秒`);else if("every"===n.mode&&"every"===s.mode&&"every"===t.mode)r.push("每秒");else if("every"===n.mode&&"every"===s.mode&&"list"===t.mode)r.push(`每分钟的第 ${(t.values??[]).join("、")} 秒`);else{const e=[],i=X(n,"时"),a=X(s,"分"),l=o(t,0)?null:X(t,"秒");i&&e.push(i),a&&e.push(a),l&&e.push(l),e.length>0&&r.push(e.join(" "))}const d="list"===i.mode&&1===(i.values??[]).length?i.values[0]:null,c="list"===a.mode&&1===(a.values??[]).length?a.values[0]:null,h="list"===l.mode&&1===(l.values??[]).length?l.values[0]:null;let u="";if(null!==c&&null!==d)u=`每年 ${c} 月 ${d} 号`;else if(null!==c)u=`每年 ${c} 月`;else if(null!==d)u=`每月 ${d} 号`;else if(null!==h)u=`每${["周日","周一","周二","周三","周四","周五","周六","周日"][h]??`星期 ${h}`}`;else{const e=[];"every"!==a.mode&&e.push(X(a,"月")),"every"!==i.mode&&e.push(X(i,"号")),"every"!==l.mode&&e.push(`星期 ${X(l,"")}`),e.length&&(u=e.join(" "))}u||(u="每天");const p=r.join(",");return/^(每|每天)/.test(p)?`${p}${"每天"===u?"":","+u} 执行`:`${u} ${p} 执行`}const T=[{label:"任意 (*)",value:"every"},{label:"每隔 (*/n)",value:"step"},{label:"区间 (a-b)",value:"range"},{label:"指定 (a,b)",value:"list"}];function M(e,t,s=!1){const n=[];for(let i=e;i<=t;i++)n.push({label:s?String(i).padStart(2,"0"):String(i),value:i});return n}const q=({label:e,field:t,min:s,max:i,pad:a,week_label:l,onChange:o})=>{const d=(0,n.useMemo)(()=>M(s,i,a),[s,i,a]),c=(0,n.useMemo)(()=>{if(!l)return d;const e=["周日","周一","周二","周三","周四","周五","周六","周日"];return d.map(t=>({value:t.value,label:`${t.value} (${e[t.value]})`}))},[d,l]);return(0,k.jsxs)("div",{className:"cron-field",children:[(0,k.jsx)("span",{className:"cron-field__label",children:e}),(0,k.jsx)(r.l6,{value:t.mode,onChange:e=>{o("every"===e?{mode:"every"}:"step"===e?{mode:"step",step:t.step??1}:"range"===e?{mode:"range",from:t.from??s,to:t.to??i}:{mode:"list",values:t.values??[s]})},options:T,no_border:!0,width:"7.5rem"}),"step"===t.mode&&(0,k.jsxs)("div",{className:"cron-field__param",children:[(0,k.jsx)("span",{children:"每"}),(0,k.jsx)(r.l6,{value:t.step??1,onChange:e=>o({mode:"step",step:e}),options:M(1,i),no_border:!0,width:"4.5rem"}),(0,k.jsx)("span",{children:e})]}),"range"===t.mode&&(0,k.jsxs)("div",{className:"cron-field__param",children:[(0,k.jsx)(r.l6,{value:t.from??s,onChange:e=>o({mode:"range",from:e,to:t.to??i}),options:c,no_border:!0,width:"6.5rem"}),(0,k.jsx)("span",{children:"到"}),(0,k.jsx)(r.l6,{value:t.to??i,onChange:e=>o({mode:"range",from:t.from??s,to:e}),options:c,no_border:!0,width:"6.5rem"})]}),"list"===t.mode&&(0,k.jsxs)("div",{className:"cron-field__param cron-field__param--list",children:[(t.values??[]).map((e,s)=>(0,k.jsxs)("span",{className:"cron-tag",children:[(0,k.jsx)(r.l6,{value:e,onChange:e=>((e,s)=>{const n=[...t.values??[]];n[e]=s,o({mode:"list",values:n})})(s,e),options:c,no_border:!0,width:"6.5rem"}),(0,k.jsx)("i",{className:"material-icons cron-tag__del",onClick:()=>(e=>{const s=(t.values??[]).filter((t,s)=>s!==e);o(s.length?{mode:"list",values:s}:{mode:"every"})})(s),children:"close"})]},s)),(0,k.jsx)("i",{className:"material-icons cron-tag__add",onClick:()=>{const e=[...t.values??[]],n=new Set(e);let a=s;for(;n.has(a)&&a<i;)a++;o({mode:"list",values:[...e,a]})},children:"add"})]})]})};const D=[{label:"每分钟",make:()=>({second:{mode:"every"},minute:{mode:"every"},hour:{mode:"every"},day:{mode:"every"},month:{mode:"every"},week:{mode:"every"},second:{mode:"list",values:[0]}})},{label:"每 5 分钟",make:()=>({second:{mode:"every"},minute:{mode:"every"},hour:{mode:"every"},day:{mode:"every"},month:{mode:"every"},week:{mode:"every"},minute:{mode:"step",step:5},second:{mode:"list",values:[0]}})},{label:"每小时",make:()=>({second:{mode:"every"},minute:{mode:"every"},hour:{mode:"every"},day:{mode:"every"},month:{mode:"every"},week:{mode:"every"},minute:{mode:"list",values:[0]},second:{mode:"list",values:[0]}})},{label:"每天 0 点",make:()=>({second:{mode:"every"},minute:{mode:"every"},hour:{mode:"every"},day:{mode:"every"},month:{mode:"every"},week:{mode:"every"},hour:{mode:"list",values:[0]},minute:{mode:"list",values:[0]},second:{mode:"list",values:[0]}})},{label:"每天 8 点",make:()=>({second:{mode:"every"},minute:{mode:"every"},hour:{mode:"every"},day:{mode:"every"},month:{mode:"every"},week:{mode:"every"},hour:{mode:"list",values:[8]},minute:{mode:"list",values:[0]},second:{mode:"list",values:[0]}})},{label:"每周一 0 点",make:()=>({second:{mode:"every"},minute:{mode:"every"},hour:{mode:"every"},day:{mode:"every"},month:{mode:"every"},week:{mode:"every"},hour:{mode:"list",values:[0]},minute:{mode:"list",values:[0]},second:{mode:"list",values:[0]},week:{mode:"list",values:[1]}})},{label:"每月 1 号 0 点",make:()=>({second:{mode:"every"},minute:{mode:"every"},hour:{mode:"every"},day:{mode:"every"},month:{mode:"every"},week:{mode:"every"},hour:{mode:"list",values:[0]},minute:{mode:"list",values:[0]},second:{mode:"list",values:[0]},day:{mode:"list",values:[1]}})}],U=({value:e,onChange:t,no_border:s})=>{const[i,a]=(0,n.useState)(!1),l=(0,n.useRef)(null),o=(0,n.useRef)(null),r=(0,n.useMemo)(()=>z(e??"")??{second:{mode:"every"},minute:{mode:"every"},hour:{mode:"every"},day:{mode:"every"},month:{mode:"every"},week:{mode:"every"}},[e]),d=!!e&&!z(e??""),c=(0,$.r)({active:i,trigger_ref:l,floating_ref:o,width:384,max_height:26});(0,N.$)(i,[l,o],()=>a(!1));const h=e=>{t(P(e))};return(0,k.jsxs)("div",{className:"cron-input "+(i?"cron-input--open":""),children:[(0,k.jsxs)("div",{ref:l,className:"cron-input__display "+(s?"cron-input__display--no-border":""),title:d?"表达式格式不正确":`${e||""} ${O(r)}`.trim(),onClick:()=>a(!i),children:[(0,k.jsx)("span",{className:"cron-input__expr "+(d?"cron-input__expr--invalid":""),children:e||"(未设置)"}),!s&&(0,k.jsx)("span",{className:"cron-input__desc",children:d?"表达式格式不正确":O(r)}),(0,k.jsx)("i",{className:"material-icons cron-input__arrow",children:"arrow_drop_down"})]}),i&&(0,k.jsxs)("div",{ref:o,className:"cron-editor",style:{left:c.left,top:c.top,...c.css_vars,visibility:c.ready?"visible":"hidden"},children:[(0,k.jsxs)("div",{className:"cron-editor__scroll",children:[(0,k.jsxs)("div",{className:"cron-editor__row",children:[(0,k.jsx)("span",{className:"cron-editor__title",children:"常用"}),(0,k.jsx)("div",{className:"cron-editor__presets",children:D.map(e=>(0,k.jsx)("button",{className:"cron-preset",onClick:()=>h(e.make()),children:e.label},e.label))})]}),(0,k.jsx)("div",{className:"cron-editor__fields",children:V.map(e=>(0,k.jsx)(q,{label:e.label,field:r[e.key],min:e.min,max:e.max,pad:"day"!==e.key&&"month"!==e.key&&"week"!==e.key,week_label:"week"===e.key,onChange:t=>{return s=e.key,n=t,void h({...r,[s]:n});var s,n}},e.key))})]}),(0,k.jsxs)("div",{className:"cron-editor__footer",children:[(0,k.jsx)("span",{className:"cron-editor__preview",children:P(r)}),(0,k.jsx)("button",{className:"cron-editor__done",onClick:()=>a(!1),children:"完成"})]})]})]})};var H=s(24659);function W(){const{t:e,i18n:t}=(0,_.Bd)(),{initUserInfo:s,reloadUserInfo:a}=(0,n.useContext)(b.F),[m,x]=(0,n.useState)([]),[f,y]=(0,n.useState)([]),[w,g]=(0,h.fp)(u.AG.prompt_card),[,S]=(0,h.fp)(u.AG.editorSetting),[C,N]=(0,n.useState)([]),[$,V]=(0,n.useState)([]),[B,P]=(0,n.useState)([]),[F,z]=(0,n.useState)([]),[K,X]=(0,n.useState)(""),[O,T]=(0,n.useState)([]),M=(0,H.K)(),q=[e("软件"),e("是否安装"),e("路径")],D=[e("编号"),e("路径"),e("备注")],W=[e("编号"),e("路径"),e("是否开启"),e("备注")],E=[e("编号"),e("文件路径"),e("是否开启"),e("系统启动执行"),e("cron表达式"),e("用户id"),e("备注")],Z=[e("编号"),e("路径"),e("单用户并发数量"),e("系统并发数量"),e("big_res"),e("big_sz"),e("大文件并发数量"),e("big_ck"),e("备注")],G=[e("编号"),e("名称"),e("路径"),e("是否开启"),e("params"),e("备注")],{check_user_auth:R}=(0,j.MH)(),L=async()=>{const e=await d.XO.get("env/path/get");e.code===c.m.Success&&P(e.data)},J=async()=>{const e=await d.XO.get("workflow_setting_get");e.code===c.m.Success&&z(e.data)};(0,n.useEffect)(()=>{(async()=>{const e=await d.XO.get("outside/software/get");e.code===c.m.Success&&y(e.data);const t=await d.XO.get("pty_cmd");t.code===c.m.Success&&X(t.data),L(),J();const s=await d.XO.get("protection_dir/sys");s.code===c.m.Success&&N(s.data??[]);const n=await d.XO.get("dir_upload_max_num");n.code===c.m.Success&&V(n.data??[]);const i=await d.XO.get("plugin/list");i.code===c.m.Success&&T(i.data??[])})()},[]);const Q=(0,I.Q)(),Y=async()=>{await d.XO.post("plugin/list/save",O)};return(0,k.jsxs)(n.Fragment,{children:[(0,k.jsx)(i.J,{widthPer:100,maxWidth:"100rem",children:(0,k.jsx)(l.uF,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e("up_conc")})," ",(0,k.jsx)(o.rA,{icon:"info",onClick:()=>{Q("文件上传")},title:e("信息")})]}),rightTopCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{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,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{for(const e of $)if(e.open_ws_file){if("number"!=typeof e.ws_file_block_mb_size)return void(0,v.zN)(`编号:${e.index??""} 文件块的大小设置有问题`);if("number"!=typeof e.ws_file_parallel_num)return void(0,v.zN)(`编号:${e.index??""} 并发数量设置有问题`);if("number"!=typeof e.ws_file_standard_size)return void(0,v.zN)(`编号:${e.index??""} 大文件size设置有问题`)}(0,A.di)($,e=>e.index??0);(await d.XO.post("dir_upload_max_num/save",$)).code===c.m.Success&&((0,v.SK)(e("保存成功")),a())}})]}),children:(0,k.jsx)(p.X,{headers:Z,rows:$.map((t,s)=>{const n=[(0,k.jsx)(r.Sm,{value:t.index,placeholder:s,handleInputChange:e=>{t.index=parseInt(e)},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.user_upload_num,handleInputChange:e=>{t.user_upload_num=parseInt(e)},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.sys_upload_num,handleInputChange:e=>{t.sys_upload_num=parseInt(e)},no_border:!0}),(0,k.jsx)(r.l6,{value:!0===t.open_ws_file,onChange:e=>{t.open_ws_file=e,V([...$])},options:M,no_border:!0}),(0,k.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,k.jsx)(r.Sm,{value:t.ws_file_parallel_num,handleInputChange:e=>{t.ws_file_parallel_num=parseInt(e)},no_border:!0}),(0,k.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,k.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{$.splice(e,1),V([...$])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{V((0,A.TI)($,e,t))}})})}),(0,k.jsx)(i.J,{widthPer:100,maxWidth:"100rem",children:(0,k.jsx)(l.uF,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e("Workflow Job")}),(0,k.jsx)(o.rA,{icon:"info",onClick:()=>{Q("Workflow")},title:e("信息")})]}),rightTopCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{z([...F,{open:!1}])}}),(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await d.XO.post("workflow_setting_save",F)).code===c.m.Success&&((0,v.SK)("ok"),J())}})]}),children:(0,k.jsx)(p.X,{headers:E,rows:F.map((t,s)=>{const n=[(0,k.jsx)("div",{children:s}),(0,k.jsx)(r.Sm,{value:t.file_path,handleInputChange:e=>{t.file_path=e},no_border:!0}),(0,k.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,z([...F])},options:M,no_border:!0}),(0,k.jsx)(r.l6,{value:!!t.sys_power_on,onChange:e=>{t.sys_power_on=e,z([...F])},options:M,no_border:!0}),(0,k.jsx)(U,{value:t.cron_str,onChange:e=>{t.cron_str=e,z([...F])},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.user_id,handleInputChange:e=>{t.user_id=e},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{F.splice(e,1),z([...F])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{z((0,A.TI)(F,e,t))}})})}),(0,k.jsxs)(i.fI,{children:[(0,k.jsx)(i.VP,{widthPer:50,maxWidth:"50rem",children:(0,k.jsxs)(i.xh,{children:[(0,k.jsx)(l.uF,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e("PATH")}),(0,k.jsx)(o.rA,{icon:"info",onClick:()=>{Q("环境路径")},title:e("信息")})]}),rightTopCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"list",title:e("查看"),onClick:async()=>{const t=await d.XO.get("env/process/view");t.code===c.m.Success?g({open:!0,title:e("进程环境变量"),context_div:(0,k.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,v.zN)(e("获取失败"))}}),(0,k.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:async()=>{const t=await d.XO.get("env/process/get");t.code===c.m.Success?(j.xK.set_value_temp(t.data??""),S({model:"ace/mode/ini",open:!0,fileName:"",save:async e=>{await d.XO.post("env/process/save",{text:e})}})):(0,v.zN)(e("获取失败"))}}),(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{P([...B,{path:"",note:""}])}}),(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await d.XO.post("env/path/save",{paths:B})).code===c.m.Success&&((0,v.SK)(e("保存成功")),L(),s())}})]}),children:(0,k.jsx)(p.X,{headers:W,rows:B.map((t,s)=>{const n=[(0,k.jsx)("div",{children:s}),(0,k.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,k.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,P([...B])},options:M,no_border:!0}),(0,k.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{B.splice(e,1),P([...B])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{P((0,A.TI)(B,e,t))}})}),(0,k.jsx)(l.Zp,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e("PTY CMD")}),(0,k.jsx)(o.rA,{icon:"info",onClick:()=>{Q("pty")},title:e("信息")})]}),rightBottomCom:(0,k.jsx)(o.C3,{text:e("更新"),clickFun:async()=>{(await d.XO.post("pty_cmd/save",{str:K})).code===c.m.Success&&((0,v.SK)(e("保存成功")),a())}}),children:(0,k.jsx)(r.Sm,{placeholder:e("cmd need pty env"),value:K,handleInputChange:e=>{X(e)}})}),(0,k.jsx)(l.uF,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e("插件配置")}),(0,k.jsx)(o.rA,{icon:"info",onClick:()=>{Q("插件配置")},title:e("信息")})]}),rightTopCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{T([...O,{name:"",path:"",note:"",open:!1}])}}),(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:Y})]}),children:(0,k.jsx)(p.X,{headers:G,rows:O.map((t,s)=>{const n=[s,(0,k.jsx)(r.Sm,{value:t.name,handleInputChange:e=>{t.name=e},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,k.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,T([...O])},options:M,no_border:!0}),(0,k.jsx)(o.mu,{icon:"edit",value:t.params,save:async e=>{t.params=e,await Y()},title:""}),(0,k.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{O.splice(e,1),T([...O])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{T((0,A.TI)(O,e,t))}})})]})}),(0,k.jsx)(i.VP,{widthPer:50,maxWidth:"50rem",children:(0,k.jsxs)(i.xh,{children:[(0,k.jsx)(l.uF,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e("系统保护路径")})," ",(0,k.jsx)(o.rA,{icon:"info",onClick:()=>{Q("保护目录")},title:e("信息")})]}),rightTopCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{N([...C,{path:"",note:""}])}}),(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await d.XO.post("protection_dir/sys/save",C)).code===c.m.Success&&((0,v.SK)(e("保存成功")),a())}})]}),children:(0,k.jsx)(p.X,{headers:D,rows:C.map((t,s)=>{const n=[(0,k.jsx)("div",{children:s}),(0,k.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{C.splice(e,1),N([...C])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{N((0,A.TI)(C,e,t))}})}),(0,k.jsx)(l.uF,{title:e("外部软件"),rightTopCom:(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await d.XO.post("outside/software/save",f)).code===c.m.Success&&((0,v.SK)(e("保存成功")),s())}}),children:(0,k.jsx)(p.X,{headers:q,rows:f.map((t,s)=>[(0,k.jsx)("div",{children:t.id}),(0,k.jsx)(l.fq,{ok:t.installed}),(0,k.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0,placeholder:e("use_env")}),(0,k.jsx)(o.rA,{icon:"info",onClick:()=>{Q(t.id)},title:e("信息")})]),width:"10rem"})})]})})]})]})}var E=s(21499);function Z(e){const{t,i18n:s}=(0,_.Bd)(),[i,l]=(0,h.fp)(u.AG.user_base_info),o=[{title:t("用户权限"),list:[{title:t("用户管理"),permission:a.oV.user_manage},{title:t("角色管理"),permission:a.oV.role_manage}]},{title:t("系统管理权限"),list:[{title:t("系统信息"),permission:a.oV.all_sys},{title:t("系统进程关闭"),permission:a.oV.sys_process_close},{title:t("dc_ctdl"),permission:a.oV.docker_container_update},{title:t("dc_idl"),permission:a.oV.docker_images_delete},{title:t("systemd管理"),permission:a.oV.systemd},{title:t("防火墙管理"),permission:a.oV.firewall}]},{title:t("网络功能权限"),list:[{title:t("系统网络"),permission:a.oV.vir_net},{title:t("内网穿透"),permission:a.oV.tcp_proxy},{title:"ddns",permission:a.oV.ddns}]},{title:t("Ai 设置权限"),list:[{title:t("Ai 配置"),permission:a.oV.ai_agent_setting},{title:t("ai_page"),permission:a.oV.ai_agent_page},{title:t("sw_mdl"),permission:a.oV.ai_model_switch}]},{title:t("文件权限"),list:[{title:t("log_del"),permission:a.oV.filecat_file_delete_cut_rename},{title:t("log_wr"),permission:a.oV.filecat_file_context_update_upload_created_copy_decompression},{title:t("内容更新"),permission:a.oV.filecat_file_context_update},{title:t("文件回收站修改"),permission:a.oV.recycle_file_save},{title:t("文件分享"),permission:a.oV.share_file}]},{title:t("系统设置权限"),list:[{title:t("系统页面"),permission:a.oV.sys_setting_page},{title:t("tk_time"),permission:a.oV.token_update},{title:t("修改密码"),permission:a.oV.update_password},{title:t("磁盘挂载"),permission:a.oV.sys_disk_mount},{title:t("通用设置"),permission:a.oV.sys_env_setting_key},{title:t("md_set"),permission:a.oV.md_editor_setting},{title:t("目录挂载"),permission:a.oV.file_mount},{title:t("文件服务"),permission:a.oV.file_server}]},{title:t("系统环境设置"),list:[{title:t("sys_env"),permission:a.oV.sys_env_page},{title:t("up_lim"),permission:a.oV.dir_upload_max_num},{title:t("path_md"),permission:a.oV.env_path_update},{title:"pty cmd "+t("更新"),permission:a.oV.pty_cmd_update},{title:"workflow job",permission:a.oV.workflow_job},{title:t("path_up"),permission:a.oV.sys_protection_dir},{title:t("外部软件路径"),permission:a.oV.outside_software_path}]},{title:t("个人环境设置"),list:[{title:t("个性化设置"),permission:a.oV.private_sys_env}]},{title:t("标签编辑权限"),list:[{title:t("ssh代理"),permission:a.oV.ssh_proxy_tag_update},{title:t("http代理"),permission:a.oV.http_proxy_tag_update},{title:t("浏览器代理"),permission:a.oV.browser_proxy_tag_update},{title:t("rdp代理"),permission:a.oV.rdp_proxy_tag_update},{title:t("网络唤醒"),permission:a.oV.wol_proxy_tag_update},{title:t("rtsp播放器"),permission:a.oV.rtsp_proxy_tag_update}]},{title:t("代理功能"),list:[{title:t("ssh代理"),permission:a.oV.ssh_proxy},{title:t("http代理"),permission:a.oV.http_proxy},{title:t("pxy_off"),permission:a.oV.http_proxy_download_cancel},{title:t("浏览器代理"),permission:a.oV.browser_proxy},{title:t("浏览器代理编辑"),permission:a.oV.browser_proxy_edit},{title:t("rdp代理"),permission:a.oV.rdp_proxy}]},{title:t("其他功能"),list:[{title:t("wf_run"),permission:a.oV.workflow_exe},{title:t("wf_user"),permission:a.oV.workflow_exe_user,noDisable:!0},{title:t("网络唤醒"),permission:a.oV.wol_proxy},{title:t("端口扫描"),permission:a.oV.port_scan},{title:t("rtsp播放器"),permission:a.oV.rtsp_proxy},{title:t("ssh_sv"),permission:a.oV.crypto_ssh_file},{title:t("cmd_rst"),permission:a.oV.shell_cmd_filecat_restart},{title:t("cmd_upg"),permission:a.oV.shell_cmd_filecat_upgrade},{title:t("cmd_dwn"),permission:a.oV.shell_cmd_filecat_kill_self},{title:t("cmd_ai"),permission:a.oV.ai_chat_cmd}]}];return(0,k.jsx)(n.Fragment,{children:o.map((t,s)=>(0,k.jsxs)("div",{children:[(0,k.jsx)("h3",{children:t.title}),t.list.map((t,s)=>(0,k.jsxs)("div",{children:[(0,k.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 G=new Map;function R(){const{t:e,i18n:t}=(0,_.Bd)(),{initUserInfo:s,reloadUserInfo:m}=(0,n.useContext)(b.F),[x,j]=(0,h.fp)(u.AG.user_base_info),[f,y]=(0,n.useState)([]),[w,g]=(0,h.fp)(u.AG.prompt_card),[S,C]=(0,n.useState)(!1),[N,$]=(0,n.useState)(!1),[V,B]=(0,h.fp)(u.AG.confirm),[P,F]=(0,n.useState)(""),[z,K]=(0,n.useState)(""),[X,O]=(0,n.useState)(""),[T,M]=(0,n.useState)([]),[q,D]=(0,n.useState)([]),[U,H]=(0,n.useState)([]),[W,R]=(0,n.useState)(""),[L,J]=(0,n.useState)(""),[Q,Y]=(0,n.useState)("en"),[ee,te]=(0,n.useState)(""),[se,ne]=(0,n.useState)([]),[ie,ae]=(0,n.useState)(""),[le,oe]=(0,n.useState)(!1),[re,de]=(0,n.useState)(""),[ce,he]=(0,n.useState)(""),[ue,pe]=(0,n.useState)({}),me=(0,I.o)(),[_e,xe]=(0,n.useState)([]),[je,ve]=(0,n.useState)(void 0),fe=[e("用户id"),e("用户名"),e("目录范围"),e("备注")],ye=async()=>{const e=await d.wm.get("all_users");if(e.code===c.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);y(e)}else y(t)}const t=await d.wm.get("all_roles");if(t.code===c.m.Success){xe(t.data),G.clear();for(const e of t.data)G.set(e.role_id,e)}},we=e=>{F(e?.username??""),K(e?.password??""),O(e?.cwd??""),M(e?.access_dirs??[]),D(e?.not_access_dirs??[]),H(e?.only_read_dirs??[]),R(e?.access_cmd??""),J(e?.not_access_cmd??""),Y(e?.language??""),te(e?.theme??""),ne(e?.auth_list??[]),ae(e?.note??""),oe(e?.is_root??!1),de(e?.id??""),e?.bind_role_id?ge(e.bind_role_id,e.auth_list??[]):(he(""),pe({}))};(0,n.useEffect)(()=>{ye()},[]);const ge=(e,t=[])=>{if(!e)return he(""),void pe({});const s=G.get(e);if(s){if(s.cwd&&O(s.cwd),s.access_dirs&&s.access_dirs.length>0&&M(s.access_dirs),s.not_access_dirs&&s.not_access_dirs.length>0&&D(s.not_access_dirs),s.only_read_dirs&&s.only_read_dirs.length>0&&H(s.only_read_dirs),s.access_cmd&&R(s.access_cmd),s.not_access_cmd&&J(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)}},be=()=>{if(!P)return void(0,v.zN)("username not empty");if((0,E.CB)(P))return void(0,v.zN)("username not empty char");if(!X)return void(0,v.zN)("cwd not empty");const e=new a.E0;return e.language=Q,e.theme=ee,e.access_dirs=T,e.username=P,e.password=z,e.not_access_dirs=q,e.only_read_dirs=U,e.cwd=X,e.note=ie,e.access_cmd=W,e.not_access_cmd=L,e.auth_list=se,e.bind_role_id=ce,e};return(0,k.jsxs)(i.fI,{children:[(0,k.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(0,k.jsx)(i.xh,{children:(0,k.jsx)(l.uF,{self_title:(0,k.jsx)("span",{className:" div-row ",children:(0,k.jsx)("h2",{children:e("用户")})}),rightTopCom:(0,k.jsxs)("div",{className:"div-row",style:{gap:"0.5rem"},children:[(0,k.jsx)(r.Sm,{placeholder:e("过滤"),value:je,handleInputChange:e=>{ve(e)},handlerEnter:()=>{ye()}}),(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{C(!0),$(!1),we(void 0)}})]}),children:(0,k.jsx)(p.X,{headers:fe,rows:f.map((t,s)=>{const n=[(0,k.jsx)("p",{children:t.id}),(0,k.jsx)(l.xP,{children:t.username}),(0,k.jsx)(l.xP,{children:t.cwd}),(0,k.jsx)(l.xP,{children:t.note}),(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{C(!1),$(!0),we(e)})(t)}),!t.is_root&&(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(async t=>{B({open:!0,title:e("确定删除吗"),handle:async()=>{const s=new a.E0;s.username=t,(await d.wm.post("delete_user",s)).code===c.m.Success&&((0,v.SK)(e("删除完成")),ye(),B({open:!1,handle:null}))}})})(t.username)})]})];return n}),width:"10rem"})})})}),(0,k.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(S||N)&&(0,k.jsx)(i.xh,{children:(0,k.jsxs)(l.Zp,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e(""+(S?"添加":"编辑"))})," "]}),rightBottomCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:()=>{C(!1),$(!1),we(void 0)}}),S&&(0,k.jsx)(o.rA,{icon:"add_circle",title:e("添加"),onClick:async()=>{if(!z)return void(0,v.zN)("password not empty");if((0,E.CB)(z))return void(0,v.zN)("username not empty char");const t=be(),s=await d.wm.post("create_user",t);ye(),s.code===c.m.Success&&((0,v.SK)(e("创建完成")),ye(),C(!1),$(!1),we(void 0))}}),N&&(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{const t=be();if(!t)return;t.id=re;(await d.wm.post("save_user",t)).code===c.m.Success&&((0,v.SK)(e("保存完成")),ye())}})]}),children:[(0,k.jsx)("label",{children:e("用户名")}),(0,k.jsx)(r.Sm,{value:P,handleInputChange:e=>F(e)}),(0,k.jsx)("label",{children:e("密码")}),(0,k.jsx)(r.Sm,{type:"password",value:z,handleInputChange:e=>K(e)}),(0,k.jsxs)("label",{children:[!ue?.access_dirs?.length&&(0,k.jsx)(o.rA,{icon:"add",onClick:()=>{M([...T,""])},title:"添加"}),e("目录范围")]}),(0,k.jsx)(r.Sm,{disabled:""!==ue.cwd&&void 0!==ue.cwd,value:X,handleInputChange:e=>O(e)}),(T??[]).map((t,s)=>(0,k.jsxs)("div",{style:{display:"flex"},children:[(0,k.jsx)("div",{style:{width:"90%"},children:(0,k.jsx)(r.Sm,{disabled:0!==ue?.access_dirs?.length&&void 0!==ue?.access_dirs?.length,value:t,handleInputChange:e=>{T[s]=e,M([...T])}})}),0===ue?.access_dirs?.length||void 0===ue?.access_dirs?.length&&(0,k.jsx)(o.rA,{icon:"delete",onClick:()=>{T.splice(s,1),M([...T])},title:e("删除")})]},s)),(0,k.jsxs)("label",{children:[!ue?.not_access_dirs?.length&&(0,k.jsx)(o.rA,{icon:"add",onClick:()=>{D([...q,""])},title:e("添加")}),e("禁止目录范围")]}),(q??[]).map((t,s)=>(0,k.jsxs)("div",{style:{display:"flex"},children:[(0,k.jsx)("div",{style:{width:"90%"},children:(0,k.jsx)(r.Sm,{disabled:0!==ue?.not_access_dirs?.length&&void 0!==ue?.not_access_dirs?.length,value:t,handleInputChange:e=>{q[s]=e,D([...q])}})}),0===ue?.not_access_dirs?.length||void 0===ue?.not_access_dirs?.length&&(0,k.jsx)(o.rA,{icon:"delete",onClick:()=>{q.splice(s,1),D([...q])},title:e("删除")})]},s)),(0,k.jsxs)("label",{children:[!ue?.only_read_dirs?.length&&(0,k.jsx)(o.rA,{icon:"add",onClick:()=>{H([...U,""])},title:e("添加")}),e("只读目录范围")]}),(U??[]).map((t,s)=>(0,k.jsxs)("div",{style:{display:"flex"},children:[(0,k.jsx)("div",{style:{width:"90%"},children:(0,k.jsx)(r.Sm,{disabled:0!==ue?.only_read_dirs?.length&&void 0!==ue?.only_read_dirs?.length,value:t,handleInputChange:e=>{U[s]=e,H([...U])}})}),0===ue?.only_read_dirs?.length||void 0===ue?.only_read_dirs?.length&&(0,k.jsx)(o.rA,{icon:"delete",onClick:()=>{U.splice(s,1),H([...U])},title:e("删除")})]},s)),(0,k.jsx)("label",{children:e("可执行的命令")}),(0,k.jsx)(r.Sm,{disabled:""!==ue.access_cmd&&void 0!==ue.access_cmd,value:W,placeholder:"use blank split",handleInputChange:e=>R(e)}),(0,k.jsx)("label",{children:e("禁止执行的命令")}),(0,k.jsx)(r.Sm,{disabled:""!==ue.not_access_cmd&&void 0!==ue.not_access_cmd,value:L,placeholder:"use blank split",handleInputChange:e=>J(e)}),!le&&(0,k.jsxs)(n.Fragment,{children:[(0,k.jsx)("label",{children:e("角色")}),(0,k.jsx)(r.l6,{value:ce,onChange:e=>{ge(e)},options:(()=>{const e=[];e.push({title:"NOT",value:""});for(let t of _e)e.push({title:t.role_name,value:t.role_id});return e})()})]}),(0,k.jsx)("label",{children:e("语言")}),(0,k.jsx)(r.l6,{disabled:""!==ue.language&&void 0!==ue.language,value:Q,onChange:e=>{Y(e)},options:[{title:e("跟随系统"),value:"sys"},{title:"English",value:"en"},{title:"中文",value:"zh"}]}),(0,k.jsx)("label",{children:e("主题")}),(0,k.jsx)(r.l6,{disabled:""!==ue.theme&&void 0!==ue.theme,value:ee,onChange:e=>{te(e)},options:me}),(0,k.jsx)(Z,{is_disable:e=>{if(!0===le)return!0;if(ce){const t=G.get(ce);if(t)return(t.auth_list??[]).includes(e)}return!1},is_selected:(e,t)=>!t&&!0===le||void 0!==se?.find(t=>t===e),select_auth:e=>{se?se.includes(e)?((0,A.I)(se,t=>t===e),ne([...se])):ne([...se,e]):ne([e])}}),(0,k.jsx)("label",{children:e("备注")}),(0,k.jsx)(r.Sm,{value:ie,handleInputChange:e=>ae(e)})]})})})]})}function L(){const{t:e,i18n:t}=(0,_.Bd)(),{initUserInfo:s}=(0,n.useContext)(b.F),[m,x]=(0,n.useState)([]),[j,f]=(0,h.fp)(u.AG.prompt_card),[y,w]=(0,n.useState)(!1),[g,S]=(0,n.useState)(!1),[C,N]=(0,h.fp)(u.AG.confirm),[$,V]=(0,n.useState)(""),[B,P]=(0,n.useState)(""),[F,z]=(0,n.useState)([]),[K,X]=(0,n.useState)([]),[O,T]=(0,n.useState)([]),[M,q]=(0,n.useState)(""),[D,U]=(0,n.useState)(""),[H,W]=(0,n.useState)(""),[E,G]=(0,n.useState)(""),[R,L]=(0,n.useState)([]),[J,Q]=(0,n.useState)(""),[Y,ee]=(0,n.useState)(""),te=(0,I.o)(),se=[e("角色id"),e("角色名"),e("备注")],ne=async()=>{const e=await d.wm.get("all_roles");e.code===c.m.Success&&x(e.data)},ie=e=>{V(e?.role_name??""),P(e?.cwd??""),z(e?.access_dirs??[]),X(e?.not_access_dirs??[]),T(e?.only_read_dirs??[]),q(e?.access_cmd??""),U(e?.not_access_cmd??""),W(e?.language??""),G(e?.theme??""),L(e?.auth_list??[]),Q(e?.role_id??""),ee(e?.role_note??"")};(0,n.useEffect)(()=>{ne()},[]);const ae=()=>{if(!$)return void(0,v.zN)("role_name not empty");const e=new a.E0;return e.language=H,e.theme=E,e.access_dirs=F,e.role_name=$,e.not_access_dirs=K,e.only_read_dirs=O,e.cwd=B,e.access_cmd=M,e.not_access_cmd=D,e.auth_list=R,e.role_note=Y,e};return(0,k.jsxs)(i.fI,{children:[(0,k.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(0,k.jsx)(i.xh,{children:(0,k.jsx)(l.uF,{self_title:(0,k.jsx)("span",{className:" div-row ",children:(0,k.jsx)("h2",{children:e("角色")})}),rightTopCom:(0,k.jsx)("div",{children:(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{w(!0),S(!1),ie(void 0)}})}),children:(0,k.jsx)(p.X,{headers:se,rows:m.map((t,s)=>{const n=[(0,k.jsx)("p",{children:t.role_id}),(0,k.jsx)(l.xP,{children:t.role_name}),(0,k.jsx)(l.xP,{children:t.role_note}),(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{w(!1),S(!0),ie(e)})(t)}),!t.is_root&&(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(async t=>{N({open:!0,title:e("确定删除吗"),handle:async()=>{const s=new a.E0;s.role_id=t,(await d.wm.post("delete_role",s)).code===c.m.Success&&((0,v.SK)(e("删除完成")),ne(),N({open:!1,handle:null}))}})})(t.role_id)})]})];return n}),width:"10rem"})})})}),(0,k.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(y||g)&&(0,k.jsx)(i.xh,{children:(0,k.jsxs)(l.Zp,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e(""+(y?"添加":"编辑"))})," "]}),rightBottomCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:()=>{w(!1),S(!1),ie(void 0)}}),y&&(0,k.jsx)(o.rA,{icon:"add_circle",title:e("添加"),onClick:async()=>{const t=ae();if(!t)return;const s=await d.wm.post("create_role",t);ne(),s.code===c.m.Success&&((0,v.SK)(e("创建完成")),ne(),w(!1),S(!1),ie(void 0))}}),g&&(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{const t=ae();if(!t)return;t.role_id=J;(await d.wm.post("save_role",t)).code===c.m.Success&&((0,v.SK)(e("保存完成")),ne())}})]}),children:[(0,k.jsx)("label",{children:e("角色名")}),(0,k.jsx)(r.Sm,{value:$,handleInputChange:e=>V(e)}),(0,k.jsx)("label",{children:e("角色备注")}),(0,k.jsx)(r.Sm,{value:Y,handleInputChange:e=>ee(e)}),(0,k.jsxs)("label",{children:[(0,k.jsx)(o.rA,{icon:"add",onClick:()=>{z([...F,""])},title:"添加"}),e("目录范围")]}),(0,k.jsx)(r.Sm,{value:B,handleInputChange:e=>P(e)}),(F??[]).map((e,t)=>(0,k.jsxs)("div",{style:{display:"flex"},children:[(0,k.jsx)("div",{style:{width:"90%"},children:(0,k.jsx)(r.Sm,{value:e,handleInputChange:e=>{F[t]=e,z([...F])}})}),(0,k.jsx)(o.rA,{icon:"delete",onClick:()=>{F.splice(t,1),z([...F])},title:"删除"})]},t)),(0,k.jsxs)("label",{children:[(0,k.jsx)(o.rA,{icon:"add",onClick:()=>{X([...K,""])},title:"添加"}),e("禁止目录范围")]}),(K??[]).map((t,s)=>(0,k.jsxs)("div",{style:{display:"flex"},children:[(0,k.jsx)("div",{style:{width:"90%"},children:(0,k.jsx)(r.Sm,{value:t,handleInputChange:e=>{K[s]=e,X([...K])}})}),(0,k.jsx)(o.rA,{icon:"delete",onClick:()=>{K.splice(s,1),X([...K])},title:e("删除")})]},s)),(0,k.jsxs)("label",{children:[(0,k.jsx)(o.rA,{icon:"add",onClick:()=>{T([...O,""])},title:e("添加")}),e("只读目录范围")]}),(O??[]).map((e,t)=>(0,k.jsxs)("div",{style:{display:"flex"},children:[(0,k.jsx)("div",{style:{width:"90%"},children:(0,k.jsx)(r.Sm,{value:e,handleInputChange:e=>{O[t]=e,T([...O])}})}),(0,k.jsx)(o.rA,{icon:"delete",onClick:()=>{O.splice(t,1),T([...O])},title:"删除"})]},t)),(0,k.jsx)("label",{children:e("可执行的命令")}),(0,k.jsx)(r.Sm,{value:M,placeholder:"use blank split",handleInputChange:e=>q(e)}),(0,k.jsx)("label",{children:e("禁止执行的命令")}),(0,k.jsx)(r.Sm,{value:D,placeholder:"use blank split",handleInputChange:e=>U(e)}),(0,k.jsx)("label",{children:e("语言")}),(0,k.jsx)(r.l6,{value:H,onChange:e=>{W(e)},options:[{title:e("跟随系统"),value:"sys"},{title:"NOT",value:""},{title:"English",value:"en"},{title:"中文",value:"zh"}]}),(0,k.jsx)("label",{children:e("主题")}),(0,k.jsx)(r.l6,{value:E,onChange:e=>{G(e)},options:te}),(0,k.jsx)(Z,{is_disable:()=>!1,is_selected:(e,t)=>void 0!==R?.find(t=>t===e),select_auth:e=>{R?(R.find(t=>t==e)?(0,A.I)(R,t=>t===e):R.push(e),L([...R])):L([e])}})]})})})]})}var J=s(93245);function Q(e){const{t}=(0,_.Bd)(),[s,i]=(0,n.useState)((e.children_list??[]).map(e=>({path:e.path,note:e.note}))),a=[t("编号"),t("目录"),t("备注")],d=()=>{i([...s,{path:"",note:""}])};(0,n.useEffect)(()=>{s?.length||d()});return(0,k.jsx)(l.uF,{self_title:(0,k.jsx)("span",{className:" div-row ",children:(0,k.jsx)("h2",{children:t("sub_dir")})}),rightTopCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"add",title:t("添加"),onClick:d}),(0,k.jsx)(o.rA,{icon:"save",title:t("保存"),onClick:()=>{e.on_confirm(s.filter(e=>e.path))}}),(0,k.jsx)(o.rA,{icon:"close",title:t("取消"),onClick:e.on_cancel})]}),children:(0,k.jsx)(p.X,{headers:a,rows:s.map((e,n)=>[(0,k.jsx)("span",{children:n}),(0,k.jsx)(r.Sm,{value:e.path,handleInputChange:t=>{e.path=t},no_border:!0}),(0,k.jsx)(r.Sm,{value:e.note,handleInputChange:t=>{e.note=t},no_border:!0}),(0,k.jsx)("div",{children:(0,k.jsx)(o.rA,{icon:"delete",title:t("删除"),onClick:()=>{i(s.filter((e,t)=>t!==n))}})})]),width:"10rem"})})}function Y(){const{t:e,i18n:t}=(0,_.Bd)(),{initUserInfo:s,reloadUserInfo:x}=(0,n.useContext)(b.F),[j,f]=(0,n.useState)([]),[w,g]=(0,h.fp)(u.AG.prompt_card),[S,C]=(0,n.useState)([]),[N,$]=(0,n.useState)([]),[V,B]=(0,n.useState)([]),[P,F]=(0,h.fp)(u.AG.user_base_info),z=(0,H.K)(),K=(0,I.o)(),X=[e("编号"),e("路径"),e("是否默认"),e("备注"),e("sub_dir")],O=[e("编号"),e("路径"),e("备注")],T=[e("编号"),e("命令"),e("父编号"),e("备注")],M=[e("文件后缀"),e("命令"),e("其他参数"),e("备注")],[q,D]=(0,n.useState)(""),[U,W]=(0,n.useState)(""),[E,Z]=(0,n.useState)(""),[G,R]=(0,n.useState)(!1),[L,Y]=(0,n.useState)(""),[ee,te]=(0,n.useState)(""),[se,ne]=(0,n.useState)(""),[ie,ae]=(0,n.useState)(!1),[le,oe]=(0,n.useState)(""),[re,de]=(0,n.useState)([]);(0,n.useEffect)(()=>{(async()=>{const e=await d.XO.get("filesSetting");e.code===c.m.Success&&(f(e.data.dirs),$(e.data.quick_cmd),B(e.data.file_quick_cmd));const t=await d.XO.get("protection_dir");t.code===c.m.Success&&C(t.data??[])})(),Y(P?.user_data?.language),te(P?.user_data?.theme),ne(P?.user_data?.upload_file_ignore);const e=P?.user_data?.editor_auto_save;ae(!!e?.enable),oe(null!=e?.interval?String(e.interval):""),de(e?.editors??[])},[]);const ce=(0,I.Q)();return(0,k.jsx)(n.Fragment,{children:(0,k.jsxs)(i.fI,{children:[(0,k.jsxs)(i.VP,{widthPer:33,children:[(0,k.jsx)(i.xh,{children:(0,k.jsxs)(l.Zp,{title:e("修改密码"),rightBottomCom:(0,k.jsx)(o.C3,{text:e("确定修改"),clickFun:async()=>{if(!q||!U)return void(0,v.zN)(e("账号密码不能为空"));if(U!==E)return void(0,v.zN)(e("两次密码不一样"));const t=new a.tl;t.username=q,t.password=U,t.confirm_password=E,t.user_id=P.user_data.id;(await d.wm.post("updatePassword",t)).code===c.m.Success&&(0,v.SK)(e("修改成功"))}}),children:[(0,k.jsx)(r.Sm,{placeholder:e("新账号"),value:q,handleInputChange:e=>{D(e)}}),(0,k.jsx)(r.cA,{placeholder:e("新密码"),handleInputChange:e=>{W(e)}}),(0,k.jsx)(r.cA,{placeholder:e("确认密码"),handleInputChange:e=>{Z(e)}})]})}),(0,k.jsx)(i.xh,{children:(0,k.jsxs)(l.Zp,{title:e("个性化设置"),rightBottomCom:(0,k.jsx)(o.C3,{text:e("确定修改"),clickFun:async()=>{(await d.XO.post(y.s.setting_sys_option_status_save,{type:m.Mu.private_sys_env,value:{language:L,theme:ee,upload_file_ignore:se}})).code===c.m.Success&&((0,v.SK)(e("修改成功")),s())}}),children:[e("语言"),(0,k.jsx)(r.l6,{value:L,onChange:e=>{Y(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,k.jsx)(r.l6,{value:ee,onChange:e=>{te(e)},options:K}),(0,k.jsx)(r.Sm,{value:se,handleInputChange:e=>{ne(e)},placeholderOut:e("拖拽文件上传忽略列表"),placeholder:"node_modules *.js",no_border:!0})]})}),(0,k.jsx)(i.xh,{children:(0,k.jsxs)(l.Zp,{title:e("编辑器自动保存"),rightBottomCom:(0,k.jsx)(o.C3,{text:e("确定修改"),clickFun:async()=>{const t=parseInt(String(le),10);if(isNaN(t)||t<1)return void(0,v.zN)(e("请输入不小于 1 的整数(秒)"));(await d.wm.post(y.s.user_save_private_attr,{is_editor_auto_save:!0,editor_auto_save:{enable:ie,interval:t,editors:re}})).code===c.m.Success&&((0,v.SK)(e("修改成功")),s())}}),children:[(0,k.jsx)(r.BC,{label:e("开启"),children:(0,k.jsx)(r.l6,{value:ie,onChange:e=>{ae(e)},options:z,no_border:!0})}),(0,k.jsx)(r.BC,{label:e("自动保存间隔(秒)"),children:(0,k.jsx)(r.Sm,{type:"number",value:le,handleInputChange:e=>{oe(e)},placeholder:"30",no_border:!0})}),(0,k.jsx)("h3",{children:e("编辑器")}),J.d.map(t=>(0,k.jsxs)("div",{children:[(0,k.jsx)("input",{type:"checkbox",checked:re.includes(t.id),onChange:e=>{const s=e.target.checked;de(s?[...re,t.id]:re.filter(e=>e!==t.id))}}),e(t.label)]},t.id))]})})]}),(0,k.jsxs)(i.VP,{children:[(0,k.jsxs)(i.xh,{children:[(0,k.jsx)(l.uF,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e("文件夹路径")})," ",(0,k.jsx)(o.rA,{icon:"info",onClick:()=>{ce("文件夹路径")},title:e("信息")})]}),rightTopCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{f([...j,{note:"",default:!1,path:""}])}}),(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{for(let e=0;e<j.length;e++)j[e].index=e;(await d.XO.post("filesSetting/save",{dirs:j})).code===c.m.Success&&((0,v.SK)(e("保存成功")),x(),s())}})]}),children:(0,k.jsx)(p.X,{headers:X,rows:j.map((t,s)=>{const n=[(0,k.jsx)("div",{children:s}),(0,k.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,k.jsx)(r.l6,{value:t.default,onChange:e=>{((e,t,s)=>{const n=[];for(let e=0;e<j.length;e++)j[e].default=e===s&&t,n.push(j[e]);f(n)})(0,e,s)},options:z,no_border:!0}),(0,k.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,k.jsxs)("div",{className:"div-row",children:[(0,k.jsx)("span",{children:t.children?.length??0}),0!==s&&(0,k.jsx)(o.rA,{icon:"folder_open",title:e("sub_dir"),onClick:()=>(e=>{g({open:!0,main_context_div:(0,k.jsx)(Q,{children_list:e.children,on_cancel:()=>{g({open:!1})},on_confirm:t=>{e.children=t,f([...j]),g({open:!1})}})})})(t)})]}),(0,k.jsx)("div",{children:0!==s&&(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{j.splice(e,1),f([...j])})(s)})})];return n}),width:"10rem",onRowDrag:(e,t)=>{0!==e&&0!==t&&f((0,A.TI)(j,e,t))}})}),(0,k.jsx)(l.uF,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e("个人保护路径")})," ",(0,k.jsx)(o.rA,{icon:"info",onClick:()=>{ce("保护目录")},title:e("信息")})]}),rightTopCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{C([...S,{path:"",note:""}])}}),(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await d.XO.post("protection_dir/save",S)).code===c.m.Success&&((0,v.SK)(e("保存成功")),x())}})]}),children:(0,k.jsx)(p.X,{headers:O,rows:S.map((t,s)=>{const n=[(0,k.jsx)("div",{children:s}),(0,k.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{S.splice(e,1),C([...S])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{C((0,A.TI)(S,e,t))}})})]}),(0,k.jsxs)(i.xh,{children:[(0,k.jsx)(l.uF,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e("目录快捷命令")}),(0,k.jsx)(o.rA,{icon:"info",onClick:()=>{ce("目录快捷命令")},title:"info"})]}),rightTopCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{$([...N,{cmd:"",note:""}])}}),(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await d.XO.post("filesSetting/save",{quick_cmd:N})).code===c.m.Success&&((0,v.SK)(e("保存成功")),s())}})]}),children:(0,k.jsx)(p.X,{headers:T,rows:N.map((t,s)=>{const n=[(0,k.jsx)(r.Sm,{value:t.index,handleInputChange:e=>{t.index=e},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.cmd,handleInputChange:e=>{t.cmd=e},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.father_index,handleInputChange:e=>{t.father_index=e},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{N.splice(e,1),$([...N])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{$((0,A.TI)(N,e,t))}})}),(0,k.jsx)(l.uF,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e("文件快捷命令")}),(0,k.jsx)(o.rA,{icon:"info",onClick:()=>{ce("文件快捷命令")},title:"info"})]}),rightTopCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{B([...V,{cmd:"",note:"",file_suffix:"",params:""}])}}),(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await d.XO.post("filesSetting/save",{file_quick_cmd:V})).code===c.m.Success&&((0,v.SK)(e("保存成功")),s())}})]}),children:(0,k.jsx)(p.X,{headers:M,rows:V.map((t,s)=>{const n=[(0,k.jsx)(r.Sm,{value:t.file_suffix,handleInputChange:e=>{t.file_suffix=e},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.cmd,handleInputChange:e=>{t.cmd=e},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.params,handleInputChange:e=>{t.params=e},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{V.splice(e,1),B([...V])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{B((0,A.TI)(V,e,t))}})})]})]})]})})}var ee=s(45907),te=s(90764),se=s(17903);function ne(){const{t:e}=(0,_.Bd)(),t=(0,ee.y)(),[s,a]=(0,n.useState)([]),[r,c]=(0,n.useState)([]),[m,x]=(0,h.fp)(u.AG.mount_enabled),[j,f]=(0,n.useState)(!1),[y,w]=(0,n.useState)(""),[g,b]=(0,n.useState)((0,te.v)()),S=async()=>{try{const[e,t]=await Promise.all([d.I2.post("list",{}),d.I2.post("credential/list",{})]);a(Array.isArray(e?.data)?e.data:[]),c(Array.isArray(t?.data)?t.data:[])}catch(e){}};(0,n.useEffect)(()=>{S(),(async()=>{try{const e=await d.I2.post("enabled/get",{});x(!0===e?.data)}catch(e){x(!1)}})()},[]);const C=(0,se.ln)(g.credential_id,r),A=()=>{f(!1),w(""),b((0,te.v)())};return(0,k.jsxs)(i.fI,{children:[(0,k.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(0,k.jsx)(i.xh,{children:(0,k.jsx)(l.uF,{self_title:(0,k.jsx)("span",{className:" div-row ",children:(0,k.jsx)("h2",{children:e("网盘挂载")})}),rightTopCom:(0,k.jsxs)("div",{className:"div-row",children:[(0,k.jsx)(o.rA,{icon:!0===m?"cloud_done":"cloud_off",title:e(!0===m?"muntont":"muntoff"),selected:!0===m,onClick:async()=>{const t=!m;try{const s=await d.I2.post("enabled/set",{enabled:t}),n=!0===s?.data;x(n),(0,v.SK)(e(n?"挂载已启用":"挂载已停用"))}catch(e){}}}),(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{A(),f(!0)}})]}),children:(0,k.jsx)(p.X,{headers:[e("编号"),e("备注"),e("挂载类型"),e("凭据"),e("账号"),e("操作")],rows:s.map((s,n)=>{const i=r.find(e=>e.id===s.credential_id),a=(i?.accounts??[]).find(e=>e.id===s.account_id);return[(0,k.jsx)("span",{children:n}),(0,k.jsx)(l.xP,{context:s.note||"-"}),(0,k.jsx)("p",{children:(c=s.driver,se.sI.find(e=>e.type===c)?.name??c)}),(0,k.jsx)(l.xP,{context:i?i.note:e("凭据已丢失")}),(0,k.jsx)(l.xP,{context:s.account_id?a?a.note||a.account_name||a.nickname||a.id:e("账号已丢失"):"-"}),(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{f(!0),w(e.id),b({driver:e.driver,mount_path:e.mount_path??"",credential_id:e.credential_id??"",account_id:e.account_id??"",root_dir:e.root_dir??"",note:e.note??"",color:e.color??se.OT,readonly:Boolean(e.readonly),forward_to_remote:Boolean(e.forward_to_remote)})})(s)}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(async s=>{t({title:e("确认删除"),sub_title:s.mount_path,confirm_fun:async()=>{try{await d.I2.post("delete",{id:s.id}),(0,v.SK)(e("已删除")),await S()}catch(e){}}})})(s)})]})];var c})})})})}),(0,k.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:j&&(0,k.jsx)(i.xh,{children:(0,k.jsx)(l.Zp,{self_title:(0,k.jsx)("span",{className:" div-row ",children:(0,k.jsx)("h2",{children:e(y?"编辑":"添加")})}),rightBottomCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"network_check",title:e("测试连接"),onClick:async()=>{if(g.credential_id)try{const t=await d.I2.post("test",{id:y||void 0,driver:g.driver,credential_id:g.credential_id,account_id:g.account_id,root_dir:g.root_dir}),s=t?.data;s?.ok?(0,v.SK)(`${e("连接成功")}(${s.count??0})`):(0,v.zN)(`${e("连接失败")}:${s?.error??""}`)}catch(e){}else(0,v.zN)(e("请选择凭据"))}}),(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{if(g.credential_id)if(!C||g.account_id)if(g.mount_path.trim())try{await d.I2.post(y?"update":"add",{id:y||void 0,driver:g.driver,mount_path:g.mount_path,credential_id:g.credential_id,account_id:C?g.account_id:void 0,root_dir:g.root_dir,note:g.note,color:g.color,readonly:g.readonly,enabled:!0,forward_to_remote:"tcp_proxy"===g.driver&&Boolean(g.forward_to_remote)}),(0,v.SK)(e("保存成功")),await S()}catch(e){}else(0,v.zN)(e("munt_rq"));else(0,v.zN)(e("请选择账号"));else(0,v.zN)(e("请选择凭据"))}}),(0,k.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:A})]}),children:(0,k.jsx)(te.A,{value:g,onChange:b,creds:r})})})})]})}function ie(){const{t:e}=(0,_.Bd)(),{check_user_auth:t}=(0,j.MH)();return t(a.oV.file_mount)?(0,k.jsx)(i.xh,{children:(0,k.jsx)(i.fI,{children:(0,k.jsx)(i.VP,{widthPer:100,maxWidth:"90rem",children:(0,k.jsx)(ne,{})})})}):(0,k.jsx)(i.fI,{children:(0,k.jsx)(i.VP,{children:(0,k.jsx)(l.Zp,{self_title:(0,k.jsx)("h2",{children:e("网盘挂载")}),children:(0,k.jsx)("p",{children:e("nmuntpr")})})})})}var ae=s(47996);function le(e){const{src:t,name:s,size:i=1.5,show_name:a=!0,label:l,label_width:o,className:r}=e,[d,c]=(0,n.useState)(!1);(0,n.useEffect)(()=>{c(!1)},[t]);const h={width:`${i}rem`,height:`${i}rem`,borderRadius:"50%",flexShrink:0,verticalAlign:"middle"},u=["avatar",r].filter(Boolean).join(" "),p=t&&!d?(0,k.jsx)("img",{className:u,style:{...h,objectFit:"cover"},src:t,alt:s??"",referrerPolicy:"no-referrer",onError:()=>c(!0)}):(0,k.jsx)("span",{className:`${u} avatar--fallback`,style:{...h,display:"inline-flex",alignItems:"center",justifyContent:"center"},children:(s??"").trim().charAt(0).toUpperCase()||"?"}),m=a&&s?(0,k.jsxs)("span",{className:"avatar-with-name",children:[p,(0,k.jsx)("span",{className:"avatar__name",children:s})]}):p;if(void 0===l)return m;const _={whiteSpace:"nowrap",flex:"0 0 auto",textAlign:"right"};return o&&(_.width=o),(0,k.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.4rem"},children:[(0,k.jsx)("label",{style:_,children:l}),(0,k.jsx)("div",{style:{flex:1,minWidth:0},children:m})]})}const oe=[{type:"webdav",name:"WebDAV",fields:[{key:"webdav_url",label:"Service URL",type:"text",required:!0,placeholder:"https://example.com/dav"}],accounts:!0,account_key:"account_name",account_fields:[{key:"account_name",label:"Username",type:"text"},{key:"password",label:"Password",type:"password",tip:"Use an app password for services like Nutstore or Synology"}]},{type:"ssh",name:"SSH / SFTP",fields:[{key:"ssh_host",label:"Host",type:"text",required:!0},{key:"ssh_port",label:"Port",type:"text",placeholder:"Default 22"}],accounts:!0,account_key:"account_name",account_fields:[{key:"account_name",label:"Username",type:"text",required:!0},{key:"password",label:"Password",type:"password",tip:"Can be left empty when a private key is set"},{key:"private_key",label:"Private key",type:"textarea",tip:"Takes precedence over the password when filled"}]},{type:"smb",name:"SMB / Windows share",fields:[{key:"smb_server",label:"Host",type:"text",required:!0,placeholder:"192.168.1.10 or nas.local"}],accounts:!0,account_key:"account_name",account_fields:[{key:"account_name",label:"Username",type:"text"},{key:"password",label:"Password",type:"password"}]},{type:"s3",name:"S3 compatible storage",fields:[{key:"s3_endpoint",label:"Endpoint",type:"text",required:!0,placeholder:"https://s3.amazonaws.com",tip:"Use the endpoint of your provider, e.g. Alibaba OSS, Tencent COS or MinIO"},{key:"s3_region",label:"Region",type:"text",placeholder:"us-east-1"},{key:"s3_force_path_style",label:"Force path style",type:"switch",tip:"Usually required by MinIO"}],accounts:!0,account_key:"account_name",account_fields:[{key:"account_name",label:"AccessKey",type:"text",required:!0},{key:"secret_key",label:"SecretKey",type:"password",required:!0}]},{type:"baidu",name:"Baidu Netdisk",fields:[{key:"baidu_app_id",label:"AppID",type:"text"},{key:"baidu_app_key",label:"AppKey",type:"text",required:!0},{key:"baidu_secret_key",label:"SecretKey",type:"password",required:!0}],accounts:!0,account_key:"account_name",account_fields:[]},{type:"local",name:"Local directory",fields:[],sources:!0},{type:"tcp_proxy",name:"TCP proxy FileCat",fields:[{key:"tcp_client_num_id",label:"Proxy client",type:"text",required:!0,options_source:"tcp_client",tip:"Pick one from the TCP proxy client list"},{key:"tcp_base_url",label:"Remote base_url",type:"text",placeholder:"/pre",tip:"Only needed when the remote FileCat has a base_url configured"}],accounts:!0,account_key:"account_name",account_fields:[{key:"account_name",label:"Username",type:"text",required:!0},{key:"password",label:"Password",type:"password"}]}];const re="webdav",de="@authorize",ce={baidu:[{keys:["baidu_app_id","baidu_app_key","baidu_secret_key"],on_next:"save_app"},{keys:[de]}],tcp_proxy:[{keys:["tcp_client_num_id"],on_next:"save_app"},{keys:["@tcp_account"]}]};function he(){const{t:e}=(0,_.Bd)(),t=(0,ee.y)(),[,s]=(0,h.fp)(u.AG.prompt_card),[a,c]=(0,n.useState)([]),[m,x]=(0,n.useState)([]),[j,f]=(0,n.useState)(!1),[y,w]=(0,n.useState)(""),[g,b]=(0,n.useState)(re),[S,C]=(0,n.useState)(""),[A,I]=(0,n.useState)({}),[N,$]=(0,n.useState)({}),[V,B]=(0,n.useState)("oob"),[P,F]=(0,n.useState)(""),[z,K]=(0,n.useState)(""),[X,O]=(0,n.useState)(""),[T,M]=(0,n.useState)(""),[q,D]=(0,n.useState)([]),[U,H]=(0,n.useState)(!0),W=async()=>{try{const e=await d.I2.post("credential/list",{}),t=Array.isArray(e?.data)?e.data:[];return c(t),x(oe),t}catch(e){return[]}},E=async e=>{const t=(await W()).find(t=>t.id===e);t&&D(t.accounts??[])};(0,n.useEffect)(()=>{W()},[]);const Z=m.find(e=>e.type===g),G=Z?.fields??[],R=!0===Z?.sources,L=!0===Z?.accounts,J=Z?.account_fields??[],Q=q,Y=(e,t)=>{D(s=>s.map((s,n)=>n===e?{...s,...t}:s))},te=()=>{D(e=>[...e,{id:"",account_name:"",password:"",secret_key:""}])},ne=(e,t)=>{D(s=>s.map((s,n)=>n===e?{...s,...t}:s))},ie=ce[g],he=()=>{f(!1),w(""),b(re),C(""),I({}),D([]),F(""),H(!0)},ue=async e=>{const t=Array.from(new Set(e.map(e=>e.options_source).filter(e=>Boolean(e)))),s={};for(const e of t){const t=await d.I2.post("credential/options",{source:e});s[e]=(t?.data??[]).map(e=>({label:e.label,value:e.value}))}$(s)},pe=async()=>{try{const e=await d.I2.post("baidu/authorize_url",{id:y,mode:V});e?.data&&window.open(e.data,"_blank","noopener,noreferrer")}catch(e){}},me=async()=>{if(P.trim())try{const t=await d.I2.post("baidu/exchange",{id:y,code:P.trim(),mode:V});(0,v.SK)(`${e("授权成功")}:${t?.data?.baidu_name??""}`),F(""),await E(y)}catch(e){}else(0,v.zN)(e("请填写授权码"))},_e=async()=>{if(z.trim())if(X.trim())try{const t=await d.I2.post("baidu/import",{id:y,uk:z.trim(),access_token:X.trim(),refresh_token:T.trim()});(0,v.SK)(`${e("添加成功")}:${t?.data?.baidu_name??""}`),K(""),O(""),M(""),await E(y)}catch(e){}else(0,v.zN)(e("请填写 access_token"));else(0,v.zN)(e("请填写账号 id"))},xe=async t=>{try{const s={credential_id:y};t.id&&(s.account_id=t.id),void 0!==t.note&&(s.note=t.note);for(const e of J){const n=t[e.key];null!=n&&(s[e.key]=String(n))}const n=await d.I2.post("credential/account_save",s);(0,v.SK)(e("保存成功"));const i=n?.data;D(e=>e.map(e=>e===t?{...e,...i}:e))}catch(e){}},je=async t=>{try{const s={credential_id:y};t.id&&(s.account_id=t.id);for(const e of J){const n=t[e.key];null!=n&&(s[e.key]=String(n))}const n=await d.I2.post("credential/account_verify",s),i=n?.data??{};i.ok?(0,v.SK)(e("账号可用")):(0,v.zN)(`${e("账号不可用")}:${i.error??""}`)}catch(e){}},ve=s=>{if(!s.id)return n=q.indexOf(s),void D(e=>e.filter((e,t)=>t!==n));var n;t({title:e("确认删除"),sub_title:s.note||s.account_name||s.id,confirm_fun:async()=>{try{await d.I2.post("credential/account_remove",{credential_id:y,account_id:s.id}),(0,v.SK)(e("已删除")),await E(y)}catch(e){}}})};return(0,k.jsxs)(i.fI,{children:[(0,k.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(0,k.jsx)(i.xh,{children:(0,k.jsx)(l.uF,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e("网盘凭据")}),(0,k.jsx)(o.rA,{icon:"info",title:e("信息"),onClick:()=>{s({open:!0,title:e("信息"),context_div:(0,k.jsxs)("div",{children:[(0,k.jsxs)("ul",{children:[(0,k.jsx)("li",{children:e("crd_tp")}),(0,k.jsx)("li",{children:e("pwdkept")}),(0,k.jsx)("li",{children:e("tstbfrs")})]}),(0,k.jsxs)("ul",{children:[(0,k.jsxs)("li",{children:[(0,k.jsx)("b",{children:"WebDAV"}),":",e("prtwbdv")]}),(0,k.jsxs)("li",{children:[(0,k.jsx)("b",{children:"SSH / SFTP"}),":",e("prtsftp")]}),(0,k.jsxs)("li",{children:[(0,k.jsx)("b",{children:"S3 兼容对象存储"}),":",e("prt_s3")]}),(0,k.jsxs)("li",{children:[(0,k.jsx)("b",{children:"SMB"}),":",e("prt_smb")]}),(0,k.jsxs)("li",{children:[(0,k.jsx)("b",{children:"百度网盘"}),":",e("prt_bd")]}),(0,k.jsxs)("li",{children:[(0,k.jsx)("b",{children:e("内网穿透 FileCat")}),":",e("prt_tcp")]}),(0,k.jsxs)("li",{children:[(0,k.jsx)("b",{children:e("本地目录")}),":",e("prt_local")]})]})]})})}})]}),rightTopCom:(0,k.jsx)("div",{className:"div-row",children:(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{he(),f(!0)}})}),children:(0,k.jsx)(p.X,{headers:[e("编号"),e("备注"),e("类型"),e("操作")],rows:a.map((s,n)=>{return[(0,k.jsx)("span",{children:n}),(0,k.jsx)(l.xP,{context:s.note||"-"}),(0,k.jsx)(l.xP,{context:(i=s.type,m.find(e=>e.type===i)?.name??i)}),(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{f(!0),w(e.id),b(e.type),C(e.note??""),I({webdav_url:e.webdav_url,ssh_host:e.ssh_host,ssh_port:e.ssh_port,ssh_private_key:e.ssh_private_key,smb_server:e.smb_server,s3_endpoint:e.s3_endpoint,s3_region:e.s3_region,s3_force_path_style:e.s3_force_path_style,baidu_app_id:e.baidu_app_id,baidu_app_key:e.baidu_app_key,baidu_secret_key:e.baidu_secret_key,tcp_client_num_id:e.tcp_client_num_id,tcp_base_url:e.tcp_base_url}),D(e.accounts??[]),F(""),K(""),O(""),M(""),H(!1!==e.enabled);const t=m.find(t=>t.type===e.type)?.fields??[];t.some(e=>e.options_source)&&ue(t).catch(()=>{})})(s)}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(async s=>{t({title:e("确认删除"),sub_title:s.note,confirm_fun:async()=>{try{await d.I2.post("credential/delete",{id:s.id}),(0,v.SK)(e("已删除")),await W()}catch(e){}}})})(s)})]})];var i})})})})}),(0,k.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:j&&(0,k.jsxs)(n.Fragment,{children:[(0,k.jsx)(i.xh,{children:(0,k.jsxs)(l.Zp,{self_title:(0,k.jsx)("span",{className:" div-row ",children:(0,k.jsx)("h2",{children:e("凭据")})}),rightBottomCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{const t=(t=>{if(!S.trim())return e("请填写备注");for(const s of G){if(!1===t.includes(s.key))continue;const n=String(A[s.key]??"").trim();if(s.required&&!n)return e(s.label)}})(G.map(e=>e.key));if(t)(0,v.zN)(`${e("请填写")}${t}`);else{if(R){const t=new Set;for(const s of Q){const n=String(s.account_name??"").trim(),i=String(s.path??"").trim();if(!n||!i)return void(0,v.zN)(e("源目录的名称和路径都不能为空"));if(t.has(n))return void(0,v.zN)(`${e("源目录名称重复")}:${n}`);t.add(n)}}if(L)for(const t of q)for(const s of J)if(s.required&&!String(t[s.key]??"").trim())return void(0,v.zN)(`${e("请填写")}${e(s.label)}`);try{const t=await d.I2.post(y?"credential/update":"credential/add",{id:y||void 0,type:g,note:S,...A,enabled:U});(0,v.SK)(e("保存成功"));const s=y||t.data?.id;if(!y&&t.data?.id&&w(t.data.id),(L||R)&&s)for(const e of q){if(e.id)continue;const t={credential_id:s};void 0!==e.note&&(t.note=e.note);const n=R?["account_name","path"]:J.map(e=>e.key);for(const s of n){const n=e[s];null!=n&&(t[s]=String(n))}const i=await d.I2.post("credential/account_save",t);Object.assign(e,i?.data??{})}await W()}catch(e){}}}}),(0,k.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:he})]}),children:[(0,k.jsx)(r.Sm,{placeholder:e("备注"),value:S,handleInputChange:C}),(0,k.jsx)(r.l6,{value:g,options:m.map(e=>({title:e.name,value:e.type})),onChange:e=>{b(e),I({}),$({}),F("");const t=m.find(t=>t.type===e)?.fields??[];t.some(e=>e.options_source)&&ue(t)}}),!R&&G.map(t=>{const s=A[t.key];return t.options_source?(0,k.jsx)(r.BC,{label:e(t.label),label_width:"6rem",children:(0,k.jsx)(r.l6,{value:String(s??""),options:N[t.options_source]??[],onChange:e=>I({...A,[t.key]:e})})},t.key):"switch"===t.type?(0,k.jsx)(r.BC,{label:e(t.label),label_width:"6rem",children:(0,k.jsx)(r.l6,{value:!0===s?"on":"off",options:[{title:e("开启"),value:"on"},{title:e("关闭"),value:"off"}],onChange:e=>I({...A,[t.key]:"on"===e})})},t.key):(0,k.jsx)(n.Fragment,{children:(0,k.jsx)(r.Sm,{type:"password"===t.type?"password":"text",placeholder:t.label,value:String(s??""),handleInputChange:e=>I({...A,[t.key]:e})})},t.key)})]})}),ie?.[1]?.keys?.includes(de)&&(0,k.jsx)(i.xh,{children:(0,k.jsx)(l.Zp,{self_title:(0,k.jsx)("span",{className:" div-row ",children:(0,k.jsx)("h2",{children:e("授权")})}),children:(0,k.jsxs)(n.Fragment,{children:[(0,k.jsx)(r.BC,{label:e("授权方式"),label_width:"6rem",children:(0,k.jsxs)("div",{className:"div-row",children:[(0,k.jsx)(r.U6,{name:"baidu_auth_mode",value:"one_click",context:e("一键授权"),selected:"one_click"===V,onchange:()=>B("one_click")}),(0,k.jsx)(r.U6,{name:"baidu_auth_mode",value:"oob",context:e("outh_ob"),selected:"oob"===V,onchange:()=>B("oob")})]})}),"oob"===V&&(0,k.jsx)(r.BC,{label:e("授权码"),label_width:"6rem",children:(0,k.jsx)(r.Sm,{placeholder:e("粘贴授权码 code"),value:P,handleInputChange:F})}),(0,k.jsxs)("div",{className:"div-row",children:[(0,k.jsx)(o.rA,{icon:"open_in_new",title:e("去授权"),onClick:pe}),"oob"===V&&(0,k.jsx)(o.rA,{icon:"check",title:e("完成授权"),onClick:me})]}),(0,k.jsx)(r.BC,{label:e("手动添加"),label_width:"6rem",children:(0,k.jsx)(r.Sm,{placeholder:e("账号 id(uk)"),value:z,handleInputChange:K})}),(0,k.jsx)(r.BC,{label:e("access_token"),label_width:"6rem",children:(0,k.jsx)(r.Sm,{placeholder:e("粘贴 access_token"),value:X,handleInputChange:O})}),(0,k.jsx)(r.BC,{label:e("refresh_token"),label_width:"6rem",children:(0,k.jsx)(r.Sm,{placeholder:e("粘贴 refresh_token"),value:T,handleInputChange:M})}),(0,k.jsx)("div",{className:"div-row",children:(0,k.jsx)(o.rA,{icon:"add",title:e("添加账号"),onClick:_e})})]},de)})}),R&&(0,k.jsx)(i.xh,{children:(0,k.jsxs)(l.Zp,{self_title:(0,k.jsx)("span",{className:" div-row ",children:(0,k.jsx)("h2",{children:e("目录")})}),children:[(0,k.jsx)("div",{className:"div-row",children:(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{D(e=>[...e,{id:"",account_name:"",path:""}])}})}),Q.map((t,s)=>(0,k.jsxs)(ae.d,{title:`#${s+1}`,toolbar:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:()=>(async t=>{const s=q[t];if(y)try{const n={credential_id:y};s.id&&(n.account_id=s.id),void 0!==s.note&&(n.note=s.note),void 0!==s.account_name&&(n.account_name=String(s.account_name)),void 0!==s.path&&(n.path=String(s.path));const i=await d.I2.post("credential/account_save",n);(0,v.SK)(e("保存成功"));const a=i?.data;D(e=>e.map((e,s)=>s===t?{...e,...a}:e))}catch(e){}else(0,v.zN)(e("请先保存凭据"))})(s)}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{ve(q[e])})(s)})]}),children:[(0,k.jsx)(r.BC,{label:e("备注"),label_width:"7rem",children:(0,k.jsx)(r.Sm,{placeholder:e("便于辨认的名字"),value:t.note??"",handleInputChange:e=>Y(s,{note:e})})}),(0,k.jsx)(r.BC,{label:e("名称"),label_width:"7rem",children:(0,k.jsx)(r.Sm,{placeholder:e("目录"),value:t.account_name??"",handleInputChange:e=>Y(s,{account_name:e})})}),(0,k.jsx)(r.BC,{label:e("目录"),label_width:"7rem",required:!0,children:(0,k.jsx)(r.Sm,{placeholder:e("本地绝对路径"),value:t.path,handleInputChange:e=>Y(s,{path:e})})})]},s))]})}),L&&(0,k.jsx)(i.xh,{children:(0,k.jsx)(l.Zp,{self_title:(0,k.jsx)("span",{className:" div-row ",children:(0,k.jsx)("h2",{children:e("账号")})}),children:(0,k.jsxs)(n.Fragment,{children:[J.length>0&&(0,k.jsx)("div",{className:"div-row",children:(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:te})}),q.map((t,s)=>(0,k.jsxs)(ae.d,{title:(0,k.jsx)(k.Fragment,{children:(0,k.jsx)("span",{children:`${e("账号")} #${s+1}`})}),toolbar:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:()=>xe(t)}),(0,k.jsx)(o.rA,{icon:"network_check",title:e("验证"),onClick:()=>je(t)}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>ve(t)})]}),children:[(0,k.jsx)(r.BC,{label:e("备注"),label_width:"7rem",children:(0,k.jsx)(r.Sm,{placeholder:e("便于辨认的名字"),value:t.note??"",handleInputChange:e=>ne(s,{note:e})})}),J.map(n=>(0,k.jsx)(r.BC,{label:e(n.label),label_width:"7rem",required:n.required,children:"textarea"===n.type?(0,k.jsx)(r.Z2,{style:{width:"100%",height:"6rem"},placeholder:n.placeholder?e(n.placeholder):"",value:String(t[n.key]??""),handleInputChange:e=>ne(s,{[n.key]:e})}):(0,k.jsx)(r.Sm,{type:"password"===n.type?"password":"text",placeholder:n.placeholder?e(n.placeholder):"",value:String(t[n.key]??""),handleInputChange:e=>ne(s,{[n.key]:e})})},n.key)),t.id&&void 0!==t.token&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(le,{src:t.avatar_url,name:t.nickname||t.account_name,label:e("头像"),label_width:"7rem"}),(0,k.jsx)(r.BC,{label:e("百度账号"),label_width:"7rem",children:(0,k.jsx)("p",{children:t.account_name||t.id})}),(0,k.jsx)(r.BC,{label:e("授权状态"),label_width:"7rem",children:(0,k.jsx)("p",{children:t.token?e("已授权"):e("未授权")})}),(0,k.jsx)(r.BC,{label:e("授权时间"),label_width:"7rem",children:(0,k.jsx)("p",{children:t.token?.obtained_at?(0,se.eK)(t.token.obtained_at):"-"})})]})]},t.id??s))]})})})]})})," "]})}function ue(){const{t:e}=(0,_.Bd)(),{check_user_auth:t}=(0,j.MH)();return t(a.oV.file_mount)?(0,k.jsx)(i.xh,{children:(0,k.jsx)(i.fI,{children:(0,k.jsx)(i.VP,{widthPer:100,maxWidth:"90rem",children:(0,k.jsx)(he,{})})})}):(0,k.jsx)(i.fI,{children:(0,k.jsx)(i.VP,{children:(0,k.jsx)(l.Zp,{self_title:(0,k.jsx)("h2",{children:e("网盘凭据")}),children:(0,k.jsx)("p",{children:e("nmuntpr")})})})})}const pe=[{value:"sftp",label:"SFTP"},{value:"webdav",label:"WebDAV"},{value:"smb",label:"SMB"}];function me(){const{t:e}=(0,_.Bd)(),t=(0,ee.y)(),s=(0,f.T)(),[a,c]=(0,n.useState)([]),[h,u]=(0,n.useState)("none"),[m,x]=(0,n.useState)(""),[j,y]=(0,n.useState)("sftp"),[w,g]=(0,n.useState)(""),[b,S]=(0,n.useState)(0),[C,A]=(0,n.useState)(!1),[I,N]=(0,n.useState)(""),[$,V]=(0,n.useState)(""),[B,P]=(0,n.useState)(""),[F,z]=(0,n.useState)([{share_name:"",path:"",readonly:!1}]),[K,X]=(0,n.useState)(""),[O,T]=(0,n.useState)(""),[M,q]=(0,n.useState)([{url_path:"",path:"",readonly:!1}]),[D,U]=(0,n.useState)([{username:"",password:"",path:"",readonly:!1}]),H=async()=>{const e=await d.od.post("list",{});c(e?.data??[])};(0,n.useEffect)(()=>{H()},[]);const W=()=>{x(""),y("sftp"),g(""),S(0),A(!1),N(""),V(""),P(""),z([{share_name:"",path:"",readonly:!1}]),X(""),T(""),q([{url_path:"",path:"",readonly:!1}]),U([{username:"",password:"",path:"",readonly:!1}])},E=()=>{u("none"),W()},Z=e=>"smb"===e?F:"webdav"===e?M:D,G=(e,t)=>{"smb"!==e?"webdav"!==e?U(t):q(t):z(t)},R=(e,t,s)=>{G(e,Z(e).map((e,n)=>n===t?{...e,...s}:e))},L=e=>"smb"===e.type?(e.smb?.shares??[]).map(e=>e.share_name).join(", "):"webdav"===e.type?(e.webdav?.shares??[]).map(e=>e.url_path).join(", "):(e.sftp?.shares??[]).map(e=>e.username).join(", ");return(0,k.jsxs)(i.fI,{children:[(0,k.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(0,k.jsx)(i.xh,{children:(0,k.jsx)(l.uF,{self_title:(0,k.jsx)("span",{className:" div-row ",children:(0,k.jsx)("h2",{children:e("文件服务")})}),rightTopCom:(0,k.jsx)("div",{className:"div-row",children:(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{W(),S(2022),u("add")}})}),children:(0,k.jsx)(p.X,{headers:[e("状态"),e("备注"),e("协议"),e("端口"),e("共享"),e("操作")],rows:a.map((s,n)=>{return[(0,k.jsx)(o.Ay,{checked:s.running,title:e("启用"),onChange:t=>(async(t,s)=>{await d.od.post(s?"start":"stop",{id:t.id}),(0,v.SK)(e(s?"已启用":"已禁用")),await H()})(s,t)}),(0,k.jsx)(l.xP,{children:s.note||"-"}),(0,k.jsx)("p",{children:(i=s.type,pe.find(e=>e.value===i)?.label??i)}),(0,k.jsx)("p",{children:s.port}),(0,k.jsx)(l.xP,{children:L(s)||"-"}),(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{W(),x(e.id),y(e.type),g(e.note),S(e.port),A(e.readonly),N(e.smb?.hostname??""),V(e.smb?.username??""),P(e.smb?.password??""),z(e.smb?.shares?.length?e.smb.shares.map(e=>({...e})):[{share_name:"",path:"",readonly:!1}]),X(e.webdav?.username??""),T(e.webdav?.password??""),q(e.webdav?.shares?.length?e.webdav.shares.map(e=>({...e})):[{url_path:"",path:"",readonly:!1}]),U(e.sftp?.shares?.length?e.sftp.shares.map(e=>({...e})):[{username:"",password:"",path:"",readonly:!1}]),u("edit")})(s)}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(s=>{t({title:e("确认删除"),confirm_fun:async()=>{await d.od.post("delete",{id:s.id}),(0,v.SK)(e("删除成功")),m===s.id&&E(),await H()}})})(s)})]})];var i})})})})}),(0,k.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:"none"!==h&&(0,k.jsx)(i.xh,{children:(0,k.jsxs)(l.Zp,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e("add"===h?"添加":"编辑")}),(0,k.jsx)(o.rA,{icon:"info",title:e("说明"),onClick:()=>s(e("smb_known_issue_tip"))})]}),rightBottomCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:E}),(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{const t={type:j,note:w,port:Number(b),readonly:C};"smb"===j&&(t.smb={hostname:I,username:$,password:B,shares:F}),"webdav"===j&&(t.webdav={username:K,password:O,shares:M}),"sftp"===j&&(t.sftp={shares:D}),m?(t.id=m,await d.od.post("update",t)):await d.od.post("add",t),(0,v.SK)(e("保存成功")),E(),await H()}})]}),children:[(0,k.jsx)(r.BC,{label:e("协议"),label_width:"7rem",required:!0,children:(0,k.jsx)(r.l6,{value:j,options:pe,onChange:e=>y(e)})}),(0,k.jsx)(r.BC,{label:e("端口"),label_width:"7rem",required:!0,children:(0,k.jsx)(r.Sm,{placeholder:"1-65535",value:String(b||""),handleInputChange:e=>S(Number(e)||0)})}),(0,k.jsx)(r.BC,{label:e("备注"),label_width:"7rem",children:(0,k.jsx)(r.Sm,{value:w,handleInputChange:g})}),(0,k.jsx)(r.BC,{label:e("只读"),label_width:"7rem",children:(0,k.jsx)(o.Ay,{checked:C,onChange:A})}),"webdav"===j&&(0,k.jsxs)(n.Fragment,{children:[(0,k.jsx)(r.BC,{label:e("用户名"),label_width:"7rem",children:(0,k.jsx)(r.Sm,{placeholder:e("留空则不验证身份"),value:K,handleInputChange:X})}),(0,k.jsx)(r.BC,{label:e("密码"),label_width:"7rem",children:(0,k.jsx)(r.Sm,{type:"password",value:O,handleInputChange:T})})]}),"smb"===j&&(0,k.jsxs)(n.Fragment,{children:[(0,k.jsx)(r.BC,{label:e("主机名"),label_width:"7rem",children:(0,k.jsx)(r.Sm,{value:I,handleInputChange:N})}),(0,k.jsx)(r.BC,{label:e("用户名"),label_width:"7rem",children:(0,k.jsx)(r.Sm,{placeholder:e("留空则不验证身份"),value:$,handleInputChange:V})}),(0,k.jsx)(r.BC,{label:e("密码"),label_width:"7rem",children:(0,k.jsx)(r.Sm,{type:"password",value:B,handleInputChange:P})})]}),Z(j).map((t,s)=>(0,k.jsxs)(ae.d,{title:e("sftp"===j?"账号":"共享")+` #${s+1}`,toolbar:(0,k.jsxs)(k.Fragment,{children:["smb"===j&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("span",{children:e("共享名")}),(0,k.jsx)(r.Sm,{value:t.share_name,no_border:!0,width:"8rem",placeholder:"share",handleInputChange:e=>R(j,s,{share_name:e})})]}),"webdav"===j&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("span",{children:e("路径")}),(0,k.jsx)(r.Sm,{value:t.url_path,no_border:!0,width:"8rem",placeholder:"docs",handleInputChange:e=>R(j,s,{url_path:e})})]}),"sftp"===j&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("span",{children:e("用户名")}),(0,k.jsx)(r.Sm,{value:t.username,no_border:!0,width:"8rem",handleInputChange:e=>R(j,s,{username:e})}),(0,k.jsx)("span",{children:e("密码")}),(0,k.jsx)(r.Sm,{type:"password",value:t.password,no_border:!0,width:"8rem",handleInputChange:e=>R(j,s,{password:e})})]}),(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>(e=>{const t="smb"===e?{share_name:"",path:"",readonly:!1}:"webdav"===e?{url_path:"",path:"",readonly:!1}:{username:"",password:"",path:"",readonly:!1};G(e,[...Z(e),t])})(j)}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>((e,t)=>{G(e,Z(e).filter((e,s)=>s!==t))})(j,s)})]}),children:[(0,k.jsx)(r.BC,{label:e("目录"),label_width:"7rem",required:!0,children:(0,k.jsx)(r.Sm,{placeholder:e("对外提供的本地绝对路径"),value:t.path,handleInputChange:e=>R(j,s,{path:e})})}),(0,k.jsx)(r.BC,{label:e("只读"),label_width:"7rem",children:(0,k.jsx)(o.Ay,{checked:t.readonly,onChange:e=>R(j,s,{readonly:e})})})]},s))]})})})]})}function _e(){const{t:e}=(0,_.Bd)(),{check_user_auth:t}=(0,j.MH)();return t(a.oV.file_mount)?(0,k.jsx)(me,{}):(0,k.jsx)(i.fI,{children:(0,k.jsx)(l.Zp,{self_title:(0,k.jsx)("h2",{children:e("文件服务")}),children:(0,k.jsx)("p",{children:e("没有权限")})})})}var xe=s(87361);function je(){const{t:e}=(0,_.Bd)(),{check_user_auth:t}=(0,j.MH)(),s=[{index:2,name:`${e("个人环境")}`,rto:"private_env_setting",component:(0,k.jsx)(Y,{})}];return t(a.oV.sys_setting_page)&&s.unshift({index:1,name:e("系统"),rto:"password",component:(0,k.jsx)(C,{})}),t(a.oV.sys_env_page)&&s.push({index:3,name:`${e("系统环境")}`,rto:"env_setting/",component:(0,k.jsx)(W,{})}),t(a.oV.file_mount)&&(s.push({index:5,name:e("网盘凭据"),rto:"credential_setting/",component:(0,k.jsx)(ue,{})}),s.push({index:5,name:e("网盘挂载"),rto:"mount_setting/",component:(0,k.jsx)(ie,{})})),t(a.oV.file_server)&&s.push({index:6,name:e("文件服务"),rto:"file_server_setting/",component:(0,k.jsx)(_e,{})}),t(a.oV.user_manage)&&s.push({index:7,name:e("用户管理"),rto:"user_manager/",component:(0,k.jsx)(R,{})}),t(a.oV.role_manage)&&s.push({index:8,name:e("角色管理"),rto:"role_manager/",component:(0,k.jsx)(L,{})}),(0,k.jsx)(i.W1,{optionList:s,father_route:xe.o.setting})}},92350(e,t,s){s.d(t,{Q:()=>h,o:()=>p});var n=s(34843),i=s(82893),a=s(74777),l=s(96540),o=s(22022),r=s(23430),d=s(14284),c=s(74848);function h(){const[e,t]=(0,n.fp)(i.AG.prompt_card),{t:s,i18n:l}=(0,o.Bd)();return e=>{let n;e===a.jk.ffmpeg?n=(0,c.jsx)("div",{children:"视频转换,rtsp播放器等媒体功能都需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置"}):e===a.jk.smartmontools?n=(0,c.jsx)("div",{children:"磁盘检查需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置。"}):"保护目录"===e?n=(0,c.jsxs)("div",{children:["在删除的时候保护目录会拒绝删除。",(0,c.jsxs)("ul",{children:[(0,c.jsx)("li",{children:"可以使用 /* 来表达该目录下所有文件都禁止删除"}),(0,c.jsx)("li",{children:"可以使用 /** 来表达该目录下所有子目录文件都禁止删除"})]})]}):"文件夹路径"===e?n=(0,c.jsx)("div",{children:"用于在文件夹下切换根目录"}):"环境路径"===e?n=(0,c.jsx)("div",{children:"当在不同用户环境下运行的时候由于没有执行终端去加载PATH,这里可以添加额外的PATH路径,点击这里的保存还会更新系统上的path路径"}):"pty"===e?n=(0,c.jsx)("div",{children:"一些需要Pty环境的命令"}):"文件上传"===e?n=(0,c.jsx)("div",{children:(0,c.jsxs)("ul",{children:[(0,c.jsx)("li",{children:"对于不同的目录(包括所有子目录),可能是机械或者固态硬盘,机械硬盘在处理多个小文件的时候会做随机i/o,由于一般只有一个盘头所以会影响整体效率,特别是写操作,这里提供了上传时候的最大数量限制,对于下载数量目前不做限制."}),(0,c.jsx)("li",{children:"大文件支持断点和分块并发传输,建议并发数量设置为2,分块大小设置为10MB,大文件判断为500MB,设置过大的话会上传的时候会占据较大内存"})]})}):"目录快捷命令"===e?n=(0,c.jsx)("div",{children:"右键文件夹空白处用于,打开终端快捷执行命令"}):"文件快捷命令"===e?n=(0,c.jsx)("div",{children:"用于右键特定后缀的文件,执行一些快捷命令,文件后缀可以是多个,用空格分割"}):"Workflow"===e?n=(0,c.jsx)("div",{children:(0,c.jsxs)("ul",{children:[(0,c.jsx)("li",{children:"在特定的时间启动系统中的workflow任务"}),(0,c.jsx)("li",{children:"cron表达式是定时器 格式为: 秒 分 时 日 月 星期"}),(0,c.jsxs)("li",{children:[(0,c.jsx)("li",{children:'1. "*"(通配符,所有值)'}),(0,c.jsx)("li",{children:'2. "," 是枚举: 0 0 1,15 * * *'}),(0,c.jsx)("li",{children:'3. "-" 是范围: 0 0 1-5 * * *'}),(0,c.jsx)("li",{children:'4. "/" 是步长,标识每隔n执行 */3 * * * * * 每隔三秒,必须配合 * 使用 ,/ 只能写一次 ,有了/就成了定时器,而不是指定时间执行'})]})]})}):"插件配置"===e?n=(0,c.jsx)("div",{children:s("路径可以是一个 js 文件也可以是一个node 项目目录")}):"机器人配置"===e&&(n=(0,c.jsxs)("div",{children:[(0,c.jsx)("dv",{children:"机器人功能用于开通各种第三方支持的机器人,让第三方机器人接入本地的 AI 模型。"}),(0,c.jsxs)("ul",{children:[(0,c.jsx)("li",{children:" 1. qq 机器人需要先在手机 app 中添加,然后在https://q.qq.com/qqbot/ 登录机器人配置页面,在开发管理中复制机器人的 appId,appSecret 到这里就完成了配置了。目前 qq 机器人不稳定,且创建后无法删除(2026.07.05)"}),(0,c.jsx)("li",{children:" 2. https://opensource.dingtalk.com/developerpedia/docs/explore/tutorials/stream/bot/nodejs/create-bot 这个是钉钉机器人开通教程,注意复制钉钉的 clientId 的是时候不要复制成appId 了。"}),(0,c.jsx)("li",{children:" 3. 企业微信机器人的开通甚至不需要 pc 操作,在通讯录中点击智能机器人,选择 api 模式,就创建完成了,手机上直接复制 id 和密钥。"}),(0,c.jsx)("li",{children:" 4. 飞书https://open.feishu.cn/document/develop-an-echo-bot/introduction?from=banner 登录这个开发者后台,按照这个地址教程创建机器人,使用的时候这个机器人是作为一个应用,可以在工作台内搜索你的这个机器人的名字。"})]})]})),t({open:!0,title:"信息",context_div:(0,c.jsx)("div",{children:n})})}}let u=r.Ky;function p(){const[e,t]=(0,l.useState)([]);return(0,l.useEffect)(()=>{(async()=>{try{const e=await d.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:()=>l});var n=s(72635);const i=1440,a=525600;function l(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<a?`${(s/43200).toFixed(0)} ${n.Ay.t("月前")}`:`${(s/a).toFixed(0)} ${n.Ay.t("年前")}`}},24659(e,t,s){var n=s(22022);s.d(t,["K",0,()=>{const{t:e}=(0,n.Bd)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[676,4091,8319],{77481(e,t,n){n.d(t,{S:()=>l,X:()=>i});var s=n(96540),r=n(61443),a=n(74848);function i(e){const[t,n]=s.useState([]),i=(0,s.useRef)(-1),[l,c]=(0,s.useState)(-1),[o,u]=(0,s.useState)(-1);(0,s.useEffect)(()=>{e.children?n(Array.isArray(e.children)?e.children:[e.children]):n(e.rows)},[e.rows,e.children]);const d=()=>{i.current=-1,c(-1),u(-1)};return(0,a.jsxs)("table",{children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:e.headers?.map((t,n)=>{const s=!!e.filter&&(e.filter.column??0)===n;let i=t;if(s){const n=e.filter,s=n.options.find(e=>e.value===n.value);null!=n.value&&s&&(i=`${t} (${s.label})`)}return(0,a.jsx)("th",{className:s?"table-filter-col":"",children:s?(0,a.jsx)(r.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:i}):t},n)})})}),(0,a.jsx)("tbody",{children:t.map((t,n)=>{const s=!!e.onRowDrag;return(0,a.jsx)("tr",{className:s?(l===n?"row-dragging":"")+(o===n?" row-drop-target":""):"",draggable:s,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{s&&(i.current=n,c(n),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!s||i.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",u(n))},onDrop:t=>{s&&(t.preventDefault(),(()=>{const t=i.current,n=o;d(),t<0||n<0||t===n||e.onRowDrag?.(t,n)})())},onDragEnd:d,children:t.map((n,s)=>{const r=s===t.length-1?"small":"";return(0,a.jsx)("td",{className:r,style:{width:e.width??"auto"},children:n},s)})},n)})})]})}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,n){n.d(t,{Kw:()=>s,Tt:()=>r});var s=n(80952),r=(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(55208),n(34678),n(24522));const a=`https://gcore.jsdelivr.net/npm/ace-builds@${s.version}/src-min-noconflict/`;s.config.set("basePath",a),s.config.set("modePath",a),s.config.set("themePath",a),s.config.set("workerPath",a)},84091(e,t,n){n.r(t),n.d(t,{default:()=>d});var s=n(96540),r=(n(80952),n(48890)),a=n(34843),i=n(82893),l=n(78247),c=n(93245),o=n(23430),u=n(74848);function d(e){const t=(0,s.useRef)(null),[n,d]=(0,a.fp)(i.AG.user_base_info),[p,h]=(0,s.useState)(!1),f=(0,s.useRef)(p);f.current=p;const _=(0,s.useRef)(e.save);_.current=e.save;const x=(0,s.useRef)(e.on_dirty);x.current=e.on_dirty,(0,s.useEffect)(()=>{x.current?.(p)},[p]);const m=async e=>{if(!_.current||!f.current)return;!1!==await _.current(e)&&h(!1)},j=(0,s.useRef)(m);j.current=m;const g=(0,s.useRef)(e.register);g.current=e.register,(0,s.useEffect)(()=>{g.current?.({save:e=>j.current(e)})},[]),(0,c.a)(o.nE.ace,()=>!!_.current&&f.current,m);const v=n.user_data.theme?.includes("dark")?"cloud_editor_dark":"cloud9_day";return(0,s.useEffect)(()=>{const n=r.Kw.edit(t.current,{value:l.xK.get_value_temp(e.editor_id),showPrintMargin:!1,theme:`ace/theme/${v}`,mode:e.model??r.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){h(!0),e.on_change&&e.on_change()}),t.current=n,n.formatCode=()=>{const e=r.Kw.require("ace/ext/beautify"),n=t.current;n&&e.beautify(n.session)},l.xK.set_editor_temp(n,e.editor_id),()=>{l.xK.delete_editor_temp(e.editor_id),n.destroy()}},[]),(0,u.jsx)("div",{ref:t,style:{height:"100%",width:"100%"}})}},60676(e,t,n){n.r(t),n.d(t,{default:()=>C});var s=n(96540),r=n(57952),a=n(85997),i=n(14284),l=n(61973),c=n(77481),o=n(70447),u=n(34843),d=n(82893),p=n(84091),h=n(78247),f=n(61443),_=n(23496),x=n(62042),m=n(22022),j=n(53459),g=n(7523),v=n(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:n=0,format:r="auto",prefix:a="",onTick:i,className:l}=e,[c,o]=(0,s.useState)(0),u=(0,s.useRef)(0),d=(0,s.useRef)(null),p=(0,s.useRef)(t);p.current=t;const h=(0,s.useCallback)(()=>{null!==d.current&&(cancelAnimationFrame(d.current),d.current=null)},[]),f=(0,s.useCallback)(()=>{h();const e=()=>{const t=performance.now()-u.current;o(t),i?.(t),p.current&&(d.current=requestAnimationFrame(e))};e()},[i,h]);return(0,s.useEffect)(()=>{u.current=performance.now(),o(0),i?.(0),p.current&&f()},[n]),(0,s.useEffect)(()=>{t?f():h()},[t,f,h]),(0,s.useEffect)(()=>()=>h(),[h]),(0,v.jsxs)("span",{className:l,children:[a,b(c,r)]})}var q=n(87361),y=n(28319);function w(e){const[t,n]=(0,s.useState)("");return(0,v.jsxs)("div",{className:"db-query-preset-input",children:[(0,v.jsx)(f.Sm,{placeholder:e.placeholder,value:t,handleInputChange:n}),(0,v.jsx)("div",{className:"db-query-preset-input__actions",children:(0,v.jsx)(a.C3,{text:e.confirmText,clickFun:()=>e.onConfirm(t.trim())})})]})}function C(){const e=(0,l.Zp)(),{t}=(0,m.Bd)(),{initUserInfo:n}=(0,s.useContext)(g.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),E=(0,s.useMemo)(()=>b?.path??"",[b?.path]),N=(0,s.useMemo)(()=>b?.path?`${b?.name||"数据库"} | ${b.path}`:"未选择数据库",[b?.name,b?.path]),A=97,[K,R]=(0,s.useState)(""),[F,L]=(0,s.useState)("table"),[$,M]=(0,s.useState)(!1),[T,O]=(0,s.useState)(""),[Q,D]=(0,s.useState)(null),[P,G]=(0,s.useState)(!1),[I,J]=(0,s.useState)(0),[Z,W]=(0,s.useState)(!1),[B,H]=(0,s.useState)([]),[V,X]=(0,s.useState)(-1);(0,s.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})),s=await i.wm.post(_.s.user_save_private_attr,{is_sql_preset:!0,sql_preset_list:t});return s?.code===j.m.Success&&(await n(),H(t),!0)},z=async(e,n)=>{const s=[...B,{note:n||t("SQL 预设"),sql:e,env:y.sqlEnvDefault}];await U(s)&&(k({open:!1}),(0,x.SK)(t("创建成功")),X(s.length-1))},Y=(e,t)=>{if(!e)return"";for(const n of e.split("\n")){const e=n.indexOf("=");if(!(e<0)&&n.slice(0,e).trim()===t)return n.slice(e+1).trim()}return""},[ee,te]=(0,s.useState)(""),[ne,se]=(0,s.useState)("");(0,s.useEffect)(()=>{h.xK.set_value_temp(K,A)},[K]),(0,s.useEffect)(()=>{R(""),O(""),D(null),L("table"),G(!1),W(!1),J(0),te(""),se(""),h.xK.set_value_temp("",A),E||O("请先从文件右键打开一个数据库")},[E,b?.open]);const re=async()=>{const e=(h.xK.get_editor_value(A)??K).trim();if(!E)return O("请先从文件右键打开一个数据库"),void D(null);if(!e)return O("请输入 SQL 语句"),void D(null);M(!0),O(""),W(!0),J(e=>e+1),G(!0);try{const n=(t=e,ee?t.split(ee).join(ne):t),s=await i.$M.post("sqlite/query",{path:E,sql:n});D(s.data),L("table")}catch(e){O(e?.message??`${e}`),D(null)}finally{G(!1),M(!1)}var t},ae=Q?.columns?.length?Q.columns:Object.keys(Q?.rows?.[0]??{}),ie=(Q?.rows??[]).map(e=>ae.map(t=>{return null==(n=e[t])?"":"object"==typeof n?JSON.stringify(n):`${n}`;var n}));return(0,v.jsxs)("div",{className:"db-query-page",children:[(0,v.jsx)(r.A,{ignore_tags:!0,left_children:[(0,v.jsx)(a.rA,{icon:"arrow_back",title:"返回",onClick:()=>e(-1)},"back"),(0,v.jsx)(a.rA,{icon:"play_arrow",title:"执行",onClick:re},"run"),(0,v.jsx)(a.rA,{icon:"table_chart",title:"表格视图",onClick:()=>L("table")},"table"),(0,v.jsx)(a.rA,{icon:"data_object",title:"原 JSON",onClick:()=>L("json")},"json"),(0,v.jsx)(a.rA,{icon:"settings",title:t("SQL预设设置"),onClick:()=>{e(q.o.sql_preset_setting_page)}},"preset-setting")],children:(0,v.jsx)(o.xP,{context:N,tip_context:"点击复制数据库信息"})}),(0,v.jsxs)("div",{className:"db-query-page__content",children:[(0,v.jsxs)(o.Zp,{title:"SQL 查询",rightTopCom:(0,v.jsxs)("div",{className:"db-query-page__preset-bar",children:[ee&&(0,v.jsx)(f.Sm,{placeholder:`${t("替换")}: ${ee}`,value:ne,handleInputChange:se,width:"12rem"}),B.length>0&&(0,v.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),R(e)})(t.sql),te(Y(t.env??"","find")),se(""),O(""))},options:B.map((e,t)=>({value:t,title:`${e.note||e.sql.slice(0,24)}`}))}),(0,v.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_in"));const n=[...B];if(V>=0&&n[V]){n[V].sql=e,n[V].note||(n[V].note=t("SQL 预设"));await U(n)&&(0,x.SK)(t("更新成功"))}else k({open:!0,title:t("创建新预选项"),context_div:(0,v.jsx)(w,{placeholder:t("请输入备注"),confirmText:t("确认"),onConfirm:t=>z(e,t)}),cancel:()=>k({open:!1})})}})]}),rightBottomCom:(0,v.jsxs)("div",{className:"db-query-page__actions",children:[(0,v.jsx)(a.C3,{text:$?"查询中...":"执行查询",clickFun:re}),(0,v.jsx)(a.C3,{text:"清空",clickFun:()=>{h.xK.set_value_temp("",A);const e=h.xK.get_editor(A);e&&e.setValue("",-1),R("")}}),(0,v.jsx)(a.C3,{text:"table"===F?"表格视图":"切换到表格",clickFun:()=>L("table")}),(0,v.jsx)(a.C3,{text:"json"===F?"原 JSON":"切换到 JSON",clickFun:()=>L("json")})]}),children:[(0,v.jsx)("div",{className:"db-query-page__editor",children:(0,v.jsx)(p.default,{name:"sqlite.sql",editor_id:A,model:"ace/mode/sql",on_change:()=>{const e=h.xK.get_editor_value(A)??"";R(e)},options:{showPrintMargin:!1,highlightActiveLine:!0,wrap:!0}})}),T&&(0,v.jsx)("div",{className:"db-query-page__error",children:T})]}),(0,v.jsxs)(o.Zp,{title:"查询结果",rightTopCom:(0,v.jsxs)("span",{className:"db-query-page__result-meta",children:[Q?`${Q.row_count} 行`:"暂无结果",Z&&(0,v.jsx)("span",{className:"db-query-page__elapsed",children:(0,v.jsx)(S,{running:P,resetKey:I,prefix:`${t("耗时")}: `,format:"auto"})})]}),children:[Q&&"table"===F&&(0,v.jsx)(c.X,{headers:ae,rows:ie}),Q&&"json"===F&&(0,v.jsx)("pre",{className:"db-query-page__result-json",children:JSON.stringify(Q.rows,null,2)}),!Q&&!T&&(0,v.jsx)("div",{className:"db-query-page__hint",children:"先输入查询语句,再执行。支持 `select`、`with`、`pragma`、`explain`。"}),!Q&&T&&(0,v.jsx)("div",{className:"db-query-page__hint",children:T})]})]})]})}},28319(e,t,n){n.r(t),n.d(t,{default:()=>S,defaultSqlPreset:()=>v});var s=n(96540),r=n(22022),a=n(4412),i=n(85997),l=n(75725),c=n(77481),o=n(70447),u=n(61443),d=n(34843),p=n(82893),h=n(14284),f=n(23496),_=n(53459),x=(n(62042),n(7523)),m=n(78247),j=n(61973),g=n(74848);function v(e){return{index:0,note:e("查询全部表"),sql:"SELECT name, type FROM sqlite_master WHERE type='table';"}}const b='# 可选:设置 SQL 中的"替换词"(在查询页选中该预设后,会显示输入框)\n# 例子:SQL 为 SELECT * FROM t WHERE id = 123456 ,请填写下面的 find=123456\n# 这样查询页输入新值即可把 SQL 中的 123456 替换掉后再查询\nfind=';function S(){const{t:e}=(0,r.Bd)(),{initUserInfo:t}=(0,s.useContext)(x.F),[,n]=(0,d.fp)(p.AG.editorSetting),[S]=(0,d.fp)(p.AG.user_base_info),q=(0,j.Zp)(),y=s.useRef(-1),[w,C]=(0,s.useState)([]);(0,s.useEffect)(()=>{const t=S?.user_data?.sql_preset_list;C(t?.length?[...t]:[v(e)])},[e,S?.user_data?.sql_preset_list]);const k=async()=>{const e=w.map((e,t)=>({...e,index:t})),n=await h.wm.post(f.s.user_save_private_attr,{is_sql_preset:!0,sql_preset_list:e});n?.code===_.m.Success&&await t()},E=(e,t)=>{y.current=e;const s=w[e][t]??"";m.xK.set_value_temp(s),n({model:"sql"===t?"ace/mode/sql":"ace/mode/ini",open:!0,fileName:"",save:async e=>{w[y.current][t]=e,C([...w]),m.xK.set_value_temp(""),k()}})},N=[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:()=>q(-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)(o.uF,{self_title:(0,g.jsx)("span",{className:"div-row",children:(0,g.jsx)("h2",{children:e("SQL 预设")})}),rightTopCom:(0,g.jsxs)("div",{className:"db-query-setting__toolbar",children:[(0,g.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>C([...w,{note:"",sql:"",env:b}])}),(0,g.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:()=>k()})]}),children:(0,g.jsx)(c.X,{headers:N,rows:w.map((t,n)=>[(0,g.jsx)("div",{children:n+1}),(0,g.jsx)(u.Sm,{value:t.note,no_border:!0,placeholder:e("备注"),handleInputChange:e=>{t.note=e,C([...w])}}),(0,g.jsx)("div",{children:(0,g.jsx)(i.rA,{icon:"short_text",title:e("编辑SQL"),onClick:()=>E(n,"sql")})}),(0,g.jsx)("div",{children:(0,g.jsx)(i.rA,{icon:"settings",title:e("env编辑"),onClick:()=>E(n,"env")})}),(0,g.jsx)("div",{children:(0,g.jsx)(i.rA,{icon:"delete",title:e("删除"),onClick:()=>{w.splice(n,1),C([...w])}})})]),width:"8rem"})})})})})})})]})}n.d(t,["sqlEnvDefault",0,b])}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6805],{47996(e,n,t){t.d(n,{d:()=>i});t(96540);var s=t(74848);function i(e){return(0,s.jsxs)("div",{className:"instance-item",children:[(0,s.jsxs)("div",{className:"instance-item__toolbar",children:[(0,s.jsx)("span",{className:"instance-item__label",children:e.title}),e.toolbar]}),e.children]})}},77481(e,n,t){t.d(n,{S:()=>c,X:()=>r});var s=t(96540),i=t(61443),l=t(74848);function r(e){const[n,t]=s.useState([]),r=(0,s.useRef)(-1),[c,a]=(0,s.useState)(-1),[o,d]=(0,s.useState)(-1);(0,s.useEffect)(()=>{e.children?t(Array.isArray(e.children)?e.children:[e.children]):t(e.rows)},[e.rows,e.children]);const _=()=>{r.current=-1,a(-1),d(-1)};return(0,l.jsxs)("table",{children:[(0,l.jsx)("thead",{children:(0,l.jsx)("tr",{children:e.headers?.map((n,t)=>{const s=!!e.filter&&(e.filter.column??0)===t;let r=n;if(s){const t=e.filter,s=t.options.find(e=>e.value===t.value);null!=t.value&&s&&(r=`${n} (${s.label})`)}return(0,l.jsx)("th",{className:s?"table-filter-col":"",children:s?(0,l.jsx)(i.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:r}):n},t)})})}),(0,l.jsx)("tbody",{children:n.map((n,t)=>{const s=!!e.onRowDrag;return(0,l.jsx)("tr",{className:s?(c===t?"row-dragging":"")+(o===t?" row-drop-target":""):"",draggable:s,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(n)},onDragStart:e=>{s&&(r.current=t,a(t),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!s||r.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(t))},onDrop:n=>{s&&(n.preventDefault(),(()=>{const n=r.current,t=o;_(),n<0||t<0||n===t||e.onRowDrag?.(n,t)})())},onDragEnd:_,children:n.map((t,s)=>{const i=s===n.length-1?"small":"";return(0,l.jsx)("td",{className:i,style:{width:e.width??"auto"},children:t},s)})},t)})})]})}function c(e){return(0,l.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,n)=>(0,l.jsx)("div",{children:e},n))})}},36805(e,n,t){t.r(n),t.d(n,{default:()=>B});var s=t(96540),i=t(75725),l=t(22022),r=t(70447),c=t(85997),a=t(77481),o=t(61443),d=t(14284),_=t(53459),x=t(7523),h=t(34843),u=t(82893),p=t(62042),m=(t(23430),t(64694)),j=(t(21499),t(14944)),v=t(92275),f=t(6960),g=t(40505),w=t(4412),y=t(24659),S=t(74848);let C={};function b(){const{t:e,i18n:n}=(0,l.Bd)(),{initUserInfo:t,reloadUserInfo:b}=(0,s.useContext)(x.F),[k,I]=(0,h.fp)(u.AG.user_base_info),[A,P]=(0,s.useState)([]),$=(0,s.useRef)([]),[N,F]=(0,h.fp)(u.AG.prompt_card),K=(0,y.K)(),[B,U]=(0,s.useState)(),[D,E]=(0,s.useState)(void 0),[G,V]=(0,s.useState)(null),[q,M]=(0,s.useState)([]),[X,Z]=(0,s.useState)([]),z=[e("序号"),e("名称"),e("在线状态"),e("时间"),e("备注")],T=[e("序号"),e("服务端口"),e("转发ip"),e("转发端口"),e("开启"),e("备注")],W=[e("序号"),e("服务端口"),e("fwd_nm"),e("转发ip"),e("转发端口"),e("开启"),e("备注")],O=e=>null==e?"":(0,f.s)(e),H=async e=>{const n=await d.s9.post("server_bridge_get_one_fig",{server_client_num_id:e});if(n.code===_.m.Success){const e=n.data;for(const n of e)n.client_name=C?.[n.client_num_id]?.client_name??"";Z(e)}},R=async e=>{const n=void 0===e?G:e,t=await d.s9.get("server_client_get");if(t.code===_.m.Success){const e=t.data,s=[],i=[];C={},$.current=e.map(e=>e.client_num_id);for(const t of e)null!==n&&!!t.status!==n||(D?`${t.index}${t.client_name}${t.note}`.includes(D)&&s.push(t):s.push(t),i.push({label:t.client_name,value:t.client_num_id}),C[t.client_num_id]=t);P(s),M(i)}};(0,s.useEffect)(()=>{j.ws.addMsg(v.HK.tcp_forward_server_load,e=>{R()}),R()},[]);return(0,S.jsxs)(s.Fragment,{children:[(0,S.jsx)(w.aZ,{position:"right",children:B&&(0,S.jsx)("span",{children:`${B.client_name}${B.note?`(${B.note})`:""}`})}),(0,S.jsxs)(i.fI,{children:[(0,S.jsx)(i.VP,{widthPer:50,children:(0,S.jsx)(i.xh,{children:(0,S.jsx)(r.uF,{self_title:(0,S.jsx)("span",{className:" div-row ",children:(0,S.jsx)("h2",{children:e("客户端列表")})}),rightTopCom:(0,S.jsx)(o.Sm,{placeholder:e("过滤"),value:D,handleInputChange:e=>{E(e)},handlerEnter:()=>{R()}}),children:(0,S.jsx)(a.X,{headers:z,filter:{title:e("在线状态"),column:2,value:G,options:[{label:e("全部"),value:null},{label:e("在线"),value:!0},{label:e("离线"),value:!1}],onChange:e=>{V(e),R(e)}},rows:A.map((n,t)=>[(0,S.jsx)("p",{children:t}),(0,S.jsx)(r.xP,{children:n.client_name}),(0,S.jsx)(r.fq,{ok:n.status}),(0,S.jsx)(r.xP,{children:O(n.status?n.online_start_time:n.offline_time)}),(0,S.jsx)(r.xP,{children:n.note}),(0,S.jsxs)("div",{children:[(0,S.jsx)(c.rA,{icon:"edit",title:e("编辑"),onClick:()=>{U({...n}),H(n.client_num_id)}}),(0,S.jsx)(c.rA,{icon:"delete",title:e("删除"),onClick:()=>{F({open:!0,title:"share file",confirm:async()=>{F({open:!1}),await(async n=>{(await d.s9.post("server_client_del",{client_num_id:n})).code===_.m.Success&&((0,p.SK)(e("成功")),R())})(n.client_num_id)},context_div:(0,S.jsx)("div",{className:"card-content",children:e("确定删除这个吗客户端吗?")})})}})]})]),width:"10rem",onRowDrag:(e,n)=>{const t=(0,m.TI)(A,e,n);P(t);const s=A[e],i=A[n];if(!s||!i)return;const l=$.current,r=l.indexOf(s.client_num_id),c=l.indexOf(i.client_num_id);if(r<0||c<0)return;const a=[...l];a.splice(r,1),a.splice(c,0,s.client_num_id),$.current=a,d.s9.post("server_client_sort",{ids:a})}})})})}),(0,S.jsx)(i.VP,{widthPer:50,children:B?(0,S.jsxs)(i.xh,{children:[(0,S.jsxs)(r.Zp,{self_title:(0,S.jsxs)("span",{className:" div-row ",children:[(0,S.jsx)("h2",{children:`服务器 ${e("代理配置")}`})," "]}),rightBottomCom:(0,S.jsx)("div",{children:(0,S.jsx)(c.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await d.s9.post("server_client_save",B)).code===_.m.Success&&(0,p.SK)(e("成功"))}})}),children:[(0,S.jsx)(i.Yh,{left:e("远程地址"),center:B?.client_remote_address??""}),(0,S.jsx)(i.Yh,{left:e(B?.status?"在线时间":"离线时间"),center:O(B?.status?B?.online_start_time:B?.offline_time)}),(0,S.jsx)(o.Sm,{placeholder:"名称",value:B.client_name,handleInputChange:e=>{B.client_name=e,U({...B})}}),(0,S.jsxs)("form",{children:[e("fc_pxy"),":",(0,S.jsx)(a.S,{isFlex:!0,columns:[(0,S.jsx)(o.U6,{value:1,context:e("开启"),selected:B.open_filecat,onchange:()=>{B.open_filecat=!B.open_filecat,U({...B})}}),(0,S.jsx)(o.U6,{value:1,context:e("关闭"),selected:!B.open_filecat,onchange:()=>{B.open_filecat=!B.open_filecat,U({...B})}})]})]}),(0,S.jsxs)(s.Fragment,{children:[(0,S.jsxs)("form",{children:[e("fc_pxyw"),":",(0,S.jsx)(a.S,{isFlex:!0,columns:[(0,S.jsx)(o.U6,{value:1,context:e("开启"),selected:B.filecat_use_local_page,onchange:()=>{B.filecat_use_local_page=!B.filecat_use_local_page,U({...B})}}),(0,S.jsx)(o.U6,{value:1,context:e("关闭"),selected:!B.filecat_use_local_page,onchange:()=>{B.filecat_use_local_page=!B.filecat_use_local_page,U({...B})}})]})]}),(0,S.jsx)(o.Sm,{placeholderOut:e("fc_pxyr"),placeholder:"127.0.0.1:5567",value:B.filecat_proxy_host_port,handleInputChange:e=>{B.filecat_proxy_host_port=e,U({...B})}}),(0,S.jsx)(c.rA,{icon:"content_copy",title:e("fc_pxyc"),onClick:()=>{const e=`${window.location.origin}?tcp_client_num_id=${B.client_num_id}`;(0,g.lW)(e),(0,p.SK)(e)}}),(0,S.jsx)(c.rA,{icon:"open_in_new",title:e("fc_pxyo"),onClick:()=>{const e=`${window.location.origin}?tcp_client_num_id=${B.client_num_id}`;window.open(e,"_blank")}})]}),(0,S.jsx)(o.Sm,{placeholder:"备注",value:B.note,handleInputChange:e=>{B.note=e,U({...B})}}),(0,S.jsx)(c.rA,{icon:"add",onClick:()=>{B.proxy_fig_list.push({open:!1}),U({...B})},title:e("添加")}),e("代理"),(0,S.jsx)(a.X,{headers:T,rows:B.proxy_fig_list.map((n,t)=>[(0,S.jsx)("p",{children:t}),(0,S.jsx)(o.Sm,{value:n.server_port,handleInputChange:e=>{n.server_port=parseInt(e)},no_border:!0}),(0,S.jsx)(o.Sm,{value:n.proxy_host,handleInputChange:e=>{n.proxy_host=e},no_border:!0}),(0,S.jsx)(o.Sm,{value:n.proxy_port,handleInputChange:e=>{n.proxy_port=parseInt(e)},no_border:!0}),(0,S.jsx)(o.l6,{value:!!n.open,onChange:e=>{n.open=e,U({...B})},options:K,no_border:!0}),(0,S.jsx)(o.Sm,{value:n.note,handleInputChange:e=>{n.note=e},no_border:!0}),(0,S.jsx)("div",{children:(0,S.jsx)(c.rA,{icon:"delete",title:e("删除"),onClick:()=>{const e=[];for(let n=0;n<(B.proxy_fig_list.length??0);n++)n!==t&&e.push(B.proxy_fig_list[n]);B.proxy_fig_list=e,U({...B})}})})]),width:"10rem"})]}),(0,S.jsxs)(r.Zp,{self_title:(0,S.jsxs)("span",{className:" div-row ",children:[(0,S.jsx)("h2",{children:`${e("客户端")} ${e("桥接配置")}`}),(0,S.jsx)(c.rA,{title:"info",icon:"info",onClick:()=>{F({open:!0,title:"Info",confirm:async()=>{F({open:!1})},context_div:(0,S.jsx)("div",{className:"card-content",children:e("在客户端设置一个端口,访问这个端口把流量转发到另一个客户端所在网络环境内的第一个地址")})})}})]}),children:[(0,S.jsx)(c.rA,{icon:"add",onClick:()=>{X.push({open:!1,server_client_num_id:B.client_num_id}),Z([...X])},title:e("添加")}),e("代理"),(0,S.jsx)(a.X,{headers:W,rows:X.map((n,t)=>[(0,S.jsx)("p",{children:t}),(0,S.jsx)(o.Sm,{value:n.server_port,handleInputChange:e=>{n.server_port=parseInt(e)},no_border:!0}),(0,S.jsx)(o.Sm,{value:n.client_name,options:q,handleInputChange:e=>{const t=(e=>q.find(n=>String(n.value)===String(e)))(e);n.client_num_id=parseInt(String(t.value)),n.client_name=t.label,Z([...X])},no_border:!0}),(0,S.jsx)(o.Sm,{value:n.client_proxy_host,handleInputChange:e=>{n.client_proxy_host=e},no_border:!0}),(0,S.jsx)(o.Sm,{value:n.client_proxy_port,handleInputChange:e=>{n.client_proxy_port=parseInt(e)},no_border:!0}),(0,S.jsx)(o.l6,{value:!!n.open,onChange:e=>{n.open=e,Z([...X])},options:K,no_border:!0}),(0,S.jsx)(o.Sm,{value:n.note,handleInputChange:e=>{n.note=e},no_border:!0}),(0,S.jsxs)("div",{children:[(0,S.jsx)(c.rA,{icon:"delete",title:e("删除"),onClick:async()=>{if(null==n.id){const e=[];for(let n=0;n<(X.length??0);n++)n!==t&&e.push(X[n]);Z([...e])}else await(async(n,t)=>{(await d.s9.post("server_bridge_del_fig",{id:n})).code===_.m.Success&&((0,p.SK)(e("成功")),H(t))})(n.id,n.server_client_num_id)}}),null==n.id?(0,S.jsx)(c.rA,{icon:"add",title:e("添加"),onClick:async()=>{await(async n=>{if(null==n.client_num_id)return void(0,p.zN)(e("未选择转发送 client"));(await d.s9.post("server_bridge_add_fig",n)).code===_.m.Success&&((0,p.SK)(e("成功")),H(n.server_client_num_id))})(n)}}):(0,S.jsx)(c.rA,{icon:"save",title:e("保存"),onClick:async()=>{await(async n=>{if(null==n.client_num_id)return void(0,p.zN)(e("未选择转发送 client"));(await d.s9.post("server_bridge_edit_fig",n)).code===_.m.Success&&((0,p.SK)(e("成功")),H(n.server_client_num_id))})(n)}})]})]),width:"10rem"})]})]}):(0,S.jsx)(i.xh,{})})]})]})}var k=t(18840),I=t(7463);function A(e){const{t:n}=(0,l.Bd)(),[t,x]=(0,s.useState)([]),[h,u]=(0,s.useState)([]),[m,f]=(0,s.useState)([]),[g,w]=(0,s.useState)([]),C=[n("序号"),n("服务端口"),n("转发客户端名称")],b=[n("序号"),n("原客户端"),n("目标客户端"),n("待同步文件数量")],A=[n("序号"),n("port"),n("host"),n("名称"),n("key"),n("在线"),n("开启"),n("备注")],P=(0,y.K)(),$=async()=>{const e=await d.s9.get("client_get");if(e.code===_.m.Success){const n=e.data;x(n.list)}const n=await d.s9.get("client_bridge_get_all_fig");n.code===_.m.Success&&f(n.data);const t=await d.s9.get("client_sync_task_get");t.code===_.m.Success&&w(t.data)};(0,s.useEffect)(()=>($(),j.ws.sendData(v.HK.tcp_proxy_client_status,{}).then(()=>{const e=(0,I.s)(()=>$(),500);j.ws.addMsg(v.HK.tcp_proxy_client_status,e)}),()=>{j.ws.removeMsg(v.HK.tcp_proxy_client_status)}),[]);const N=async e=>{const t=new k.gE;t.index=e.index,t.key=e.key,t.serverIp=e.serverIp,t.serverPort=e.serverPort,t.open=e.open,t.client_name=e.client_name,t.client_num_id=e.client_num_id;(await d.s9.post("client_save",t)).code===_.m.Success?(0,p.SK)(n("保存成功")):(0,p.zN)(n("网络错误"))};return(0,S.jsxs)("div",{children:[(0,S.jsxs)(i.fI,{children:[(0,S.jsx)(i.VP,{widthPer:33,maxWidth:"30rem",children:(0,S.jsxs)(r.Zp,{title:"",rightBottomCom:(0,S.jsx)(c.C3,{text:n("保存"),clickFun:()=>{t[0].index=0,N(t[0])}}),rightTopCom:(0,S.jsxs)("div",{children:[n("连接状态"),(0,S.jsx)(r.fq,{ok:!!t[0]?.status})]}),children:[(0,S.jsx)(o.Sm,{placeholder:`${n("服务器")} ip`,value:t[0]?.serverIp,handleInputChange:e=>{t[0].serverIp=e}}),(0,S.jsx)(o.Sm,{type:"number",placeholder:`${n("服务器")} port`,value:t[0]?.serverPort,handleInputChange:e=>{const n=parseInt(e);!isNaN(n)&&n>=0&&n<=65535&&(t[0].serverPort=n)}}),(0,S.jsx)(o.Sm,{placeholder:n("名称"),value:t[0]?.client_name,handleInputChange:e=>{t[0].client_name=e}}),(0,S.jsx)(o.Sm,{type:"password",placeholder:"key ",value:t[0]?.key,handleInputChange:e=>{t[0].key=e}}),(0,S.jsxs)("form",{children:[n("状态"),(0,S.jsx)(a.S,{isFlex:!0,columns:[(0,S.jsx)(o.U6,{value:1,context:n("开启"),selected:t[0]?.open,onchange:()=>{t[0].open=!t[0].open,x([...t])}}),(0,S.jsx)(o.U6,{value:1,context:n("关闭"),selected:!t[0]?.open,onchange:()=>{t[0].open=!t[0].open,x([...t])}})]})]})]})}),(0,S.jsx)(i.VP,{widthPer:60,maxWidth:"90rem",children:(0,S.jsxs)(r.Zp,{self_title:(0,S.jsxs)("span",{className:" div-row ",children:[(0,S.jsx)("h2",{children:n("更多服务器")})," "]}),children:[(0,S.jsx)(c.rA,{icon:"add",onClick:()=>{t.push({open:!1,is_new:!0}),x([...t])},title:n("添加")}),n("代理"),(0,S.jsx)(a.X,{headers:A,rows:t.slice(1).map((e,s)=>[(0,S.jsx)("p",{children:s}),(0,S.jsx)(o.Sm,{type:"number",value:e.serverPort,handleInputChange:n=>{const t=parseInt(n);!isNaN(t)&&t>=0&&t<=65535&&(e.serverPort=t)},no_border:!0}),(0,S.jsx)(o.Sm,{value:e.serverIp,handleInputChange:n=>{e.serverIp=n},no_border:!0}),(0,S.jsx)(o.Sm,{value:e.client_name,handleInputChange:n=>{e.client_name=n},no_border:!0}),(0,S.jsx)(o.Sm,{type:"password",value:e.key,handleInputChange:n=>{e.key=n},no_border:!0}),(0,S.jsx)(r.fq,{ok:!!e.status}),(0,S.jsx)(o.l6,{value:!!e.open,onChange:n=>{e.open=n,x([...t])},options:P,no_border:!0}),(0,S.jsx)(o.Sm,{value:e.note,handleInputChange:n=>{e.note=n},no_border:!0}),(0,S.jsxs)("div",{children:[(0,S.jsx)(c.rA,{icon:"delete",title:n("删除"),onClick:async()=>{if(e.is_new){const e=[];for(let n=0;n<(t.length??0);n++)n!==s&&e.push(t[n]);x([...e])}else await(async e=>{(await d.s9.post("client_del",{index:e})).code===_.m.Success?((0,p.SK)(n("保存成功")),$()):(0,p.zN)(n("网络错误"))})(s+1)}}),e.is_new?(0,S.jsx)(c.rA,{icon:"add",title:n("添加"),onClick:async()=>{e.index=s+1,await N(e)}}):(0,S.jsx)(c.rA,{icon:"save",title:n("保存"),onClick:async()=>{e.index=s+1,await N(e)}})]})]),width:"10rem"})]})})]}),(0,S.jsxs)(i.fI,{children:[!!m?.length&&(0,S.jsx)(i.VP,{widthPer:40,maxWidth:"40rem",children:(0,S.jsx)(r.Zp,{title:n("br_port"),children:(0,S.jsx)(a.X,{headers:C,rows:m.map((e,n)=>[(0,S.jsx)("p",{children:n}),(0,S.jsx)(r.xP,{children:e.server_port}),(0,S.jsx)(r.xP,{children:e.client_name})]),width:"10rem"})})}),!!g?.length&&(0,S.jsx)(i.VP,{widthPer:40,maxWidth:"40rem",children:(0,S.jsx)(r.Zp,{title:n("文件同步列表"),children:(0,S.jsx)(a.X,{headers:b,rows:g.map((e,n)=>[(0,S.jsx)("p",{children:n}),(0,S.jsx)(r.xP,{children:e.source_client_name}),(0,S.jsx)(r.xP,{children:e.target_client_name}),(0,S.jsx)(r.xP,{children:e.running_num})]),width:"10rem"})})})]})]})}function P(){const{t:e,i18n:n}=(0,l.Bd)(),{initUserInfo:t,reloadUserInfo:m}=(0,s.useContext)(x.F),[f,g]=(0,h.fp)(u.AG.user_base_info),[w,y]=(0,h.fp)(u.AG.prompt_card),[C,b]=(0,s.useState)(!1),[I,A]=(0,s.useState)([]),[P,$]=(0,s.useState)(null),[N,F]=(0,s.useState)([]),[K,B]=(0,s.useState)(void 0),[U,D]=(0,s.useState)(void 0),E=(0,s.useMemo)(()=>{const e=[...I];return null!=P?(e.sort((e,n)=>P?e.server_port-n.server_port:n.server_port-e.server_port),e):e},[I,P]),G=async()=>{const e=await d.s9.get("get_all_open_server_client_proxy_fig");if(e.code===_.m.Success){const n=[];for(const t of e.data)U?`${t.server_port}${t.client_name}${t.proxy_host}${t.server_port}${t.server_port_note}`.includes(U)&&n.push(t):n.push(t);A(n)}},V=async()=>{const e=await d.s9.get("server_get");e.code===_.m.Success&&(B(e.data.port),b(!!e.data.open),F(e.data.option_keys??[])),G()};(0,s.useEffect)(()=>{j.ws.addMsg(v.HK.tcp_forward_server_load,e=>{V()}),V()},[]);const q=async n=>{const t=new k.I;t.port=K,t.open=C,t.option_keys=N;(await d.s9.post("server_save",{fig:t,notice_client:n})).code===_.m.Success&&(0,p.SK)(e("成功"))};return(0,S.jsxs)(i.fI,{children:[(0,S.jsx)(i.VP,{widthPer:33,children:(0,S.jsx)(i.xh,{children:(0,S.jsxs)(r.Zp,{title:e("服务器配置"),rightBottomCom:(0,S.jsxs)("div",{children:[(0,S.jsx)(c.C3,{text:e("sv_ntf"),clickFun:()=>{q(!0)}}),(0,S.jsx)(c.C3,{text:e("保存"),clickFun:()=>{q(!1)}})]}),children:[(0,S.jsx)(o.Sm,{placeholder:"port",value:K,handleInputChange:e=>{B(e)}}),(0,S.jsxs)("label",{children:[(0,S.jsx)(c.rA,{icon:"add",onClick:()=>{F([...N,""])},title:e("添加")}),e("key")]}),(N??[]).map((n,t)=>(0,S.jsxs)("div",{style:{display:"flex"},children:[(0,S.jsx)("div",{style:{width:"90%"},children:(0,S.jsx)(o.Sm,{type:"password",value:n,handleInputChange:e=>{N[t]=e,F([...N])}})}),(0,S.jsx)(c.rA,{icon:"delete",onClick:()=>{N.splice(t,1),F([...N])},title:e("删除")})]},t)),(0,S.jsxs)("form",{children:[e("状态"),":",(0,S.jsx)(a.S,{isFlex:!0,columns:[(0,S.jsx)(o.U6,{value:1,context:e("开启"),selected:C,onchange:()=>{b(!C)}}),(0,S.jsx)(o.U6,{value:1,context:e("关闭"),selected:!C,onchange:()=>{b(!C)}})]})]})]})})}),(0,S.jsx)(i.VP,{widthPer:50,children:(0,S.jsx)(i.xh,{children:(0,S.jsx)(r.uF,{self_title:(0,S.jsx)("span",{className:" div-row ",children:(0,S.jsx)("h2",{children:e("服务器")+e("端口映射")})}),rightTopCom:(0,S.jsx)(o.Sm,{placeholder:e("过滤"),value:U,handleInputChange:e=>{D(e)},handlerEnter:()=>{G()}}),children:(0,S.jsx)(a.X,{headers:[e("序号"),(0,S.jsx)(c.rA,{title:e("服务端口"),onClick:()=>{$(e=>!e)}}),e("转发ip"),e("转发端口"),"client "+e("名称"),e("开启"),e("备注")],rows:E.map((e,n)=>[(0,S.jsx)("p",{children:n}),(0,S.jsx)(r.xP,{children:e.server_port}),(0,S.jsx)(r.xP,{children:e.proxy_host}),(0,S.jsx)(r.xP,{children:e.proxy_port}),(0,S.jsx)(r.xP,{children:e.client_name}),(0,S.jsx)(r.fq,{ok:!!e.open_success}),(0,S.jsx)(r.xP,{children:e.server_port_note})]),width:"10rem"})})})})]})}var $=t(47996),N=t(78247);function F(){const{t:e,i18n:n}=(0,l.Bd)(),{initUserInfo:t,reloadUserInfo:m}=(0,s.useContext)(x.F),[j,v]=(0,h.fp)(u.AG.user_base_info),[f,g]=(0,h.fp)(u.AG.prompt_card),[,w]=(0,h.fp)(u.AG.confirm),[y,C]=(0,h.fp)(u.AG.editorSetting),[b,I]=(0,s.useState)([]),[A,P]=(0,s.useState)([]),F=[e("编号"),e("原客户端"),e("开启"),e("备注"),e("操作")],[K,B]=(0,s.useState)(null);(0,s.useEffect)(()=>{(async()=>{const e=await d.s9.get("server_client_get");if(e.code===_.m.Success){const n=e.data,t=[];for(const e of n)t.push({label:e.client_name,value:e.client_num_id});P(t),await U()}})()},[]);const U=async()=>{const e=await d.s9.get("sync_task_get");e.code===_.m.Success&&I(e.data)},D=e=>A.find(n=>String(n.value)===String(e))?.label??"",E=e=>A.find(n=>String(n.value)===String(e)),G=(e,n,t)=>{K?.targets&&(K.targets[e]={...K.targets[e],[n]:t},B({...K,targets:[...K.targets]}))},V=async e=>{(await d.s9.post("sync_task_save",e)).code===_.m.Success&&await U()};return(0,S.jsxs)(i.fI,{children:[(0,S.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(0,S.jsx)(i.xh,{children:(0,S.jsx)(r.uF,{self_title:(0,S.jsxs)("span",{className:" div-row ",children:[(0,S.jsx)("h2",{children:e("客户端文件同步")}),(0,S.jsx)(c.rA,{icon:"info",onClick:()=>{g({open:!0,title:"信息",context_div:(0,S.jsx)("div",{children:(0,S.jsxs)("ul",{children:[(0,S.jsx)("li",{children:e("sy_tp1")}),(0,S.jsx)("li",{children:e("sy_tp2")}),(0,S.jsx)("li",{children:e("sy_tp3")})]})})})},title:e("信息")})]}),rightTopCom:(0,S.jsx)("div",{children:(0,S.jsx)(c.rA,{icon:"add",title:e("添加"),onClick:()=>{B({open:!1,source_client_num_id:void 0,source_dir:"",targets:[],delete_missing:!0,is_new:!0})}})}),children:(0,S.jsx)(a.X,{headers:F,rows:b.map((n,t)=>[(0,S.jsx)("p",{children:t}),(0,S.jsx)(r.xP,{children:n.source_client_name}),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(r.fq,{ok:!!n.open}),n.open?e("开启"):e("关闭")]}),(0,S.jsx)(r.xP,{children:n.note}),(0,S.jsxs)("div",{children:[(0,S.jsx)(c.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{B(JSON.parse(JSON.stringify(e)))})(n)}),(0,S.jsx)(c.rA,{icon:"sync",title:e("立即同步"),onClick:()=>(async n=>{if(!n.id||!n.open)return void(0,p.zN)(e("tsk_off"));const t=await d.s9.post("sync_task_rescan",{id:n.id});t.code===_.m.Success?(0,p.SK)(e("已触发同步")):(0,p.zN)(t.message??e("操作失败"))})(n)}),(0,S.jsx)(c.rA,{icon:"delete",title:e("删除"),onClick:()=>{w({open:!0,title:e("确定删除吗"),handle:async()=>{await(async n=>{(await d.s9.post("sync_task_del",{id:n})).code===_.m.Success&&((0,p.SK)(e("成功")),K?.id===n&&B(null),await U())})(n.id),w({open:!1,handle:null})}})}})]})]),width:"10rem"})})})}),(0,S.jsx)(i.VP,{widthPer:50,children:K&&(0,S.jsx)(i.xh,{children:(0,S.jsxs)(r.Zp,{self_title:(0,S.jsx)("span",{className:" div-row ",children:(0,S.jsx)("h2",{children:e(""+(K.is_new?"添加":"编辑"))})}),rightBottomCom:(0,S.jsxs)("div",{children:[(0,S.jsx)(c.rA,{icon:"cancel",title:e("取消"),onClick:()=>B(null)}),(0,S.jsx)(c.rA,{icon:"save",title:e("保存"),onClick:async()=>{if(!K)return;const n=K,t=await d.s9.post("sync_task_save",n);t.code===_.m.Success?((0,p.SK)(e("成功")),B(null),await U()):(0,p.zN)(t.message??e("操作失败"))}})]}),children:[(0,S.jsx)(o.BC,{label:e("开启"),label_width:"6rem",children:(0,S.jsx)(o.GL,{selected:!!K.open,onchange:()=>{B({...K,open:!K.open})}})}),(0,S.jsx)(o.BC,{label:e("备注"),label_width:"6rem",children:(0,S.jsx)(o.Sm,{value:K.note,handleInputChange:e=>{B({...K,note:e})}})}),(0,S.jsx)(o.BC,{label:e("原客户端"),label_width:"6rem",required:!0,children:(0,S.jsx)(o.Sm,{value:D(K.source_client_num_id),options:A,handleInputChange:e=>{const n=E(e);n&&B({...K,source_client_num_id:parseInt(String(n.value))})}})}),(0,S.jsx)(o.BC,{label:e("原目录"),label_width:"6rem",required:!0,children:(0,S.jsx)(o.Sm,{value:K.source_dir,placeholder:e("被同步的源目录"),handleInputChange:e=>{B({...K,source_dir:e})}})}),(0,S.jsx)("label",{children:e("目标列表")}),(K.targets??[]).map((n,t)=>(0,S.jsxs)($.d,{title:`${e("目标")}${t+1}`,toolbar:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(o.BC,{label:e("全量同步"),label_width:"6rem",children:(0,S.jsx)(o.GL,{selected:!!n.full_sync,onchange:()=>G(t,"full_sync",!n.full_sync)})}),(0,S.jsx)(c.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{if(!K?.targets)return;const n=[...K.targets];n.splice(e,1),B({...K,targets:n})})(t)})]}),children:[(0,S.jsx)(o.BC,{label:e("客户端"),label_width:"6rem",required:!0,children:(0,S.jsx)(o.Sm,{value:D(n.client_num_id),options:A,handleInputChange:e=>{const n=E(e);n&&G(t,"client_num_id",parseInt(String(n.value)))}})}),(0,S.jsx)(o.BC,{label:e("目标目录"),label_width:"6rem",required:!0,children:(0,S.jsx)(o.Sm,{value:n.dir,handleInputChange:e=>G(t,"dir",e)})})]},t)),(0,S.jsxs)("div",{className:"div-row",children:[(0,S.jsx)(c.rA,{icon:"add",title:e("添加"),onClick:()=>{if(!K)return;const e=[...K.targets??[],{client_num_id:void 0,dir:"",full_sync:!1}];B({...K,targets:e})}}),(0,S.jsx)(c.rA,{icon:"edit",title:e("忽略目录"),onClick:()=>{var e;e=K,N.xK.set_value_temp(e.ignore_text??k.mo),C({model:"ace/mode/gitignore",open:!0,fileName:"",save:async n=>{e.ignore_text=n,B({...e}),N.xK.set_value_temp(""),await V(e)}})}})]})]})})})]})}var K=t(87361);function B(){const{t:e}=(0,l.Bd)(),n=[{index:1,name:e("客户端"),rto:"tcp_proxy_client/",component:(0,S.jsx)(A,{})},{index:2,name:e("服务端"),rto:"tcp_proxy_server_info/",component:(0,S.jsx)(P,{})},{index:3,name:`${e("客户端列表")}(${e("服务端")})`,rto:"tcp_proxy_server_client/",component:(0,S.jsx)(b,{})},{index:4,name:`${e("客户端功能")}(${e("服务端")})`,rto:"tcp_proxy_server_client_setting/",component:(0,S.jsx)(F,{})}];return(0,S.jsx)(i.W1,{optionList:n,father_route:K.o.net_proxy})}},6960(e,n,t){t.d(n,{s:()=>r});var s=t(72635);const i=1440,l=525600;function r(e){e=e>1e12?e:1e3*e;const n=Date.now(),t=Math.abs(n-e)/6e4;return t<1?s.Ay.t("小于一分钟"):t<60?`${t.toFixed(0)} ${s.Ay.t("分钟前")}`:t<i?`${(t/60).toFixed(0)} ${s.Ay.t("小时前")}`:t<43200?`${(t/i).toFixed(0)} ${s.Ay.t("天前")}`:t<l?`${(t/43200).toFixed(0)} ${s.Ay.t("月前")}`:`${(t/l).toFixed(0)} ${s.Ay.t("年前")}`}},24659(e,n,t){var s=t(22022);t.d(n,["K",0,()=>{const{t:e}=(0,s.Bd)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6919],{86919(e,t,l){l.r(t),l.d(t,{default:()=>j});var r=l(96540),a=l(22022),i=l(61973),s=l(34843),n=l(4412),o=l(85997),h=l(75725),d=l(70447),c=l(61443),p=l(82893),u=l(14284),m=l(53459),x=l(62042),_=l(74848);function j(){const{t:e}=(0,a.Bd)(),t=(0,i.Zp)(),[l,j]=(0,s.fp)(p.AG.confirm),[,v]=(0,s.fp)(p.AG.prompt_card),[b,C]=(0,r.useState)(""),[g,w]=(0,r.useState)(""),[S,f]=(0,r.useState)(""),[y,k]=(0,r.useState)(""),[B,I]=(0,r.useState)(""),[W,A]=(0,r.useState)(""),[N,D]=(0,r.useState)(""),[P,T]=(0,r.useState)(""),[Y,z]=(0,r.useState)(!0),[F,G]=(0,r.useState)(!1);(0,r.useEffect)(()=>{(async()=>{const e=await u.Yu.get("docker/config");if(e?.code!==m.m.Success)return;const t=e.data??{};C(t.http_proxy??""),w(t.https_proxy??""),f(t.no_proxy??""),k((t.registry_mirrors||[]).join(",")),I((t.insecure_registries||[]).join(",")),A(t.data_root??""),D(t.storage_driver??""),T(t.log_driver??""),z(t.iptables??!0),G(!!t.live_restore)})()},[]);return(0,_.jsxs)("div",{children:[(0,_.jsx)(n.aZ,{position:"right",children:(0,_.jsx)(o.rA,{icon:"arrow_back",title:e("返回"),onClick:()=>t(-1)})}),(0,_.jsx)(h.jW,{isFull:!0,more:!0,children:(0,_.jsx)(h.NN,{children:(0,_.jsx)(h.xh,{children:(0,_.jsx)(h.fI,{children:(0,_.jsx)(h.VP,{widthPer:35,children:(0,_.jsxs)(d.uF,{self_title:(0,_.jsxs)("span",{className:"div-row",children:[(0,_.jsx)("h2",{children:e("doc_pxy")}),(0,_.jsx)(o.rA,{icon:"info",title:e("信息"),onClick:()=>{v({open:!0,title:e("信息"),context_div:(0,_.jsx)("div",{style:{whiteSpace:"pre-wrap",lineHeight:"1.6"},children:e("代理写入 systemd 服务环境变量,其余写入 daemon.json;修改后需重启 Docker 生效,请谨慎操作(尤其数据存储目录变更)。")})})}})]}),rightTopCom:(0,_.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:()=>(async()=>{const t=e=>e.split(/[\n,,]/).map(e=>e.trim()).filter(Boolean),l=await u.Yu.post("docker/config/save",{http_proxy:b,https_proxy:g,no_proxy:S,registry_mirrors:t(y),insecure_registries:t(B),data_root:W,storage_driver:N,log_driver:P,iptables:Y,live_restore:F});l?.code===m.m.Success?j({open:!0,title:e("是否重启 Docker 服务以生效?"),sub_title:e("重启 Docker 会短暂中断容器服务,请确认当前没有关键任务在执行"),handle:async()=>{const t=await u.Yu.post("docker/restart");j({open:!1,handle:null}),t?.code===m.m.Success?(0,x.SK)(e("已重启 Docker,代理配置已生效")):(0,x.zN)(e("重启失败"))}}):(0,x.zN)(e("保存失败"))})()}),children:[(0,_.jsx)(c.BC,{label:e("HTTP 代理"),label_width:"4rem",children:(0,_.jsx)(c.Sm,{maxWidth:"24rem",placeholder:"http://127.0.0.1:3067",value:b,handleInputChange:e=>C(e)})}),(0,_.jsx)(c.BC,{label:e("pxy_htt"),label_width:"4rem",children:(0,_.jsx)(c.Sm,{maxWidth:"24rem",placeholder:"https://127.0.0.1:3067",value:g,handleInputChange:e=>w(e)})}),(0,_.jsx)(c.BC,{label:e("pxy_nne"),label_width:"4rem",children:(0,_.jsx)(c.Sm,{maxWidth:"24rem",placeholder:"localhost,127.0.0.1",value:S,handleInputChange:e=>f(e)})}),(0,_.jsx)(c.BC,{label:e("镜像加速"),label_width:"4rem",children:(0,_.jsx)(c.Sm,{maxWidth:"24rem",placeholder:"https://docker.mirrors.ustc.edu.cn,https://hub-mirror.c.163.com",value:y,handleInputChange:e=>k(e)})}),(0,_.jsx)(c.BC,{label:e("不安全仓库"),label_width:"4rem",children:(0,_.jsx)(c.Sm,{maxWidth:"24rem",placeholder:"127.0.0.1:5000,registry.example.com",value:B,handleInputChange:e=>I(e)})}),(0,_.jsx)(c.BC,{label:e("数据存储目录"),label_width:"4rem",children:(0,_.jsx)(c.Sm,{maxWidth:"24rem",placeholder:"/var/lib/docker",value:W,handleInputChange:e=>A(e)})}),(0,_.jsx)(c.BC,{label:e("存储驱动"),label_width:"4rem",children:(0,_.jsx)(c.Sm,{maxWidth:"24rem",placeholder:"overlay2",value:N,handleInputChange:e=>D(e)})}),(0,_.jsx)(c.BC,{label:e("日志驱动"),label_width:"4rem",children:(0,_.jsx)(c.Sm,{maxWidth:"24rem",placeholder:"json-file",value:P,handleInputChange:e=>T(e)})}),(0,_.jsx)(c.BC,{label:e("fw_iptb"),label_width:"4rem",input_max_width:"8rem",children:(0,_.jsx)(c.l6,{options:[{title:e("是"),value:!0},{title:e("否"),value:!1}],value:Y,onChange:e=>z(!!e)})}),(0,_.jsx)(c.BC,{label:e("lve_rst"),label_width:"4rem",input_max_width:"8rem",children:(0,_.jsx)(c.l6,{options:[{title:e("是"),value:!0},{title:e("否"),value:!1}],value:F,onChange:e=>G(!!e)})})]})})})})})})]})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[8319],{77481(e,t,n){n.d(t,{S:()=>a,X:()=>i});var s=n(96540),r=n(61443),l=n(74848);function i(e){const[t,n]=s.useState([]),i=(0,s.useRef)(-1),[a,o]=(0,s.useState)(-1),[c,d]=(0,s.useState)(-1);(0,s.useEffect)(()=>{e.children?n(Array.isArray(e.children)?e.children:[e.children]):n(e.rows)},[e.rows,e.children]);const u=()=>{i.current=-1,o(-1),d(-1)};return(0,l.jsxs)("table",{children:[(0,l.jsx)("thead",{children:(0,l.jsx)("tr",{children:e.headers?.map((t,n)=>{const s=!!e.filter&&(e.filter.column??0)===n;let i=t;if(s){const n=e.filter,s=n.options.find(e=>e.value===n.value);null!=n.value&&s&&(i=`${t} (${s.label})`)}return(0,l.jsx)("th",{className:s?"table-filter-col":"",children:s?(0,l.jsx)(r.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:i}):t},n)})})}),(0,l.jsx)("tbody",{children:t.map((t,n)=>{const s=!!e.onRowDrag;return(0,l.jsx)("tr",{className:s?(a===n?"row-dragging":"")+(c===n?" row-drop-target":""):"",draggable:s,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{s&&(i.current=n,o(n),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!s||i.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(n))},onDrop:t=>{s&&(t.preventDefault(),(()=>{const t=i.current,n=c;u(),t<0||n<0||t===n||e.onRowDrag?.(t,n)})())},onDragEnd:u,children:t.map((n,s)=>{const r=s===t.length-1?"small":"";return(0,l.jsx)("td",{className:r,style:{width:e.width??"auto"},children:n},s)})},n)})})]})}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))})}},28319(e,t,n){n.r(t),n.d(t,{default:()=>C,defaultSqlPreset:()=>g});var s=n(96540),r=n(22022),l=n(4412),i=n(85997),a=n(75725),o=n(77481),c=n(70447),d=n(61443),u=n(34843),h=n(82893),x=n(14284),f=n(23496),p=n(53459),j=(n(62042),n(7523)),v=n(78247),m=n(61973),_=n(74848);function g(e){return{index:0,note:e("查询全部表"),sql:"SELECT name, type FROM sqlite_master WHERE type='table';"}}const w='# 可选:设置 SQL 中的"替换词"(在查询页选中该预设后,会显示输入框)\n# 例子:SQL 为 SELECT * FROM t WHERE id = 123456 ,请填写下面的 find=123456\n# 这样查询页输入新值即可把 SQL 中的 123456 替换掉后再查询\nfind=';function C(){const{t:e}=(0,r.Bd)(),{initUserInfo:t}=(0,s.useContext)(j.F),[,n]=(0,u.fp)(h.AG.editorSetting),[C]=(0,u.fp)(h.AG.user_base_info),S=(0,m.Zp)(),b=s.useRef(-1),[q,E]=(0,s.useState)([]);(0,s.useEffect)(()=>{const t=C?.user_data?.sql_preset_list;E(t?.length?[...t]:[g(e)])},[e,C?.user_data?.sql_preset_list]);const k=async()=>{const e=q.map((e,t)=>({...e,index:t})),n=await x.wm.post(f.s.user_save_private_attr,{is_sql_preset:!0,sql_preset_list:e});n?.code===p.m.Success&&await t()},y=(e,t)=>{b.current=e;const s=q[e][t]??"";v.xK.set_value_temp(s),n({model:"sql"===t?"ace/mode/sql":"ace/mode/ini",open:!0,fileName:"",save:async e=>{q[b.current][t]=e,E([...q]),v.xK.set_value_temp(""),k()}})},A=[e("编号"),e("备注"),e("SQL代码"),e("env编辑"),e("操作")];return(0,_.jsxs)("div",{children:[(0,_.jsx)(l.aZ,{position:"right",children:(0,_.jsx)(i.rA,{icon:"arrow_back",title:e("返回"),onClick:()=>S(-1)})}),(0,_.jsx)(a.jW,{isFull:!0,more:!0,children:(0,_.jsx)(a.NN,{children:(0,_.jsx)(a.xh,{children:(0,_.jsx)(a.fI,{children:(0,_.jsx)(a.VP,{widthPer:60,children:(0,_.jsx)(c.uF,{self_title:(0,_.jsx)("span",{className:"div-row",children:(0,_.jsx)("h2",{children:e("SQL 预设")})}),rightTopCom:(0,_.jsxs)("div",{className:"db-query-setting__toolbar",children:[(0,_.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>E([...q,{note:"",sql:"",env:w}])}),(0,_.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:()=>k()})]}),children:(0,_.jsx)(o.X,{headers:A,rows:q.map((t,n)=>[(0,_.jsx)("div",{children:n+1}),(0,_.jsx)(d.Sm,{value:t.note,no_border:!0,placeholder:e("备注"),handleInputChange:e=>{t.note=e,E([...q])}}),(0,_.jsx)("div",{children:(0,_.jsx)(i.rA,{icon:"short_text",title:e("编辑SQL"),onClick:()=>y(n,"sql")})}),(0,_.jsx)("div",{children:(0,_.jsx)(i.rA,{icon:"settings",title:e("env编辑"),onClick:()=>y(n,"env")})}),(0,_.jsx)("div",{children:(0,_.jsx)(i.rA,{icon:"delete",title:e("删除"),onClick:()=>{q.splice(n,1),E([...q])}})})]),width:"8rem"})})})})})})})]})}n.d(t,["sqlEnvDefault",0,w])}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[8603],{58603(e,t,i){i.r(t),i.d(t,{default:()=>N});var n=i(96540),s=i(75725),r=i(70447),a=i(34843),o=i(82893),l=i(60096),c=i(85997),d=i(34251),m=i(34289),h=i(87361),_=i(14284),u=i(53459),x=i(61443),f=i(22022),p=i(62042),j=(i(32768),i(4412)),k=i(99214),g=i(6960),w=i(88815),v=i(40505),z=i(23430),F=i(64694),b=i(61973),C=i(74848);function N(){const[e,t]=(0,n.useState)(null),i=(0,n.useRef)(""),N=(0,n.useRef)(""),[y,$]=(0,a.fp)(o.AG.prompt_card),[S,M]=(0,a.fp)(o.AG.share_sort_type),{t:A}=(0,f.Bd)(),[G,I]=(0,a.fp)(o.AG.selectedFileList),[U,V]=(0,a.fp)(o.AG.clickFileList),{click_file:W}=(0,k.kZ)(),[D]=(0,b.ok)(),L=(0,k.oT)(),R=(0,k.xp)(),Z=(0,k.Vs)(!0),B=(0,n.useMemo)(()=>{const t=[...e?.items??[]],i=e=>Number(e.mtime??0);return S===z.t8.time_minx_max?t.sort((e,t)=>i(e)-i(t)):S===z.t8.time_max_min&&t.sort((e,t)=>i(t)-i(e)),t},[e?.items,S]),H=async()=>{const e=await _.$M.post("share",{id:i.current,token:N.current});if(e.code===u.m.Success){const n={is_dir:e.data.is_dir};n.items=e.data.files??[];for(const e of n.items)e.origin_size=e.size,e.show_mtime=e.mtime?(0,g.s)(e.mtime):"",e.size=(0,w.v7)(e.size);if(!n.is_dir){const t=e.data.files[0];n.name=t.name,n.size=t.size,n.show_mtime=t.show_mtime}localStorage.setItem(`file_share_token_${i.current}`,N.current);const s=D.get("share_preview_file_name");if(s)try{const t=e.data.files.find(e=>e.name===s);W({file_path:t.path,file_url:_.$M.getDownloadUrlV2(t.path,"share_download",{share_id:i.current,share_token:N.current}),name:t.name,size:t.origin_size,opt_shell:!0,mtime:t.mtime,not_type_tip:A("未知类型,请下载查看"),readonly:!0,close:()=>{L("share_preview_file_name",null)}})}catch(e){(0,p.zN)(e?.message||e)}else t(n)}else e.code===u.m.need_token_share&&(localStorage.removeItem(`file_share_token_${i.current}`),(0,p.zN)("需要正确的访问token"),$({open:!0,title:"share file",confirm:()=>{$({open:!1}),H()},context_div:(0,C.jsx)("div",{className:"card-content",children:(0,C.jsx)(x.Sm,{placeholderOut:A("请输入访问token"),value:"",handleInputChange:e=>{N.current=e}})})}))};if((0,n.useEffect)(()=>{const e=(0,m.oW)(`${(0,m.GG)(h.o.share,(0,m.vX)())}`);i.current=e,N.current=localStorage.getItem(`file_share_token_${e}`),H()},[D]),!e)return(0,C.jsx)(s.jW,{isFull:!0,children:(0,C.jsx)("div",{className:"common-box common-box-center",children:"Loading..."})});return(0,C.jsxs)(n.Fragment,{children:[(0,C.jsx)(j.aZ,{children:(0,C.jsx)(C.Fragment,{children:(0,C.jsxs)("h2",{children:["Share ",e.is_dir?"Folder":"File"]})})}),(0,C.jsxs)(j.aZ,{position:"right",children:[G.length>0&&(0,C.jsx)(c.rA,{icon:"download",title:A("下载"),onClick:function(){const e=[];for(let t=0;t<G.length;t++){const i=B[G[t]];e.push(encodeURIComponent(i.path))}const t=_.$M.getDownloadUrlV2(e,"share_download",{share_id:i.current,share_token:N.current});window.open(t)}}),e.is_dir&&(0,C.jsx)(c.rA,{icon:"grid_view",title:A("切换样式"),onClick:Z}),e.is_dir&&(0,C.jsx)(c.rA,{icon:"schedule",title:S===z.t8.time_minx_max?A("时间逆序"):A("时间顺序"),onClick:()=>{const e=(0,F.jH)([z.t8.time_max_min,z.t8.time_minx_max,z.t8.defualt],S);M(e),I([]),V([])}})]}),(0,C.jsx)(s.xh,{children:(0,C.jsx)(s.jW,{isFull:!0,children:(0,C.jsx)("div",{className:"common-box ",children:e.is_dir?(0,C.jsx)(l.QW,{share:{share_id:i.current,share_token:N.current},handleContextMenu:()=>{},file_list:B,clickBlank:e=>{e.target===e.currentTarget&&(I([]),V([]))}}):(0,C.jsx)(r.uF,{children:(0,C.jsxs)("div",{style:{height:"25rem"},className:"common-box common-box-center",children:[(0,C.jsx)("div",{className:"file-icons",children:(0,C.jsx)("div",{"data-type":(0,d.uL)(e.name),"data-dir":e.is_dir,"aria-label":e.name,children:(0,C.jsx)(c.In,{icon:"",style:{fontSize:"10rem",display:"inline-block",lineHeight:1},aria_label:e.name})})}),(0,C.jsx)("div",{className:"",children:e.name}),(0,C.jsx)("div",{className:"",children:e.size}),(0,C.jsx)("div",{className:"",children:e.show_mtime}),(0,C.jsx)(c.C3,{text:"download",clickFun:()=>{const e=B[0],t=_.$M.getDownloadUrlV2(e.path,"share_download",{share_id:i.current,share_token:N.current});window.open(t)}}),(0,C.jsx)(c.C3,{text:"copy url",clickFun:()=>{const e=B[0],t=_.$M.getDownloadUrlV2(e.path,"share_download",{share_id:i.current,share_token:N.current}),n=_.$M.get_full_url(t);(0,v.lW)(n),(0,p.SK)(n)}}),(0,C.jsx)(c.C3,{text:"preview",clickFun:()=>{const e=B[0];R(e.name)}})]})})})})})]})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[8649],{8694(e,t,s){s.d(t,{$K:()=>a,RB:()=>l,l5:()=>i,vo:()=>o,vr:()=>r});let n=function(e){return e[e.tcp=0]="tcp",e[e.udp=1]="udp",e}({});class a{open=!1;port;key="";async_ips=[]}class o{client_num_id;client_name;open=!1;ip;mask;serverIp;serverPort;key="";model=n.udp}let l=function(e){return e[e.row=1]="row",e[e.json=2]="json",e[e.form=3]="form",e}({});class r{body_type;header_type;url;method;headers;data;form_data_list;local_download_path}class i{enabled;ip;port;bypass;useForLocal;type}},47996(e,t,s){s.d(t,{d:()=>a});s(96540);var n=s(74848);function a(e){return(0,n.jsxs)("div",{className:"instance-item",children:[(0,n.jsxs)("div",{className:"instance-item__toolbar",children:[(0,n.jsx)("span",{className:"instance-item__label",children:e.title}),e.toolbar]}),e.children]})}},77481(e,t,s){s.d(t,{S:()=>r,X:()=>l});var n=s(96540),a=s(61443),o=s(74848);function l(e){const[t,s]=n.useState([]),l=(0,n.useRef)(-1),[r,i]=(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 p=()=>{l.current=-1,i(-1),d(-1)};return(0,o.jsxs)("table",{children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:e.headers?.map((t,s)=>{const n=!!e.filter&&(e.filter.column??0)===s;let l=t;if(n){const s=e.filter,n=s.options.find(e=>e.value===s.value);null!=s.value&&n&&(l=`${t} (${n.label})`)}return(0,o.jsx)("th",{className:n?"table-filter-col":"",children:n?(0,o.jsx)(a.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:l}):t},s)})})}),(0,o.jsx)("tbody",{children:t.map((t,s)=>{const n=!!e.onRowDrag;return(0,o.jsx)("tr",{className:n?(r===s?"row-dragging":"")+(c===s?" row-drop-target":""):"",draggable:n,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{n&&(l.current=s,i(s),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!n||l.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(s))},onDrop:t=>{n&&(t.preventDefault(),(()=>{const t=l.current,s=c;p(),t<0||s<0||t===s||e.onRowDrag?.(t,s)})())},onDragEnd:p,children:t.map((s,n)=>{const a=n===t.length-1?"small":"";return(0,o.jsx)("td",{className:a,style:{width:e.width??"auto"},children:s},n)})},s)})})]})}function r(e){return(0,o.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,o.jsx)("div",{children:e},t))})}},88649(e,t,s){s.r(t),s.d(t,{default:()=>H});var n=s(96540),a=s(75725),o=s(14284),l=s(62042),r=s(53459),i=s(70447),c=s(61443),d=s(85997),p=s(77481),u=s(8694),h=s(14944),x=s(92275),v=s(22022),m=s(4412),j=s(74848);function f(e){const{t}=(0,v.Bd)(),[s,f]=(0,n.useState)(void 0),[y,g]=(0,n.useState)(!1),[S,w]=(0,n.useState)(""),[_,b]=(0,n.useState)([t(`${t("名称")}`),t(`${t("虚拟")}ip`),`${t("物理")}`,t("在线状态"),t("选择")]),[I,k]=(0,n.useState)([]),[C,P]=(0,n.useState)({}),[N,D]=(0,n.useState)(!1);(0,n.useEffect)(()=>{(async()=>{const e=new x.hf(x.HK.vir_net_serverIno_get);h.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,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(i.fq,{ok:e}),t(e?"在线":"离线")]}),s[0]=(0,j.jsx)(i.xP,{context:s[0],tip_context:s[0]}),s[2]=(0,j.jsx)(i.xP,{context:s[2],tip_context:s[2]})}})(e.context),k(e.context)}),await h.ws.send(e)})();return(async()=>{const e=await o._U.get("vir/server/get");if(e.code!==r.m.Success)return;const t=e.data;f(t.port),w(t.key),g(t.open)})(),()=>{}},[]);return(0,j.jsxs)("div",{children:[(0,j.jsxs)(m.aZ,{position:"right",children:[!!Object.keys(C).length&&C[0],!!Object.keys(C).length&&(0,j.jsx)(d.rA,{icon:"delete",title:"删除",onClick:async()=>{await o._U.post("vir/server/delete/client",{ips:Object.keys(C)}),P({})}})]}),(0,j.jsx)(a.fI,{children:(0,j.jsxs)(a.VP,{children:[(0,j.jsxs)(i.Zp,{title:"",rightBottomCom:(0,j.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{const e=new u.$K;e.open=y,e.key=S,N&&(e.async_ips=Object.keys(C)),s&&(e.port=parseInt(s));(await o._U.post("vir/server/save",e)).code===r.m.Success?((0,l.SK)(t("保存成功")),D(!1)):(0,l.zN)(t("网络错误"))}}),children:[(0,j.jsx)(c.Sm,{placeholder:"port",value:s,handleInputChange:e=>{f(e)}}),(0,j.jsx)(c.Sm,{type:"password",placeholder:"key ",value:S,handleInputChange:e=>{w(e)}}),(0,j.jsxs)("form",{children:[t("状态"),":",(0,j.jsx)(p.S,{isFlex:!0,columns:[(0,j.jsx)(c.U6,{value:1,context:t("开启"),selected:y,onchange:()=>{g(!y)}}),(0,j.jsx)(c.U6,{value:1,context:t("关闭"),selected:!y,onchange:()=>{g(!y)}})]})]}),!!Object.keys(C).length&&(0,j.jsx)(c.GL,{context:t("sync_sv"),selected:N,onchange:()=>{D(!N)}})]}),(0,j.jsx)(i.Zp,{title:"",children:(0,j.jsx)(p.X,{headers:_,rows:I.map(e=>[...e,(0,j.jsx)(c.GL,{context:t(""),selected:C[e[1]],onchange:()=>{const t={...C};t[e[1]]?delete t[e[1]]:t[e[1]]=e,P(t)}})]),width:"10rem"})})]})})]})}function y(e){const{t}=(0,v.Bd)(),[s,m]=(0,n.useState)(""),[f,y]=(0,n.useState)(void 0),[g,S]=(0,n.useState)(""),[w,_]=(0,n.useState)(""),[b,I]=(0,n.useState)(void 0),[k,C]=(0,n.useState)(!1),[P,N]=(0,n.useState)(""),[D,A]=(0,n.useState)(!1);(0,n.useEffect)(()=>{(async()=>{const e=await o._U.get("vir/client/get");if(e.code!==r.m.Success)return;const t=e.data;if(I(t.serverPort),S(t.serverIp),m(t.ip),y(t.mask),N(t.key),C(t.open),_(t.client_name),t.open){const e=new x.hf(x.HK.vir_net_client_get),t=(await h.ws.send(e)).context.state;A(t),h.ws.addMsg(x.HK.vir_net_client_get,e=>{A(e.context.state)})}})()},[]);return(0,j.jsx)("div",{children:(0,j.jsx)(a.fI,{children:(0,j.jsxs)(a.VP,{children:[(0,j.jsxs)(i.Zp,{title:"",rightBottomCom:(0,j.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{const e=new u.vo;e.ip=s,e.mask=parseInt(f),e.key=P,e.serverIp=g,e.serverPort=parseInt(b),e.open=k,e.client_name=w;(await o._U.post("vir/client/save",e)).code===r.m.Success?(0,l.SK)(t("保存成功")):(0,l.zN)(t("网络错误"))}}),rightTopCom:(0,j.jsxs)("div",{children:[t("连接状态"),(0,j.jsx)(i.fq,{ok:D})]}),children:[(0,j.jsx)(c.Sm,{placeholder:"ip ",value:s,handleInputChange:e=>{m(e)}}),(0,j.jsx)(c.Sm,{placeholder:"mask",value:f,handleInputChange:e=>{y(e)}}),(0,j.jsx)(c.Sm,{placeholder:`${t("服务器")} ip`,value:g,handleInputChange:e=>{S(e)}}),(0,j.jsx)(c.Sm,{placeholder:`${t("服务器")} part`,value:b,handleInputChange:e=>{I(e)}}),(0,j.jsx)(c.Sm,{placeholder:"名称 ",value:w,handleInputChange:e=>{_(e)}}),(0,j.jsx)(c.Sm,{type:"password",placeholder:"key ",value:P,handleInputChange:e=>{N(e)}}),(0,j.jsxs)("form",{children:[t("状态"),(0,j.jsx)(p.S,{isFlex:!0,columns:[(0,j.jsx)(c.U6,{value:1,context:t("开启"),selected:k,onchange:()=>{C(!k)}}),(0,j.jsx)(c.U6,{value:1,context:t("关闭"),selected:!k,onchange:()=>{C(!k)}})]})]})]}),(0,j.jsxs)(i.Zp,{title:"",children:[(0,j.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,j.jsx)("div",{children:"mask: 一些常见的子网掩码网段/8:255.0.0.0;/16:255.255.0.0 ;/24:255.255.255.0"}),(0,j.jsx)("div",{children:"key:用于验证身份信息并加密的和服务器设置的一样"})]})]})})})}var g=s(47996),S=s(34843),w=s(82893),_=s(23430),b=s(78247),I=s(21499),k=s(24659),C=s(64694);function P(e){const{t}=(0,v.Bd)(),[s,h]=(0,n.useState)(""),[x,m]=(0,n.useState)(""),[f,y]=(0,n.useState)(""),[P,N]=(0,n.useState)(!1),[D,A]=(0,n.useState)(!1),[$,K]=(0,n.useState)({list:[]}),[T,O]=(0,S.fp)(w.AG.editorSetting),[U,z]=(0,S.fp)(w.AG.user_base_info),F=[t("端口"),t("目标地址"),t("目标端口"),t("开启"),t("备注"),t("删除")],[B,M]=(0,n.useState)([]),H=[t("port"),t("ip"),t("type"),t("开启")],[W,V]=(0,n.useState)([]),G=[t("编辑"),t("开启"),t("备注"),t("删除")],q=(0,k.K)(),X=async()=>{const e=[o._U.post("vir/client/tcp_proxy/get"),o._U.post("http/proxy/server/get")];let t;U.sys===_.XM.mac?t=(async()=>{const e=await o._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])})():U.sys===_.XM.win&&(t=(async()=>{const e=await o._U.post("http/proxy/get/win");if(e.code===r.m.Success){const t=e.data;h(t.ip),m(t.port),N(t.enabled),y(t.bypass),A(t.useForLocal)}})()),t&&e.push(t);const[s,n]=await Promise.all(e);s.code===r.m.Success&&M(s.data),n.code===r.m.Success&&K(n.data)};(0,n.useEffect)(()=>{X()},[]);return(0,j.jsx)("div",{children:(0,j.jsxs)(a.fI,{children:[U.sys===_.XM.win&&(0,j.jsx)(a.VP,{widthPer:33,children:(0,j.jsxs)(i.Zp,{title:"Http Proxy",rightBottomCom:(0,j.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{const e=new u.l5;e.port=parseInt(x),e.enabled=P,e.useForLocal=D,e.ip=s,e.bypass=f;(await o._U.post("http/proxy/set/win",e)).code===r.m.Success&&(X(),(0,l.SK)(t("保存成功")))}}),children:[(0,j.jsx)(c.Sm,{placeholder:"ip (default localhost) ",value:s,handleInputChange:e=>{h(e)}}),(0,j.jsx)(c.Sm,{placeholder:"port ",value:x,handleInputChange:e=>{m(e)}}),(0,j.jsx)(c.Sm,{placeholder:t("忽略ip"),value:f,handleInputChange:e=>{y(e)}}),(0,j.jsxs)("form",{children:[t("pxy_nln"),(0,j.jsx)(p.S,{isFlex:!0,columns:[(0,j.jsx)(c.U6,{value:1,context:t("开启"),selected:D,onchange:()=>{A(!D)}}),(0,j.jsx)(c.U6,{value:1,context:t("关闭"),selected:!D,onchange:()=>{A(!D)}})]})]}),(0,j.jsxs)("form",{children:[t("状态"),(0,j.jsx)(p.S,{isFlex:!0,columns:[(0,j.jsx)(c.U6,{value:1,context:t("开启"),selected:P,onchange:()=>{N(!P)}}),(0,j.jsx)(c.U6,{value:1,context:t("关闭"),selected:!P,onchange:()=>{N(!P)}})]})]})]})}),U.sys===_.XM.mac&&(0,j.jsx)(a.VP,{children:W.map((e,s)=>(0,j.jsxs)(i.uF,{self_title:(0,j.jsxs)("span",{className:" div-row ",children:[(0,j.jsx)("h2",{children:e.name})," "]}),rightTopCom:(0,j.jsx)("div",{children:(0,j.jsx)(d.rA,{icon:"save",title:t("保存"),onClick:()=>{(async e=>{const s=W[e];(await o._U.post("http/proxy/set/mac",[s])).code===r.m.Success&&(X(),(0,l.SK)(t("保存成功")))})(s)}})}),children:[(0,j.jsx)(p.X,{headers:H,rows:e.proxies.map((e,t)=>{const n=[(0,j.jsx)(c.Sm,{value:e.port,handleInputChange:t=>{e.port=parseInt(t)},no_border:!0}),(0,j.jsx)(c.Sm,{value:e.ip,handleInputChange:t=>{e.ip=t},no_border:!0}),(0,j.jsx)("div",{children:1===e.type?"http":"https"}),(0,j.jsx)(c.l6,{value:e.enabled,onChange:e=>{((e,t,s)=>{const n=[...W];n[e].proxies[t].enabled=s,V(n)})(s,t,e)},options:q,no_border:!0})];return n}),width:"10rem"}),"ignore ips",(0,j.jsx)(c.Sm,{value:e.bypass,handleInputChange:e=>{W[s].bypass=e},no_border:!0})]},s))}),(0,j.jsxs)(a.VP,{children:[(0,j.jsx)(i.uF,{self_title:(0,j.jsxs)("span",{className:" div-row ",children:[(0,j.jsx)("h2",{children:t("Tcp Proxy")})," "]}),rightTopCom:(0,j.jsxs)("div",{children:[(0,j.jsx)(d.rA,{icon:"add",title:t("添加"),onClick:()=>{M([...B,{note:"",open:!1,port:0,target_port:0,target_ip:""}])}}),(0,j.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 o._U.post("vir/client/tcp_proxy/save",e)).code===r.m.Success&&((0,l.SK)(t("保存成功")),X())}})]}),children:(0,j.jsx)(p.X,{headers:F,rows:B.map((e,s)=>{const n=[(0,j.jsx)(c.Sm,{value:e.port,handleInputChange:t=>{e.port=parseInt(t)},no_border:!0}),(0,j.jsx)(c.Sm,{value:e.target_ip,handleInputChange:t=>{e.target_ip=t},no_border:!0}),(0,j.jsx)(c.Sm,{value:e.target_port,handleInputChange:t=>{e.target_port=parseInt(t)},no_border:!0}),(0,j.jsx)(c.l6,{value:e.open,onChange:e=>{B[s].open=e,M([...B])},options:q,no_border:!0}),(0,j.jsx)(c.Sm,{value:e.note,handleInputChange:t=>{e.note=t},no_border:!0}),(0,j.jsx)("div",{children:(0,j.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>(e=>{B.splice(e,1),M([...B])})(s)})})];return n}),width:"10rem",onRowDrag:(e,t)=>{M((0,C.TI)(B,e,t))}})}),(0,j.jsx)(i.uF,{self_title:(0,j.jsxs)("span",{className:" div-row ",children:[(0,j.jsx)("h2",{children:t("Http Proxy Server")})," "]}),rightTopCom:(0,j.jsxs)("div",{children:[(0,j.jsx)(d.rA,{icon:"add",title:t("添加端口实例"),onClick:()=>{$.list.push({open:!1,port:0,note:"",list:[]}),K({...$})}}),(0,j.jsx)(d.rA,{icon:"save",title:t("保存"),onClick:async()=>{(await o._U.post("http/proxy/server/save",$)).code===r.m.Success&&(0,l.SK)(t("保存成功"))}})]}),children:$.list.map((e,s)=>(0,j.jsx)(g.d,{title:`${t("端口实例")} #${s+1}`,toolbar:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("span",{children:t("状态")}),(0,j.jsx)(c.l6,{value:e.open,width:"15%",onChange:t=>{e.open=t,K({...$})},options:q,no_border:!0}),(0,j.jsx)("span",{children:t("端口")}),(0,j.jsx)(c.Sm,{value:e.port||"",handleInputChange:t=>{e.port=t?parseInt(t):0,K({...$})},no_border:!0,width:"80px"}),(0,j.jsx)(d.rA,{icon:"add",title:t("添加规则"),onClick:()=>{e.list.push({note:"",open:!1}),K({...$})}}),(0,j.jsx)(d.rA,{icon:"delete",title:t("删除端口实例"),onClick:()=>{$.list.splice(s,1),K({...$})}}),(0,j.jsx)(c.Sm,{placeholder:t("备注"),width:"100%",value:e.note,handleInputChange:t=>{e.note=t,K({...$})},no_border:!0})]}),children:(0,j.jsx)(p.X,{headers:G,rows:e.list.map((n,a)=>{const l=[(0,j.jsx)("div",{children:(0,j.jsx)(d.rA,{icon:"edit",title:t("编辑"),onClick:()=>{(async(e,t)=>{const s=$.list[e];if(!s)return;const n=s.list[t];if(!n)return;n.random_key||(n.random_key=(0,I.hU)(),K({...$}));const a=await o._U.post("http/proxy/server/code/get",{key:n.random_key,name:n.random_key});O({model:"ace/mode/javascript",open:!0,fileName:"",can_format:!0,save:async e=>{await o._U.post("http/proxy/server/code/save",{context:e,key:n.random_key})}}),b.xK.set_value_temp(a.data)})(s,a)}})}),(0,j.jsx)(c.l6,{value:n.open,onChange:t=>{e.list[a].open=t,K({...$})},options:q,no_border:!0}),(0,j.jsx)(c.Sm,{value:n.note,handleInputChange:e=>{n.note=e},no_border:!0}),(0,j.jsx)("div",{children:(0,j.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{e.list.splice(a,1),K({...$})}})})];return l}),width:"10rem"})},s))})]})]})})}var N=s(87361);let D=function(e){return e.physics="物理",e.http_get="http_get",e.fixed="fixed",e}({}),A=function(e){return e.unverified="unverified",e.ok="ok",e.fail="fail",e}({}),$=function(e){return e.dnspod="dnspod",e.tengxun="tengxun",e.ali="ali",e.cloudflare="cloudflare",e.godaddy="godaddy",e.namesilo="namesilo",e.namecheap="namecheap",e.vercel="vercel",e.duckdns="duckdns",e.noip="noip",e.easydns="easydns",e.freedns="freedns",e.dynv6="dynv6",e.oray="oray",e.dyn="dyn",e.custom="custom",e}({});const K=[{provider:$.dnspod,label:"DNSPod(腾讯)",fields:[{label:"ID",placeholder:"ID"},{label:"Token",placeholder:"在密钥管理中生成",password:!0}],info:"DNSPod 老版 API。在 dnspod.cn 控制台「用户中心 - 密钥管理」创建 API Token,分别填入 ID 与 Token。"},{provider:$.tengxun,label:"腾讯云 DNSPod",fields:[{label:"SecretId",placeholder:"云 API 密钥 ID"},{label:"SecretKey",placeholder:"云 API 密钥 Key",password:!0}],info:"腾讯云新版云 API。在腾讯云控制台「访问管理 - API 密钥管理」创建密钥,分别填入 SecretId 与 SecretKey。"},{provider:$.ali,label:"阿里云解析",fields:[{label:"AccessKeyId",placeholder:"AccessKey ID"},{label:"AccessKeySecret",placeholder:"AccessKey Secret",password:!0}],info:"在阿里云控制台「AccessKey 管理」创建密钥,分别填入 AccessKeyId 与 AccessKeySecret。"},{provider:$.cloudflare,label:"Cloudflare",fields:[{label:"API Token",placeholder:"Cloudflare API 令牌",password:!0}],info:"在 Cloudflare「我的个人资料 - API 令牌」创建令牌,权限需包含「编辑区域 DNS」。"},{provider:$.godaddy,label:"GoDaddy",fields:[{label:"API Key",placeholder:"GoDaddy API Key"},{label:"API Secret",placeholder:"GoDaddy API Secret",password:!0}],info:"在 GoDaddy 开发者后台创建 API Key(生产环境),分别填入 Key 与 Secret。"},{provider:$.namesilo,label:"NameSilo",fields:[{label:"API Key",placeholder:"NameSilo API Key",password:!0}],info:"在 NameSilo「账号 - API Manager」生成 API Key。"},{provider:$.namecheap,label:"Namecheap",fields:[{label:"Dynamic DNS 密码",placeholder:"Namecheap DDNS 密码",password:!0}],info:"在 Namecheap 域名管理页「Advanced DNS」开启 Dynamic DNS,复制其中的密码。不支持 IPv6。"},{provider:$.vercel,label:"Vercel",fields:[{label:"API Token",placeholder:"Vercel API Token",password:!0}],info:"在 Vercel「账号设置 - Tokens」创建 Token,需具备 DNS 权限。"},{provider:$.duckdns,label:"DuckDNS",fields:[{label:"Token",placeholder:"DuckDNS Token",password:!0}],info:"DuckDNS 首页登录后即可看到 Token。域名需为 xxx.duckdns.org 形式。"},{provider:$.dynv6,label:"dynv6",fields:[{label:"Token",placeholder:"dynv6 Token",password:!0}],info:"在 dynv6 域名详情页复制 HTTP 更新 token 填入。"},{provider:$.freedns,label:"FreeDNS(afraid.org)",fields:[{label:"更新 Token",placeholder:"FreeDNS 更新 Token",password:!0}],info:"在 FreeDNS 域名管理页的 Dynamic DNS 链接中复制 update token 填入。"},{provider:$.noip,label:"No-IP",fields:[{label:"用户名",placeholder:"No-IP 用户名"},{label:"密码",placeholder:"No-IP 密码",password:!0}],info:"No-IP 官网账号的用户名与密码。"},{provider:$.easydns,label:"easyDNS",fields:[{label:"用户名",placeholder:"easyDNS 用户名"},{label:"密码",placeholder:"easyDNS 密码",password:!0}],info:"easyDNS 账号的用户名与密码。"},{provider:$.oray,label:"花生壳 Oray",fields:[{label:"账号",placeholder:"花生壳账号"},{label:"密码",placeholder:"花生壳密码",password:!0}],info:"花生壳官网账号与密码。更新地址:ddns.oray.com/ph/update。"},{provider:$.dyn,label:"通用 DynDNS2",fields:[{label:"用户名",placeholder:"DynDNS 用户名"},{label:"密码",placeholder:"DynDNS 密码",password:!0}],info:"适用于兼容 DynDNS2 协议的服务(更新地址 members.dyndns.org)。"},{provider:$.custom,label:"自定义 HTTP",fields:[{label:"URL 模板",placeholder:"https://example.com/update?domain={host}&ip={ip}"}],info:"任意支持 HTTP 更新的 DDNS 服务,模板中可用 {host} {ip} {family} 占位。"}];function T(e){return K.find(t=>t.provider===e)}function O(e,t){const s=(e??"").split(","),n=[];for(let e=0;e<t;e++)n.push((s[e]??"").trim());return n}function U(e){if(!e)return"-";const t=new Date(e),s=e=>String(e).padStart(2,"0");return`${t.getFullYear()}-${s(t.getMonth()+1)}-${s(t.getDate())} ${s(t.getHours())}:${s(t.getMinutes())}:${s(t.getSeconds())}`}function z(e){if(!e)return"-";const t=Date.now()-e;if(t<6e4)return"刚刚";if(t<36e5)return`${Math.floor(t/6e4)} 分钟前`;if(t<864e5)return`${Math.floor(t/36e5)} 小时前`;const s=new Date(e),n=e=>String(e).padStart(2,"0");return`${n(s.getMonth()+1)}-${n(s.getDate())} ${n(s.getHours())}:${n(s.getMinutes())}`}function F(e){const{t}=(0,v.Bd)();return e.status===A.ok?(0,j.jsx)(i.fq,{success:!0,text:t("成功")}):e.status===A.fail?(0,j.jsx)(i.fq,{success:!1,text:t("失败")}):(0,j.jsx)(i.fq,{text:t("未验证")})}function B(){const{t:e}=(0,v.Bd)(),[,t]=(0,S.fp)(w.AG.confirm),[s,u]=(0,S.fp)(w.AG.prompt_card),[h,x]=(0,n.useState)([]),[m,f]=(0,n.useState)(null),[y,_]=(0,n.useState)([]),[b,I]=(0,n.useState)(60),[k,C]=(0,n.useState)(!1),P=async()=>{const e=await o.ez.get("ip_options");e.code===r.m.Success&&_(e.data??[])};(0,n.useEffect)(()=>{(async()=>{const e=await o.ez.get("list");e.code===r.m.Success&&x(e.data??[])})(),P(),(async()=>{const e=await o.ez.get("interval");e.code===r.m.Success&&I(e.data?.interval??60)})()},[]);const N=K.map(e=>({label:e.label,value:e.provider})),B=y.map(t=>({label:t.source_type===D.fixed?`${e("IP")} ${t.ifaceOrWww} (${t.isIPv4?"IPv4":"IPv6"})`:`${t.ifaceOrWww} (${t.isIPv4?"IPv4":"IPv6"}) ${t.ip??""}`,value:H(t)}));function H(e){return`${e.ifaceOrWww}#${e.scopeid??""}#${e.isIPv4?"4":"6"}`}const W=(e,t)=>{m&&f({...m,[e]:t})},V=m?T(m.provider):void 0,G=m?O(m.account,V?.fields.length??1):[];return(0,j.jsxs)(a.fI,{children:[(0,j.jsx)(a.VP,{widthPer:50,maxWidth:"60rem",children:(0,j.jsx)(a.xh,{children:(0,j.jsxs)(i.uF,{self_title:(0,j.jsxs)("span",{className:" div-row ",children:[(0,j.jsx)("h2",{children:e("动态域名解析")}),(0,j.jsx)(d.rA,{icon:"info",onClick:()=>{u({open:!0,title:e("信息"),context_div:(0,j.jsxs)("div",{children:[(0,j.jsx)("p",{children:e("ddns_help_1")}),(0,j.jsx)("p",{children:e("ddns_help_2")})]})})},title:e("信息")})]}),rightTopCom:(0,j.jsxs)("div",{children:[(0,j.jsx)(d.rA,{icon:"sync",title:e("立即同步"),selected:k,onClick:async()=>{C(!0);try{const t=await o.ez.post("sync_now",{});t.code===r.m.Success?((0,l.SK)(e("同步完成")),x(t.data??[])):(0,l.zN)(t.message??e("操作失败"))}finally{C(!1)}}}),(0,j.jsx)(d.rA,{icon:"dns",title:e("IP 来源管理"),onClick:()=>{u({open:!0,title:e("IP 来源管理"),context_div:(0,j.jsx)(M,{on_refresh:P})})}}),(0,j.jsx)(d.rA,{icon:"add",title:e("添加"),onClick:()=>{f({id:"",provider:$.dnspod,account:"",isOpen:!1,note:"",ips:[],account_status:A.unverified,account_message:"",is_new:!0})}})]}),children:[(0,j.jsxs)(c.BC,{label:e("同步间隔"),label_width:"5rem",row:!0,children:[(0,j.jsx)(c.Sm,{value:String(b),type:"number",width:"6rem",handleInputChange:e=>I(Number(e))}),(0,j.jsx)("span",{children:e("秒")}),(0,j.jsx)(d.rA,{icon:"save",title:e("保存"),onClick:()=>(async t=>{if(!t||t<10)return void(0,l.zN)(e("间隔不能小于 10 秒"));const s=await o.ez.post("interval",{interval:t});s.code===r.m.Success?((0,l.SK)(e("保存成功")),I(s.data?.interval??t)):(0,l.zN)(s.message??e("操作失败"))})(b)})]}),(0,j.jsx)(p.X,{headers:[e("编号"),e("平台"),e("开启"),e("账号状态"),e("上次同步"),e("备注"),e("操作")],rows:h.map((s,n)=>{return[(0,j.jsx)("p",{children:n}),(0,j.jsx)(i.xP,{context:(a=s.provider,T(a)?.label??a)}),(0,j.jsx)(i.fq,{success:!!s.isOpen,text:s.isOpen?e("开启"):e("关闭")}),(0,j.jsx)(i.xP,{tip_context:s.account_message,children:(0,j.jsx)(F,{status:s.account_status})}),(0,j.jsx)(i.xP,{tip_context:`${U(s.time)} ${s.message??""}`,children:z(s.time)}),(0,j.jsx)(i.xP,{context:s.note}),(0,j.jsxs)("div",{className:"div-row",children:[(0,j.jsx)(d.rA,{icon:"check",title:e("验证"),onClick:()=>(async t=>{const s=await o.ez.post("verify",{id:t});if(s.code===r.m.Success){x(s.data??[]);const n=(s.data??[]).find(e=>e.id===t);n?.account_status===A.ok?(0,l.SK)(n.account_message||e("验证成功")):(0,l.zN)(n?.account_message||e("验证失败"))}})(s.id)}),(0,j.jsx)(d.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>f(JSON.parse(JSON.stringify(e))))(s)}),(0,j.jsx)(d.rA,{icon:"delete",title:e("删除"),onClick:()=>{return n=s.id,void t({open:!0,title:e("确定删除吗"),handle:async()=>{const s=await o.ez.post("del",{id:n});s.code===r.m.Success&&((0,l.SK)(e("成功")),x(s.data??[]),m?.id===n&&f(null)),t({open:!1,handle:null})}});var n}})]})];var a})})]})})}),(0,j.jsx)(a.VP,{widthPer:50,children:m&&(0,j.jsx)(a.xh,{children:(0,j.jsxs)(i.Zp,{self_title:(0,j.jsx)("span",{className:" div-row ",children:(0,j.jsx)("h2",{children:e(""+(m.is_new?"添加":"编辑"))})}),rightTopCom:(0,j.jsx)(d.rA,{icon:"info",title:e("信息"),onClick:()=>{if(!m)return;const t=T(m.provider);u({open:!0,title:t?.label??e("信息"),context_div:(0,j.jsx)("div",{children:t?.info&&(0,j.jsx)("p",{children:t.info})})})}}),rightBottomCom:(0,j.jsxs)("div",{children:[(0,j.jsx)(d.rA,{icon:"cancel",title:e("取消"),onClick:()=>f(null)}),(0,j.jsx)(d.rA,{icon:"save",title:e("保存"),onClick:async()=>{if(!m)return;const t=T(m.provider);if(O(m.account,t?.fields.length??1).some(e=>!e))return void(0,l.zN)(e("请填写完整的账号凭证"));const{is_new:s,...n}=m,a=await o.ez.post("save",n);a.code===r.m.Success?((0,l.SK)(e("保存成功")),f(null),x(a.data??[]),P()):(0,l.zN)(a.message??e("操作失败"))}})]}),children:[(0,j.jsx)(c.BC,{label:e("开启"),label_width:"5rem",children:(0,j.jsx)(c.GL,{selected:!!m.isOpen,onchange:()=>W("isOpen",!m.isOpen)})}),(0,j.jsx)(c.BC,{label:e("备注"),label_width:"5rem",children:(0,j.jsx)(c.Sm,{value:m.note,handleInputChange:e=>W("note",e)})}),(0,j.jsx)(c.BC,{label:e("平台"),label_width:"5rem",required:!0,children:(0,j.jsx)(c.l6,{options:N,value:m.provider,onChange:e=>{f({...m,provider:e,account:"",account_status:A.unverified,account_message:""})}})}),V?.fields.map((e,t)=>(0,j.jsx)(c.BC,{label:e.label,label_width:"5rem",required:!0,children:(0,j.jsx)(c.Sm,{value:G[t]??"",type:e.password?"password":"text",placeholder:e.placeholder,handleInputChange:e=>((e,t,s)=>{if(!m)return;const n=O(m.account,s);n[e]=t,W("account",n.map(e=>(e??"").trim()).join(","))})(t,e,V.fields.length)})},t)),m.account_status===A.fail&&(0,j.jsx)("p",{className:"text-red",children:m.account_message}),(0,j.jsxs)("div",{className:"div-row",children:[(0,j.jsx)("label",{children:e("域名绑定")}),(0,j.jsx)(d.rA,{icon:"add",title:e("添加"),onClick:()=>{if(!m)return;const e=[...m.ips??[],{isIPv4:!0,ifaceOrWww:"",ddnsHost:"",source_type:D.physics}];f({...m,ips:e})}})]}),(m.ips??[]).map((t,s)=>{const n=`${t.ifaceOrWww}#${t.scopeid??""}#${t.isIPv4?"4":"6"}`,a=B.find(e=>e.value===n);return(0,j.jsxs)(g.d,{title:`${e("绑定")}${s+1}`,toolbar:(0,j.jsx)(d.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{if(!m?.ips)return;const t=[...m.ips];t.splice(e,1),f({...m,ips:t})})(s)}),children:[(0,j.jsx)(c.BC,{label:e("IP 来源"),label_width:"5rem",required:!0,children:(0,j.jsx)(c.Sm,{value:a?.label??"",options:B,handleInputChange:e=>((e,t)=>{const s=y.find(e=>H(e)===t)??y.find(e=>`${e.ifaceOrWww} (${e.isIPv4?"IPv4":"IPv6"}) ${e.ip??""}`===t);if(!s||!m?.ips)return;const n=[...m.ips];n[e]={...n[e],ifaceOrWww:s.ifaceOrWww,scopeid:s.scopeid,isIPv4:s.isIPv4,source_type:s.source_type},f({...m,ips:n})})(s,e)})}),(0,j.jsx)(c.BC,{label:e("域名"),label_width:"5rem",required:!0,children:(0,j.jsx)(c.Z2,{style:{minHeight:"7rem",resize:"vertical"},placeholder:e("多个域名用空格分隔"),value:t.ddnsHost,onChange:e=>{((e,t,s)=>{if(!m?.ips)return;const n=[...m.ips];n[e]={...n[e],[t]:s},f({...m,ips:n})})(s,"ddnsHost",e.target.value)}})}),t.time&&(0,j.jsxs)(c.BC,{label:e("上次同步"),label_width:"5rem",row:!0,children:[(0,j.jsx)(F,{status:t.status}),(0,j.jsx)("span",{children:U(t.time)})]})]},s)})]})})})]})}function M(e){const{t}=(0,v.Bd)(),[s,a]=(0,n.useState)([]),[i,p]=(0,n.useState)(""),[u,h]=(0,n.useState)("ipv4"),x=async()=>{const t=await o.ez.get("http/list");t.code===r.m.Success&&a(t.data??[]),await e.on_refresh()};(0,n.useEffect)(()=>{x()},[]);return(0,j.jsxs)("div",{children:[(0,j.jsx)("p",{children:t("http_source_tip")}),(0,j.jsxs)("div",{className:"div-row",children:[(0,j.jsx)(c.l6,{options:[{label:"IPv4",value:"ipv4"},{label:"IPv6",value:"ipv6"},{label:t("IP"),value:D.fixed}],value:u,width:"6rem",onChange:e=>{h(e),p("")}}),(0,j.jsx)(c.Sm,{value:i,placeholder:u===D.fixed?"1.1.1.1":"ipv6"===u?"https://6.ipw.cn":"https://4.ipw.cn",handleInputChange:e=>p(e)}),(0,j.jsx)(d.rA,{icon:"add",title:t("添加"),onClick:async()=>{if(!i.trim())return void(0,l.zN)(t("请输入地址"));const e=await o.ez.post("http/add",{ifaceOrWww:i.trim(),isIPv4:"ipv6"!==u,ip:"",source_type:u===D.fixed?D.fixed:D.http_get});e.code===r.m.Success?((0,l.SK)(t("成功")),p(""),await x()):(0,l.zN)(e.message??t("操作失败"))}})]}),(0,j.jsxs)("div",{children:[0===s.length&&(0,j.jsx)("p",{children:t("暂无数据")}),s.map((e,s)=>(0,j.jsxs)("div",{className:"div-row",children:[(0,j.jsxs)("span",{children:[e.ifaceOrWww,"(",e.isIPv4?"IPv4":"IPv6",e.source_type===D.fixed?` / ${t("IP")}`:"",")"]}),(0,j.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>(async e=>{(await o.ez.post("http/del",e)).code===r.m.Success&&((0,l.SK)(t("成功")),await x())})(e)})]},s))]})]})}function H(){const{t:e}=(0,v.Bd)(),{check_user_auth:t}=(0,b.MH)(),s=[];return t(_.oV.vir_net)&&s.push({index:1,name:e("系统代理"),rto:"proxy_sys/",component:(0,j.jsx)(P,{})},{index:3,name:"Tun proxy "+e("客户端"),rto:"client/",component:(0,j.jsx)(y,{})},{index:4,name:"Tun proxy "+e("服务端"),rto:"server/",component:(0,j.jsx)(f,{})}),t(_.oV.ddns)&&s.push({index:2,name:"DDNS",rto:"ddns/",component:(0,j.jsx)(B,{})}),(0,j.jsx)(a.W1,{optionList:s,father_route:N.o.net})}},24659(e,t,s){var n=s(22022);s.d(t,["K",0,()=>{const{t:e}=(0,n.Bd)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])}}]);
|