@customize-agent/server 4.0.51 → 4.0.53
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +32 -26
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/chunks/432.js +1 -1
- package/.next/server/chunks/6697.js +31 -31
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages/api/health.js +1 -1
- package/.next/server/pages/asset-library.html +1 -1
- package/.next/server/pages/context/long-term.html +1 -1
- package/.next/server/pages/context/short-term.html +1 -1
- package/.next/server/pages/document-roles.html +1 -1
- package/.next/server/pages/documents.html +1 -1
- package/.next/server/pages/guide.html +1 -1
- package/.next/server/pages/index.html +1 -1
- package/.next/server/pages/knowledge/file-detail.html +1 -1
- package/.next/server/pages/knowledge/files.html +1 -1
- package/.next/server/pages/knowledge/manage.html +1 -1
- package/.next/server/pages/knowledge/search.html +1 -1
- package/.next/server/pages/knowledge.html +1 -1
- package/.next/server/pages/models.html +1 -1
- package/.next/server/pages/overview.html +1 -1
- package/.next/server/pages/prompt.html +1 -1
- package/.next/server/pages/settings.html +1 -1
- package/.next/server/pages/system/logs.html +1 -1
- package/.next/server/pages-manifest.json +24 -24
- package/.next/static/7BxPmRQXi-2VWFugrlQk8/_buildManifest.js +1 -0
- package/.next/static/chunks/{150-134099bf526e9292.js → 102-881dcc464f983c89.js} +14 -14
- package/.next/static/chunks/{20-00147a779147a5a4.js → 20-86ac6910225cce4e.js} +3 -3
- package/.next/static/chunks/289-0031e62ca424247b.js +38 -0
- package/.next/static/chunks/{749-83476f9bcd014a5a.js → 317-18aac52df5551e76.js} +1 -1
- package/.next/static/chunks/375-4a1c73eb22d653d2.js +1 -0
- package/.next/static/chunks/499-d6bcc76195b28550.js +4 -0
- package/.next/static/chunks/{412-b9c854c6a76db67d.js → 940-7cb66111eee2f9fb.js} +1 -1
- package/.next/static/chunks/pages/{asset-library-e9ddfe1cbaac42d9.js → asset-library-8ba41e8bc4644f41.js} +1 -1
- package/.next/static/chunks/pages/context/{long-term-6b9a9683a4d6ea86.js → long-term-994425812e118c6c.js} +1 -1
- package/.next/static/chunks/pages/context/{short-term-6078efae6e3a905c.js → short-term-fcae99e1744d998a.js} +1 -1
- package/.next/static/chunks/pages/documents-d7ea38fc2e590069.js +1 -0
- package/.next/static/chunks/pages/{guide-cba4ca0b28bb9b64.js → guide-0a3cdfa79c037307.js} +1 -1
- package/.next/static/chunks/pages/knowledge/{file-detail-2e874c92d01b1c14.js → file-detail-87669392540614e4.js} +1 -1
- package/.next/static/chunks/pages/knowledge/{files-9d30d5f23d78f46b.js → files-14ef1012fd201e47.js} +1 -1
- package/.next/static/chunks/pages/system/{logs-3826fa44a76b12fc.js → logs-cbeeb77dc70086ae.js} +1 -1
- package/package.json +4 -4
- package/scripts/verify-next-static.js +9 -1
- package/.next/static/Ki0fhhnkp5kCGWyYdaCEa/_buildManifest.js +0 -1
- package/.next/static/chunks/289-30e7c55f49a896b7.js +0 -38
- package/.next/static/chunks/304-7bc5b1cd0b9315a1.js +0 -1
- package/.next/static/chunks/pages/documents-9967f1fdf3fb6d03.js +0 -1
- /package/.next/static/{Ki0fhhnkp5kCGWyYdaCEa → 7BxPmRQXi-2VWFugrlQk8}/_ssgManifest.js +0 -0
package/.next/static/chunks/pages/knowledge/{files-9d30d5f23d78f46b.js → files-14ef1012fd201e47.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
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"}},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:()=>j});var r=l(51541),a=l(61848),s=l(5669),i=l(97109),n=l(72658),c=l(3638),o=l(92162),d=l(82725),u=l(74567),h=l(632),f=l(49517),m=l(79412),p=l(19527);let v=(0,d.U)(e=>{let{prefixCls:t,className:l,closeIcon:r,closable:a,type:s,title:d,children:v,footer:g,classNames:y,styles:x,...j}=e,{getPrefixCls:w}=i.useContext(u.QO),{className:_,style:A,classNames:b,styles:z}=(0,u.TP)("modal"),C=w(),P=t||w("modal"),k=(0,h.A)(C),[S,M]=(0,p.Ay)(P,k),[N,E]=(0,o.AV)([b,y],[z,x],{props:e}),O=`${P}-confirm`,H={};return H=s?{closable:a??!1,title:"",footer:"",children:i.createElement(f.k,{...e,prefixCls:P,confirmPrefixCls:O,rootPrefixCls:C,content:v})}:{closable:a??!0,title:d,footer:null!==g&&i.createElement(m.w,{...e}),children:v},i.createElement(n.Z,{prefixCls:P,className:(0,c.$)(S,`${P}-pure-panel`,s&&O,s&&`${O}-${s}`,l,_,M,k,N.root),style:{...A,...E.root},...j,closeIcon:(0,m.O)(P,r),closable:a,classNames:N,styles:E,...H})});var g=l(99739);function y(e){return(0,r.Ay)((0,r.fp)(e))}let x=s.A;x.useModal=g.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(;a.A.length;){let e=a.A.pop();e&&e()}},x.config=r.FB,x._InternalPanelDoNotUseOrYouWillBeFired=v;let j=x},26619:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});var r=l(97109),a=l(1611),s=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 n=r.forwardRef((e,t)=>r.createElement(s.A,i({},e,{ref:t,icon:a.A})))},26631:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});var r=l(97109),a=l(12887),s=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 n=r.forwardRef((e,t)=>r.createElement(s.A,i({},e,{ref:t,icon:a.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"}},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 a(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),a=Math.floor(r/24);return a>30?new Date(e).toLocaleDateString(t):"en-US"===t?a>0?"".concat(a,"d ago"):r>0?"".concat(r,"h ago"):l>0?"".concat(l,"m ago"):"Just now":a>0?"".concat(a," 天前"):r>0?"".concat(r," 小时前"):l>0?"".concat(l," 分钟前"):"刚刚"}l.d(t,{Jm:()=>n,fw:()=>a,z3:()=>r});let s={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 n(e){var t;let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";return null!=(t=("en-US"===l?i:s)[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:()=>n});var r=l(97109),a=l(23793),s=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 n=r.forwardRef((e,t)=>r.createElement(s.A,i({},e,{ref:t,icon:a.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:()=>n});var r=l(97109),a=l(30289),s=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 n=r.forwardRef((e,t)=>r.createElement(s.A,i({},e,{ref:t,icon:a.A})))},82738:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>et});var r=l(65321),a=l(97109),s=l(79059),i=l(43220),n=l.n(i),c=l(86109),o=l(17807),d=l(25258),u=l(11702),h=l(33442),f=l(14932),m=l(85114),p=l(7576),v=l(57271),g=l(68787),y=l(99605),x=l(21289),j=l(56768),w=l(48893),_=l(88483);function A(){return(A=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 b=a.forwardRef((e,t)=>a.createElement(_.A,A({},e,{ref:t,icon:w.A})));var z=l(13067);function C(){return(C=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 P=a.forwardRef((e,t)=>a.createElement(_.A,C({},e,{ref:t,icon:z.A})));var k=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=a.forwardRef((e,t)=>a.createElement(_.A,S({},e,{ref:t,icon:k.A})));var N=l(90939);function E(){return(E=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 O=a.forwardRef((e,t)=>a.createElement(_.A,E({},e,{ref:t,icon:N.A})));var H=l(93314),V=l(61825),I=l(26619),T=l(29606),F=l(26631),B=l(64254),L=l(64629),R=l(58209),D=l(30486),U=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 J=a.forwardRef((e,t)=>a.createElement(_.A,$({},e,{ref:t,icon:U.A})));var Q=l(84742),W=l(38762),X=l(6578),q=l(45551),G=l(14569),K=l.n(G);let Z=["document","spreadsheet","image","cad","code","data","web","diagram","other"],Y=/\.(zip|jar|war|apk|tar|gz|tgz|bz2|rar|7z)$/iu,ee=/(^|\/)\.DS_Store$|(^|\/)Thumbs\.db$|(^|\/)__MACOSX\/|\.bak$/iu;function et(){let e=(0,s.Vr)("knowledge"),{locale:t}=(0,s.x_)(),{message:l}=o.A.useApp(),i=(0,c.useRouter)(),w="string"==typeof i.query.category?i.query.category:"",[_,A]=(0,a.useState)([]),[z,C]=(0,a.useState)(!1),[k,S]=(0,a.useState)(""),[N,E]=(0,a.useState)(""),[U,$]=(0,a.useState)(w),[G,et]=(0,a.useState)(!1),[el,er]=(0,a.useState)(!1),[ea,es]=(0,a.useState)([]),[ei,en]=(0,a.useState)([]),[ec,eo]=(0,a.useState)(new Set),[ed,eu]=(0,a.useState)("all"),[eh,ef]=(0,a.useState)(!0),[em,ep]=(0,a.useState)([]),[ev,eg]=(0,a.useState)(new Set),ey=(0,a.useRef)(U);(0,a.useEffect)(()=>{ey.current=U},[U]),(0,a.useEffect)(()=>{$("string"==typeof i.query.category?i.query.category:"")},[i.query.category]);let ex=(0,a.useCallback)(async(e,t)=>{let l=null!=e?e:ey.current;(null==t?void 0:t.silent)||(C(!0),S(""));try{let e=await (0,X.HT)({category:l||void 0,limit:5e3});A(e.files||[]),e.initializing&&window.setTimeout(()=>{ex(l,{silent:!0})},3e3)}catch(e){(null==t?void 0:t.silent)||(A([]),S(e instanceof Error?e.message:"文件列表加载失败"))}finally{(null==t?void 0:t.silent)||C(!1)}},[]);(0,a.useEffect)(()=>{ex(U)},[U,ex]);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}),ew=(0,a.useCallback)(async()=>{try{let e=(await (0,X.Qx)()).operations.map(ej);es(t=>{let l=new Set(e.map(e=>e.id).filter(Boolean)),r=e.map(e=>{var l;let r=t.find(t=>t.id===e.id);return r?{...r,...e,createdAt:null!=(l=r.createdAt)?l:e.createdAt}:e}),a=t.filter(e=>e.id&&!l.has(e.id)&&"processing"===e.status);return[...r,...a].slice(0,50)})}catch(e){}},[]),e_=(0,a.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];es(l=>{let r=l.findIndex(l=>e.id&&l.id===e.id||t.includes(l.title));if(r>=0){var a;let t=[...l];return t[r]={...l[r],...e,createdAt:null!=(a=l[r].createdAt)?a:e.createdAt},t}return[e,...l].slice(0,50)})},[]);(0,a.useEffect)(()=>{ew()},[ew]);let eA=async()=>{try{await (0,X.H7)(),es([]),l.success("任务状态已清空")}catch(e){l.error("清空任务状态失败")}},eb=async(e,t)=>{if(t.stopPropagation(),e.id)try{await (0,X.CU)(e.id)}catch(e){}es(t=>t.filter(t=>t!==e))},ez=(0,a.useMemo)(()=>{let e=0,t=0,l=0;for(let r of ea)"processing"===r.status?e++:"success"===r.status?t++:("error"===r.status||"warning"===r.status)&&l++;return{processing:e,success:t,error:l}},[ea]);(0,a.useEffect)(()=>{ez.processing>0&&ef(!1)},[ez.processing]),(0,a.useEffect)(()=>{if(0===ez.processing)return;let e=window.setInterval(()=>{ew()},2e3),t=window.setInterval(()=>{ex(void 0,{silent:!0})},8e3);return()=>{window.clearInterval(e),window.clearInterval(t)}},[ex,ew,ez.processing]);let eC="all"===ed?ea:ea.filter(e=>"processing"===ed?"processing"===e.status:"success"===ed?"success"===e.status:"error"!==ed||"error"===e.status||"warning"===e.status),eP=async e=>{let t=e.filter(e=>{let t=e.webkitRelativePath||e.name;return e.size>0&&!Y.test(e.name)&&!ee.test(t)}),r=e.length-t.length;if(r>0&&l.warning("已跳过 ".concat(r," 个空文件、系统文件、备份文件或压缩包")),0===t.length)return;let a=1===t.length?t[0].name:"".concat(t.length," 个文件");et(!0);let s="".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2));e_({id:s,type:"upload",title:"上传 ".concat(a),description:"等待上传、解析、切片和入库;同路径文件会更新,其他已有文件不会清除",status:"processing",percent:5});try{await (0,X.c1)(t,void 0,s,e=>{e_({id:s,type:"upload",title:"上传 ".concat(a),description:"正在上传文件:".concat(e.uploadedFiles,"/").concat(e.totalFiles,",批次 ").concat(e.batchIndex+1,"/").concat(e.totalBatches),status:"processing",percent:Math.min(5,Math.max(1,Math.round(e.uploadedFiles/Math.max(1,e.totalFiles)*5)))})}),l.info("文件已上传,正在后台解析、切片和入库;同路径文件会更新,其他已有文件不会清除,可在顶部“后台任务”查看进度"),E(""),$(""),en([]),ey.current="",await ew(),window.setTimeout(()=>{ex(void 0,{silent:!0})},2e3)}catch(t){let e=t instanceof Error?t.message:"请重试或检查文件格式";l.error(e||"上传失败"),e_({id:s,type:"error",title:"上传失败 ".concat(a),description:e,status:"error",percent:100})}finally{et(!1)}},ek=async()=>{er(!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)(),a=r.operationId||e,s=r.job;l.info(r.alreadyRunning?"已有重新解析任务正在后台执行":"已提交重新解析入库任务,可在顶部“后台任务”查看进度"),e_({id:a,type:"reindex",title:(null==s?void 0:s.title)||"重新解析入库",description:(null==s?void 0:s.message)||"后台将重新扫描文件、解析、切片并重建索引",status:(null==s?void 0:s.status)||"processing",percent:null!=(t=null==s?void 0:s.percent)?t:10,error:null==s?void 0:s.error},["重新解析入库"]);for(let e=0;e<360;e++){let e=await (0,X.ax)(a).then(e=>e.job).catch(async()=>(await (0,X.Qx)()).operations.find(e=>e.id===a));if(e){let t="success"===e.status||"error"===e.status;if(e_({id:a,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 ex(),await ew()}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{er(!1)}},eS=async e=>{let t="file-reindex-ui-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2));eg(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 a=await (0,X.HC)(e.relativePath),s=a.operationId||t,i=a.job;l.info(a.alreadyRunning?"已有知识库任务正在后台执行":"已提交单文件重新解析任务"),e_({id:s,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)(s).then(e=>e.job).catch(async()=>(await (0,X.Qx)()).operations.find(e=>e.id===s));if(t){let r="success"===t.status||"error"===t.status;if(e_({id:s,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 ex(),r){"success"===t.status?l.success(t.message||"单文件重新解析完成"):l.error(t.error||t.message||"单文件重新解析失败");break}}await new Promise(e=>setTimeout(e,1e3))}await ex(),await ew()}catch(a){let r=a instanceof Error?a.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{eg(t=>{let l=new Set(t);return l.delete(e.relativePath),l})}},eM=t=>{let r="selected"===t?eF:"filtered"===t?eN.map(e=>e.relativePath):[],a=_.length;if("all"!==t&&0===r.length||"all"===t&&0===a)return void l.info("没有可删除的文件");let s="all"===t?"删除全部文件 ".concat(a," 个?"):"filtered"===t?"删除当前筛选结果中的文件 ".concat(r.length," 个?"):"删除已选文件 ".concat(r.length," 个?");d.A.confirm({title:s,content:"将同时删除文件、切片、索引和向量记录。此操作不可撤销。",okText:e("common.delete"),cancelText:e("common.cancel"),okButtonProps:{danger:!0},onOk:async()=>{es(e=>[{type:"delete",title:s,description:"正在批量删除文件和索引",status:"processing",percent:10},...e].slice(0,50));try{var e;let s=null!=(e=("all"===t?await (0,X.X8)():"selected"===t?await (0,X.tZ)(eT,eI):await (0,X.SJ)(r)).deleted)?e:"all"===t?a:r.length;l.success("已删除 ".concat(s," 个文件")),en([]),es(e=>[{type:"delete",title:"批量删除完成",description:"已删除 ".concat(s," 个文件、切片和索引"),status:"success"},...e].slice(0,50)),await ex(),await ew()}catch(e){l.error("批量删除失败"),es(e=>[{type:"error",title:"批量删除失败",description:"请重试",status:"error"},...e].slice(0,50))}}})},eN=(0,a.useMemo)(()=>N?_.filter(e=>e.relativePath.toLowerCase().includes(N.toLowerCase())):_,[N,_]),eE=(0,a.useMemo)(()=>new Set(eN.map(e=>e.relativePath)),[eN]),eO=(0,a.useMemo)(()=>{let e={};for(let l of[...eN].sort((e,t)=>e.relativePath.localeCompare(t.relativePath))){let r=l.relativePath.split("/"),a="";for(let s=0;s<r.length;s++){let i=r[s],n=a;a=a?"".concat(a,"/").concat(i):i;let c=s===r.length-1;if(e[a])c||e[a].isFolder?c&&(e[a].isFolder=!1,e[a].file=l,e[a].fileCount=1,e[a].totalSize=l.fileSize,e[a].totalChunks=l.chunkCount):(e[a].isFolder=!0,e[a].children=[],e[a].fileCount=0,e[a].totalSize=0,e[a].totalChunks=0);else{var t;e[a]={key:a,name:i,isFolder:!c,...c?{file:l,fileCount:1,totalSize:l.fileSize,totalChunks:l.chunkCount}:{children:[],fileCount:0,totalSize:0,totalChunks:0}},n&&(null==(t=e[n])?void 0:t.children)&&e[n].children.push(e[a])}}}let l=e=>{for(let s of e)if(s.children){l(s.children);let e=0,i=0,n=0;for(let l of s.children){var t,r,a;e+=null!=(t=l.fileCount)?t:0,i+=null!=(r=l.totalSize)?r:0,n+=null!=(a=l.totalChunks)?a:0}s.fileCount=e,s.totalSize=i,s.totalChunks=n}},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}),a=Object.values(e).filter(e=>!e.key.includes("/"));return l(a),r(a)},[eN]),eH=(0,a.useMemo)(()=>{let e=[],t=l=>{for(let r of l)e.push(r.key),r.children&&t(r.children)};return t(eO),e},[eO]),eV=(0,a.useMemo)(()=>new Set([...eE,...eH]),[eH,eE]),eI=(0,a.useMemo)(()=>ei.map(String).filter(e=>!eE.has(e)&&eH.includes(e)),[eH,ei,eE]),eT=(0,a.useMemo)(()=>ei.map(String).filter(e=>eE.has(e)),[ei,eE]),eF=(0,a.useMemo)(()=>{let e=new Set;for(let t of eT){let l=_.find(e=>e.relativePath===t);l&&e.add(l.relativePath)}for(let t of eI){let l="".concat(t,"/");for(let t of _)t.relativePath.startsWith(l)&&e.add(t.relativePath)}return Array.from(e)},[_,eT,eI]),eB=eF.length;(0,a.useEffect)(()=>{en(e=>e.filter(e=>eV.has(String(e))))},[eV]);let eL=(0,a.useMemo)(()=>N?eH:eO.map(e=>e.key),[N,eH,eO]);(0,a.useEffect)(()=>{ep(eL)},[eL]);let eR=(e,t)=>{ep(l=>e?[...l,t.key]:l.filter(e=>e!==t.key))},eD=[{title:e("fileName"),dataIndex:"name",key:"name",render:(e,t)=>(0,r.jsxs)("span",{className:K().fileNameCell,children:[t.isFolder?(0,r.jsx)("span",{style:{cursor:"pointer"},onClick:e=>{e.stopPropagation(),eR(!em.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)(T.A,{style:{color:"#fa8c16",fontSize:15}})})(t)}):(e=>{if(!e)return(0,r.jsx)(j.A,{style:{fontSize:15}});let t=e.category;return"image"===t?(0,r.jsx)(b,{style:{color:"#eb2f96",fontSize:15}}):"spreadsheet"===t?(0,r.jsx)(P,{style:{color:"#52c41a",fontSize:15}}):"document"===t?(0,r.jsx)(M,{style:{color:"#1677ff",fontSize:15}}):"code"===t?(0,r.jsx)(O,{style:{color:"#fa8c16",fontSize:15}}):"archive"===t?(0,r.jsx)(H.A,{style:{color:"#8c8c8c",fontSize:15}}):"web"===t?(0,r.jsx)(V.A,{style:{color:"#13c2c2",fontSize:15}}):"data"===t?(0,r.jsx)(I.A,{style:{color:"#722ed1",fontSize:15}}):"cad"===t?(0,r.jsx)(T.A,{style:{color:"#fa541c",fontSize:15}}):"diagram"===t?(0,r.jsx)(b,{style:{color:"#a0d911",fontSize:15}}):(0,r.jsx)(F.A,{style:{fontSize:15}})})(t.file),t.isFolder?(0,r.jsx)("span",{className:K().folderName,onClick:e=>{e.stopPropagation(),eR(!em.includes(t.key),t)},children:t.name}):(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(n(),{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 a,s;return l.isFolder?(0,r.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(0,r.jsx)(u.A,{children:(0,q.Jm)(null!=(s=null==(a=l.file)?void 0:a.category)?s:"",t)})}},{title:e("fileSize"),dataIndex:"fileSize",key:"size",width:90,render:(e,t)=>{var l,r,a;return(0,q.z3)(t.isFolder?null!=(r=t.totalSize)?r:0:null!=(a=null==(l=t.file)?void 0:l.fileSize)?a:0)}},{title:"切片",dataIndex:"chunkCount",key:"chunks",width:80,render:(e,t)=>{var l,a,s;let i=t.isFolder?null!=(a=t.totalChunks)?a:0:null!=(s=null==(l=t.file)?void 0:l.chunkCount)?s:0;return(0,r.jsx)(u.A,{color:i>1?"green":"orange",children:i})}},{title:"解析状态",dataIndex:"status",key:"status",width:100,render:(e,t)=>{var l,a,s,i;return t.isFolder?(0,r.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(0,r.jsx)(u.A,{color:"active"===(i=null==(l=t.file)?void 0:l.status)?"green":"processing"===i||"indexing"===i?"blue":"error"===i?"red":"orange",children:(null==(a=t.file)?void 0:a.errorMessage)||(null==(s=t.file)?void 0:s.status)||"—"})}},{title:e("fileDate"),dataIndex:"mtime",key:"date",width:130,render:(e,l)=>{var a;return l.isFolder?(0,r.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(null==(a=l.file)?void 0:a.mtime)?new Date(l.file.mtime).toLocaleDateString(t):"—"}},{title:"来源",key:"source",width:100,render:(e,t)=>t.isFolder?(0,r.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(0,r.jsx)(u.A,{color:"cyan",children:"文件"})},{title:"",key:"act",width:100,render:(t,a)=>a.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",loading:!!(a.file&&ev.has(a.file.relativePath)),icon:(0,r.jsx)(L.A,{}),onClick:()=>{eS(a.file)}})}),(0,r.jsx)(m.Ay,{type:"text",danger:!0,size:"small",icon:(0,r.jsx)(R.A,{}),onClick:()=>{var t;return t=a.file,void d.A.confirm({title:e("delete"),content:e("deleteConfirm"),okText:e("common.confirm"),cancelText:e("common.cancel"),okButtonProps:{danger:!0},onOk:async()=>{es(e=>[{type:"delete",title:"删除 ".concat(t.relativePath),description:"正在删除文件记录",status:"processing"},...e].slice(0,50));try{await (0,X.xq)(t.relativePath),l.success("已删除"),es(e=>[{type:"delete",title:"删除完成 ".concat(t.relativePath),description:"文件和索引记录已移除",status:"success"},...e].slice(0,50)),en(e=>e.filter(e=>e!==t.relativePath)),await ex(),await ew()}catch(e){l.error("删除失败"),es(e=>[{type:"error",title:"删除失败 ".concat(t.relativePath),description:"请重试",status:"error"},...e].slice(0,50))}}})}})]})}];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=>{E(e.target.value)},allowClear:!0,className:K().filterInput}),(0,r.jsx)(v.A,{value:U||void 0,onChange:e=>{$(e||"")},placeholder:e("filterCategory"),allowClear:!0,className:K().filterSelect,options:[{label:e("allCategories"),value:""},...Z.map(e=>({label:(0,q.Jm)(e,t),value:e}))]}),(0,r.jsx)(m.Ay,{type:"primary",icon:(0,r.jsx)(J,{}),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)(J,{}),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:el,onClick:()=>{ek()},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)(g.A,{size:"small",className:K().statusCard,styles:{body:{padding:0}},children:[(0,r.jsxs)("div",{className:K().statusSummary,onClick:()=>ef(!eh),children:[(0,r.jsx)("span",{className:K().statusSummaryText,children:0===ea.length?"暂无文件任务":(0,r.jsxs)(h.A,{size:6,children:[ez.processing>0&&(0,r.jsxs)(u.A,{color:"processing",style:{margin:0},icon:(0,r.jsx)(L.A,{spin:!0}),children:["处理中 ",ez.processing]}),(0,r.jsxs)(u.A,{color:"success",style:{margin:0},icon:(0,r.jsx)(Q.A,{}),children:["已完成 ",ez.success]}),(0,r.jsxs)(u.A,{color:"error",style:{margin:0},icon:(0,r.jsx)(W.A,{}),children:["失败 ",ez.error]})]})}),ea.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(),ef(!eh)},children:eh?"展开":"收起"})]})]}),!eh&&ea.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"===ed?K().filterPillActive:""),style:"all"===ed?{color:"#1677ff"}:void 0,onClick:()=>eu("all"),children:["全部 ",(0,r.jsx)("b",{children:ea.length})]}),(0,r.jsxs)("span",{className:"".concat(K().filterPill," ").concat("processing"===ed?K().filterPillActive:""),style:"processing"===ed?{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"===ed?K().filterPillActive:""),style:"success"===ed?{color:"#52c41a"}:void 0,onClick:()=>eu("success"),children:[(0,r.jsx)(Q.A,{})," 已完成 ",(0,r.jsx)("b",{children:ez.success})]}),(0,r.jsxs)("span",{className:"".concat(K().filterPill," ").concat("error"===ed?K().filterPillActive:""),style:"error"===ed?{color:"#ff4d4f"}:void 0,onClick:()=>eu("error"),children:[(0,r.jsx)(W.A,{})," 失败 ",(0,r.jsx)("b",{children:ez.error})]})]}),(0,r.jsx)("div",{className:K().timelineList,children:0===eC.length?(0,r.jsx)("div",{className:K().statusEmpty,children:"没有匹配的任务"}):eC.map((e,l)=>{var a;let s=e.id||"".concat(e.type,"-").concat(null!=(a=e.createdAt)?a:e.title,"-").concat(l),i=ec.has(s);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(s)?t.delete(s):t.add(s),t})},children:[(0,r.jsx)("span",{className:K().timelineStatusIcon,children:"success"===e.status?(0,r.jsx)(Q.A,{style:{color:"#52c41a"}}):"processing"===e.status?(0,r.jsx)(L.A,{spin:!0,style:{color:"#1677ff"}}):"error"===e.status?(0,r.jsx)(W.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=>{eb(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:"此任务失败,请重新上传文件或重试操作"})]})]},s)})})]})]}),(0,r.jsxs)(g.A,{title:"文件列表",extra:(0,r.jsxs)(h.A,{size:8,children:[(0,r.jsxs)(m.Ay,{danger:!0,size:"small",disabled:0===eB,icon:(0,r.jsx)(R.A,{}),onClick:()=>eM("selected"),children:["删除已选 ",eB||""]}),(0,r.jsx)(m.Ay,{danger:!0,size:"small",disabled:0===_.length,onClick:()=>eM("all"),children:"删除全部文件"})]}),children:[k&&(0,r.jsxs)("div",{className:K().statusEmpty,children:["文件列表加载失败:",k]}),(0,r.jsx)(x.A,{rowKey:"key",columns:eD,dataSource:eO,loading:z,size:"middle",expandable:{expandedRowKeys:em,onExpand:eR,childrenColumnName:"children"},locale:{emptyText:z?"正在加载文件列表...":N?e("emptySearch"):e("noFiles")},pagination:!1,rowClassName:e=>e.isFolder?K().folderRow:"",rowSelection:{selectedRowKeys:ei,onChange:en,checkStrictly:!1,getCheckboxProps:e=>{var t;return{disabled:!!e.isFolder&&(null!=(t=e.fileCount)?t:0)===0}}},footer:()=>(0,r.jsxs)("div",{style:{color:"var(--colorTextSecondary)",fontSize:12},children:["当前展示 ",eN.length," 个文件;全部文件 ",_.length," 个;",eO.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:()=>n});var r=l(97109),a=l(53234),s=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 n=r.forwardRef((e,t)=>r.createElement(s.A,i({},e,{ref:t,icon:a.A})))}},e=>{e.O(0,[433,787,576,985,150,289,636,593,792],()=>e(e.s=90426)),_N_E=e.O()}]);
|
|
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"}},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:()=>j});var r=l(51541),a=l(61848),s=l(5669),i=l(97109),n=l(72658),c=l(3638),o=l(92162),d=l(82725),u=l(74567),h=l(632),f=l(49517),m=l(79412),p=l(19527);let v=(0,d.U)(e=>{let{prefixCls:t,className:l,closeIcon:r,closable:a,type:s,title:d,children:v,footer:g,classNames:y,styles:x,...j}=e,{getPrefixCls:w}=i.useContext(u.QO),{className:_,style:A,classNames:b,styles:z}=(0,u.TP)("modal"),C=w(),P=t||w("modal"),k=(0,h.A)(C),[S,M]=(0,p.Ay)(P,k),[N,E]=(0,o.AV)([b,y],[z,x],{props:e}),O=`${P}-confirm`,H={};return H=s?{closable:a??!1,title:"",footer:"",children:i.createElement(f.k,{...e,prefixCls:P,confirmPrefixCls:O,rootPrefixCls:C,content:v})}:{closable:a??!0,title:d,footer:null!==g&&i.createElement(m.w,{...e}),children:v},i.createElement(n.Z,{prefixCls:P,className:(0,c.$)(S,`${P}-pure-panel`,s&&O,s&&`${O}-${s}`,l,_,M,k,N.root),style:{...A,...E.root},...j,closeIcon:(0,m.O)(P,r),closable:a,classNames:N,styles:E,...H})});var g=l(99739);function y(e){return(0,r.Ay)((0,r.fp)(e))}let x=s.A;x.useModal=g.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(;a.A.length;){let e=a.A.pop();e&&e()}},x.config=r.FB,x._InternalPanelDoNotUseOrYouWillBeFired=v;let j=x},26619:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});var r=l(97109),a=l(1611),s=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 n=r.forwardRef((e,t)=>r.createElement(s.A,i({},e,{ref:t,icon:a.A})))},26631:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});var r=l(97109),a=l(12887),s=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 n=r.forwardRef((e,t)=>r.createElement(s.A,i({},e,{ref:t,icon:a.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"}},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 a(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),a=Math.floor(r/24);return a>30?new Date(e).toLocaleDateString(t):"en-US"===t?a>0?"".concat(a,"d ago"):r>0?"".concat(r,"h ago"):l>0?"".concat(l,"m ago"):"Just now":a>0?"".concat(a," 天前"):r>0?"".concat(r," 小时前"):l>0?"".concat(l," 分钟前"):"刚刚"}l.d(t,{Jm:()=>n,fw:()=>a,z3:()=>r});let s={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 n(e){var t;let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";return null!=(t=("en-US"===l?i:s)[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:()=>n});var r=l(97109),a=l(23793),s=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 n=r.forwardRef((e,t)=>r.createElement(s.A,i({},e,{ref:t,icon:a.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:()=>n});var r=l(97109),a=l(30289),s=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 n=r.forwardRef((e,t)=>r.createElement(s.A,i({},e,{ref:t,icon:a.A})))},82738:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>et});var r=l(65321),a=l(97109),s=l(79059),i=l(43220),n=l.n(i),c=l(86109),o=l(17807),d=l(25258),u=l(11702),h=l(33442),f=l(14932),m=l(85114),p=l(7576),v=l(57271),g=l(68787),y=l(99605),x=l(21289),j=l(56768),w=l(48893),_=l(88483);function A(){return(A=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 b=a.forwardRef((e,t)=>a.createElement(_.A,A({},e,{ref:t,icon:w.A})));var z=l(13067);function C(){return(C=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 P=a.forwardRef((e,t)=>a.createElement(_.A,C({},e,{ref:t,icon:z.A})));var k=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=a.forwardRef((e,t)=>a.createElement(_.A,S({},e,{ref:t,icon:k.A})));var N=l(90939);function E(){return(E=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 O=a.forwardRef((e,t)=>a.createElement(_.A,E({},e,{ref:t,icon:N.A})));var H=l(93314),V=l(61825),I=l(26619),T=l(29606),F=l(26631),B=l(64254),L=l(64629),R=l(58209),D=l(30486),U=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 J=a.forwardRef((e,t)=>a.createElement(_.A,$({},e,{ref:t,icon:U.A})));var Q=l(84742),W=l(38762),X=l(6578),q=l(45551),G=l(14569),K=l.n(G);let Z=["document","spreadsheet","image","cad","code","data","web","diagram","other"],Y=/\.(zip|jar|war|apk|tar|gz|tgz|bz2|rar|7z)$/iu,ee=/(^|\/)\.DS_Store$|(^|\/)Thumbs\.db$|(^|\/)__MACOSX\/|\.bak$/iu;function et(){let e=(0,s.Vr)("knowledge"),{locale:t}=(0,s.x_)(),{message:l}=o.A.useApp(),i=(0,c.useRouter)(),w="string"==typeof i.query.category?i.query.category:"",[_,A]=(0,a.useState)([]),[z,C]=(0,a.useState)(!1),[k,S]=(0,a.useState)(""),[N,E]=(0,a.useState)(""),[U,$]=(0,a.useState)(w),[G,et]=(0,a.useState)(!1),[el,er]=(0,a.useState)(!1),[ea,es]=(0,a.useState)([]),[ei,en]=(0,a.useState)([]),[ec,eo]=(0,a.useState)(new Set),[ed,eu]=(0,a.useState)("all"),[eh,ef]=(0,a.useState)(!0),[em,ep]=(0,a.useState)([]),[ev,eg]=(0,a.useState)(new Set),ey=(0,a.useRef)(U);(0,a.useEffect)(()=>{ey.current=U},[U]),(0,a.useEffect)(()=>{$("string"==typeof i.query.category?i.query.category:"")},[i.query.category]);let ex=(0,a.useCallback)(async(e,t)=>{let l=null!=e?e:ey.current;(null==t?void 0:t.silent)||(C(!0),S(""));try{let e=await (0,X.HT)({category:l||void 0,limit:5e3});A(e.files||[]),e.initializing&&window.setTimeout(()=>{ex(l,{silent:!0})},3e3)}catch(e){(null==t?void 0:t.silent)||(A([]),S(e instanceof Error?e.message:"文件列表加载失败"))}finally{(null==t?void 0:t.silent)||C(!1)}},[]);(0,a.useEffect)(()=>{ex(U)},[U,ex]);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}),ew=(0,a.useCallback)(async()=>{try{let e=(await (0,X.Qx)()).operations.map(ej);es(t=>{let l=new Set(e.map(e=>e.id).filter(Boolean)),r=e.map(e=>{var l;let r=t.find(t=>t.id===e.id);return r?{...r,...e,createdAt:null!=(l=r.createdAt)?l:e.createdAt}:e}),a=t.filter(e=>e.id&&!l.has(e.id)&&"processing"===e.status);return[...r,...a].slice(0,50)})}catch(e){}},[]),e_=(0,a.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];es(l=>{let r=l.findIndex(l=>e.id&&l.id===e.id||t.includes(l.title));if(r>=0){var a;let t=[...l];return t[r]={...l[r],...e,createdAt:null!=(a=l[r].createdAt)?a:e.createdAt},t}return[e,...l].slice(0,50)})},[]);(0,a.useEffect)(()=>{ew()},[ew]);let eA=async()=>{try{await (0,X.H7)(),es([]),l.success("任务状态已清空")}catch(e){l.error("清空任务状态失败")}},eb=async(e,t)=>{if(t.stopPropagation(),e.id)try{await (0,X.CU)(e.id)}catch(e){}es(t=>t.filter(t=>t!==e))},ez=(0,a.useMemo)(()=>{let e=0,t=0,l=0;for(let r of ea)"processing"===r.status?e++:"success"===r.status?t++:("error"===r.status||"warning"===r.status)&&l++;return{processing:e,success:t,error:l}},[ea]);(0,a.useEffect)(()=>{ez.processing>0&&ef(!1)},[ez.processing]),(0,a.useEffect)(()=>{if(0===ez.processing)return;let e=window.setInterval(()=>{ew()},2e3),t=window.setInterval(()=>{ex(void 0,{silent:!0})},8e3);return()=>{window.clearInterval(e),window.clearInterval(t)}},[ex,ew,ez.processing]);let eC="all"===ed?ea:ea.filter(e=>"processing"===ed?"processing"===e.status:"success"===ed?"success"===e.status:"error"!==ed||"error"===e.status||"warning"===e.status),eP=async e=>{let t=e.filter(e=>{let t=e.webkitRelativePath||e.name;return e.size>0&&!Y.test(e.name)&&!ee.test(t)}),r=e.length-t.length;if(r>0&&l.warning("已跳过 ".concat(r," 个空文件、系统文件、备份文件或压缩包")),0===t.length)return;let a=1===t.length?t[0].name:"".concat(t.length," 个文件");et(!0);let s="".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2));e_({id:s,type:"upload",title:"上传 ".concat(a),description:"等待上传、解析、切片和入库;同路径文件会更新,其他已有文件不会清除",status:"processing",percent:5});try{await (0,X.c1)(t,void 0,s,e=>{e_({id:s,type:"upload",title:"上传 ".concat(a),description:"正在上传文件:".concat(e.uploadedFiles,"/").concat(e.totalFiles,",批次 ").concat(e.batchIndex+1,"/").concat(e.totalBatches),status:"processing",percent:Math.min(5,Math.max(1,Math.round(e.uploadedFiles/Math.max(1,e.totalFiles)*5)))})}),l.info("文件已上传,正在后台解析、切片和入库;同路径文件会更新,其他已有文件不会清除,可在顶部“后台任务”查看进度"),E(""),$(""),en([]),ey.current="",await ew(),window.setTimeout(()=>{ex(void 0,{silent:!0})},2e3)}catch(t){let e=t instanceof Error?t.message:"请重试或检查文件格式";l.error(e||"上传失败"),e_({id:s,type:"error",title:"上传失败 ".concat(a),description:e,status:"error",percent:100})}finally{et(!1)}},ek=async()=>{er(!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)(),a=r.operationId||e,s=r.job;l.info(r.alreadyRunning?"已有重新解析任务正在后台执行":"已提交重新解析入库任务,可在顶部“后台任务”查看进度"),e_({id:a,type:"reindex",title:(null==s?void 0:s.title)||"重新解析入库",description:(null==s?void 0:s.message)||"后台将重新扫描文件、解析、切片并重建索引",status:(null==s?void 0:s.status)||"processing",percent:null!=(t=null==s?void 0:s.percent)?t:10,error:null==s?void 0:s.error},["重新解析入库"]);for(let e=0;e<360;e++){let e=await (0,X.ax)(a).then(e=>e.job).catch(async()=>(await (0,X.Qx)()).operations.find(e=>e.id===a));if(e){let t="success"===e.status||"error"===e.status;if(e_({id:a,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 ex(),await ew()}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{er(!1)}},eS=async e=>{let t="file-reindex-ui-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2));eg(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 a=await (0,X.HC)(e.relativePath),s=a.operationId||t,i=a.job;l.info(a.alreadyRunning?"已有知识库任务正在后台执行":"已提交单文件重新解析任务"),e_({id:s,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)(s).then(e=>e.job).catch(async()=>(await (0,X.Qx)()).operations.find(e=>e.id===s));if(t){let r="success"===t.status||"error"===t.status;if(e_({id:s,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 ex(),r){"success"===t.status?l.success(t.message||"单文件重新解析完成"):l.error(t.error||t.message||"单文件重新解析失败");break}}await new Promise(e=>setTimeout(e,1e3))}await ex(),await ew()}catch(a){let r=a instanceof Error?a.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{eg(t=>{let l=new Set(t);return l.delete(e.relativePath),l})}},eM=t=>{let r="selected"===t?eF:"filtered"===t?eN.map(e=>e.relativePath):[],a=_.length;if("all"!==t&&0===r.length||"all"===t&&0===a)return void l.info("没有可删除的文件");let s="all"===t?"删除全部文件 ".concat(a," 个?"):"filtered"===t?"删除当前筛选结果中的文件 ".concat(r.length," 个?"):"删除已选文件 ".concat(r.length," 个?");d.A.confirm({title:s,content:"将同时删除文件、切片、索引和向量记录。此操作不可撤销。",okText:e("common.delete"),cancelText:e("common.cancel"),okButtonProps:{danger:!0},onOk:async()=>{es(e=>[{type:"delete",title:s,description:"正在批量删除文件和索引",status:"processing",percent:10},...e].slice(0,50));try{var e;let s=null!=(e=("all"===t?await (0,X.X8)():"selected"===t?await (0,X.tZ)(eT,eI):await (0,X.SJ)(r)).deleted)?e:"all"===t?a:r.length;l.success("已删除 ".concat(s," 个文件")),en([]),es(e=>[{type:"delete",title:"批量删除完成",description:"已删除 ".concat(s," 个文件、切片和索引"),status:"success"},...e].slice(0,50)),await ex(),await ew()}catch(e){l.error("批量删除失败"),es(e=>[{type:"error",title:"批量删除失败",description:"请重试",status:"error"},...e].slice(0,50))}}})},eN=(0,a.useMemo)(()=>N?_.filter(e=>e.relativePath.toLowerCase().includes(N.toLowerCase())):_,[N,_]),eE=(0,a.useMemo)(()=>new Set(eN.map(e=>e.relativePath)),[eN]),eO=(0,a.useMemo)(()=>{let e={};for(let l of[...eN].sort((e,t)=>e.relativePath.localeCompare(t.relativePath))){let r=l.relativePath.split("/"),a="";for(let s=0;s<r.length;s++){let i=r[s],n=a;a=a?"".concat(a,"/").concat(i):i;let c=s===r.length-1;if(e[a])c||e[a].isFolder?c&&(e[a].isFolder=!1,e[a].file=l,e[a].fileCount=1,e[a].totalSize=l.fileSize,e[a].totalChunks=l.chunkCount):(e[a].isFolder=!0,e[a].children=[],e[a].fileCount=0,e[a].totalSize=0,e[a].totalChunks=0);else{var t;e[a]={key:a,name:i,isFolder:!c,...c?{file:l,fileCount:1,totalSize:l.fileSize,totalChunks:l.chunkCount}:{children:[],fileCount:0,totalSize:0,totalChunks:0}},n&&(null==(t=e[n])?void 0:t.children)&&e[n].children.push(e[a])}}}let l=e=>{for(let s of e)if(s.children){l(s.children);let e=0,i=0,n=0;for(let l of s.children){var t,r,a;e+=null!=(t=l.fileCount)?t:0,i+=null!=(r=l.totalSize)?r:0,n+=null!=(a=l.totalChunks)?a:0}s.fileCount=e,s.totalSize=i,s.totalChunks=n}},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}),a=Object.values(e).filter(e=>!e.key.includes("/"));return l(a),r(a)},[eN]),eH=(0,a.useMemo)(()=>{let e=[],t=l=>{for(let r of l)e.push(r.key),r.children&&t(r.children)};return t(eO),e},[eO]),eV=(0,a.useMemo)(()=>new Set([...eE,...eH]),[eH,eE]),eI=(0,a.useMemo)(()=>ei.map(String).filter(e=>!eE.has(e)&&eH.includes(e)),[eH,ei,eE]),eT=(0,a.useMemo)(()=>ei.map(String).filter(e=>eE.has(e)),[ei,eE]),eF=(0,a.useMemo)(()=>{let e=new Set;for(let t of eT){let l=_.find(e=>e.relativePath===t);l&&e.add(l.relativePath)}for(let t of eI){let l="".concat(t,"/");for(let t of _)t.relativePath.startsWith(l)&&e.add(t.relativePath)}return Array.from(e)},[_,eT,eI]),eB=eF.length;(0,a.useEffect)(()=>{en(e=>e.filter(e=>eV.has(String(e))))},[eV]);let eL=(0,a.useMemo)(()=>N?eH:eO.map(e=>e.key),[N,eH,eO]);(0,a.useEffect)(()=>{ep(eL)},[eL]);let eR=(e,t)=>{ep(l=>e?[...l,t.key]:l.filter(e=>e!==t.key))},eD=[{title:e("fileName"),dataIndex:"name",key:"name",render:(e,t)=>(0,r.jsxs)("span",{className:K().fileNameCell,children:[t.isFolder?(0,r.jsx)("span",{style:{cursor:"pointer"},onClick:e=>{e.stopPropagation(),eR(!em.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)(T.A,{style:{color:"#fa8c16",fontSize:15}})})(t)}):(e=>{if(!e)return(0,r.jsx)(j.A,{style:{fontSize:15}});let t=e.category;return"image"===t?(0,r.jsx)(b,{style:{color:"#eb2f96",fontSize:15}}):"spreadsheet"===t?(0,r.jsx)(P,{style:{color:"#52c41a",fontSize:15}}):"document"===t?(0,r.jsx)(M,{style:{color:"#1677ff",fontSize:15}}):"code"===t?(0,r.jsx)(O,{style:{color:"#fa8c16",fontSize:15}}):"archive"===t?(0,r.jsx)(H.A,{style:{color:"#8c8c8c",fontSize:15}}):"web"===t?(0,r.jsx)(V.A,{style:{color:"#13c2c2",fontSize:15}}):"data"===t?(0,r.jsx)(I.A,{style:{color:"#722ed1",fontSize:15}}):"cad"===t?(0,r.jsx)(T.A,{style:{color:"#fa541c",fontSize:15}}):"diagram"===t?(0,r.jsx)(b,{style:{color:"#a0d911",fontSize:15}}):(0,r.jsx)(F.A,{style:{fontSize:15}})})(t.file),t.isFolder?(0,r.jsx)("span",{className:K().folderName,onClick:e=>{e.stopPropagation(),eR(!em.includes(t.key),t)},children:t.name}):(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(n(),{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 a,s;return l.isFolder?(0,r.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(0,r.jsx)(u.A,{children:(0,q.Jm)(null!=(s=null==(a=l.file)?void 0:a.category)?s:"",t)})}},{title:e("fileSize"),dataIndex:"fileSize",key:"size",width:90,render:(e,t)=>{var l,r,a;return(0,q.z3)(t.isFolder?null!=(r=t.totalSize)?r:0:null!=(a=null==(l=t.file)?void 0:l.fileSize)?a:0)}},{title:"切片",dataIndex:"chunkCount",key:"chunks",width:80,render:(e,t)=>{var l,a,s;let i=t.isFolder?null!=(a=t.totalChunks)?a:0:null!=(s=null==(l=t.file)?void 0:l.chunkCount)?s:0;return(0,r.jsx)(u.A,{color:i>1?"green":"orange",children:i})}},{title:"解析状态",dataIndex:"status",key:"status",width:100,render:(e,t)=>{var l,a,s,i;return t.isFolder?(0,r.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(0,r.jsx)(u.A,{color:"active"===(i=null==(l=t.file)?void 0:l.status)?"green":"processing"===i||"indexing"===i?"blue":"error"===i?"red":"orange",children:(null==(a=t.file)?void 0:a.errorMessage)||(null==(s=t.file)?void 0:s.status)||"—"})}},{title:e("fileDate"),dataIndex:"mtime",key:"date",width:130,render:(e,l)=>{var a;return l.isFolder?(0,r.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(null==(a=l.file)?void 0:a.mtime)?new Date(l.file.mtime).toLocaleDateString(t):"—"}},{title:"来源",key:"source",width:100,render:(e,t)=>t.isFolder?(0,r.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(0,r.jsx)(u.A,{color:"cyan",children:"文件"})},{title:"",key:"act",width:100,render:(t,a)=>a.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",loading:!!(a.file&&ev.has(a.file.relativePath)),icon:(0,r.jsx)(L.A,{}),onClick:()=>{eS(a.file)}})}),(0,r.jsx)(m.Ay,{type:"text",danger:!0,size:"small",icon:(0,r.jsx)(R.A,{}),onClick:()=>{var t;return t=a.file,void d.A.confirm({title:e("delete"),content:e("deleteConfirm"),okText:e("common.confirm"),cancelText:e("common.cancel"),okButtonProps:{danger:!0},onOk:async()=>{es(e=>[{type:"delete",title:"删除 ".concat(t.relativePath),description:"正在删除文件记录",status:"processing"},...e].slice(0,50));try{await (0,X.xq)(t.relativePath),l.success("已删除"),es(e=>[{type:"delete",title:"删除完成 ".concat(t.relativePath),description:"文件和索引记录已移除",status:"success"},...e].slice(0,50)),en(e=>e.filter(e=>e!==t.relativePath)),await ex(),await ew()}catch(e){l.error("删除失败"),es(e=>[{type:"error",title:"删除失败 ".concat(t.relativePath),description:"请重试",status:"error"},...e].slice(0,50))}}})}})]})}];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=>{E(e.target.value)},allowClear:!0,className:K().filterInput}),(0,r.jsx)(v.A,{value:U||void 0,onChange:e=>{$(e||"")},placeholder:e("filterCategory"),allowClear:!0,className:K().filterSelect,options:[{label:e("allCategories"),value:""},...Z.map(e=>({label:(0,q.Jm)(e,t),value:e}))]}),(0,r.jsx)(m.Ay,{type:"primary",icon:(0,r.jsx)(J,{}),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)(J,{}),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:el,onClick:()=>{ek()},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)(g.A,{size:"small",className:K().statusCard,styles:{body:{padding:0}},children:[(0,r.jsxs)("div",{className:K().statusSummary,onClick:()=>ef(!eh),children:[(0,r.jsx)("span",{className:K().statusSummaryText,children:0===ea.length?"暂无文件任务":(0,r.jsxs)(h.A,{size:6,children:[ez.processing>0&&(0,r.jsxs)(u.A,{color:"processing",style:{margin:0},icon:(0,r.jsx)(L.A,{spin:!0}),children:["处理中 ",ez.processing]}),(0,r.jsxs)(u.A,{color:"success",style:{margin:0},icon:(0,r.jsx)(Q.A,{}),children:["已完成 ",ez.success]}),(0,r.jsxs)(u.A,{color:"error",style:{margin:0},icon:(0,r.jsx)(W.A,{}),children:["失败 ",ez.error]})]})}),ea.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(),ef(!eh)},children:eh?"展开":"收起"})]})]}),!eh&&ea.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"===ed?K().filterPillActive:""),style:"all"===ed?{color:"#1677ff"}:void 0,onClick:()=>eu("all"),children:["全部 ",(0,r.jsx)("b",{children:ea.length})]}),(0,r.jsxs)("span",{className:"".concat(K().filterPill," ").concat("processing"===ed?K().filterPillActive:""),style:"processing"===ed?{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"===ed?K().filterPillActive:""),style:"success"===ed?{color:"#52c41a"}:void 0,onClick:()=>eu("success"),children:[(0,r.jsx)(Q.A,{})," 已完成 ",(0,r.jsx)("b",{children:ez.success})]}),(0,r.jsxs)("span",{className:"".concat(K().filterPill," ").concat("error"===ed?K().filterPillActive:""),style:"error"===ed?{color:"#ff4d4f"}:void 0,onClick:()=>eu("error"),children:[(0,r.jsx)(W.A,{})," 失败 ",(0,r.jsx)("b",{children:ez.error})]})]}),(0,r.jsx)("div",{className:K().timelineList,children:0===eC.length?(0,r.jsx)("div",{className:K().statusEmpty,children:"没有匹配的任务"}):eC.map((e,l)=>{var a;let s=e.id||"".concat(e.type,"-").concat(null!=(a=e.createdAt)?a:e.title,"-").concat(l),i=ec.has(s);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(s)?t.delete(s):t.add(s),t})},children:[(0,r.jsx)("span",{className:K().timelineStatusIcon,children:"success"===e.status?(0,r.jsx)(Q.A,{style:{color:"#52c41a"}}):"processing"===e.status?(0,r.jsx)(L.A,{spin:!0,style:{color:"#1677ff"}}):"error"===e.status?(0,r.jsx)(W.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=>{eb(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:"此任务失败,请重新上传文件或重试操作"})]})]},s)})})]})]}),(0,r.jsxs)(g.A,{title:"文件列表",extra:(0,r.jsxs)(h.A,{size:8,children:[(0,r.jsxs)(m.Ay,{danger:!0,size:"small",disabled:0===eB,icon:(0,r.jsx)(R.A,{}),onClick:()=>eM("selected"),children:["删除已选 ",eB||""]}),(0,r.jsx)(m.Ay,{danger:!0,size:"small",disabled:0===_.length,onClick:()=>eM("all"),children:"删除全部文件"})]}),children:[k&&(0,r.jsxs)("div",{className:K().statusEmpty,children:["文件列表加载失败:",k]}),(0,r.jsx)(x.A,{rowKey:"key",columns:eD,dataSource:eO,loading:z,size:"middle",expandable:{expandedRowKeys:em,onExpand:eR,childrenColumnName:"children"},locale:{emptyText:z?"正在加载文件列表...":N?e("emptySearch"):e("noFiles")},pagination:!1,rowClassName:e=>e.isFolder?K().folderRow:"",rowSelection:{selectedRowKeys:ei,onChange:en,checkStrictly:!1,getCheckboxProps:e=>{var t;return{disabled:!!e.isFolder&&(null!=(t=e.fileCount)?t:0)===0}}},footer:()=>(0,r.jsxs)("div",{style:{color:"var(--colorTextSecondary)",fontSize:12},children:["当前展示 ",eN.length," 个文件;全部文件 ",_.length," 个;",eO.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:()=>n});var r=l(97109),a=l(53234),s=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 n=r.forwardRef((e,t)=>r.createElement(s.A,i({},e,{ref:t,icon:a.A})))}},e=>{e.O(0,[433,787,576,985,375,102,289,636,593,792],()=>e(e.s=90426)),_N_E=e.O()}]);
|
package/.next/static/chunks/pages/system/{logs-3826fa44a76b12fc.js → logs-cbeeb77dc70086ae.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[979],{14995:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"}},39214:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/system/logs",function(){return r(91698)}])},91698:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>k});var a=r(65321),s=r(97109),i=r(35292),n=r(9137),l=r(11702),o=r(88762),c=r(33442),d=r(85114),h=r(26171),p=r(85493),g=r(7576),u=r(21289),x=r(84253),f=r(99811),y=r(58209),m=r(96651),w=r(60470),j=r(79059),v=r(6578);let{Text:A,Paragraph:b}=i.A;function k(){let e=(0,j.Vr)(),[t,r]=(0,s.useState)([]),[i,k]=(0,s.useState)(!0),[S,z]=(0,s.useState)(""),[I,C]=(0,s.useState)(!1),N=async()=>{k(!0);try{r((await (0,v.oH)(500)).logs)}catch(e){n.Ay.error(e instanceof Error?e.message:"加载日志失败")}finally{k(!1)}};(0,s.useEffect)(()=>{N()},[]);let B=(0,s.useMemo)(()=>{let e=S.trim().toLowerCase();return e?t.filter(t=>[t.id,t.level,t.source,t.functionName,t.message,t.stack].filter(Boolean).some(t=>String(t).toLowerCase().includes(e))):t},[S,t]),O=[{title:"序号",key:"index",width:70,render:(e,t,r)=>r+1},{title:"时间",dataIndex:"createdAt",width:170,render:e=>new Date(e).toLocaleString()},{title:"级别",dataIndex:"level",width:80,render:e=>(0,a.jsx)(l.A,{color:"error"===e?"error":"warn"===e?"warning":"blue",style:{margin:0},children:e})},{title:"来源",dataIndex:"source",width:200,render:e=>(0,a.jsx)(A,{code:!0,style:{fontSize:12},children:e})},{title:"函数",dataIndex:"functionName",width:160,render:e=>e?(0,a.jsx)(A,{code:!0,style:{fontSize:12},children:e}):(0,a.jsx)(A,{type:"secondary",children:"-"})},{title:"错误信息",dataIndex:"message",render:e=>(0,a.jsx)(b,{style:{maxWidth:480,overflowWrap:"anywhere",wordBreak:"break-all",marginBottom:0,fontSize:12},ellipsis:{rows:2,expandable:!0,symbol:"展开"},children:e})},{title:"Request ID",dataIndex:"id",width:200,render:e=>(0,a.jsx)(A,{copyable:!0,code:!0,style:{fontSize:12},children:e.slice(0,8)})}];return i&&0===t.length?(0,a.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,a.jsx)(o.A,{active:!0,title:!0,paragraph:{rows:1}}),(0,a.jsx)(o.A,{active:!0,paragraph:{rows:12}})]}):(0,a.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:12},children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"pageTitle",children:e("nav.systemLogs")}),(0,a.jsx)("p",{className:"pageDesc",children:"查看 API 异常、模型健康检查失败、PDF 降级等运行时问题。"})]}),(0,a.jsxs)(c.A,{children:[(0,a.jsx)(d.Ay,{icon:(0,a.jsx)(f.A,{}),loading:i,onClick:()=>void N(),children:"刷新"}),(0,a.jsx)(h.A,{title:"确认清空所有错误日志?",onConfirm:()=>{(async()=>{await (0,v.hH)(),n.Ay.success("已清空"),await N()})()},children:(0,a.jsx)(d.Ay,{danger:!0,icon:(0,a.jsx)(y.A,{}),children:"清空日志"})})]})]}),(0,a.jsx)(p.A,{type:"info",showIcon:!0,message:(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,a.jsx)("span",{children:"日志保存在本机 ~/.customize-agent/logs/errors.jsonl,最多读取最近 500 条。"}),(0,a.jsx)(d.Ay,{type:"link",size:"small",icon:I?(0,a.jsx)(m.A,{}):(0,a.jsx)(w.A,{}),onClick:()=>C(!I),style:{padding:"0 4px"},children:I?"收起":"展开"})]}),description:I?"系统自动记录未捕获的异常、API 错误、模型健康检查失败等运行时问题。日志文件超过 2MB 会自动轮转。":void 0}),(0,a.jsx)(g.A.Search,{allowClear:!0,placeholder:"搜索 requestId / source / function / message / stack",value:S,onChange:e=>z(e.target.value),style:{maxWidth:480}}),(0,a.jsx)(u.A,{rowKey:"id",loading:i,dataSource:B,columns:O,size:"middle",locale:{emptyText:(0,a.jsx)(x.A,{description:"暂无错误日志"})},pagination:{pageSize:20,showSizeChanger:!0,showTotal:e=>"共 ".concat(e," 条")},expandable:{expandedRowRender:e=>(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8,padding:"8px 0"},children:[e.request&&(0,a.jsxs)("div",{children:[(0,a.jsx)(A,{strong:!0,style:{fontSize:12,marginBottom:4,display:"block"},children:"Request"}),(0,a.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0,padding:10,background:"var(--colorFillAlter)",borderRadius:8,fontSize:12,lineHeight:1.5},children:JSON.stringify(e.request,null,2)})]}),void 0!==e.meta&&(0,a.jsxs)("div",{children:[(0,a.jsx)(A,{strong:!0,style:{fontSize:12,marginBottom:4,display:"block"},children:"Meta"}),(0,a.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0,padding:10,background:"var(--colorFillAlter)",borderRadius:8,fontSize:12,lineHeight:1.5},children:JSON.stringify(e.meta,null,2)})]}),e.stack&&(0,a.jsxs)("div",{children:[(0,a.jsx)(A,{strong:!0,style:{fontSize:12,marginBottom:4,display:"block"},children:"Stack"}),(0,a.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0,padding:10,background:"var(--colorFillAlter)",borderRadius:8,fontSize:12,lineHeight:1.5,maxHeight:300,overflow:"auto"},children:e.stack})]})]})}})]})}},92123:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"}},96651:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var a=r(97109),s=r(92123),i=r(88483);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let l=a.forwardRef((e,t)=>a.createElement(i.A,n({},e,{ref:t,icon:s.A})))},99811:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var a=r(97109),s=r(14995),i=r(88483);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let l=a.forwardRef((e,t)=>a.createElement(i.A,n({},e,{ref:t,icon:s.A})))}},e=>{e.O(0,[433,576,195,985,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[979],{14995:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"}},39214:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/system/logs",function(){return r(91698)}])},91698:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>k});var a=r(65321),s=r(97109),i=r(35292),n=r(9137),l=r(11702),o=r(88762),c=r(33442),d=r(85114),h=r(26171),p=r(85493),g=r(7576),u=r(21289),x=r(84253),f=r(99811),y=r(58209),m=r(96651),w=r(60470),j=r(79059),v=r(6578);let{Text:A,Paragraph:b}=i.A;function k(){let e=(0,j.Vr)(),[t,r]=(0,s.useState)([]),[i,k]=(0,s.useState)(!0),[S,z]=(0,s.useState)(""),[I,C]=(0,s.useState)(!1),N=async()=>{k(!0);try{r((await (0,v.oH)(500)).logs)}catch(e){n.Ay.error(e instanceof Error?e.message:"加载日志失败")}finally{k(!1)}};(0,s.useEffect)(()=>{N()},[]);let B=(0,s.useMemo)(()=>{let e=S.trim().toLowerCase();return e?t.filter(t=>[t.id,t.level,t.source,t.functionName,t.message,t.stack].filter(Boolean).some(t=>String(t).toLowerCase().includes(e))):t},[S,t]),O=[{title:"序号",key:"index",width:70,render:(e,t,r)=>r+1},{title:"时间",dataIndex:"createdAt",width:170,render:e=>new Date(e).toLocaleString()},{title:"级别",dataIndex:"level",width:80,render:e=>(0,a.jsx)(l.A,{color:"error"===e?"error":"warn"===e?"warning":"blue",style:{margin:0},children:e})},{title:"来源",dataIndex:"source",width:200,render:e=>(0,a.jsx)(A,{code:!0,style:{fontSize:12},children:e})},{title:"函数",dataIndex:"functionName",width:160,render:e=>e?(0,a.jsx)(A,{code:!0,style:{fontSize:12},children:e}):(0,a.jsx)(A,{type:"secondary",children:"-"})},{title:"错误信息",dataIndex:"message",render:e=>(0,a.jsx)(b,{style:{maxWidth:480,overflowWrap:"anywhere",wordBreak:"break-all",marginBottom:0,fontSize:12},ellipsis:{rows:2,expandable:!0,symbol:"展开"},children:e})},{title:"Request ID",dataIndex:"id",width:200,render:e=>(0,a.jsx)(A,{copyable:!0,code:!0,style:{fontSize:12},children:e.slice(0,8)})}];return i&&0===t.length?(0,a.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,a.jsx)(o.A,{active:!0,title:!0,paragraph:{rows:1}}),(0,a.jsx)(o.A,{active:!0,paragraph:{rows:12}})]}):(0,a.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:12},children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"pageTitle",children:e("nav.systemLogs")}),(0,a.jsx)("p",{className:"pageDesc",children:"查看 API 异常、模型健康检查失败、PDF 降级等运行时问题。"})]}),(0,a.jsxs)(c.A,{children:[(0,a.jsx)(d.Ay,{icon:(0,a.jsx)(f.A,{}),loading:i,onClick:()=>void N(),children:"刷新"}),(0,a.jsx)(h.A,{title:"确认清空所有错误日志?",onConfirm:()=>{(async()=>{await (0,v.hH)(),n.Ay.success("已清空"),await N()})()},children:(0,a.jsx)(d.Ay,{danger:!0,icon:(0,a.jsx)(y.A,{}),children:"清空日志"})})]})]}),(0,a.jsx)(p.A,{type:"info",showIcon:!0,message:(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,a.jsx)("span",{children:"日志保存在本机 ~/.customize-agent/logs/errors.jsonl,最多读取最近 500 条。"}),(0,a.jsx)(d.Ay,{type:"link",size:"small",icon:I?(0,a.jsx)(m.A,{}):(0,a.jsx)(w.A,{}),onClick:()=>C(!I),style:{padding:"0 4px"},children:I?"收起":"展开"})]}),description:I?"系统自动记录未捕获的异常、API 错误、模型健康检查失败等运行时问题。日志文件超过 2MB 会自动轮转。":void 0}),(0,a.jsx)(g.A.Search,{allowClear:!0,placeholder:"搜索 requestId / source / function / message / stack",value:S,onChange:e=>z(e.target.value),style:{maxWidth:480}}),(0,a.jsx)(u.A,{rowKey:"id",loading:i,dataSource:B,columns:O,size:"middle",locale:{emptyText:(0,a.jsx)(x.A,{description:"暂无错误日志"})},pagination:{pageSize:20,showSizeChanger:!0,showTotal:e=>"共 ".concat(e," 条")},expandable:{expandedRowRender:e=>(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8,padding:"8px 0"},children:[e.request&&(0,a.jsxs)("div",{children:[(0,a.jsx)(A,{strong:!0,style:{fontSize:12,marginBottom:4,display:"block"},children:"Request"}),(0,a.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0,padding:10,background:"var(--colorFillAlter)",borderRadius:8,fontSize:12,lineHeight:1.5},children:JSON.stringify(e.request,null,2)})]}),void 0!==e.meta&&(0,a.jsxs)("div",{children:[(0,a.jsx)(A,{strong:!0,style:{fontSize:12,marginBottom:4,display:"block"},children:"Meta"}),(0,a.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0,padding:10,background:"var(--colorFillAlter)",borderRadius:8,fontSize:12,lineHeight:1.5},children:JSON.stringify(e.meta,null,2)})]}),e.stack&&(0,a.jsxs)("div",{children:[(0,a.jsx)(A,{strong:!0,style:{fontSize:12,marginBottom:4,display:"block"},children:"Stack"}),(0,a.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0,padding:10,background:"var(--colorFillAlter)",borderRadius:8,fontSize:12,lineHeight:1.5,maxHeight:300,overflow:"auto"},children:e.stack})]})]})}})]})}},92123:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"}},96651:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var a=r(97109),s=r(92123),i=r(88483);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let l=a.forwardRef((e,t)=>a.createElement(i.A,n({},e,{ref:t,icon:s.A})))},99811:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var a=r(97109),s=r(14995),i=r(88483);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let l=a.forwardRef((e,t)=>a.createElement(i.A,n({},e,{ref:t,icon:s.A})))}},e=>{e.O(0,[433,576,195,985,375,102,289,861,636,593,792],()=>e(e.s=39214)),_N_E=e.O()}]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@customize-agent/server",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.53",
|
|
4
4
|
"description": "Customize Agent Web 管理控制台",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./package.json": "./package.json"
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"tesseract.js": "^7.0.0",
|
|
50
50
|
"typescript": "^6.0.3",
|
|
51
51
|
"xlsx": "^0.18.5",
|
|
52
|
-
"@customize-agent/
|
|
53
|
-
"@customize-agent/
|
|
54
|
-
"@customize-agent/
|
|
52
|
+
"@customize-agent/knowledge": "^4.0.19",
|
|
53
|
+
"@customize-agent/runtime": "^3.0.9",
|
|
54
|
+
"@customize-agent/llm": "^3.0.7"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@tailwindcss/postcss": "^4.3.2",
|
|
@@ -13,11 +13,19 @@ const required = [
|
|
|
13
13
|
|
|
14
14
|
for (const item of required) {
|
|
15
15
|
if (!fs.existsSync(item)) {
|
|
16
|
-
console.error(`Missing Next build
|
|
16
|
+
console.error(`[server] Missing Next build artifact: ${path.relative(root, item)}`);
|
|
17
|
+
console.error('[server] Run `pnpm build` in apps/server before `pnpm start`.');
|
|
17
18
|
process.exit(1);
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
|
|
22
|
+
const apiRuntime = path.join(nextDir, 'server', 'webpack-api-runtime.js');
|
|
23
|
+
if (fs.existsSync(apiRuntime)) {
|
|
24
|
+
const runtime = fs.readFileSync(apiRuntime, 'utf8');
|
|
25
|
+
const patched = runtime.replace(/\.\/chunks\/vendor-chunks\//gu, './vendor-chunks/');
|
|
26
|
+
if (patched !== runtime) fs.writeFileSync(apiRuntime, patched);
|
|
27
|
+
}
|
|
28
|
+
|
|
21
29
|
const manifest = JSON.parse(fs.readFileSync(path.join(nextDir, 'build-manifest.json'), 'utf8'));
|
|
22
30
|
const files = new Set();
|
|
23
31
|
for (const value of Object.values(manifest.pages || {})) {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
self.__BUILD_MANIFEST=function(s,e,t,c,a,n,d,i,r,u,o,k,f,b,g,h,l,j,m){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},__routerFilterStatic:{numItems:0,errorRate:1e-4,numBits:0,numHashes:f,bitArray:[]},__routerFilterDynamic:{numItems:r,errorRate:1e-4,numBits:r,numHashes:f,bitArray:[]},"/":[s,e,b,g,"static/chunks/pages/index-a2a24e9602e7ea52.js"],"/_error":["static/chunks/pages/_error-282257fbdcc167b4.js"],"/asset-library":[s,e,n,"static/chunks/749-83476f9bcd014a5a.js","static/chunks/pages/asset-library-e9ddfe1cbaac42d9.js"],"/context/long-term":[s,e,t,c,a,n,d,i,h,"static/chunks/pages/context/long-term-6b9a9683a4d6ea86.js"],"/context/short-term":[s,e,t,c,a,n,d,i,h,"static/chunks/pages/context/short-term-6078efae6e3a905c.js"],"/document-roles":[s,e,t,c,i,"static/chunks/496-4fb9a063790e65ff.js","static/chunks/pages/document-roles-fd02980db151650c.js"],"/documents":[s,e,t,c,i,u,l,"static/chunks/304-7bc5b1cd0b9315a1.js","static/chunks/pages/documents-9967f1fdf3fb6d03.js"],"/guide":[s,e,l,"static/chunks/20-00147a779147a5a4.js","static/chunks/pages/guide-cba4ca0b28bb9b64.js"],"/knowledge":["static/chunks/pages/knowledge-905248d8dcb15453.js"],"/knowledge/file-detail":[s,e,t,a,n,d,u,j,o,"static/chunks/pages/knowledge/file-detail-2e874c92d01b1c14.js"],"/knowledge/files":[s,e,t,a,n,d,o,"static/chunks/pages/knowledge/files-9d30d5f23d78f46b.js"],"/knowledge/manage":[s,e,u,"static/chunks/788-7f7359a830e3f4fd.js","static/chunks/pages/knowledge/manage-ed99a6cb254ddbb7.js"],"/knowledge/search":[s,e,t,u,m,o,"static/chunks/pages/knowledge/search-afb423fc22eb623b.js"],"/models":[s,e,t,c,a,i,m,"static/chunks/647-d5e08fda405f7059.js","static/chunks/pages/models-d5e80645dc4a61b1.js"],"/overview":[s,e,b,g,"static/chunks/pages/overview-1260176045ed5f7a.js"],"/prompt":[s,e,t,c,a,"static/chunks/525-5d947137d894f5fe.js","static/chunks/pages/prompt-9b869fbe3463020d.js"],"/settings":[s,e,"static/chunks/pages/settings-fa9d6a56898ba678.js"],"/system/logs":[s,t,c,a,n,d,j,"static/chunks/pages/system/logs-3826fa44a76b12fc.js"],sortedPages:["/","/_app","/_error","/asset-library","/context/long-term","/context/short-term","/document-roles","/documents","/guide","/knowledge","/knowledge/file-detail","/knowledge/files","/knowledge/manage","/knowledge/search","/models","/overview","/prompt","/settings","/system/logs"]}}("static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/576-6699fed6c88502fe.js","static/chunks/195-2c0168eacab722d2.js","static/chunks/985-4b4a3ed36ada16eb.js","static/chunks/150-134099bf526e9292.js","static/chunks/289-30e7c55f49a896b7.js","static/chunks/455-97ad88d6604f54b7.js",0,"static/chunks/506-93f730bc149d0dce.js","static/css/09be1fdeab8595ab.css",1e-4,NaN,"static/chunks/694-2d545cfbb9779f2c.js","static/chunks/795-d8fb7a0420512701.js","static/chunks/932-2f195f4200ce9378.js","static/chunks/412-b9c854c6a76db67d.js","static/chunks/861-91cbdd34b8e23151.js","static/chunks/938-45efd516bb130bd5.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|