filecat 7.22.6 → 7.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/build/dist/{3355.0f88ac30eb4999991dda.js → 3355.c9db08c8d67b7e840abc.js} +1 -1
- package/build/dist/3659.5e4db939f61d44a8ef48.js +1 -0
- package/build/dist/3884.3886a9c14bdeb4241184.js +1 -0
- package/build/dist/{4598.7b747273661918b2f6e6.js → 4598.1a07d84c2e544f056145.js} +1 -1
- package/build/dist/{47.16d1fc34dc38edfd69a5.js → 47.d41ba7c7f7fd72073078.js} +1 -1
- package/build/dist/{6097.18a9a64a4aab7d5abcb8.js → 6097.b89ac3ca2dfd42bc5c27.js} +1 -1
- package/build/dist/{7678.929a10650be536a1023a.js → 7678.6e8bdd4910520d650001.js} +1 -1
- package/build/dist/{9202.61819e50b72283a13578.js → 9202.ed0c1484a072df695026.js} +1 -1
- package/build/dist/{9260.5718a904359072533596.js → 9260.9ea7e05e3aab82c311f8.js} +1 -1
- package/build/dist/{9765.c7488c28539a4d29f1c8.js → 9765.eea171e9919d01f5a676.js} +1 -1
- package/build/dist/index.html +1 -1
- package/build/dist/main.743d2077c18cdb22ce97.js +2 -0
- package/build/main.js +1 -1
- package/package.json +1 -1
- package/build/dist/2334.2dc6eade8b0775300e27.js +0 -1
- package/build/dist/3659.a257153b5a0947e81b3c.js +0 -1
- package/build/dist/main.dd420f7acfe27ad91b38.js +0 -2
- /package/build/dist/{main.dd420f7acfe27ad91b38.js.LICENSE.txt → main.743d2077c18cdb22ce97.js.LICENSE.txt} +0 -0
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2334],{72458(e,t,n){function i(e,t){let n=function(e){let t="\\";for(const n of e)if("/"===n||"\\"===n){t=n;break}return t}(e);if("."===t)return e;if(".."===t){if(e.length>1){let t=e[e.length-1]===n?1:0;for(let i=e.length-1-t;i>=0;i--)if(e[i]===n)return e.substring(0,i+1)}return e}return e.endsWith(n)&&t.startsWith(n)?e.slice(0,-1)+t:e.endsWith(n)||t.startsWith(n)?e+t:e+n+t}n.d(t,{Jn:()=>i,Z1:()=>s});function s(e){if("string"!=typeof e||0===e.length)return!1;return/^[a-zA-Z]:[\\\/]/.test(e)||/^\\\\[^\\/]+[\\/]/.test(e)||/^\//.test(e)}},47374(e,t,n){n.d(t,{e:()=>f});var i=n(96540),s=n(52671),o=n(64694),a=n(34289),l=n(61443),r=n(75725),c=n(22022),d=n(85997),_=n(74848);function f(e){let t=(0,s.zy)();const n=(0,s.Zp)(),[f,p]=(0,i.useState)([]),[h,u]=(0,i.useState)("/"),[m,w]=(0,i.useState)(void 0),{t:v,i18n:g}=(0,c.Bd)();i.useEffect(()=>{let t="",n=(0,a.vX)().split("/");n=n.filter(e=>e);const i=n.indexOf(e.baseRoute),s=[];if(-1!=i){t=(0,o.IO)(n.slice(0,i),e.baseRoute);const a=n.slice(i+1);for(let e=0;e<a.length;e++){const n=a[e];s.push({value:n,href:0===e?`${t}${n}/`:(0,o.IO)(s[e-1].href,n)})}u(t),p(s)}},[t]);const x=t=>{t.stopPropagation(),e.clickFun(t)},[y,j]=(0,i.useState)(0),k=(0,i.useRef)(null),G=(0,i.useRef)(null),A=()=>{const e=k.current,t=G.current;if(!e||!t)return;const n=[];for(const e of Array.from(t.children))n.push(e.getBoundingClientRect().width);const i=e.clientWidth;if(n.reduce((e,t)=>e+t,0)<=i||n.length<=2)return void j(e=>0===e?e:0);let s=n[0]+48,o=0;for(let e=n.length-1;e>=1&&!(s+n[e]>i);e--)s+=n[e],o++;const a=Math.max(n.length-1-o,0);j(e=>e===a?e:a)};(0,i.useEffect)(()=>{A();const e=new ResizeObserver(A);return k.current&&e.observe(k.current),()=>e.disconnect()},[f,h,t]),(0,i.useEffect)(()=>{const e=k.current;e&&0!==y&&e.scrollWidth>e.clientWidth&&y<f.length-1&&j(e=>e+1)});const b=y>0?1+y:1,C=y>0?f.slice(1,b):[],[N,S]=(0,i.useState)(null);return(0,i.useEffect)(()=>{S(null)},[t,y]),(0,_.jsxs)("div",{className:"breadcrumbs",ref:k,onClick:e=>{w(void 0!==m?void 0:"")},children:[(0,_.jsx)(i.Fragment,{children:void 0===m?(0,_.jsxs)(i.Fragment,{children:[(0,_.jsx)("span",{className:"chevron",children:(0,_.jsx)(s.N_,{to:h,onClick:x,children:(0,_.jsx)(d.In,{icon:"home"})})}),f.map((e,t)=>y>0&&t>=1&&t<b?1!==t?null:(0,_.jsxs)("span",{className:"chevron",children:[(0,_.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,_.jsx)("span",{className:"breadcrumbs-fold-dot",onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();S({x:t.left,y:t.bottom})},children:"..."})]},"fold"):(0,_.jsxs)("span",{className:"chevron",children:[(0,_.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,_.jsx)(s.N_,{to:e.href,onClick:x,children:decodeURIComponent(e.value)})]},t)),(0,_.jsxs)("div",{className:"breadcrumbs-measure",ref:G,"aria-hidden":!0,children:[(0,_.jsx)("span",{className:"chevron",children:(0,_.jsx)(s.N_,{to:h,children:(0,_.jsx)(d.In,{icon:"home"})})}),f.map((e,t)=>(0,_.jsxs)("span",{className:"chevron",children:[(0,_.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,_.jsx)(s.N_,{to:e.href,children:decodeURIComponent(e.value)})]},t))]})]}):(0,_.jsx)(r.QM,{click:()=>{w(void 0)},children:(0,_.jsx)(l.Sm,{width:"100%",placeholder:v("输入跳转的目录"),handlerEnter:t=>{e.input_path_enter&&e.input_path_enter(t),w(void 0)}})})}),N&&(0,_.jsx)(r.rY,{click:()=>S(null),children:(0,_.jsx)(r.sw,{x:N.x,y:N.y,items:C.map(e=>({r:decodeURIComponent(e.value),v:e.href})),click:e=>{S(null),n(e)}})})]})}},77481(e,t,n){n.d(t,{S:()=>l,X:()=>a});var i=n(96540),s=n(61443),o=n(74848);function a(e){const[t,n]=i.useState([]),a=(0,i.useRef)(-1),[l,r]=(0,i.useState)(-1),[c,d]=(0,i.useState)(-1);(0,i.useEffect)(()=>{e.children?n(Array.isArray(e.children)?e.children:[e.children]):n(e.rows)},[e.rows,e.children]);const _=()=>{a.current=-1,r(-1),d(-1)};return(0,o.jsxs)("table",{children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:e.headers?.map((t,n)=>{const i=!!e.filter&&(e.filter.column??0)===n;let a=t;if(i){const n=e.filter,i=n.options.find(e=>e.value===n.value);null!=n.value&&i&&(a=`${t} (${i.label})`)}return(0,o.jsx)("th",{className:i?"table-filter-col":"",children:i?(0,o.jsx)(s.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:a}):t},n)})})}),(0,o.jsx)("tbody",{children:t.map((t,n)=>{const i=!!e.onRowDrag;return(0,o.jsx)("tr",{className:i?(l===n?"row-dragging":"")+(c===n?" row-drop-target":""):"",draggable:i,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{i&&(a.current=n,r(n),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!i||a.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(n))},onDrop:t=>{i&&(t.preventDefault(),(()=>{const t=a.current,n=c;_(),t<0||n<0||t===n||e.onRowDrag?.(t,n)})())},onDragEnd:_,children:t.map((n,i)=>{const s=i===t.length-1?"small":"";return(0,o.jsx)("td",{className:s,style:{width:e.width??"auto"},children:n},i)})},n)})})]})}function l(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))})}},62334(e,t,n){n.r(t),n.d(t,{default:()=>J});var i=n(96540),s=n(47374),o=n(34843),a=n(52035),l=n(82893),r=n(14284),c=n(52671),d=n(4412),_=n(78150),f=n(34289),p=n(53459),h=n(99214),u=n(61443),m=n(47022),w=n(62042),v=n(22022),g=n(7523),x=n(78247),y=n(88815),j=n(6960),k=n(47071),G=n(14944),A=n(92275),b=n(23430),C=n(72458),N=n(34251),S=n(60096),M=n(87361),$=n(97952),z=n(85997),E=n(77481),I=n(70447),D=n(74848);const F=500;function P(e){const{t}=(0,v.Bd)(),n=(0,c.Zp)(),[,s]=(0,o.fp)(l.AG.prompt_card),[a,r]=(0,i.useState)(""),[d,_]=(0,i.useState)(!1),[f,p]=(0,i.useState)([]),[h,m]=(0,i.useState)(0),[w,g]=(0,i.useState)(!1),x=(0,i.useMemo)(()=>new $.I(window.location.host,"file_deep_search"),[]),y=(0,i.useRef)(!1),j=decodeURIComponent(e.base_path);(0,i.useEffect)(()=>{let e=[],t=null;const n=()=>{if(t=null,y.current||!e.length)return;const n=e;e=[],m(e=>e+n.length),p(e=>e.length>=F?e:[...e,...n].slice(0,F))},i=()=>{y.current||_(!1)};return x.addMsg(A.HK.file_deep_search_data,i=>{y.current||(e.push(...i.context??[]),null===t&&(t=setTimeout(n,100)))}),x.addMsg(A.HK.file_deep_search_end,()=>{y.current||(n(),_(!1))}),x.on_message("close",i),()=>{y.current=!0,clearTimeout(t),x.sendData(A.HK.file_deep_search_cancel,{}).catch(()=>{}),x.off_message("close",i),x.close()}},[]);const k=()=>{const t=a.trim();if(!t||d)return;p([]),m(0),g(!0),_(!0);const n={param_path:e.base_path,keyword:t};x.sendData(A.HK.file_deep_search,n).catch(()=>{})},G=e=>{let t=e.is_dir?e.path:e.path.slice(0,e.path.lastIndexOf("/")+1);t.endsWith("/")||(t+="/"),s({open:!1}),n(M.o.file+t.split("/").map(encodeURIComponent).join("/"))};return(0,D.jsxs)("div",{className:"file-deep-search",children:[(0,D.jsxs)("div",{className:"file-deep-search__bar",children:[(0,D.jsx)(u.$Z,{icon:"search",value:a,placeholder:t("搜文件名"),handleInputChange:e=>r(e),handleEnterPress:k}),(0,D.jsx)("button",{className:"button button--flat",onClick:d?()=>{x.sendData(A.HK.file_deep_search_cancel,{}).catch(()=>{}),_(!1)}:k,children:t(d?"取消":"搜索")})]}),(0,D.jsxs)("div",{className:"file-deep-search__hint",children:[(0,D.jsxs)("span",{children:[t("范围"),":",j]}),h>0&&(0,D.jsx)("span",{className:"file-deep-search__count",children:h>F?`${t("已显示")} 500 / ${h}`:`${h}`})]}),(0,D.jsxs)("div",{className:"file-deep-search__body",children:[f.length>0&&(0,D.jsx)(E.X,{headers:[t("名称"),t("路径"),""],rows:f.map(e=>{const n=e.path.slice(0,e.path.lastIndexOf("/")+1);return[e.is_dir?(0,D.jsx)("span",{className:"file-deep-search__dir",children:e.name}):e.name,(0,D.jsx)(I.xP,{context:n}),(0,D.jsx)(z.rA,{icon:"folder_open",title:t("打开所在目录"),onClick:()=>G(e)})]})}),d&&(0,D.jsxs)("div",{className:"file-deep-search__empty",children:[(0,D.jsx)("span",{className:"chat-session-running",title:t("搜索中")}),t("搜索中")]}),!d&&h>F&&(0,D.jsx)("div",{className:"file-deep-search__more",children:t("结果过多")}),!d&&0===f.length&&(0,D.jsx)("div",{className:"file-deep-search__empty",children:t(w?"无匹配":"输入后搜")})]})]})}var R=n(64694),X=n(23496),K=n(12730),L=n(75725),U=n(40505);let H={};function Z(){const{t:e}=(0,v.Bd)();let t=(0,c.zy)();const n=(0,c.Zp)(),{check_user_auth:s}=(0,x.MH)(),[a,d]=(0,o.fp)(l.AG.nowFileList),[p,u]=(0,o.fp)(l.AG.uploadFiles),[y,j]=(0,o.fp)(l.AG.showPrompt),[k,C]=(0,o.fp)(l.AG.selectedFileList),[S,$]=(0,o.fp)(l.AG.copyedFileList),[E,F]=(0,o.fp)(l.AG.cutedFileList),[P,X]=(0,o.fp)(l.AG.selectedFileList),[U,Z]=(0,o.fp)(l.AG.clickFileList),[B,Y]=(0,o.fp)(l.AG.fileShellShow),O=(0,h.Cf)(),[W,T]=(0,o.fp)(l.AG.file_root_list),[V,q]=(0,o.fp)(l.AG.file_root_index),[J,Q]=(0,i.useState)(void 0),[ee,te]=(0,i.useState)(""),[ne,ie]=(0,o.fp)(l.AG.workflow_show),[se,oe]=(0,o.fp)(l.AG.workflow_realtime_show),[ae,le]=(0,o.fp)(l.AG.work_flow_show),{initUserInfo:re}=(0,i.useContext)(g.F),[ce,de]=(0,o.fp)(l.AG.user_base_info),{click_file:_e}=(0,h.kZ)(),[fe,pe]=(0,o.fp)(l.AG.prompt_card),he=(0,i.useMemo)(()=>a.files.reduce((e,t)=>e+(t.type!==m.Iw.folder?1:0),0),[a]),ue=(0,i.useMemo)(()=>a.files.reduce((e,t)=>e+(t.type===m.Iw.folder?1:0),0)+(a.folders?.length??0),[a]);function me(e){(0,w.SK)(e)}(0,i.useEffect)(()=>{H={}},[t]),(0,i.useEffect)(()=>()=>{Y({show:!1,path:""})},[]);const we=(0,h.Vs)(),ve=t=>{pe({open:!0,title:e("信息"),context_div:(0,D.jsxs)("div",{style:{maxWidth:"25rem"},children:[(0,D.jsx)(L.Yh,{left:e("挂载位置磁盘"),right:t?.total_size}),(0,D.jsx)(L.Yh,{left:`${e("磁盘剩余")}`,right:t?.left_size}),(0,D.jsx)(L.Yh,{left:`${e("文件系统")}`,right:t?.fs_type}),(0,D.jsx)(L.Yh,{left:`${e("文件夹数")}`,right:ue}),(0,D.jsx)(L.Yh,{left:`${e("文件数")}`,right:he}),(0,D.jsx)(L.Yh,{left:`${e("当前位置")}`,right:(0,D.jsx)(I.xP,{context:t?.now_absolute_path})})]}),cancel:()=>{G.ws.removeMsg(A.HK.file_info)}})};return(0,D.jsxs)(i.Fragment,{children:[k.length>0&&(0,D.jsx)(z.rA,{icon:"delete",title:e("删除"),onClick:()=>{j({show:!0,type:_.PromptEnum.FilesDelete,overlay:!0,data:{}})}}),k.length>0&&(0,D.jsx)(z.rA,{icon:"content_copy",title:e("复制"),onClick:function(){const e=(0,h.ib)(a,k);$(e.map(e=>(0,h.Ok)(e.name))),F([]),me("已复制")}}),k.length>0&&(0,D.jsx)(z.rA,{icon:"content_cut",title:e("剪切"),onClick:function(){const e=(0,h.ib)(a,k);F(e.map(e=>(0,h.Ok)(e.name))),$([]),me("已剪切")}}),(S.length>0||E.length>0)&&(0,D.jsx)(z.rA,{onClick:function(){j({show:!0,type:_.PromptEnum.Confirm,overlay:!0,data:{}})},icon:"content_paste",title:e("粘贴到此处"),tip:S.length+E.length}),k.length>0&&(0,D.jsx)(z.rA,{icon:"download",title:e("下载"),onClick:function(){const e=(0,h.ib)(a,k);for(let t=0;t<e.length;t++){const n=e[t];e[t]=encodeURIComponent((0,h.Ok)(n.name))}const t=r.$M.getDownloadUrl(e);window.open(t)}}),k.length>0&&(0,D.jsx)(z.rA,{icon:"compress",title:e("压缩"),onClick:function(){const t=(0,h.ib)(a,k);for(let e=0;e<t.length;e++){const n=t[e];t[e]=(0,h.Ok)(n.name)}t&&0!==t.length?j({show:!0,type:_.PromptEnum.Compress,overlay:!0,data:{files:t}}):(0,w.zN)(e("没有选中"))}}),1===k.length&&(0,D.jsx)(z.rA,{icon:"edit_attributes",title:e("重命名"),onClick:function(){j({show:!0,type:_.PromptEnum.FileRename,overlay:!0,data:{}})}}),ae&&(0,D.jsx)(z.rA,{icon:"api",title:"workflow",onClick:()=>{ie(!ne)}}),O.can_terminal&&(0,D.jsx)(z.rA,{icon:"terminal",title:"shell",onClick:function(){B.show?Y({show:!1,path:""}):Y({show:!0,path:(0,f.GG)("file",(0,f.vX)())})}}),s(b.oV.share_file)&&(0,D.jsx)(z.rA,{icon:"share",title:e("文件分享"),onClick:()=>{n(`${M.o.share_list_setting_page}`)}}),(0,D.jsx)(z.rA,{icon:"grid_view",title:e("切换样式"),onClick:we}),(0,D.jsx)(z.rA,{icon:"create_new_folder",title:e("创建文件夹"),onClick:function(){j({show:!0,type:_.PromptEnum.DirNew,overlay:!0,data:{dir:(0,f.GG)("file",(0,f.vX)())}})}}),(0,D.jsx)(z.rA,{icon:"note_add",title:e("创建文本文件"),onClick:function(){j({show:!0,type:_.PromptEnum.FileNew,overlay:!0,data:{dir:(0,f.GG)("file",(0,f.vX)())}})}}),(0,D.jsx)(z.rA,{icon:"upload_file",title:e("上传"),onClick:()=>{j({show:!0,type:_.PromptEnum.UploadFile,overlay:!0,data:{call:e=>{let t=e.currentTarget?.files;if(!t)return;let n=!!t[0].webkitRelativePath;const i=[],s=new Set;for(let e=0;e<t.length;e++){const o=t[e],a=n?o.webkitRelativePath:`${o.webkitRelativePath}${o.name}`;o.fullPath=a,n&&s.add((0,K.S)(a)),i.push(o)}const o=[];if(n)for(const e of s)o.push({isDir:!0,fullPath:e,name:e});o.push(...i),u(o),j({show:!0,type:_.PromptEnum.FilesUpload,overlay:!1,data:{}})}}})}}),(0,D.jsx)(z.rA,{icon:"info",title:e("信息"),onClick:async()=>{let e;if(!H.now_absolute_path){G.ws.addMsg(A.HK.file_info,t=>{const n=t.context;e&&(H={...H,...n},G.ws.removeMsg(A.HK.file_info),ve(H))});const t=await G.ws.sendData(A.HK.file_info,{type:m.Iw.folder,path:(0,f.GG)("file",(0,f.vX)())});e=t.context,H=e,ve(H)}ve(H)}}),(0,D.jsx)(z.rA,{icon:"more_vert",title:e("切换目录"),onClick:t=>{const i=new N.ik;i.x=t.clientX,i.y=t.clientY,i.type=m.Iw.directory,i.items=W,i.item_pre_value=V,i.textClick=async t=>{if(t.type===N.LU.add)return n(`${M.o.setting_private_env_setting}`),j({data:void 0,overlay:!1,type:"",show:!1}),void(0,w.N9)(e("请配置 文件夹路径"));j({data:void 0,overlay:!1,type:"",show:!1}),t.type!==N.LU.child?(async e=>{q(e),await r.$M.post("base_switch",{root_index:e}),await re(),n("/file/"),X([]),Z([])})(t.index):n((0,R.IO)(M.o.file,t.rel))},j({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:i})}})]})}var B=n(2543),Y=n(21499);const O=i.lazy(()=>Promise.all([n.e(7856),n.e(6349),n.e(3659)]).then(n.bind(n,63659))),W=i.lazy(()=>Promise.all([n.e(7856),n.e(1636)]).then(n.bind(n,81636))),T=i.lazy(()=>n.e(9857).then(n.bind(n,69857)));let V,q="";function J(){const[e,t]=(0,o.fp)(l.AG.editorSetting),[,n]=(0,o.fp)(l.AG.md_editor),[,w]=(0,o.fp)(l.AG.log_viewer),[,$]=(0,o.fp)(l.AG.image_editor),[,E]=(0,o.fp)(l.AG.markdown),[,I]=(0,o.fp)(l.AG.excalidraw_editor),[,F]=(0,o.fp)(l.AG.mind_editor),[,K]=(0,o.fp)(l.AG.timeline_editor),[,L]=(0,o.fp)(l.AG.excel_editor),[H,J]=(0,o.fp)(l.AG.file_preview),{t:Q}=(0,v.Bd)();let ee=(0,c.zy)();const te=(0,c.Zp)(),[ne,ie]=(0,o.fp)(l.AG.nowFileList),[se]=(0,o.fp)(l.AG.file_list_refresh),[oe]=(0,o.fp)(l.AG.mount_enabled),[ae,le]=(0,o.fp)(l.AG.current_mount),[re,ce]=(0,o.fp)(l.AG.showPrompt),[de,_e]=(0,o.fp)(l.AG.selectedFileList),[fe,pe]=(0,o.fp)(l.AG.clickFileList),[he,ue]=(0,o.fp)(l.AG.fileShellShow),[me,we]=(0,i.useState)(""),[ve,ge]=(0,o.fp)(l.AG.workflow_show),[xe,ye]=(0,o.fp)(l.AG.workflow_realtime_show),[je,ke]=(0,o.fp)(l.AG.work_flow_show),{initUserInfo:Ge}=(0,i.useContext)(g.F),[Ae,be]=(0,o.fp)(l.AG.user_base_info),{check_user_auth:Ce}=(0,x.MH)(),{click_file:Ne}=(0,h.kZ)(),[Se]=(0,c.ok)(),Me=(0,h._A)(),$e=i.useRef(null),[ze,Ee]=(0,o.fp)(l.AG.to_running_files),[Ie,De]=(0,o.fp)(l.AG.file_page),[Fe]=(0,o.fp)(l.AG.blank_search_mode),[,Pe]=(0,o.fp)(l.AG.prompt_card),[Re,Xe]=(0,o.fp)(l.AG.blank_search_mode_for_temp),Ke=(0,h.oT)(),Le="1"===Se.get("chat_open"),Ue=Ce(b.oV.ai_agent_page),He=(0,h.Cf)();(0,i.useEffect)(()=>{Ae?.user_data&&Le&&!Ue&&Ke("chat_open",null)},[Le,Ue,Ae]);const[Ze,Be]=(0,o.fp)(l.AG.studio_chat_width),Ye=i.useRef(null),[Oe,We]=(0,i.useState)(!1),[Te,Ve]=(0,i.useState)(void 0),qe=(0,h.dN)();(0,h.rJ)(qe());const[Je,Qe]=(0,o.fp)(l.AG.ai_chat_session_by_cwd),et=function(){const e=(0,h.Cf)(),[t,n]=(0,o.fp)(l.AG.user_base_info),{t:s}=(0,v.Bd)(),{check_user_auth:a}=(0,x.MH)(),[d,p]=(0,o.fp)(l.AG.router_jump),u=(0,c.Zp)(),{initUserInfo:w}=(0,i.useContext)(g.F),[y,j]=(0,o.fp)(l.AG.nowFileList),[k,C]=(0,o.fp)(l.AG.showPrompt),[S,$]=(0,o.fp)(l.AG.fileShellShow),[z,E]=(0,o.fp)(l.AG.blank_search_mode);return n=>{n.preventDefault(),n.stopPropagation();const i=new N.ik;i.x=n.clientX,i.y=n.clientY,i.type=m.Iw.directory;const o=[{r:(0,D.jsx)("span",{style:(0,U.ok)(t.user_data.dir_show_type===b.t8.time_minx_max),children:s("时间逆序")}),v:b.t8.time_minx_max},{r:(0,D.jsx)("span",{style:(0,U.ok)(t.user_data.dir_show_type===b.t8.time_max_min),children:s("时间顺序")}),v:b.t8.time_max_min}],l=[{r:(0,D.jsx)("span",{style:(0,U.ok)(t.user_data.dir_show_type===b.t8.size_min_max),children:s("大小顺序")}),v:b.t8.size_min_max},{r:(0,D.jsx)("span",{style:(0,U.ok)(t.user_data.dir_show_type===b.t8.size_max_min),children:s("大小逆序")}),v:b.t8.size_max_min}],c=[{r:(0,D.jsx)("span",{style:(0,U.ok)(!t.user_data.file_list_pagination_mode||t.user_data.file_list_pagination_mode===b.yM.all),children:s("全部加载文件")}),v:b.yM.all},{r:(0,D.jsx)("span",{style:(0,U.ok)(t.user_data.file_list_pagination_mode===b.yM.pagination),children:s("scrll_l")}),v:b.yM.pagination}],d=[{r:(0,D.jsx)("span",{style:(0,U.ok)(!t.user_data.file_time_show_type||t.user_data.file_time_show_type===b.KD.current),children:s("最近时间")}),v:b.KD.current},{r:(0,D.jsx)("span",{style:(0,U.ok)(t.user_data.file_time_show_type===b.KD.time),children:s("准确时间")}),v:b.KD.time}],v=[{r:s("文件列表展示"),items:[{r:s("文件排序"),v:"",items:[{r:(0,D.jsx)("span",{style:(0,U.ok)(!t.user_data.dir_show_type),children:s("系统默认")}),v:b.t8.defualt},{r:(0,D.jsx)("span",{style:(0,U.ok)(t.user_data.dir_show_type===b.t8.name),children:s("名字")}),v:b.t8.name},{r:(0,D.jsx)("span",{style:(0,U.ok)(t.user_data.dir_show_type===b.t8.time_minx_max||t.user_data.dir_show_type===b.t8.time_max_min),children:s("修改时间")}),v:!1,items:o},{r:(0,D.jsx)("span",{style:(0,U.ok)(t.user_data.dir_show_type===b.t8.size_min_max||t.user_data.dir_show_type===b.t8.size_max_min),children:s("文件大小")}),v:!1,items:l}]},{r:s("文件加载方式"),v:"",items:c},{r:s("时间展示"),v:"",items:d},{r:s("缩放调整"),v:"zoom_adjust"},{r:(0,D.jsx)("span",{style:(0,U.ok)(z),children:s("srchbln")}),v:"blank_search_mode"}]}];e.git_available&&y?.folders?.find(e=>".git"===e.name)&&v.push({r:s("查看Git提交"),v:"git_page"}),a(b.oV.code_resource)&&v.push({r:s("add_rot"),v:"code_resource"}),a(b.oV.http_proxy)&&v.push({r:s("dl_here"),v:"http_resource"}),t?.user_data?.quick_cmd&&(0,h.LL)([...t.user_data.quick_cmd],v),i.items=v,i.textClick=async e=>{if(console.log(e),!1===e)return;const t={};if("gcfg_dir_config"===e){const e=(0,f.GG)("file",(0,f.vX)());return C({data:void 0,overlay:!1,type:"",show:!1}),void u(`${M.o.gcfg_page}/${encodeURIComponent(e)}`)}if("git_page"===e){const e=(0,f.GG)("file",(0,f.vX)());return C({data:void 0,overlay:!1,type:"",show:!1}),void u(`${M.o.git_page}/${encodeURIComponent(e)}`)}if("code_resource"===e){const e=await G.ws.sendData(A.HK.file_info,{path:(0,f.GG)("file",(0,f.vX)())});return p({page_self_router_api_data:[`/api/${Date.now()}`,e.context.now_absolute_path]}),C({data:void 0,overlay:!1,type:"",show:!1}),void u("/setting/customer_router/")}if("http_resource"===e){const e=await G.ws.sendData(A.HK.file_info,{path:(0,f.GG)("file",(0,f.vX)())});return p({http_download_map_path:e.context.now_absolute_path}),C({data:void 0,overlay:!1,type:"",show:!1}),void u("/proxy/http/")}if("zoom_adjust"===e)return C({data:void 0,overlay:!1,type:"",show:!1}),void setTimeout(()=>{C({show:!0,type:_.PromptEnum.ZoomAdjust,overlay:!1,data:{}})},0);if("object"==typeof e&&"quick_cmd"===e.tag){let t=e.cmd;t&&(t.endsWith("\r")||(t+="\r",$({show:!0,path:(0,f.GG)("file",(0,f.vX)()),cmd:t})))}else{if("blank_search_mode"===e)return E(!z),void C({data:void 0,overlay:!1,type:"",show:!1});if(e===b.yM.all||e===b.yM.pagination)t.is_pagination_mode=!0;else if(e===b.KD.current||e===b.KD.time)t.is_file_show_type=!0;else{if(e!==b.t8.defualt&&e!==b.t8.name&&e!==b.t8.size_max_min&&e!==b.t8.size_min_max&&e!==b.t8.time_max_min&&e!==b.t8.time_minx_max)return;t.is_dir_list_type=!0}}await r.wm.post(X.s.user_save_private_attr,{type:e,...t}),await w(),C({data:void 0,overlay:!1,type:"",show:!1}),u((0,f.vX)())},C({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:i})}}(),tt=async e=>{let t=!1;for(const n of e.files??[])n.origin_size=n.size,n.size=(0,y.v7)(n.size),Ae.user_data.file_time_show_type===b.KD.time?n.show_mtime=n.mtime?(0,Y.Yq)(n.mtime):"":n.show_mtime=n.mtime?(0,j.s)(n.mtime):"",t||!n.name.endsWith(".workflow.yml")&&!n.name.endsWith(".act")||(t=!0),n.name===k.SB&&(t=!0);for(const n of e.folders??[])Ae.user_data.file_time_show_type===b.KD.time?n.show_mtime=n.mtime?(0,Y.Yq)(n.mtime):"":n.show_mtime=n.mtime?(0,j.s)(n.mtime):"",n.name===k.SB&&(t=!0);ke(t)},nt=i.useRef(null),it=async e=>{if(!0===oe){if(nt.current!==e){nt.current=e;try{const t=await r.$M.post("file/mount_info",{param_path:e});le(t?.data??null),await G.ws.connect()}catch(e){le(null)}}}else le(null)};(0,i.useEffect)(()=>{je&&(async()=>{const e=new k.Nd,t=(0,a.zp)().get(l.AG.current_mount);e.dir_path=(0,h.Zl)((0,f.GG)("file",(0,f.vX)()),t),G.ws.addMsg(A.HK.workflow_realtime,e=>{const t=e.context;if(e.context){for(const e of t.sucess_file_list)(0,h.Ys)(e);for(const e of t.failed_file_list)(0,h.V$)(e);Ee(new Set(t.running_file_list))}}),await G.ws.sendData(A.HK.workflow_realtime,e)})()},[je,ae,ee]);const st=async()=>{const e=(0,f.GG)("file",(0,f.vX)());if(Fe||Re)return;let t;if(it(e),Ae.user_data.file_list_pagination_mode===b.yM.pagination){if(q!==e){if(q=e,1!==Ie.page_num)return void De({page_size:Ie.page_size,page_num:1})}else if(Ie.page_num<0)return;if(t=await r.$M.post("file_get_page",{param_path:e,page_num:Ie.page_num,page_size:Ie.page_size}),t.code!==p.m.Success)return;const n=t.data;return tt(n),n.files?.length?(ie(e=>{const t=(0,B.cloneDeep)(1===Ie.page_num?n.files:[...e?.files??[],...n.files]),i={...e,files:t};return(0,h.yC)(i,Ae.user_data.dir_show_type),i}),void(V=t.data)):void De({page_size:Ie.page_size,page_num:-1})}if(t=await r.$M.get(e),t.code!==p.m.Success)return;const n=t.data;(0,h.yC)(n,Ae.user_data.dir_show_type),tt(t.data),ie(t.data),V=t.data};(0,i.useEffect)(()=>async()=>{Ee(new Set)},[]);const ot=()=>{ke(!1),(()=>{const e=Se.get("preview_file_name"),t=Se.get("preview_mode");if(!e||!t)return!1;const i=(0,f.GG)("file",(0,f.vX)());if($e.current===i+e)return!0;$e.current=i+e;const s=()=>Me(null);return"md"===t?(n({url:r.$M.getDownloadUrl(`${encodeURIComponent(i)}${e}`),path:`${i}${e}`,name:e,close:s}),!0):"log"===t?(w({show:!0,fileName:e,encoding:Se.get("preview_log_enc")??"utf8",wrap:Se.get("preview_log_wrap")??"wrap",close:s}),!0):"image_edit"===t?($({path:(0,R.IO)((0,f.vX)(),e),name:e,close:s}),!0):(Ne({name:e,opt_shell:!0,..."text"===t?{model:"text"}:{},close:s}),!0)})()||(t({open:!1}),J({open:!1}),n({}),w({show:!1}),$({}),E({}),I({}),F({}),K({}),L({}),st())};(0,i.useEffect)(()=>{ot()},[ee,Ie]),(0,i.useEffect)(()=>{se>0&&st()},[se]);const at=i.useRef(!1);(0,i.useEffect)(()=>{if(null!==oe)return at.current?void(!0===oe?it((0,f.GG)("file",(0,f.vX)())):le(null)):(at.current=!0,void(!0===oe&&null===ae&&it((0,f.GG)("file",(0,f.vX)()))))},[oe]);const lt=e=>{e.target===e.currentTarget&&(_e([]),pe([]))},rt=i.useCallback((0,B.throttle)(e=>{const t=Ye.current;if(!t||!t.parentElement)return;const n=parseFloat(getComputedStyle(t).fontSize),i=t.parentElement.getBoundingClientRect(),s=i.right-e.clientX,o=Math.min(Math.max(s,320),.7*i.width);Be(parseFloat((o/n).toFixed(2)))},32),[]),ct=()=>{We(!1),document.removeEventListener("pointermove",rt)},dt=(0,D.jsxs)("div",{className:"file-list-main",children:[(0,D.jsx)(s.e,{baseRoute:"file",clickFun:function(){if(_e([]),pe([]),Ae.user_data.file_list_pagination_mode===b.yM.pagination){const e=document.getElementById("listing");e&&(e.scrollTop=0),De({page_size:Ie.page_size,page_num:1})}},input_path_enter:e=>{var t;_e([]),pe([]),ie({files:[],folders:[]}),(0,C.Z1)(e)?(e=e.replace(0===(t=Ae.user_data).folder_item_now||void 0===t.folder_item_now?t.cwd:t.folder_items[t.folder_item_now-1].path,""),te(e)):te((0,C.Jn)((0,f.vX)(),e))}}),ae&&(0,D.jsxs)("div",{className:"mount-tip-bar",style:{borderLeftColor:ae.color},children:[(0,D.jsx)("span",{className:"material-icons",style:{color:ae.color},children:"cloud"}),(0,D.jsx)("span",{children:[{v:ae.driver,t:Q("驱动")},{v:ae.credential_note,t:Q("凭据")},{v:ae.account_note,t:Q("账号")}].filter(e=>Boolean(e.v)).map(e=>`${e.v}(${e.t})`).join(" - ")}),ae.readonly&&(0,D.jsx)("span",{className:"mount-readonly-tag",children:Q("只读")})]}),Ae.user_data.file_list_pagination_mode===b.yM.pagination?(0,D.jsx)(S.$J,{handleContextMenu:et,clickBlank:lt,list:ne.files}):(0,D.jsx)(S.t$,{handleContextMenu:et,file_list:ne.files,folder_list:ne.folders,clickBlank:lt})]});return(0,D.jsxs)(i.Fragment,{children:[(0,D.jsx)(d.aZ,{children:(0,D.jsx)(u.$Z,{handleEnterPress:async()=>{if(Fe||Re){if(_e([]),pe([]),!me||!me.trim())return void ie({files:[],folders:[]});const e=(0,f.GG)("file",(0,f.vX)()),t=await r.$M.post("file_get_page",{param_path:e,page_num:1,page_size:1e4,search:me.trim()});if(t.code!==p.m.Success)return;const n=t.data;return(0,h.yC)(n,Ae.user_data.dir_show_type),tt(n),ie(n),void(V=n)}if(!V)return;_e([]),pe([]);const e=[],t=[];for(const t of V.files??[])t.name.includes(me)&&e.push(t);for(const e of V.folders??[])e.name.includes(me)&&t.push(e);ie({files:e,folders:t})},placeholder:Q("搜索当前目录"),icon:"search",value:"",mobile_hidden:!0,handleIconClick:()=>{const e=(0,f.GG)("file",(0,f.vX)());Pe({open:!0,title:Q("深搜"),context_div:(0,D.jsx)(P,{base_path:e})})},handleInputChange:e=>{we(e)},max_width:"25em"})}),(0,D.jsxs)(d.aZ,{position:"right",children:[Ce(b.oV.ai_agent_page)&&He.ai_chat_available&&(0,D.jsx)(z.rA,{icon:"smart_toy",title:Q("AI 聊天"),selected:Le,onClick:()=>Ke("chat_open",!Le?"1":null)}),(0,D.jsx)("div",{className:"mobile-context-btn",children:(0,D.jsx)(z.rA,{icon:"more_horiz",title:Q("右键"),onClick:()=>{const e=de[de.length-1];if(void 0!==e){const t=[...ne.folders??[],...ne.files??[]][e];if(t){const n=document.querySelectorAll(".item")[e],i=n?n.getBoundingClientRect():{left:window.innerWidth/2,bottom:100},s={preventDefault:()=>{},stopPropagation:()=>{},clientX:i.left+10,clientY:i.bottom??100},o=new N.ik;o.path=(0,R.IO)((0,f.vX)(),t.name),o.filename=t.name,o.x=s.clientX,o.y=s.clientY,o.type=t.type===m.Iw.folder?m.Iw.folder:(0,N.uL)(t.name),o.size=t.origin_size,ce({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:o})}}else{const e={preventDefault:()=>{},stopPropagation:()=>{},clientX:window.innerWidth/2,clientY:window.innerHeight/2};et(e)}}})}),(0,D.jsx)(Z,{})]}),(0,D.jsxs)("div",{className:"file-list-split"+(Le?" file-list-split--chat":""),children:[dt,Le&&(0,D.jsxs)(i.Fragment,{children:[(0,D.jsx)("div",{className:"studio__divider studio__divider--chat",ref:Ye,onPointerDown:e=>{e.preventDefault(),We(!0),document.addEventListener("pointermove",rt),document.addEventListener("pointerup",ct,{once:!0})}}),(0,D.jsx)("div",{className:"studio-chat-panel",style:{width:`${Ze}em`},children:(0,D.jsx)(i.Suspense,{fallback:null,children:(0,D.jsx)(T,{inline_header:!0,sync_url:!1,file_cwd_path:qe(),session_id:Te??(_t=qe(),l.AG.get_ai_chat_session(Je,_t)),on_session_change:e=>{Ve(e),((e,t)=>{Qe({...Je,[e]:t})})(qe(),e)}})})})]})]}),Oe&&(0,D.jsx)("div",{className:"shell__overlay",onPointerUp:ct}),ve&&(0,D.jsx)(O,{}),xe.open&&(0,D.jsx)(W,{})]});var _t}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[3659],{22081(e,n,t){t.d(n,{A:()=>r});var s=t(96540),a=t(16349),i=t(74848);const r=({percentage:e})=>{const n=(0,s.useRef)(null),[t,r]=(0,s.useState)(null);return(0,s.useEffect)(()=>{const t=n.current.getContext("2d"),s=new a.Ay(t,{type:"doughnut",data:{labels:["use","left"],datasets:[{data:[e,100-e],backgroundColor:["#007bff","#f0f0f0"],borderWidth:0}]},options:{plugins:{legend:{display:!1},tooltip:{enabled:!1}},elements:{arc:{borderWidth:0}}}});return r(s),()=>{s.destroy()}},[]),(0,s.useEffect)(()=>{t&&(t.data.datasets[0].data=[e,100-e],t.update())},[e]),(0,i.jsx)("div",{style:{width:"8rem",overflow:"hidden"},children:(0,i.jsx)("canvas",{ref:n})})}},88062(e,n,t){t.d(n,{A:()=>r});t(96540),t(47022);var s=t(74848);function a(e){return(0,s.jsx)("div",{className:"black-tip",onClick:()=>{e.click&&e.click(e)},onContextMenu:n=>{n.stopPropagation(),n.nativeEvent.stopImmediatePropagation(),e.onContextMenu&&e.onContextMenu(n,e)},children:e.name})}const i=e=>(0,s.jsxs)("li",{children:[e.click?(0,s.jsx)(a,{...e.node,name:e.render?e.render(e.node):e.node.name,click:e.click,onContextMenu:e.onContextMenu}):(0,s.jsx)("div",{children:e.render?e.render(e.node):e.node.name}),e.node.children&&e.node.children.length>0&&(0,s.jsx)("ul",{children:e.node.children.map((n,t)=>(0,s.jsx)(i,{node:n,click:e.click,onContextMenu:e.onContextMenu,render:e.render},t))})]}),r=e=>(0,s.jsx)("div",{className:"card-tree-view",children:(0,s.jsx)("ul",{children:e.list&&e.list.map((n,t)=>(0,s.jsx)(i,{node:n,click:e.click,onContextMenu:e.onContextMenu,render:e.render},t))})})},63659(e,n,t){t.r(n),t.d(n,{default:()=>N});var s=t(22022),a=t(96540),i=t(34843),r=t(82893),o=t(92275),d=t(14944),c=(t(14284),t(70447)),l=t(85997),u=t(62042),x=t(4412),h=t(75725),p=(t(22081),t(77481)),j=t(61443),m=t(47071),f=t(99214),w=t(88062),_=t(97856),g=t(88815),v=t(15629),k=t(74848);const y=a.lazy(()=>t.e(3233).then(t.bind(t,85614)));let b,C,S=-1;function N(e){const{t:n}=(0,s.Bd)(),t=(0,f.Du)(),[N,M]=(0,i.fp)(r.AG.workflow_show),[A,F]=(0,a.useState)([]),[E,W]=(0,a.useState)([]),[P,q]=(0,a.useState)(!1),[z,B]=(0,a.useState)(void 0),[I,J]=(0,a.useState)([]),[$,D]=(0,a.useState)(-1),[O,H]=(0,a.useState)(10),[K,Z]=(0,a.useState)(0),[T,V]=(0,a.useState)(0),[X,Y]=(0,a.useState)(""),[G,R]=(0,a.useState)(!1),L=[n("序号"),n("运行名称"),n("状态"),n("运行时长"),n("日期"),n("操作")],Q=[n("名称"),n("状态"),n("cwd"),n("运行时长"),n("操作")],U=async e=>{const n=new m._;n.page_num=e??$,n.page_size=O,n.dir_path=t;const s=await d.ws.sendData(o.HK.workflow_get,n);if(!s)return;const a=s.context;a&&(F(a.list.map(e=>{const n="string"==typeof e.meta?JSON.parse(e.meta):e.meta;return n.index=e.index,n})),Z(a.total),V((0,g.gw)(a.total,O)))};(0,a.useEffect)(()=>(q(!1),b=void 0,C=void 0,S=-1,U(),async()=>{C&&(C.dispose(),C=null)}),[]);const ee=async e=>{const n=e.steps,t=[];(0,v.Y)(t,n??[]),J(t)},ne=async e=>{C||await new Promise(e=>{b=e,q(!0),(async()=>{const e=new _.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:"#000000",cursor:"#000000",selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4,convertEol:!0});C=e,B(e)})()}),e&&(C.reset(),C.write(e))};return(0,k.jsxs)("div",{children:[(0,k.jsxs)(x.aZ,{position:"right",children:[z&&(0,k.jsx)(l.rA,{icon:"print",title:"打印日志",onClick:()=>{q(!P)}}),(0,k.jsx)(l.rA,{icon:"close",title:n("关闭"),onClick:()=>{M(!1)}})]}),(0,k.jsx)(h.jW,{isFull:!0,more:!0,children:(0,k.jsx)(h.NN,{children:(0,k.jsx)(h.xh,{children:(0,k.jsxs)(h.fI,{children:[(0,k.jsx)(h.VP,{children:(0,k.jsx)(c.uF,{self_title:(0,k.jsx)("span",{className:" div-row ",children:(0,k.jsx)("h2",{children:n("历史记录")})}),rightTopCom:(0,k.jsx)("div",{className:" div-row ",children:(0,k.jsx)(j.Sm,{disabled:G,value:X,placeholder:"搜索运行名称(支持正则)",handleInputChange:e=>{Y(X)},handlerEnter:e=>{(async e=>{const n=new m._;n.search_name=e,n.dir_path=t,R(!0);const s=await d.ws.sendData(o.HK.workflow_search_by_run_name,n);if(!s)return;const a=s.context;F(a.list.map(e=>{const n="string"==typeof e.meta?JSON.parse(e.meta):e.meta;return n.index=e.index,n})),Z(a.total),V((0,g.gw)(a.total,O)),D(0),R(!1)})(e)}})}),rightBottomCom:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsxs)("span",{children:[Math.abs($),"/",T]}),(0,k.jsx)(j.Sm,{placeholder:`max page ${T}`,handleInputChange:e=>{S=parseInt(e)},handlerEnter:()=>{if(S<1||S>T)return void(0,u.zN)("illegal page num");const e=0-S;D(e),U(e)}}),(0,k.jsx)(l.rA,{icon:"navigate_before",onClick:()=>{const e=$+1;e>-1?(0,u.zN)("max page num"):(D(e),U(e))},title:"上一页"}),(0,k.jsx)(l.rA,{icon:"navigate_next",onClick:()=>{const e=$-1;Math.abs(e)>T?(0,u.zN)("min page num"):(D(e),U(e))},title:"下一页"})]}),children:(0,k.jsx)(p.X,{headers:L,rows:A.map((e,s)=>{let a;a=e.is_running?(0,k.jsxs)("div",{children:[(0,k.jsx)(c.fq,{}),n("正在运行")]}):(0,k.jsxs)("div",{children:[(0,k.jsx)(c.fq,{success:e.is_success}),e.is_success?n("成功"):n("失败")]});const i=[(0,k.jsx)("p",{children:e.index}),(0,k.jsx)("p",{style:{wordWrap:"break-word"},children:e["run-name"]}),a,(0,k.jsx)("span",{children:e.duration}),(0,k.jsx)("span",{children:e.timestamp}),(0,k.jsx)("div",{children:(0,k.jsx)(l.rA,{icon:"details",title:n("详情"),onClick:()=>{(async e=>{if(e.is_running)return;J([]);const n=new m._;n.index=e.index,n.dir_path=t;const s=(await d.ws.sendData(o.HK.workflow_get,n)).context,a="string"==typeof s.one_data.data?JSON.parse(s.one_data.data):s.one_data.data;W(a.all_jobs)})(e)}})})];return i}),width:"10rem"})})}),(0,k.jsxs)(h.VP,{children:[(0,k.jsx)(c.Zp,{title:n("Job"),children:(0,k.jsx)(p.X,{headers:Q,rows:E.map((e,t)=>[(0,k.jsx)("p",{children:e.name}),(0,k.jsx)(v.W,{item:e}),(0,k.jsx)(c.xP,{children:String(e.cwd)}),(0,k.jsx)("span",{children:e.duration}),(0,k.jsxs)("div",{children:[(0,k.jsx)(l.rA,{icon:"details",title:n("详情"),onClick:()=>{ee(e)}}),!!e.message&&(0,k.jsx)(l.rA,{icon:"print",title:n("日志"),onClick:()=>{ne(e.message)}})]})]),width:"10rem"})}),(0,k.jsx)(c.Zp,{title:"Step",children:(0,k.jsx)(w.A,{list:I,click:e=>{(async e=>{if(e?.extra_data?.is_job)await ee(e.extra_data.job_data);else if(e?.extra_data?.context)ne(e.extra_data.context);else{if(!e?.extra_data.code)return;ne(e.extra_data.code??"")}})(e)}})})]})]})})})}),(0,k.jsx)("div",{style:{display:P?"":"none"},children:(0,k.jsx)(y,{show:!0,terminal:z,init:()=>{b&&(b(1),b=void 0)}})})]})}},15629(e,n,t){t.d(n,{W:()=>o,Y:()=>d});t(96540);var s=t(70447),a=t(47071),i=t(22022),r=t(74848);function o({item:e}){const{t:n}=(0,i.Bd)();let t,o;return null!=e.code?t=0===e.code:e.extra_data?.running_type===a.rl.running&&(o=!0),(0,r.jsxs)("div",{children:[(0,r.jsx)(s.fq,{success:t,running:o}),n(t?"成功":"失败")]})}const d=(e,n,t)=>{if(n)for(const t of n??[]){let n;const a=[];t["use-yml"]?(d(a,void 0,t.use_job_children_list),n=`${t["use-yml"]} ;${t.duration??-1}`):t.runs?n=JSON.stringify(t.runs):t.run?n=t.run:t["run-js"]?n=t["run-js"]:t.sleep&&(n=`sleep ${t.sleep}`),n=(0,r.jsxs)("div",{children:[(0,r.jsx)(s.fq,{success:void 0===t.code?void 0:0===t.code})," ",n+" ;"+(t.duration??"")]}),e.push({name:n,children:a,extra_data:{code:t.code,context:t.message}})}else if(t)for(const n of t??[]){const t=(0,r.jsxs)("div",{children:[(0,r.jsx)(s.fq,{success:void 0===n.code?void 0:0===n.code}),"$",n.name]});e.push({name:t,extra_data:{code:n.code,is_job:!0,job_data:n}})}}}}]);
|