@customize-agent/server 4.0.10 → 4.0.12

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.
Files changed (36) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +5 -5
  3. package/.next/prerender-manifest.json +3 -3
  4. package/.next/server/chunks/8204.js +1 -1
  5. package/.next/server/middleware-build-manifest.js +1 -1
  6. package/.next/server/pages/404.html +1 -1
  7. package/.next/server/pages/500.html +1 -1
  8. package/.next/server/pages/api/system/stats.js +1 -1
  9. package/.next/server/pages/api/system/stats.js.nft.json +1 -1
  10. package/.next/server/pages/asset-library.html +1 -1
  11. package/.next/server/pages/context/long-term.html +1 -1
  12. package/.next/server/pages/context/short-term.html +1 -1
  13. package/.next/server/pages/document-roles.html +1 -1
  14. package/.next/server/pages/document-specs.html +1 -1
  15. package/.next/server/pages/documents.html +1 -1
  16. package/.next/server/pages/guide.html +1 -1
  17. package/.next/server/pages/index.html +1 -1
  18. package/.next/server/pages/knowledge/file-detail.html +1 -1
  19. package/.next/server/pages/knowledge/files.html +1 -1
  20. package/.next/server/pages/knowledge/manage.html +1 -1
  21. package/.next/server/pages/knowledge/search.html +1 -1
  22. package/.next/server/pages/knowledge.html +1 -1
  23. package/.next/server/pages/models.html +1 -1
  24. package/.next/server/pages/overview.html +1 -1
  25. package/.next/server/pages/prompt.html +1 -1
  26. package/.next/server/pages/settings.html +1 -1
  27. package/.next/server/pages/system/logs.html +1 -1
  28. package/.next/server/pages-manifest.json +26 -26
  29. package/.next/static/{N1APvXKipcJdC0lz0_Wk4 → _7Cb4Q9IXzO8TEjTLJuqZ}/_buildManifest.js +1 -1
  30. package/.next/static/chunks/pages/{_app-e38deed037bfbced.js → _app-57ea5987913f2159.js} +1 -1
  31. package/.next/static/chunks/pages/knowledge/files-6be31deb582a6bdf.js +1 -0
  32. package/.next/static/chunks/pages/overview-28c7ceeca56e6a78.js +1 -0
  33. package/package.json +2 -2
  34. package/.next/static/chunks/pages/knowledge/files-89be3ee05e817c55.js +0 -1
  35. package/.next/static/chunks/pages/overview-380088496f0dae68.js +0 -1
  36. /package/.next/static/{N1APvXKipcJdC0lz0_Wk4 → _7Cb4Q9IXzO8TEjTLJuqZ}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[449],{27795:(e,l,s)=>{"use strict";s.r(l),s.d(l,{default:()=>_});var t=s(65321),r=s(97109),i=s(79059),o=s(33442),n=s(85114),c=s(2256),a=s(38770),d=s(68787),x=s(99605),v=s(54849),u=s(11702),h=s(99811),m=s(520),j=s(93314),A=s(13114),y=s(29071),p=s(26631),g=s(84742),f=s(38762),k=s(8579),w=s(9020),S=s(32632),z=s(95118),N=s(24810),T=s(6578);function _(){var e,l,s,_,P,O,b,C,D,E,M,F,I,B,W,U,X,L;let R=(0,i.Vr)(),[V,Z]=(0,r.useState)(null),[q,G]=(0,r.useState)(!0),[H,J]=(0,r.useState)(0),[K,Q]=(0,r.useState)(0),[Y,$]=(0,r.useState)(0),[ee,el]=(0,r.useState)(0),[es,et]=(0,r.useState)(0),[er,ei]=(0,r.useState)(null),eo=(0,r.useCallback)(async()=>{G(!0);try{let[e,l,s,t,r,i]=await Promise.all([(0,T.FC)(),(0,T.Z3)().catch(()=>[]),(0,T.lv)().catch(()=>({roles:[],configs:[]})),(0,T.mx)().catch(()=>({specs:[]})),(0,T.Dl)().catch(()=>({templates:[]})),(0,T.II)().catch(()=>null)]);Z(e),J(Array.isArray(l)?l.length:0);let o=Array.isArray(s.roles)?s.roles:[];Q(o.filter(e=>"file"===e.type).length),$(o.filter(e=>"prompt"===e.type).length),el(Array.isArray(t.specs)?t.specs.length:0),et(Array.isArray(r.templates)?r.templates.length:0),ei(i)}catch(e){}finally{G(!1)}},[]);(0,r.useEffect)(()=>{eo();let e=setInterval(()=>{eo()},1e4);return()=>clearInterval(e)},[eo]);let en=(null!=(l=null==V?void 0:V.cpu.usagePercent)?l:0)>80?"var(--colorDanger)":(null!=(s=null==V?void 0:V.cpu.usagePercent)?s:0)>50?"var(--colorWarning)":"var(--colorOk)",ec=(null!=(_=null==V?void 0:V.memory.usagePercent)?_:0)>80?"var(--colorDanger)":(null!=(P=null==V?void 0:V.memory.usagePercent)?P:0)>50?"var(--colorWarning)":"var(--colorOk)",ea=(null==V?void 0:V.tasks.total)?Math.round(V.tasks.success/V.tasks.total*100):0,ed=null==V||null==(e=V.models)?void 0:e[0],ex=(null==V?void 0:V.logs.latestAt)?new Date(V.logs.latestAt).toLocaleString():"暂无日志";return(0,t.jsxs)("div",{className:"space-y-6 animateFadeIn",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"pageTitle",children:R("overview.title")}),(0,t.jsx)("p",{className:"pageDesc",children:R("overview.description")})]}),(0,t.jsxs)(o.A,{children:[(0,t.jsxs)("span",{style:{color:"var(--colorTextSecondary)",fontSize:12},children:["统计更新:",ex]}),(0,t.jsx)(n.Ay,{icon:(0,t.jsx)(h.A,{spin:q}),loading:q,onClick:()=>{eo()},children:R("common.retry")})]})]}),(0,t.jsxs)(c.A,{gutter:[16,16],children:[(0,t.jsx)(a.A,{xs:24,sm:12,children:(0,t.jsx)(d.A,{size:"small",title:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m.A,{})," CPU"]}),children:(0,t.jsxs)("div",{style:{textAlign:"center"},children:[(0,t.jsx)(x.A,{type:"circle",percent:null!=(O=null==V?void 0:V.cpu.usagePercent)?O:0,size:120,strokeColor:en,format:e=>"".concat(null==e?void 0:e.toFixed(1),"%")}),(0,t.jsxs)("div",{className:"text-xs mt-2",style:{color:"var(--colorTextSecondary)"},children:[null!=(b=null==V?void 0:V.cpu.cores)?b:0," ",R("overview.cores")]})]})})}),(0,t.jsx)(a.A,{xs:24,sm:12,children:(0,t.jsx)(d.A,{size:"small",title:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.A,{})," ",R("overview.memory")]}),children:(0,t.jsxs)("div",{style:{textAlign:"center"},children:[(0,t.jsx)(x.A,{type:"circle",percent:null!=(C=null==V?void 0:V.memory.usagePercent)?C:0,size:120,strokeColor:ec,format:e=>"".concat(e,"%")}),(0,t.jsxs)("div",{className:"text-xs mt-2",style:{color:"var(--colorTextSecondary)"},children:[null!=(D=null==V?void 0:V.memory.processMB)?D:0," MB / ",null!=(E=null==V?void 0:V.memory.totalMB)?E:0," MB"]})]})})})]}),(0,t.jsxs)(c.A,{gutter:[16,16],children:[(0,t.jsx)(a.A,{xs:12,sm:6,children:(0,t.jsx)(d.A,{size:"small",children:(0,t.jsx)(v.A,{title:"运行时间",value:V?Math.floor(V.uptime/3600):0,suffix:"小时",prefix:(0,t.jsx)(A.A,{})})})}),(0,t.jsx)(a.A,{xs:12,sm:6,children:(0,t.jsxs)(d.A,{size:"small",children:[(0,t.jsx)(v.A,{title:R("overview.tokensUsed"),value:null!=(M=null==V?void 0:V.tokens.total)?M:0,prefix:(0,t.jsx)(y.A,{})}),(0,t.jsxs)("div",{style:{color:"var(--colorTextSecondary)",fontSize:12},children:["Prompt ",null!=(F=null==V?void 0:V.tokens.prompt)?F:0," / Completion ",null!=(I=null==V?void 0:V.tokens.completion)?I:0]})]})}),(0,t.jsx)(a.A,{xs:12,sm:6,children:(0,t.jsxs)(d.A,{size:"small",children:[(0,t.jsx)(v.A,{title:R("overview.tasksTotal"),value:null!=(B=null==V?void 0:V.tasks.total)?B:0,prefix:(0,t.jsx)(p.A,{})}),(0,t.jsxs)("div",{style:{color:"var(--colorTextSecondary)",fontSize:12},children:["成功 ",null!=(W=null==V?void 0:V.tasks.success)?W:0," / 失败 ",null!=(U=null==V?void 0:V.tasks.failed)?U:0," / 运行中 ",null!=(X=null==V?void 0:V.tasks.running)?X:0]})]})}),(0,t.jsx)(a.A,{xs:12,sm:6,children:(0,t.jsx)(d.A,{size:"small",children:(0,t.jsx)(v.A,{title:R("overview.successRate"),value:ea,suffix:"%",prefix:ea>80?(0,t.jsx)(g.A,{style:{color:"var(--colorOk)"}}):(0,t.jsx)(f.A,{style:{color:"var(--colorDanger)"}})})})})]}),(0,t.jsx)(d.A,{size:"small",title:"资源概览",children:(0,t.jsxs)(c.A,{gutter:[16,16],children:[(0,t.jsx)(a.A,{xs:24,sm:12,md:8,lg:4,children:(0,t.jsx)(d.A,{size:"small",style:{height:"100%"},children:(0,t.jsx)(v.A,{title:"文件角色",value:K,prefix:(0,t.jsx)(p.A,{style:{color:"var(--colorAccent)"}})})})}),(0,t.jsx)(a.A,{xs:24,sm:12,md:8,lg:4,children:(0,t.jsx)(d.A,{size:"small",style:{height:"100%"},children:(0,t.jsx)(v.A,{title:"提示词角色",value:Y,prefix:(0,t.jsx)(k.A,{style:{color:"var(--colorWarning)"}})})})}),(0,t.jsx)(a.A,{xs:24,sm:12,md:8,lg:4,children:(0,t.jsx)(d.A,{size:"small",style:{height:"100%"},children:(0,t.jsx)(v.A,{title:"文档规范包",value:ee,prefix:(0,t.jsx)(w.A,{style:{color:"var(--colorOk)"}})})})}),(0,t.jsx)(a.A,{xs:24,sm:12,md:8,lg:4,children:(0,t.jsx)(d.A,{size:"small",style:{height:"100%"},children:(0,t.jsx)(v.A,{title:"模板",value:es,prefix:(0,t.jsx)(S.A,{style:{color:"var(--colorDanger)"}})})})}),(0,t.jsx)(a.A,{xs:24,sm:12,md:8,lg:4,children:(0,t.jsxs)(d.A,{size:"small",style:{height:"100%",overflow:"hidden"},children:[(0,t.jsx)(v.A,{title:"语义模型",value:(null==er?void 0:er.provider)==="openai-compatible"?"外部 Embedding":er?"本地语义模型":"—",prefix:(0,t.jsx)(z.A,{style:{color:"var(--colorAccent)"}}),valueStyle:{fontSize:18,whiteSpace:"nowrap"}}),(null==er?void 0:er.model)&&(0,t.jsxs)("div",{className:"text-xs mt-1",style:{color:"var(--colorTextSecondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:"".concat(er.model).concat(er.dimensions?" \xb7 ".concat(er.dimensions,"维"):""),children:[er.model,er.dimensions?" \xb7 ".concat(er.dimensions,"维"):""]})]})}),(0,t.jsx)(a.A,{xs:24,sm:12,md:8,lg:4,children:(0,t.jsx)(d.A,{size:"small",style:{height:"100%"},children:(0,t.jsx)(v.A,{title:"模型供应商",value:H,prefix:(0,t.jsx)(N.A,{style:{color:"var(--colorAccent)"}})})})}),(0,t.jsx)(a.A,{xs:24,sm:12,md:8,lg:4,children:(0,t.jsx)(d.A,{size:"small",style:{height:"100%"},children:(0,t.jsx)(v.A,{title:"审计日志",value:null!=(L=null==V?void 0:V.logs.events)?L:0,suffix:"条",prefix:(0,t.jsx)(A.A,{style:{color:"var(--colorOk)"}})})})})]})}),(0,t.jsxs)(c.A,{gutter:[16,16],children:[(0,t.jsx)(a.A,{xs:24,sm:12,children:(0,t.jsx)(d.A,{size:"small",title:R("overview.topModel"),style:{height:"100%"},children:ed?(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(A.A,{style:{fontSize:24,color:"var(--colorAccent)"}}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-semibold",children:ed.model}),(0,t.jsxs)("div",{style:{color:"var(--colorTextSecondary)",fontSize:12},children:["@",ed.provider," — ",ed.count," ",R("overview.calls")]})]})]}):(0,t.jsx)("span",{style:{color:"var(--colorTextSecondary)"},children:"暂无真实模型调用日志"})})}),(0,t.jsx)(a.A,{xs:24,sm:12,children:(0,t.jsx)(d.A,{size:"small",title:R("overview.taskTypes"),style:{height:"100%"},children:(null==V?void 0:V.tasks.types)&&Object.keys(V.tasks.types).length>0?(0,t.jsx)(o.A,{wrap:!0,children:Object.entries(V.tasks.types).sort((e,l)=>l[1]-e[1]).map(e=>{let[l,s]=e;return(0,t.jsxs)(u.A,{children:[l.slice(0,30),": ",s]},l)})}):(0,t.jsx)("span",{style:{color:"var(--colorTextSecondary)"},children:R("common.noData")})})})]})]})}},53139:(e,l,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/overview",function(){return s(27795)}])}},e=>{e.O(0,[433,787,131,636,593,792],()=>e(e.s=53139)),_N_E=e.O()}]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@customize-agent/server",
3
- "version": "4.0.10",
3
+ "version": "4.0.12",
4
4
  "description": "Customize Agent Web 管理控制台",
5
5
  "exports": {
6
6
  "./package.json": "./package.json"
@@ -47,7 +47,7 @@
47
47
  "react-dom": "19.2.7",
48
48
  "tesseract.js": "^7.0.0",
49
49
  "xlsx": "^0.18.5",
50
- "@customize-agent/knowledge": "^4.0.4",
50
+ "@customize-agent/knowledge": "^4.0.6",
51
51
  "@customize-agent/runtime": "^3.0.6",
52
52
  "@customize-agent/llm": "^3.0.4"
53
53
  },
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[28],{1611:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"}},10218:(e,t,l)=>{"use strict";l.d(t,{A:()=>g,H:()=>m});var r=l(97109),n=l(4932),a=l(82813);let i=e=>"object"==typeof e&&null!=e&&1===e.nodeType,s=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,o=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let l=getComputedStyle(e,null);return s(l.overflowY,t)||s(l.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},c=(e,t,l,r,n,a,i,s)=>a<e&&i>t||a>e&&i<t?0:a<=e&&s<=l||i>=t&&s>=l?a-e-r:i>t&&s<l||a<e&&s>l?i-t+n:0,u=e=>{let t=e.parentElement;return null==t?e.getRootNode().host||null:t},d=(e,t)=>{var l,r,n,a;if("undefined"==typeof document)return[];let{scrollMode:s,block:d,inline:h,boundary:f,skipOverflowHiddenElements:m}=t,p="function"==typeof f?f:e=>e!==f;if(!i(e))throw TypeError("Invalid target");let g=document.scrollingElement||document.documentElement,v=[],y=e;for(;i(y)&&p(y);){if((y=u(y))===g){v.push(y);break}null!=y&&y===document.body&&o(y)&&!o(document.documentElement)||null!=y&&o(y,m)&&v.push(y)}let x=null!=(r=null==(l=window.visualViewport)?void 0:l.width)?r:innerWidth,w=null!=(a=null==(n=window.visualViewport)?void 0:n.height)?a:innerHeight,{scrollX:j,scrollY:b}=window,{height:_,width:A,top:C,right:z,bottom:k,left:P}=e.getBoundingClientRect(),{top:S,right:M,bottom:N,left:H}=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e),I="start"===d||"nearest"===d?C-S:"end"===d?k+N:C+_/2-S+N,E="center"===h?P+A/2-H+M:"end"===h?z+M:P-H,O=[];for(let e=0;e<v.length;e++){let t=v[e],{height:l,width:r,top:n,right:a,bottom:i,left:u}=t.getBoundingClientRect();if("if-needed"===s&&C>=0&&P>=0&&k<=w&&z<=x&&(t===g&&!o(t)||C>=n&&k<=i&&P>=u&&z<=a))break;let f=getComputedStyle(t),m=parseInt(f.borderLeftWidth,10),p=parseInt(f.borderTopWidth,10),y=parseInt(f.borderRightWidth,10),S=parseInt(f.borderBottomWidth,10),M=0,N=0,H="offsetWidth"in t?t.offsetWidth-t.clientWidth-m-y:0,F="offsetHeight"in t?t.offsetHeight-t.clientHeight-p-S:0,V="offsetWidth"in t?0===t.offsetWidth?0:r/t.offsetWidth:0,T="offsetHeight"in t?0===t.offsetHeight?0:l/t.offsetHeight:0;if(g===t)M="start"===d?I:"end"===d?I-w:"nearest"===d?c(b,b+w,w,p,S,b+I,b+I+_,_):I-w/2,N="start"===h?E:"center"===h?E-x/2:"end"===h?E-x:c(j,j+x,x,m,y,j+E,j+E+A,A),M=Math.max(0,M+b),N=Math.max(0,N+j);else{M="start"===d?I-n-p:"end"===d?I-i+S+F:"nearest"===d?c(n,i,l,p,S+F,I,I+_,_):I-(n+l/2)+F/2,N="start"===h?E-u-m:"center"===h?E-(u+r/2)+H/2:"end"===h?E-a+y+H:c(u,a,r,m,y+H,E,E+A,A);let{scrollLeft:e,scrollTop:s}=t;M=0===T?0:Math.max(0,Math.min(s+M/T,t.scrollHeight-l/T+F)),N=0===V?0:Math.max(0,Math.min(e+N/V,t.scrollWidth-r/V+H)),I+=s-M,E+=e-N}O.push({el:t,top:M,left:N})}return O};var h=l(26047),f=l(44624);function m(e){return(0,f.$r)(e).join("_")}function p(e,t){let l=t.getFieldInstance(e),r=(0,a.rb)(l);if(r)return r;let n=(0,f.kV)((0,f.$r)(e),t.__INTERNAL__.name);if(n)return document.getElementById(n)}function g(e){let[t]=(0,n.mN)(),l=r.useRef({}),a=r.useMemo(()=>e??{...t,__INTERNAL__:{itemRef:e=>t=>{let r=m(e);t?l.current[r]=t:delete l.current[r]}},scrollToField:(e,t={})=>{let{focus:l,...r}=t,n=p(e,a);n&&(!function(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;let l=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if("object"==typeof t&&"function"==typeof t.behavior)return t.behavior(d(e,t));let r="boolean"==typeof t||null==t?void 0:t.behavior;for(let{el:n,top:a,left:i}of d(e,!1===t?{block:"end",inline:"nearest"}:t===Object(t)&&0!==Object.keys(t).length?t:{block:"start",inline:"nearest"})){let e=a-l.top+l.bottom,t=i-l.left+l.right;n.scroll({top:e,left:t,behavior:r})}}(n,{scrollMode:"if-needed",block:"nearest",...r}),l&&a.focusField(e))},focusField:e=>{let t=a.getFieldInstance(e);(0,h.Tn)(t?.focus)?t.focus():p(e,a)?.focus?.()},getFieldInstance:e=>{let t=m(e);return l.current[t]}},[e,t]);return[a]}},12887:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]},name:"file-text",theme:"outlined"}},13067:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM514.1 580.1l-61.8-102.4c-2.2-3.6-6.1-5.8-10.3-5.8h-38.4c-2.3 0-4.5.6-6.4 1.9-5.6 3.5-7.3 10.9-3.7 16.6l82.3 130.4-83.4 132.8a12.04 12.04 0 0010.2 18.4h34.5c4.2 0 8-2.2 10.2-5.7L510 664.8l62.3 101.4c2.2 3.6 6.1 5.7 10.2 5.7H620c2.3 0 4.5-.7 6.5-1.9 5.6-3.6 7.2-11 3.6-16.6l-84-130.4 85.3-132.5a12.04 12.04 0 00-10.1-18.5h-35.7c-4.2 0-8.1 2.2-10.3 5.8l-61.2 102.3z"}}]},name:"file-excel",theme:"outlined"}},14569:e=>{e.exports={featureLabel:"style_featureLabel__XFSTX",featureValue:"style_featureValue__I_wMP",filterInput:"style_filterInput__4_Elu",filterSelect:"style_filterSelect__vUBJ9",statusCard:"style_statusCard__H7Mee",statusSummary:"style_statusSummary__7KavF",statusSummaryText:"style_statusSummaryText__Shw3j",statusClearBtn:"style_statusClearBtn__uJ9bE",statusExpandBtn:"style_statusExpandBtn__HhgIj",statusFilters:"style_statusFilters__g_LbG",filterPill:"style_filterPill__1pjFW",filterPillActive:"style_filterPillActive___UZVi",statusPanel:"style_statusPanel__9arTu",statusEmpty:"style_statusEmpty__8LWzH",timelineList:"style_timelineList__dqJrz",timelineItem:"style_timelineItem__dbuL_",timelineStatusIcon:"style_timelineStatusIcon__SkRwb",timelinePercent:"style_timelinePercent__pEyH4",timelineRow:"style_timelineRow__EDOVa",timelineTitle:"style_timelineTitle__Yujr8",timelineClose:"style_timelineClose__Byx_9",timelineDetail:"style_timelineDetail__nALei",timelineDesc:"style_timelineDesc__FMjWE",timelinePath:"style_timelinePath__C9VQI",timelineMeta:"style_timelineMeta__u_pCn",timelineMetaTag:"style_timelineMetaTag__G3jF1",timelineExpandArrow:"style_timelineExpandArrow__xIBdF",timelineExpandArrowOpen:"style_timelineExpandArrowOpen__TWWDC",fileNameCell:"style_fileNameCell__EHsnt",folderName:"style_folderName__VhLXP",folderRow:"style_folderRow__d7k9S",searchResultList:"style_searchResultList__cVKZg",searchResultItem:"style_searchResultItem__boj6D",searchResultHeader:"style_searchResultHeader__meVdJ",searchContent:"style_searchContent__XbUVk",pdfPreviewStrip:"style_pdfPreviewStrip__94_eG",drawingPreview:"style_drawingPreview__lkk_L"}},23793:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"}},25258:(e,t,l)=>{"use strict";l.d(t,{A:()=>w});var r=l(51541),n=l(61848),a=l(5669),i=l(97109),s=l(72658),o=l(3638),c=l(92162),u=l(82725),d=l(74567),h=l(632),f=l(49517),m=l(79412),p=l(19527);let g=(0,u.U)(e=>{let{prefixCls:t,className:l,closeIcon:r,closable:n,type:a,title:u,children:g,footer:v,classNames:y,styles:x,...w}=e,{getPrefixCls:j}=i.useContext(d.QO),{className:b,style:_,classNames:A,styles:C}=(0,d.TP)("modal"),z=j(),k=t||j("modal"),P=(0,h.A)(z),[S,M]=(0,p.Ay)(k,P),[N,H]=(0,c.AV)([A,y],[C,x],{props:e}),I=`${k}-confirm`,E={};return E=a?{closable:n??!1,title:"",footer:"",children:i.createElement(f.k,{...e,prefixCls:k,confirmPrefixCls:I,rootPrefixCls:z,content:g})}:{closable:n??!0,title:u,footer:null!==v&&i.createElement(m.w,{...e}),children:g},i.createElement(s.Z,{prefixCls:k,className:(0,o.$)(S,`${k}-pure-panel`,a&&I,a&&`${I}-${a}`,l,b,M,P,N.root),style:{..._,...H.root},...w,closeIcon:(0,m.O)(k,r),closable:n,classNames:N,styles:H,...E})});var v=l(99739);function y(e){return(0,r.Ay)((0,r.fp)(e))}let x=a.A;x.useModal=v.A,x.info=function(e){return(0,r.Ay)((0,r.$D)(e))},x.success=function(e){return(0,r.Ay)((0,r.Ej)(e))},x.error=function(e){return(0,r.Ay)((0,r.jT)(e))},x.warning=y,x.warn=y,x.confirm=function(e){return(0,r.Ay)((0,r.lr)(e))},x.destroyAll=function(){for(;n.A.length;){let e=n.A.pop();e&&e()}},x.config=r.FB,x._InternalPanelDoNotUseOrYouWillBeFired=g;let w=x},26619:(e,t,l)=>{"use strict";l.d(t,{A:()=>s});var r=l(97109),n=l(1611),a=l(88483);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r])}return e}).apply(this,arguments)}let s=r.forwardRef((e,t)=>r.createElement(a.A,i({},e,{ref:t,icon:n.A})))},26631:(e,t,l)=>{"use strict";l.d(t,{A:()=>s});var r=l(97109),n=l(12887),a=l(88483);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r])}return e}).apply(this,arguments)}let s=r.forwardRef((e,t)=>r.createElement(a.A,i({},e,{ref:t,icon:n.A})))},30289:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.4 800.9c.2-.3.5-.6.7-.9C920.6 722.1 960 621.7 960 512s-39.4-210.1-104.8-288c-.2-.3-.5-.5-.7-.8-1.1-1.3-2.1-2.5-3.2-3.7-.4-.5-.8-.9-1.2-1.4l-4.1-4.7-.1-.1c-1.5-1.7-3.1-3.4-4.6-5.1l-.1-.1c-3.2-3.4-6.4-6.8-9.7-10.1l-.1-.1-4.8-4.8-.3-.3c-1.5-1.5-3-2.9-4.5-4.3-.5-.5-1-1-1.6-1.5-1-1-2-1.9-3-2.8-.3-.3-.7-.6-1-1C736.4 109.2 629.5 64 512 64s-224.4 45.2-304.3 119.2c-.3.3-.7.6-1 1-1 .9-2 1.9-3 2.9-.5.5-1 1-1.6 1.5-1.5 1.4-3 2.9-4.5 4.3l-.3.3-4.8 4.8-.1.1c-3.3 3.3-6.5 6.7-9.7 10.1l-.1.1c-1.6 1.7-3.1 3.4-4.6 5.1l-.1.1c-1.4 1.5-2.8 3.1-4.1 4.7-.4.5-.8.9-1.2 1.4-1.1 1.2-2.1 2.5-3.2 3.7-.2.3-.5.5-.7.8C103.4 301.9 64 402.3 64 512s39.4 210.1 104.8 288c.2.3.5.6.7.9l3.1 3.7c.4.5.8.9 1.2 1.4l4.1 4.7c0 .1.1.1.1.2 1.5 1.7 3 3.4 4.6 5l.1.1c3.2 3.4 6.4 6.8 9.6 10.1l.1.1c1.6 1.6 3.1 3.2 4.7 4.7l.3.3c3.3 3.3 6.7 6.5 10.1 9.6 80.1 74 187 119.2 304.5 119.2s224.4-45.2 304.3-119.2a300 300 0 0010-9.6l.3-.3c1.6-1.6 3.2-3.1 4.7-4.7l.1-.1c3.3-3.3 6.5-6.7 9.6-10.1l.1-.1c1.5-1.7 3.1-3.3 4.6-5 0-.1.1-.1.1-.2 1.4-1.5 2.8-3.1 4.1-4.7.4-.5.8-.9 1.2-1.4a99 99 0 003.3-3.7zm4.1-142.6c-13.8 32.6-32 62.8-54.2 90.2a444.07 444.07 0 00-81.5-55.9c11.6-46.9 18.8-98.4 20.7-152.6H887c-3 40.9-12.6 80.6-28.5 118.3zM887 484H743.5c-1.9-54.2-9.1-105.7-20.7-152.6 29.3-15.6 56.6-34.4 81.5-55.9A373.86 373.86 0 01887 484zM658.3 165.5c39.7 16.8 75.8 40 107.6 69.2a394.72 394.72 0 01-59.4 41.8c-15.7-45-35.8-84.1-59.2-115.4 3.7 1.4 7.4 2.9 11 4.4zm-90.6 700.6c-9.2 7.2-18.4 12.7-27.7 16.4V697a389.1 389.1 0 01115.7 26.2c-8.3 24.6-17.9 47.3-29 67.8-17.4 32.4-37.8 58.3-59 75.1zm59-633.1c11 20.6 20.7 43.3 29 67.8A389.1 389.1 0 01540 327V141.6c9.2 3.7 18.5 9.1 27.7 16.4 21.2 16.7 41.6 42.6 59 75zM540 640.9V540h147.5c-1.6 44.2-7.1 87.1-16.3 127.8l-.3 1.2A445.02 445.02 0 00540 640.9zm0-156.9V383.1c45.8-2.8 89.8-12.5 130.9-28.1l.3 1.2c9.2 40.7 14.7 83.5 16.3 127.8H540zm-56 56v100.9c-45.8 2.8-89.8 12.5-130.9 28.1l-.3-1.2c-9.2-40.7-14.7-83.5-16.3-127.8H484zm-147.5-56c1.6-44.2 7.1-87.1 16.3-127.8l.3-1.2c41.1 15.6 85 25.3 130.9 28.1V484H336.5zM484 697v185.4c-9.2-3.7-18.5-9.1-27.7-16.4-21.2-16.7-41.7-42.7-59.1-75.1-11-20.6-20.7-43.3-29-67.8 37.2-14.6 75.9-23.3 115.8-26.1zm0-370a389.1 389.1 0 01-115.7-26.2c8.3-24.6 17.9-47.3 29-67.8 17.4-32.4 37.8-58.4 59.1-75.1 9.2-7.2 18.4-12.7 27.7-16.4V327zM365.7 165.5c3.7-1.5 7.3-3 11-4.4-23.4 31.3-43.5 70.4-59.2 115.4-21-12-40.9-26-59.4-41.8 31.8-29.2 67.9-52.4 107.6-69.2zM165.5 365.7c13.8-32.6 32-62.8 54.2-90.2 24.9 21.5 52.2 40.3 81.5 55.9-11.6 46.9-18.8 98.4-20.7 152.6H137c3-40.9 12.6-80.6 28.5-118.3zM137 540h143.5c1.9 54.2 9.1 105.7 20.7 152.6a444.07 444.07 0 00-81.5 55.9A373.86 373.86 0 01137 540zm228.7 318.5c-39.7-16.8-75.8-40-107.6-69.2 18.5-15.8 38.4-29.7 59.4-41.8 15.7 45 35.8 84.1 59.2 115.4-3.7-1.4-7.4-2.9-11-4.4zm292.6 0c-3.7 1.5-7.3 3-11 4.4 23.4-31.3 43.5-70.4 59.2-115.4 21 12 40.9 26 59.4 41.8a373.81 373.81 0 01-107.6 69.2z"}}]},name:"global",theme:"outlined"}},44624:(e,t,l)=>{"use strict";l.d(t,{$r:()=>n,BS:()=>i,kV:()=>a});let r=["parentNode"];function n(e){return void 0===e||!1===e?[]:Array.isArray(e)?e:[e]}function a(e,t){if(!e.length)return;let l=e.join("_");return t?`${t}_${l}`:r.includes(l)?`form_item_${l}`:l}function i(e,t,l,r,n,a){let i=r;return void 0!==a?i=a:l.validating?i="validating":e.length?i="error":t.length?i="warning":(l.touched||n&&l.validated)&&(i="success"),i}},45551:(e,t,l)=>{"use strict";function r(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024)),l=e/Math.pow(1024,t);return"".concat(l.toFixed(+(0!==t))," ").concat(["B","KB","MB","GB","TB"][t])}function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";if(!e||e<=0)return"en-US"===t?"Never":"从未";let l=Math.floor(Math.floor((Date.now()-e)/1e3)/60),r=Math.floor(l/60),n=Math.floor(r/24);return n>30?new Date(e).toLocaleDateString(t):"en-US"===t?n>0?"".concat(n,"d ago"):r>0?"".concat(r,"h ago"):l>0?"".concat(l,"m ago"):"Just now":n>0?"".concat(n," 天前"):r>0?"".concat(r," 小时前"):l>0?"".concat(l," 分钟前"):"刚刚"}l.d(t,{Jm:()=>s,fw:()=>n,z3:()=>r});let a={document:"文档",spreadsheet:"表格",image:"图片",cad:"图纸",code:"代码",data:"数据",web:"网页",diagram:"图表",archive:"压缩包",other:"其他"},i={document:"Document",spreadsheet:"Spreadsheet",image:"Image",cad:"CAD",code:"Code",data:"Data",web:"Web",diagram:"Diagram",archive:"Archive",other:"Other"};function s(e){var t;let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";return null!=(t=("en-US"===l?i:a)[e])?t:e}},48893:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M553.1 509.1l-77.8 99.2-41.1-52.4a8 8 0 00-12.6 0l-99.8 127.2a7.98 7.98 0 006.3 12.9H696c6.7 0 10.4-7.7 6.3-12.9l-136.5-174a8.1 8.1 0 00-12.7 0zM360 442a40 40 0 1080 0 40 40 0 10-80 0zm494.6-153.4L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file-image",theme:"outlined"}},53234:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM496 208H312c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 544h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H312c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8zm328 244a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"hdd",theme:"outlined"}},58209:(e,t,l)=>{"use strict";l.d(t,{A:()=>s});var r=l(97109),n=l(23793),a=l(88483);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r])}return e}).apply(this,arguments)}let s=r.forwardRef((e,t)=>r.createElement(a.A,i({},e,{ref:t,icon:n.A})))},58520:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM528.1 472h-32.2c-5.5 0-10.3 3.7-11.6 9.1L434.6 680l-46.1-198.7c-1.3-5.4-6.1-9.3-11.7-9.3h-35.4a12.02 12.02 0 00-11.6 15.1l74.2 276c1.4 5.2 6.2 8.9 11.6 8.9h32c5.4 0 10.2-3.6 11.6-8.9l52.8-197 52.8 197c1.4 5.2 6.2 8.9 11.6 8.9h31.8c5.4 0 10.2-3.6 11.6-8.9l74.4-276a12.04 12.04 0 00-11.6-15.1H647c-5.6 0-10.4 3.9-11.7 9.3l-45.8 199.1-49.8-199.3c-1.3-5.4-6.1-9.1-11.6-9.1z"}}]},name:"file-word",theme:"outlined"}},61825:(e,t,l)=>{"use strict";l.d(t,{A:()=>s});var r=l(97109),n=l(30289),a=l(88483);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r])}return e}).apply(this,arguments)}let s=r.forwardRef((e,t)=>r.createElement(a.A,i({},e,{ref:t,icon:n.A})))},82738:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>ee});var r=l(65321),n=l(97109),a=l(79059),i=l(43220),s=l.n(i),o=l(86109),c=l(17807),u=l(25258),d=l(11702),h=l(33442),f=l(14932),m=l(85114),p=l(7576),g=l(57271),v=l(68787),y=l(99605),x=l(21289),w=l(56768),j=l(48893),b=l(88483);function _(){return(_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r])}return e}).apply(this,arguments)}let A=n.forwardRef((e,t)=>n.createElement(b.A,_({},e,{ref:t,icon:j.A})));var C=l(13067);function z(){return(z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r])}return e}).apply(this,arguments)}let k=n.forwardRef((e,t)=>n.createElement(b.A,z({},e,{ref:t,icon:C.A})));var P=l(58520);function S(){return(S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r])}return e}).apply(this,arguments)}let M=n.forwardRef((e,t)=>n.createElement(b.A,S({},e,{ref:t,icon:P.A})));var N=l(90939);function H(){return(H=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r])}return e}).apply(this,arguments)}let I=n.forwardRef((e,t)=>n.createElement(b.A,H({},e,{ref:t,icon:N.A})));var E=l(93314),O=l(61825),F=l(26619),V=l(29606),T=l(26631),B=l(64254),L=l(64629),R=l(58209),D=l(30486),W=l(92803);function $(){return($=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r])}return e}).apply(this,arguments)}let Q=n.forwardRef((e,t)=>n.createElement(b.A,$({},e,{ref:t,icon:W.A})));var U=l(84742),J=l(38762),X=l(6578),q=l(45551),G=l(14569),K=l.n(G);let Y=["document","spreadsheet","image","cad","code","data","web","diagram","other"],Z=/\.(zip|jar|war|apk|tar|gz|tgz|bz2|rar|7z)$/iu;function ee(){let e=(0,a.Vr)("knowledge"),{locale:t}=(0,a.x_)(),{message:l}=c.A.useApp(),i=(0,o.useRouter)(),j="string"==typeof i.query.category?i.query.category:"",[b,_]=(0,n.useState)([]),[C,z]=(0,n.useState)(!1),[P,S]=(0,n.useState)(""),[N,H]=(0,n.useState)(""),[W,$]=(0,n.useState)(j),[G,ee]=(0,n.useState)(!1),[et,el]=(0,n.useState)(!1),[er,en]=(0,n.useState)([]),[ea,ei]=(0,n.useState)([]),[es,eo]=(0,n.useState)(new Set),[ec,eu]=(0,n.useState)("all"),[ed,eh]=(0,n.useState)("user"),[ef,em]=(0,n.useState)(!0),[ep,eg]=(0,n.useState)([]),[ev,ey]=(0,n.useState)(new Set),ex=(0,n.useRef)(W);(0,n.useEffect)(()=>{ex.current=W},[W]),(0,n.useEffect)(()=>{$("string"==typeof i.query.category?i.query.category:"")},[i.query.category]);let ew=(0,n.useCallback)(async e=>{let t=null!=e?e:ex.current;z(!0),S("");try{let e=await (0,X.HT)({category:t||void 0,limit:200});_(e.files||[]),e.initializing&&window.setTimeout(()=>{ew(t)},1500)}catch(e){_([]),S(e instanceof Error?e.message:"文件列表加载失败")}finally{z(!1)}},[]);(0,n.useEffect)(()=>{ew(W)},[W,ew]);let ej=e=>({id:e.id,type:e.type,title:e.title,description:e.message,status:e.status,percent:e.percent,filePath:e.filePath,chunkCount:e.chunkCount,textLength:e.textLength,extractionMode:e.extractionMode,error:e.error,createdAt:e.createdAt}),eb=(0,n.useCallback)(async()=>{try{let e=(await (0,X.Qx)()).operations.map(ej);en(t=>{let l=new Set(e.map(e=>e.id).filter(Boolean)),r=t.filter(e=>e.id&&!l.has(e.id)&&"processing"===e.status);return[...e,...r].slice(0,50)})}catch(e){}},[]),e_=(0,n.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];en(l=>{let r=l.findIndex(l=>e.id&&l.id===e.id||t.includes(l.title));if(r>=0){var n;let t=[...l];return t[r]={...l[r],...e,createdAt:null!=(n=l[r].createdAt)?n:e.createdAt},t}return[e,...l].slice(0,50)})},[]);(0,n.useEffect)(()=>{eb()},[eb]);let eA=async()=>{try{await (0,X.H7)(),en([]),l.success("任务状态已清空")}catch(e){l.error("清空任务状态失败")}},eC=async(e,t)=>{if(t.stopPropagation(),e.id)try{await (0,X.CU)(e.id)}catch(e){}en(t=>t.filter(t=>t!==e))},ez=(0,n.useMemo)(()=>{let e=0,t=0,l=0;for(let r of er)"processing"===r.status?e++:"success"===r.status?t++:("error"===r.status||"warning"===r.status)&&l++;return{processing:e,success:t,error:l}},[er]);(0,n.useEffect)(()=>{ez.processing>0&&em(!1)},[ez.processing]),(0,n.useEffect)(()=>{if(0===ez.processing)return;let e=window.setInterval(()=>{eb(),ew()},1500);return()=>window.clearInterval(e)},[ew,eb,ez.processing]);let ek="all"===ec?er:er.filter(e=>"processing"===ec?"processing"===e.status:"success"===ec?"success"===e.status:"error"!==ec||"error"===e.status||"warning"===e.status),eP=async e=>{let t=e.filter(e=>!Z.test(e.name)),r=e.length-t.length;if(r>0&&l.warning("已跳过 ".concat(r," 个压缩包,请解压后上传内部文件")),0===t.length)return;let n=1===t.length?t[0].name:"".concat(t.length," 个文件");ee(!0);let a="".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2));e_({id:a,type:"upload",title:"上传 ".concat(n),description:"等待上传、解析、切片和入库",status:"processing",percent:5});let i=!1,s=0,o=async()=>{let e=await (0,X.QT)(a);s=0;let t="error"===e.stage?"error":"done"===e.stage?"success":"processing";return e_({id:a,type:"error"===t?"error":"upload",title:"success"===t?"上传完成 ".concat(n):"上传 ".concat(n),description:"".concat(e.message).concat(e.chunkCount?",".concat(e.chunkCount," 个切片"):""),status:t,percent:e.percent}),("done"===e.stage||"error"===e.stage)&&(i=!0),e},c=e=>{if((s+=1)>=5){i=!0;let t=e instanceof Error?e.message:"进度查询失败";e_({id:a,type:"error",title:"上传失败 ".concat(n),description:t,status:"error",percent:100})}},u=setInterval(()=>{o().catch(c)},700);try{await (0,X.c1)(t,void 0,a),l.info("文件已上传,正在后台解析、切片和入库");for(let e=0;e<240&&!i;e++)await new Promise(e=>setTimeout(e,500)),await o().catch(c);H(""),$(""),ei([]),ex.current="",await ew(),await eb(),i&&l.success("上传索引流程已完成")}catch(t){let e=t instanceof Error?t.message:"请重试或检查文件格式";l.error(e||"上传失败"),e_({id:a,type:"error",title:"上传失败 ".concat(n),description:e,status:"error",percent:100})}finally{clearInterval(u),ee(!1)}},eS=async()=>{el(!0);let e="reindex-ui-".concat(Date.now());e_({id:e,type:"reindex",title:"重新解析入库",description:"正在提交后台任务",status:"processing",percent:5});try{var t;let r=await (0,X.H1)(),n=r.operationId||e,a=r.job;l.info(r.alreadyRunning?"已有重新解析任务正在后台执行":"已提交重新解析入库任务,可在顶部“后台任务”查看进度"),e_({id:n,type:"reindex",title:(null==a?void 0:a.title)||"重新解析入库",description:(null==a?void 0:a.message)||"后台将重新扫描文件、解析、切片并重建索引",status:(null==a?void 0:a.status)||"processing",percent:null!=(t=null==a?void 0:a.percent)?t:10,error:null==a?void 0:a.error},["重新解析入库"]);for(let e=0;e<360;e++){let e=await (0,X.ax)(n).then(e=>e.job).catch(async()=>(await (0,X.Qx)()).operations.find(e=>e.id===n));if(e){let t="success"===e.status||"error"===e.status;if(e_({id:n,type:"error"===e.status?"error":"reindex",title:"success"===e.status?"重新解析入库完成":"error"===e.status?"重新解析入库失败":e.title,description:e.error||e.message,status:e.status,percent:e.percent,filePath:e.filePath,chunkCount:e.chunkCount,error:e.error}),t){"success"===e.status?l.success(e.message||"重新解析入库完成"):l.error(e.error||e.message||"重新解析入库失败");break}}await new Promise(e=>setTimeout(e,1e3))}await ew(),await eb()}catch(r){let t=r instanceof Error?r.message:"重新解析入库失败";l.error(t),e_({id:e,type:"error",title:"重新解析入库失败",description:t,status:"error",percent:100},["重新解析入库","重新解析入库完成","重新解析入库失败"])}finally{el(!1)}},eM=async e=>{if(e.builtIn)return void l.info("内置示例资料不可重新解析");let t="file-reindex-ui-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2));ey(t=>new Set(t).add(e.relativePath)),e_({id:t,type:"reindex",title:"重新解析 ".concat(e.relativePath),description:"正在提交单文件后台任务",status:"processing",percent:5,filePath:e.relativePath});try{var r;let n=await (0,X.HC)(e.relativePath),a=n.operationId||t,i=n.job;l.info(n.alreadyRunning?"已有知识库任务正在后台执行":"已提交单文件重新解析任务"),e_({id:a,type:"reindex",title:(null==i?void 0:i.title)||"重新解析 ".concat(e.relativePath),description:(null==i?void 0:i.message)||"后台将重新解析、分块并入库该文件",status:(null==i?void 0:i.status)||"processing",percent:null!=(r=null==i?void 0:i.percent)?r:10,filePath:(null==i?void 0:i.filePath)||e.relativePath,chunkCount:null==i?void 0:i.chunkCount,error:null==i?void 0:i.error},["重新解析 ".concat(e.relativePath)]);for(let t=0;t<240;t++){let t=await (0,X.ax)(a).then(e=>e.job).catch(async()=>(await (0,X.Qx)()).operations.find(e=>e.id===a));if(t){let r="success"===t.status||"error"===t.status;if(e_({id:a,type:"error"===t.status?"error":"reindex",title:"success"===t.status?"重新解析完成 ".concat(e.relativePath):"error"===t.status?"重新解析失败 ".concat(e.relativePath):t.title,description:t.error||t.message,status:t.status,percent:t.percent,filePath:t.filePath||e.relativePath,chunkCount:t.chunkCount,error:t.error}),await ew(),r){"success"===t.status?l.success(t.message||"单文件重新解析完成"):l.error(t.error||t.message||"单文件重新解析失败");break}}await new Promise(e=>setTimeout(e,1e3))}await ew(),await eb()}catch(n){let r=n instanceof Error?n.message:"单文件重新解析失败";l.error(r),e_({id:t,type:"error",title:"重新解析失败 ".concat(e.relativePath),description:r,status:"error",percent:100,filePath:e.relativePath},["重新解析 ".concat(e.relativePath)])}finally{ey(t=>{let l=new Set(t);return l.delete(e.relativePath),l})}},eN=t=>{let r="selected"===t?e$:"filtered"===t?eI.filter(e=>!e.builtIn).map(e=>e.relativePath):[],n=b.filter(e=>!e.builtIn).length;if("all"!==t&&0===r.length||"all"===t&&0===n)return void l.info("没有可删除的用户文件");let a="all"===t?"删除全部用户文件 ".concat(n," 个?"):"filtered"===t?"删除当前筛选结果中的用户文件 ".concat(r.length," 个?"):"删除已选用户文件 ".concat(r.length," 个?");u.A.confirm({title:a,content:"将同时删除文件、切片、索引和向量记录。此操作不可撤销。",okText:e("common.delete"),cancelText:e("common.cancel"),okButtonProps:{danger:!0},onOk:async()=>{en(e=>[{type:"delete",title:a,description:"正在批量删除文件和索引",status:"processing",percent:10},...e].slice(0,50));try{var e;let a=null!=(e=("all"===t?await (0,X.X8)():"selected"===t?await (0,X.tZ)(eW,eD):await (0,X.SJ)(r)).deleted)?e:"all"===t?n:r.length;l.success("已删除 ".concat(a," 个文件")),ei([]),en(e=>[{type:"delete",title:"批量删除完成",description:"已删除 ".concat(a," 个文件、切片和索引"),status:"success"},...e].slice(0,50)),await ew(),await eb()}catch(e){l.error("批量删除失败"),en(e=>[{type:"error",title:"批量删除失败",description:"请重试",status:"error"},...e].slice(0,50))}}})},eH=(0,n.useMemo)(()=>"all"===ed?b:b.filter(e=>"builtIn"===ed?e.builtIn:!e.builtIn),[b,ed]),eI=(0,n.useMemo)(()=>N?eH.filter(e=>e.relativePath.toLowerCase().includes(N.toLowerCase())):eH,[N,eH]),eE=(0,n.useMemo)(()=>b.filter(e=>!e.builtIn),[b]),eO=(0,n.useMemo)(()=>b.filter(e=>e.builtIn),[b]),eF=(0,n.useMemo)(()=>eI.filter(e=>!e.builtIn),[eI]),eV=(0,n.useMemo)(()=>eI.filter(e=>e.builtIn),[eI]),eT=(0,n.useMemo)(()=>new Set(eI.map(e=>e.relativePath)),[eI]),eB=(0,n.useMemo)(()=>{let e={};for(let l of[...eI].sort((e,t)=>e.relativePath.localeCompare(t.relativePath))){let r=l.relativePath.split("/"),n="";for(let a=0;a<r.length;a++){let i=r[a],s=n;n=n?"".concat(n,"/").concat(i):i;let o=a===r.length-1;if(e[n])o||e[n].isFolder?o&&(e[n].isFolder=!1,e[n].file=l,e[n].fileCount=1,e[n].userFileCount=+!l.builtIn,e[n].totalSize=l.fileSize,e[n].totalChunks=l.chunkCount):(e[n].isFolder=!0,e[n].children=[],e[n].fileCount=0,e[n].userFileCount=0,e[n].totalSize=0,e[n].totalChunks=0);else{var t;e[n]={key:n,name:i,isFolder:!o,...o?{file:l,fileCount:1,userFileCount:+!l.builtIn,totalSize:l.fileSize,totalChunks:l.chunkCount}:{children:[],fileCount:0,userFileCount:0,totalSize:0,totalChunks:0}},s&&(null==(t=e[s])?void 0:t.children)&&e[s].children.push(e[n])}}}let l=e=>{for(let i of e)if(i.children){l(i.children);let e=0,s=0,o=0,c=0;for(let l of i.children){var t,r,n,a;e+=null!=(t=l.fileCount)?t:0,s+=null!=(r=l.userFileCount)?r:0,o+=null!=(n=l.totalSize)?n:0,c+=null!=(a=l.totalChunks)?a:0}i.fileCount=e,i.userFileCount=s,i.totalSize=o,i.totalChunks=c}},r=e=>e.map(e=>e.children?{...e,children:r(e.children)}:e).filter(e=>{var t,l,r;return!e.isFolder||(null!=(l=e.fileCount)?l:0)>0&&(null!=(r=null==(t=e.children)?void 0:t.length)?r:0)>0}),n=Object.values(e).filter(e=>!e.key.includes("/"));return l(n),r(n)},[eI]),eL=(0,n.useMemo)(()=>{let e=[],t=l=>{for(let r of l)e.push(r.key),r.children&&t(r.children)};return t(eB),e},[eB]),eR=(0,n.useMemo)(()=>new Set([...eT,...eL]),[eL,eT]),eD=(0,n.useMemo)(()=>ea.map(String).filter(e=>!eT.has(e)&&eL.includes(e)),[eL,ea,eT]),eW=(0,n.useMemo)(()=>ea.map(String).filter(e=>eT.has(e)),[ea,eT]),e$=(0,n.useMemo)(()=>{let e=new Set;for(let t of eW){let l=b.find(e=>e.relativePath===t);l&&!l.builtIn&&e.add(l.relativePath)}for(let t of eD){let l="".concat(t,"/");for(let t of b)!t.builtIn&&t.relativePath.startsWith(l)&&e.add(t.relativePath)}return Array.from(e)},[b,eW,eD]),eQ=e$.length;(0,n.useEffect)(()=>{ei(e=>e.filter(e=>eR.has(String(e))))},[eR]);let eU=(0,n.useMemo)(()=>N?eL:eB.map(e=>e.key),[N,eL,eB]);(0,n.useEffect)(()=>{eg(eU)},[eU]);let eJ=(e,t)=>{eg(l=>e?[...l,t.key]:l.filter(e=>e!==t.key))},eX=[{title:e("fileName"),dataIndex:"name",key:"name",render:(e,t)=>{var l;return(0,r.jsxs)("span",{className:K().fileNameCell,children:[t.isFolder?(0,r.jsx)("span",{style:{cursor:"pointer"},onClick:e=>{e.stopPropagation(),eJ(!ep.includes(t.key),t)},children:(e=>{let t=e.children;return t&&0!==t.length?(0,r.jsx)(B.A,{style:{color:"#fa8c16",fontSize:15}}):(0,r.jsx)(V.A,{style:{color:"#fa8c16",fontSize:15}})})(t)}):(e=>{if(!e)return(0,r.jsx)(w.A,{style:{fontSize:15}});let t=e.category;return"image"===t?(0,r.jsx)(A,{style:{color:"#eb2f96",fontSize:15}}):"spreadsheet"===t?(0,r.jsx)(k,{style:{color:"#52c41a",fontSize:15}}):"document"===t?(0,r.jsx)(M,{style:{color:"#1677ff",fontSize:15}}):"code"===t?(0,r.jsx)(I,{style:{color:"#fa8c16",fontSize:15}}):"archive"===t?(0,r.jsx)(E.A,{style:{color:"#8c8c8c",fontSize:15}}):"web"===t?(0,r.jsx)(O.A,{style:{color:"#13c2c2",fontSize:15}}):"data"===t?(0,r.jsx)(F.A,{style:{color:"#722ed1",fontSize:15}}):"cad"===t?(0,r.jsx)(V.A,{style:{color:"#fa541c",fontSize:15}}):"diagram"===t?(0,r.jsx)(A,{style:{color:"#a0d911",fontSize:15}}):(0,r.jsx)(T.A,{style:{fontSize:15}})})(t.file),t.isFolder?(0,r.jsx)("span",{className:K().folderName,onClick:e=>{e.stopPropagation(),eJ(!ep.includes(t.key),t)},children:t.name}):(0,r.jsxs)(r.Fragment,{children:[(null==(l=t.file)?void 0:l.builtIn)&&(0,r.jsx)(d.A,{color:"gold",style:{fontSize:11,lineHeight:"18px"},children:"内置"}),(0,r.jsx)(s(),{className:"truncate max-w-[380px] inline-block",href:"/knowledge/file-detail?relativePath=".concat(encodeURIComponent(t.key)),children:t.name})]})]})}},{title:e("fileCategory"),dataIndex:"category",key:"cat",width:110,render:(e,l)=>{var n,a;return l.isFolder?(0,r.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(0,r.jsx)(d.A,{children:(0,q.Jm)(null!=(a=null==(n=l.file)?void 0:n.category)?a:"",t)})}},{title:e("fileSize"),dataIndex:"fileSize",key:"size",width:90,render:(e,t)=>{var l,r,n;return(0,q.z3)(t.isFolder?null!=(r=t.totalSize)?r:0:null!=(n=null==(l=t.file)?void 0:l.fileSize)?n:0)}},{title:"切片",dataIndex:"chunkCount",key:"chunks",width:80,render:(e,t)=>{var l,n,a;let i=t.isFolder?null!=(n=t.totalChunks)?n:0:null!=(a=null==(l=t.file)?void 0:l.chunkCount)?a:0;return(0,r.jsx)(d.A,{color:i>1?"green":"orange",children:i})}},{title:"解析状态",dataIndex:"status",key:"status",width:100,render:(e,t)=>{var l,n,a;return t.isFolder?(0,r.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(0,r.jsx)(d.A,{color:(null==(l=t.file)?void 0:l.status)==="active"?"green":"red",children:(null==(n=t.file)?void 0:n.errorMessage)||(null==(a=t.file)?void 0:a.status)||"—"})}},{title:e("fileDate"),dataIndex:"mtime",key:"date",width:130,render:(e,l)=>{var n;return l.isFolder?(0,r.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(null==(n=l.file)?void 0:n.mtime)?new Date(l.file.mtime).toLocaleDateString(t):"—"}},{title:"来源",key:"source",width:100,render:(e,t)=>{var l;return t.isFolder?(0,r.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(null==(l=t.file)?void 0:l.builtIn)?(0,r.jsx)(d.A,{color:"gold",children:"内置示例"}):(0,r.jsx)(d.A,{color:"cyan",children:"我的文件"})}},{title:"",key:"act",width:100,render:(t,n)=>{var a,i;return n.isFolder?null:(0,r.jsxs)(h.A,{size:4,children:[(0,r.jsx)(f.A,{title:"重新解析、分块并入库",children:(0,r.jsx)(m.Ay,{type:"text",size:"small",disabled:null==(a=n.file)?void 0:a.builtIn,loading:!!(n.file&&ev.has(n.file.relativePath)),icon:(0,r.jsx)(L.A,{}),onClick:()=>{eM(n.file)}})}),(0,r.jsx)(m.Ay,{type:"text",danger:!0,size:"small",disabled:null==(i=n.file)?void 0:i.builtIn,icon:(0,r.jsx)(R.A,{}),onClick:()=>(t=>{if(t.builtIn)return void l.info("内置示例资料不可删除");u.A.confirm({title:e("delete"),content:e("deleteConfirm"),okText:e("common.confirm"),cancelText:e("common.cancel"),okButtonProps:{danger:!0},onOk:async()=>{en(e=>[{type:"delete",title:"删除 ".concat(t.relativePath),description:"正在删除文件记录",status:"processing"},...e].slice(0,50));try{await (0,X.xq)(t.relativePath),l.success("已删除"),en(e=>[{type:"delete",title:"删除完成 ".concat(t.relativePath),description:"文件和索引记录已移除",status:"success"},...e].slice(0,50)),ei(e=>e.filter(e=>e!==t.relativePath)),await ew(),await eb()}catch(e){l.error("删除失败"),en(e=>[{type:"error",title:"删除失败 ".concat(t.relativePath),description:"请重试",status:"error"},...e].slice(0,50))}}})})(n.file)})]})}}];return(0,r.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,r.jsx)("h2",{className:"pageTitle",children:e("files")}),(0,r.jsxs)("div",{className:"flex flex-wrap items-end gap-3",children:[(0,r.jsx)(p.A,{placeholder:e("searchPlaceholder"),prefix:(0,r.jsx)(D.A,{}),value:N,onChange:e=>{H(e.target.value)},allowClear:!0,className:K().filterInput}),(0,r.jsx)(g.A,{value:W||void 0,onChange:e=>{$(e||"")},placeholder:e("filterCategory"),allowClear:!0,className:K().filterSelect,options:[{label:e("allCategories"),value:""},...Y.map(e=>({label:(0,q.Jm)(e,t),value:e}))]}),(0,r.jsx)(g.A,{value:ed,onChange:eh,className:K().filterSelect,options:[{label:"全部来源 (".concat(b.length,")"),value:"all"},{label:"我的文件 (".concat(eE.length,")"),value:"user"},{label:"内置示例 (".concat(eO.length,")"),value:"builtIn"}]}),(0,r.jsx)(m.Ay,{type:"primary",icon:(0,r.jsx)(Q,{}),loading:G,onClick:()=>{var e;return null==(e=document.getElementById("kb-file-upload-input"))?void 0:e.click()},children:G?e("uploading"):e("upload")}),(0,r.jsx)(m.Ay,{icon:(0,r.jsx)(Q,{}),loading:G,onClick:()=>{var e;return null==(e=document.getElementById("kb-folder-upload-input"))?void 0:e.click()},children:"上传文件夹"}),(0,r.jsx)(m.Ay,{icon:(0,r.jsx)(L.A,{}),loading:et,onClick:()=>{eS()},children:"重新解析入库"}),(0,r.jsx)("input",{id:"kb-file-upload-input",type:"file",multiple:!0,hidden:!0,accept:".pdf,.doc,.docx,.txt,.md,.csv,.tsv,.xls,.xlsx,.png,.jpg,.jpeg,.webp,.svg,.dwg,.dxf,.step,.stp,.iges,.igs,.js,.ts,.tsx,.jsx,.py,.go,.java,.cs,.cpp,.c,.h,.json,.jsonl,.yaml,.yml,.xml,.html,.htm,.drawio,.dio,.vsdx,.vdx,.puml,.plantuml,.mmd,.mermaid,.excalidraw",onChange:e=>{var t;let l=Array.from(null!=(t=e.target.files)?t:[]);e.target.value="",eP(l)}}),(0,r.jsx)("input",{id:"kb-folder-upload-input",type:"file",multiple:!0,hidden:!0,webkitdirectory:"",onChange:e=>{var t;let l=Array.from(null!=(t=e.target.files)?t:[]);e.target.value="",eP(l)}})]}),(0,r.jsxs)(v.A,{size:"small",className:K().statusCard,styles:{body:{padding:0}},children:[(0,r.jsxs)("div",{className:K().statusSummary,onClick:()=>em(!ef),children:[(0,r.jsx)("span",{className:K().statusSummaryText,children:0===er.length?"暂无文件任务":(0,r.jsxs)(h.A,{size:6,children:[ez.processing>0&&(0,r.jsxs)(d.A,{color:"processing",style:{margin:0},icon:(0,r.jsx)(L.A,{spin:!0}),children:["处理中 ",ez.processing]}),(0,r.jsxs)(d.A,{color:"success",style:{margin:0},icon:(0,r.jsx)(U.A,{}),children:["已完成 ",ez.success]}),(0,r.jsxs)(d.A,{color:"error",style:{margin:0},icon:(0,r.jsx)(J.A,{}),children:["失败 ",ez.error]})]})}),er.length>0&&(0,r.jsxs)(h.A,{size:6,children:[(0,r.jsx)(m.Ay,{size:"small",className:K().statusClearBtn,onClick:e=>{e.stopPropagation(),eA()},children:"清空"}),(0,r.jsx)(m.Ay,{size:"small",className:K().statusExpandBtn,onClick:e=>{e.stopPropagation(),em(!ef)},children:ef?"展开":"收起"})]})]}),!ef&&er.length>0&&(0,r.jsxs)("div",{className:K().statusPanel,children:[(0,r.jsxs)("div",{className:K().statusFilters,children:[(0,r.jsxs)("span",{className:"".concat(K().filterPill," ").concat("all"===ec?K().filterPillActive:""),style:"all"===ec?{color:"#1677ff"}:void 0,onClick:()=>eu("all"),children:["全部 ",(0,r.jsx)("b",{children:er.length})]}),(0,r.jsxs)("span",{className:"".concat(K().filterPill," ").concat("processing"===ec?K().filterPillActive:""),style:"processing"===ec?{color:"#1677ff"}:void 0,onClick:()=>eu("processing"),children:[(0,r.jsx)(L.A,{spin:ez.processing>0})," 处理中 ",(0,r.jsx)("b",{children:ez.processing})]}),(0,r.jsxs)("span",{className:"".concat(K().filterPill," ").concat("success"===ec?K().filterPillActive:""),style:"success"===ec?{color:"#52c41a"}:void 0,onClick:()=>eu("success"),children:[(0,r.jsx)(U.A,{})," 已完成 ",(0,r.jsx)("b",{children:ez.success})]}),(0,r.jsxs)("span",{className:"".concat(K().filterPill," ").concat("error"===ec?K().filterPillActive:""),style:"error"===ec?{color:"#ff4d4f"}:void 0,onClick:()=>eu("error"),children:[(0,r.jsx)(J.A,{})," 失败 ",(0,r.jsx)("b",{children:ez.error})]})]}),(0,r.jsx)("div",{className:K().timelineList,children:0===ek.length?(0,r.jsx)("div",{className:K().statusEmpty,children:"没有匹配的任务"}):ek.map((e,l)=>{var n;let a=e.id||"".concat(e.type,"-").concat(null!=(n=e.createdAt)?n:e.title,"-").concat(l),i=es.has(a);return(0,r.jsxs)("div",{className:K().timelineItem,children:[(0,r.jsxs)("div",{className:K().timelineRow,onClick:()=>{eo(e=>{let t=new Set(e);return t.has(a)?t.delete(a):t.add(a),t})},children:[(0,r.jsx)("span",{className:K().timelineStatusIcon,children:"success"===e.status?(0,r.jsx)(U.A,{style:{color:"#52c41a"}}):"processing"===e.status?(0,r.jsx)(L.A,{spin:!0,style:{color:"#1677ff"}}):"error"===e.status?(0,r.jsx)(J.A,{style:{color:"#ff4d4f"}}):(0,r.jsx)("span",{style:{color:"#fa8c16",fontWeight:700},children:"!"})}),(0,r.jsx)("span",{className:K().timelineTitle,children:e.title}),"number"==typeof e.percent&&"processing"===e.status&&(0,r.jsxs)("span",{className:K().timelinePercent,children:[e.percent,"%"]}),(0,r.jsx)(m.Ay,{type:"text",size:"small",danger:!0,icon:(0,r.jsx)(R.A,{}),style:{width:22,height:22,padding:0,fontSize:12},onClick:t=>{eC(e,t)}})]}),i&&(0,r.jsxs)("div",{className:K().timelineDetail,children:["number"==typeof e.percent&&"processing"===e.status&&(0,r.jsx)(y.A,{percent:e.percent,size:"small",strokeColor:"#1677ff"}),e.description&&(0,r.jsx)("div",{className:K().timelineDesc,children:e.description}),e.error&&(0,r.jsx)("div",{style:{color:"var(--colorError)",fontSize:12,wordBreak:"break-word"},children:e.error}),e.filePath&&(0,r.jsx)(f.A,{title:e.filePath,children:(0,r.jsx)("div",{className:K().timelinePath,children:e.filePath})}),(0,r.jsxs)("div",{className:K().timelineMeta,children:["number"==typeof e.chunkCount&&(0,r.jsxs)("span",{className:K().timelineMetaTag,children:["切片 ",(0,r.jsx)("b",{children:e.chunkCount})]}),"number"==typeof e.textLength&&(0,r.jsxs)("span",{className:K().timelineMetaTag,children:["正文 ",(0,r.jsx)("b",{children:e.textLength.toLocaleString(t)})," 字符"]}),e.extractionMode&&(0,r.jsxs)("span",{className:K().timelineMetaTag,children:["解析 ",(0,r.jsx)("b",{children:e.extractionMode})]})]}),"error"===e.status&&(0,r.jsx)("div",{style:{color:"var(--colorError)",fontSize:12},children:"此任务失败,请重新上传文件或重试操作"})]})]},a)})})]})]}),(0,r.jsxs)(v.A,{title:"文件列表",extra:(0,r.jsxs)(h.A,{size:8,children:[(0,r.jsxs)(m.Ay,{danger:!0,size:"small",disabled:0===eQ,icon:(0,r.jsx)(R.A,{}),onClick:()=>eN("selected"),children:["删除已选 ",eQ||""]}),(0,r.jsx)(m.Ay,{danger:!0,size:"small",disabled:0===eE.length,onClick:()=>eN("all"),children:"删除全部用户文件"})]}),children:[P&&(0,r.jsxs)("div",{className:K().statusEmpty,children:["文件列表加载失败:",P]}),(0,r.jsx)(x.A,{rowKey:"key",columns:eX,dataSource:eB,loading:C,size:"middle",expandable:{expandedRowKeys:ep,onExpand:eJ,childrenColumnName:"children"},locale:{emptyText:C?"正在加载文件列表...":N?e("emptySearch"):e("noFiles")},pagination:!1,rowClassName:e=>e.isFolder?K().folderRow:"",rowSelection:{selectedRowKeys:ea,onChange:ei,checkStrictly:!1,getCheckboxProps:e=>{var t,l;return{disabled:e.isFolder?(null!=(l=e.userFileCount)?l:0)===0:!!(null==(t=e.file)?void 0:t.builtIn)}}},footer:()=>(0,r.jsxs)("div",{style:{color:"var(--colorTextSecondary)",fontSize:12},children:["当前展示 ",eI.length," 个文件,其中我的文件 ",eF.length," 个、内置示例 ",eV.length," 个;全部我的文件 ",eE.length," 个、内置示例 ",eO.length," 个;",eB.length," 个顶层目录"]})})]})]})}},90426:(e,t,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/knowledge/files",function(){return l(82738)}])},90939:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"code",theme:"outlined"}},92803:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"}},93314:(e,t,l)=>{"use strict";l.d(t,{A:()=>s});var r=l(97109),n=l(53234),a=l(88483);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r])}return e}).apply(this,arguments)}let s=r.forwardRef((e,t)=>r.createElement(a.A,i({},e,{ref:t,icon:n.A})))}},e=>{e.O(0,[433,787,576,985,150,289,636,593,792],()=>e(e.s=90426)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[449],{27795:(e,l,s)=>{"use strict";s.r(l),s.d(l,{default:()=>T});var t=s(65321),r=s(97109),i=s(79059),c=s(85114),o=s(2256),n=s(38770),a=s(68787),x=s(99605),d=s(54849),h=s(33442),v=s(11702),m=s(99811),u=s(520),j=s(93314),A=s(13114),y=s(29071),p=s(26631),g=s(84742),f=s(38762),w=s(8579),k=s(9020),z=s(32632),S=s(95118),N=s(24810),_=s(6578);function T(){var e,l,s,T,P,b,O,C,D,E,M,F;let I=(0,i.Vr)(),[B,W]=(0,r.useState)(null),[U,X]=(0,r.useState)(!0),[R,V]=(0,r.useState)(0),[Z,q]=(0,r.useState)(0),[G,H]=(0,r.useState)(0),[J,K]=(0,r.useState)(0),[L,Q]=(0,r.useState)(0),[Y,$]=(0,r.useState)(null),ee=(0,r.useCallback)(async()=>{X(!0);try{let[e,l,s,t,r,i]=await Promise.all([(0,_.FC)(),(0,_.Z3)().catch(()=>[]),(0,_.lv)().catch(()=>({roles:[],configs:[]})),(0,_.mx)().catch(()=>({specs:[]})),(0,_.Dl)().catch(()=>({templates:[]})),(0,_.II)().catch(()=>null)]);W(e),V(Array.isArray(l)?l.length:0);let c=Array.isArray(s.roles)?s.roles:[];q(c.filter(e=>"file"===e.type).length),H(c.filter(e=>"prompt"===e.type).length),K(Array.isArray(t.specs)?t.specs.length:0),Q(Array.isArray(r.templates)?r.templates.length:0),$(i)}catch(e){}finally{X(!1)}},[]);(0,r.useEffect)(()=>{ee();let e=setInterval(()=>{ee()},1e4);return()=>clearInterval(e)},[ee]);let el=(null!=(l=null==B?void 0:B.cpu.usagePercent)?l:0)>80?"var(--colorDanger)":(null!=(s=null==B?void 0:B.cpu.usagePercent)?s:0)>50?"var(--colorWarning)":"var(--colorOk)",es=(null!=(T=null==B?void 0:B.memory.usagePercent)?T:0)>80?"var(--colorDanger)":(null!=(P=null==B?void 0:B.memory.usagePercent)?P:0)>50?"var(--colorWarning)":"var(--colorOk)",et=(null==B?void 0:B.tasks.total)?Math.round(B.tasks.success/B.tasks.total*100):0,er=null==B||null==(e=B.models)?void 0:e[0];return(0,t.jsxs)("div",{className:"space-y-6 animateFadeIn",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"pageTitle",children:I("overview.title")}),(0,t.jsx)("p",{className:"pageDesc",children:I("overview.description")})]}),(0,t.jsx)(c.Ay,{icon:(0,t.jsx)(m.A,{spin:U}),loading:U,onClick:()=>{ee()},children:I("common.retry")})]}),(0,t.jsxs)(o.A,{gutter:[16,16],children:[(0,t.jsx)(n.A,{xs:24,sm:12,children:(0,t.jsx)(a.A,{size:"small",title:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.A,{})," CPU"]}),children:(0,t.jsxs)("div",{style:{textAlign:"center"},children:[(0,t.jsx)(x.A,{type:"circle",percent:null!=(b=null==B?void 0:B.cpu.usagePercent)?b:0,size:120,strokeColor:el,format:e=>"".concat(null==e?void 0:e.toFixed(1),"%")}),(0,t.jsxs)("div",{className:"text-xs mt-2",style:{color:"var(--colorTextSecondary)"},children:[null!=(O=null==B?void 0:B.cpu.cores)?O:0," ",I("overview.cores")]})]})})}),(0,t.jsx)(n.A,{xs:24,sm:12,children:(0,t.jsx)(a.A,{size:"small",title:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.A,{})," ",I("overview.memory")]}),children:(0,t.jsxs)("div",{style:{textAlign:"center"},children:[(0,t.jsx)(x.A,{type:"circle",percent:null!=(C=null==B?void 0:B.memory.usagePercent)?C:0,size:120,strokeColor:es,format:e=>"".concat(e,"%")}),(0,t.jsxs)("div",{className:"text-xs mt-2",style:{color:"var(--colorTextSecondary)"},children:[null!=(D=null==B?void 0:B.memory.processMB)?D:0," MB / ",null!=(E=null==B?void 0:B.memory.totalMB)?E:0," MB"]})]})})})]}),(0,t.jsxs)(o.A,{gutter:[16,16],children:[(0,t.jsx)(n.A,{xs:12,sm:6,children:(0,t.jsx)(a.A,{size:"small",children:(0,t.jsx)(d.A,{title:"运行时间",value:B?Math.floor(B.uptime/3600):0,suffix:"小时",prefix:(0,t.jsx)(A.A,{})})})}),(0,t.jsx)(n.A,{xs:12,sm:6,children:(0,t.jsx)(a.A,{size:"small",children:(0,t.jsx)(d.A,{title:I("overview.tokensUsed"),value:null!=(M=null==B?void 0:B.tokens.total)?M:0,prefix:(0,t.jsx)(y.A,{})})})}),(0,t.jsx)(n.A,{xs:12,sm:6,children:(0,t.jsx)(a.A,{size:"small",children:(0,t.jsx)(d.A,{title:I("overview.tasksTotal"),value:null!=(F=null==B?void 0:B.tasks.total)?F:0,prefix:(0,t.jsx)(p.A,{})})})}),(0,t.jsx)(n.A,{xs:12,sm:6,children:(0,t.jsx)(a.A,{size:"small",children:(0,t.jsx)(d.A,{title:I("overview.successRate"),value:et,suffix:"%",prefix:et>80?(0,t.jsx)(g.A,{style:{color:"var(--colorOk)"}}):(0,t.jsx)(f.A,{style:{color:"var(--colorDanger)"}})})})})]}),(0,t.jsx)(a.A,{size:"small",title:"资源概览",children:(0,t.jsxs)(o.A,{gutter:[16,16],children:[(0,t.jsx)(n.A,{xs:24,sm:12,md:8,lg:4,children:(0,t.jsx)(a.A,{size:"small",style:{height:"100%"},children:(0,t.jsx)(d.A,{title:"文件角色",value:Z,prefix:(0,t.jsx)(p.A,{style:{color:"var(--colorAccent)"}})})})}),(0,t.jsx)(n.A,{xs:24,sm:12,md:8,lg:4,children:(0,t.jsx)(a.A,{size:"small",style:{height:"100%"},children:(0,t.jsx)(d.A,{title:"提示词角色",value:G,prefix:(0,t.jsx)(w.A,{style:{color:"var(--colorWarning)"}})})})}),(0,t.jsx)(n.A,{xs:24,sm:12,md:8,lg:4,children:(0,t.jsx)(a.A,{size:"small",style:{height:"100%"},children:(0,t.jsx)(d.A,{title:"文档规范包",value:J,prefix:(0,t.jsx)(k.A,{style:{color:"var(--colorOk)"}})})})}),(0,t.jsx)(n.A,{xs:24,sm:12,md:8,lg:4,children:(0,t.jsx)(a.A,{size:"small",style:{height:"100%"},children:(0,t.jsx)(d.A,{title:"模板",value:L,prefix:(0,t.jsx)(z.A,{style:{color:"var(--colorDanger)"}})})})}),(0,t.jsx)(n.A,{xs:24,sm:12,md:8,lg:4,children:(0,t.jsxs)(a.A,{size:"small",style:{height:"100%",overflow:"hidden"},children:[(0,t.jsx)(d.A,{title:"语义模型",value:(null==Y?void 0:Y.provider)==="openai-compatible"?"外部 Embedding":Y?"本地语义模型":"—",prefix:(0,t.jsx)(S.A,{style:{color:"var(--colorAccent)"}}),valueStyle:{fontSize:18,whiteSpace:"nowrap"}}),(null==Y?void 0:Y.model)&&(0,t.jsxs)("div",{className:"text-xs mt-1",style:{color:"var(--colorTextSecondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:"".concat(Y.model).concat(Y.dimensions?" \xb7 ".concat(Y.dimensions,"维"):""),children:[Y.model,Y.dimensions?" \xb7 ".concat(Y.dimensions,"维"):""]})]})}),(0,t.jsx)(n.A,{xs:24,sm:12,md:8,lg:4,children:(0,t.jsx)(a.A,{size:"small",style:{height:"100%"},children:(0,t.jsx)(d.A,{title:"模型供应商",value:R,prefix:(0,t.jsx)(N.A,{style:{color:"var(--colorAccent)"}})})})})]})}),(0,t.jsxs)(o.A,{gutter:[16,16],children:[(0,t.jsx)(n.A,{xs:24,sm:12,children:(0,t.jsx)(a.A,{size:"small",title:I("overview.topModel"),style:{height:"100%"},children:er?(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(A.A,{style:{fontSize:24,color:"var(--colorAccent)"}}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-semibold",children:er.model}),(0,t.jsxs)("div",{style:{color:"var(--colorTextSecondary)",fontSize:12},children:["@",er.provider," — ",er.count," ",I("overview.calls")]})]})]}):(0,t.jsx)("span",{style:{color:"var(--colorTextSecondary)"},children:I("common.noData")})})}),(0,t.jsx)(n.A,{xs:24,sm:12,children:(0,t.jsx)(a.A,{size:"small",title:I("overview.taskTypes"),style:{height:"100%"},children:(null==B?void 0:B.tasks.types)&&Object.keys(B.tasks.types).length>0?(0,t.jsx)(h.A,{wrap:!0,children:Object.entries(B.tasks.types).map(e=>{let[l,s]=e;return(0,t.jsxs)(v.A,{children:[l.slice(0,30),": ",s]},l)})}):(0,t.jsx)("span",{style:{color:"var(--colorTextSecondary)"},children:I("common.noData")})})})]})]})}},53139:(e,l,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/overview",function(){return s(27795)}])}},e=>{e.O(0,[433,787,131,636,593,792],()=>e(e.s=53139)),_N_E=e.O()}]);