diff --git a/pilot/server/static/404.html b/pilot/server/static/404.html index 16ecff8a1..0e14890fa 100644 --- a/pilot/server/static/404.html +++ b/pilot/server/static/404.html @@ -1 +1 @@ -404: This page could not be found

404

This page could not be found.

\ No newline at end of file +404: This page could not be found

404

This page could not be found.

\ No newline at end of file diff --git a/pilot/server/static/404/index.html b/pilot/server/static/404/index.html index 16ecff8a1..0e14890fa 100644 --- a/pilot/server/static/404/index.html +++ b/pilot/server/static/404/index.html @@ -1 +1 @@ -404: This page could not be found

404

This page could not be found.

\ No newline at end of file +404: This page could not be found

404

This page could not be found.

\ No newline at end of file diff --git a/pilot/server/static/_next/static/3lCxW9-VrCM5_8lckYMiS/_buildManifest.js b/pilot/server/static/_next/static/3lCxW9-VrCM5_8lckYMiS/_buildManifest.js new file mode 100644 index 000000000..cb10d35e8 --- /dev/null +++ b/pilot/server/static/_next/static/3lCxW9-VrCM5_8lckYMiS/_buildManifest.js @@ -0,0 +1 @@ +self.__BUILD_MANIFEST={__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/_error":["static/chunks/pages/_error-f5357f382422dd96.js"],sortedPages:["/_app","/_error"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/pilot/server/static/_next/static/3lCxW9-VrCM5_8lckYMiS/_ssgManifest.js b/pilot/server/static/_next/static/3lCxW9-VrCM5_8lckYMiS/_ssgManifest.js new file mode 100644 index 000000000..5b3ff592f --- /dev/null +++ b/pilot/server/static/_next/static/3lCxW9-VrCM5_8lckYMiS/_ssgManifest.js @@ -0,0 +1 @@ +self.__SSG_MANIFEST=new Set([]);self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB() \ No newline at end of file diff --git a/pilot/server/static/_next/static/62hujyhLL7ORKtuvT-Afa/_buildManifest.js b/pilot/server/static/_next/static/62hujyhLL7ORKtuvT-Afa/_buildManifest.js new file mode 100644 index 000000000..cb10d35e8 --- /dev/null +++ b/pilot/server/static/_next/static/62hujyhLL7ORKtuvT-Afa/_buildManifest.js @@ -0,0 +1 @@ +self.__BUILD_MANIFEST={__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/_error":["static/chunks/pages/_error-f5357f382422dd96.js"],sortedPages:["/_app","/_error"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/pilot/server/static/_next/static/62hujyhLL7ORKtuvT-Afa/_ssgManifest.js b/pilot/server/static/_next/static/62hujyhLL7ORKtuvT-Afa/_ssgManifest.js new file mode 100644 index 000000000..5b3ff592f --- /dev/null +++ b/pilot/server/static/_next/static/62hujyhLL7ORKtuvT-Afa/_ssgManifest.js @@ -0,0 +1 @@ +self.__SSG_MANIFEST=new Set([]);self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB() \ No newline at end of file diff --git a/pilot/server/static/_next/static/LsJAw9wmT3q63aQDzaYhO/_buildManifest.js b/pilot/server/static/_next/static/LsJAw9wmT3q63aQDzaYhO/_buildManifest.js new file mode 100644 index 000000000..cb10d35e8 --- /dev/null +++ b/pilot/server/static/_next/static/LsJAw9wmT3q63aQDzaYhO/_buildManifest.js @@ -0,0 +1 @@ +self.__BUILD_MANIFEST={__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/_error":["static/chunks/pages/_error-f5357f382422dd96.js"],sortedPages:["/_app","/_error"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/pilot/server/static/_next/static/LsJAw9wmT3q63aQDzaYhO/_ssgManifest.js b/pilot/server/static/_next/static/LsJAw9wmT3q63aQDzaYhO/_ssgManifest.js new file mode 100644 index 000000000..5b3ff592f --- /dev/null +++ b/pilot/server/static/_next/static/LsJAw9wmT3q63aQDzaYhO/_ssgManifest.js @@ -0,0 +1 @@ +self.__SSG_MANIFEST=new Set([]);self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB() \ No newline at end of file diff --git a/pilot/server/static/_next/static/Q6RQQqN0WihXtsGbRggx0/_buildManifest.js b/pilot/server/static/_next/static/Q6RQQqN0WihXtsGbRggx0/_buildManifest.js new file mode 100644 index 000000000..cb10d35e8 --- /dev/null +++ b/pilot/server/static/_next/static/Q6RQQqN0WihXtsGbRggx0/_buildManifest.js @@ -0,0 +1 @@ +self.__BUILD_MANIFEST={__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/_error":["static/chunks/pages/_error-f5357f382422dd96.js"],sortedPages:["/_app","/_error"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/pilot/server/static/_next/static/Q6RQQqN0WihXtsGbRggx0/_ssgManifest.js b/pilot/server/static/_next/static/Q6RQQqN0WihXtsGbRggx0/_ssgManifest.js new file mode 100644 index 000000000..5b3ff592f --- /dev/null +++ b/pilot/server/static/_next/static/Q6RQQqN0WihXtsGbRggx0/_ssgManifest.js @@ -0,0 +1 @@ +self.__SSG_MANIFEST=new Set([]);self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB() \ No newline at end of file diff --git a/pilot/server/static/_next/static/V9eDRAyp02pLHCzJhc8_i/_buildManifest.js b/pilot/server/static/_next/static/V9eDRAyp02pLHCzJhc8_i/_buildManifest.js new file mode 100644 index 000000000..cb10d35e8 --- /dev/null +++ b/pilot/server/static/_next/static/V9eDRAyp02pLHCzJhc8_i/_buildManifest.js @@ -0,0 +1 @@ +self.__BUILD_MANIFEST={__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/_error":["static/chunks/pages/_error-f5357f382422dd96.js"],sortedPages:["/_app","/_error"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/pilot/server/static/_next/static/V9eDRAyp02pLHCzJhc8_i/_ssgManifest.js b/pilot/server/static/_next/static/V9eDRAyp02pLHCzJhc8_i/_ssgManifest.js new file mode 100644 index 000000000..5b3ff592f --- /dev/null +++ b/pilot/server/static/_next/static/V9eDRAyp02pLHCzJhc8_i/_ssgManifest.js @@ -0,0 +1 @@ +self.__SSG_MANIFEST=new Set([]);self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB() \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/agents/page-4681b3d10d858b08.js b/pilot/server/static/_next/static/chunks/app/agents/page-4681b3d10d858b08.js new file mode 100644 index 000000000..a06b07f7c --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/agents/page-4681b3d10d858b08.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[718],{15175:function(e,t,l){Promise.resolve().then(l.bind(l,4191))},4191:function(e,t,l){"use strict";l.r(t),l.d(t,{default:function(){return E}});var r=l(9268),s=l(67830),a=l(54842),n=l(70900),o=l(62414),i=l(94244),c=l(33155),u=l(7354),h=l(35891),d=l(35086),m=l(53047),x=l(86006),p=l(19700),y=l(92391),f=l(70321),j=l(75403),v=l(99398),g=l(49064);let Z=y.z.object({query:y.z.string().min(1)});var b=e=>{let{messages:t,onSubmit:l,initialMessage:y,readOnly:b,paramsList:w,clearIntialMessage:N}=e,P=x.useRef(null),[k,S]=(0,x.useState)(!1),[T,C]=(0,x.useState)(),[R,O]=(0,x.useState)(),E=(0,p.cI)({resolver:(0,s.F)(Z),defaultValues:{}}),A=async e=>{let{query:t}=e;try{S(!0),E.reset(),await l(t,{select_param:null==w?void 0:w[R]})}catch(e){}finally{S(!1)}},_=async()=>{try{let e=new URLSearchParams(window.location.search);e.delete("initMessage"),window.history.replaceState(null,null,"?".concat(e.toString())),await A({query:y})}catch(e){console.log(e)}finally{null==N||N()}},L={overrides:{code:e=>{let{children:t}=e;return(0,r.jsx)(v.Z,{language:"javascript",style:g.Z,children:t})}}};return x.useEffect(()=>{P.current&&P.current.scrollTo(0,P.current.scrollHeight)},[null==t?void 0:t.length]),x.useEffect(()=>{y&&t.length<=0&&_()},[y]),x.useEffect(()=>{var e,t;w&&(null===(e=Object.keys(w||{}))||void 0===e?void 0:e.length)>0&&O(null===(t=Object.keys(w||{}))||void 0===t?void 0:t[0])},[w]),(0,r.jsx)("div",{className:"mx-auto flex h-full max-w-3xl flex-col gap-6 px-5 py-6 sm:gap-8 xl:max-w-5xl",children:(0,r.jsxs)(n.Z,{direction:"column",gap:2,sx:{display:"flex",flex:1,flexBasis:"100%",width:"100%",height:"100%",maxHeight:"100%",minHeight:"100%",mx:"auto"},children:[(0,r.jsxs)(n.Z,{ref:P,direction:"column",gap:2,sx:{boxSizing:"border-box",maxWidth:"100%",width:"100%",mx:"auto",flex:1,maxHeight:"100%",overflowY:"auto",p:2,border:"1px solid",borderColor:"var(--joy-palette-divider)"},children:[T&&(0,r.jsx)(o.Z,{size:"sm",variant:"outlined",color:"primary",className:"message-agent",sx:{mr:"auto",ml:"none",whiteSpace:"pre-wrap"},children:null==T?void 0:T.context}),t.filter(e=>["view","human"].includes(e.role)).map((e,t)=>{var l;return(0,r.jsx)(n.Z,{sx:{mr:"view"===e.role?"auto":"none",ml:"human"===e.role?"auto":"none"},children:(0,r.jsx)(o.Z,{size:"sm",variant:"outlined",className:"view"===e.role?"message-agent":"message-human",color:"view"===e.role?"primary":"neutral",sx:e=>({px:2,"ol, ul":{my:0,pl:2},ol:{listStyle:"numeric"},ul:{listStyle:"disc",mb:2},li:{my:1},a:{textDecoration:"underline"}}),children:(0,r.jsx)(j.Z,{options:L,children:null===(l=e.context)||void 0===l?void 0:l.replaceAll("\\n","\n")})})},t)}),k&&(0,r.jsx)(i.Z,{variant:"soft",color:"neutral",size:"sm",sx:{mx:"auto",my:2}})]}),!b&&(0,r.jsxs)("form",{style:{maxWidth:"100%",width:"100%",position:"relative",display:"flex",marginTop:"auto",overflow:"visible",background:"none",justifyContent:"center",marginLeft:"auto",marginRight:"auto",flexDirection:"column",gap:"12px"},onSubmit:e=>{e.stopPropagation(),E.handleSubmit(A)(e)},children:[Object.keys(w||{}).length>0&&(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(c.Z,{value:R,onChange:(e,t)=>{O(t)},className:"max-w-xs",children:Object.keys(w||{}).map(e=>(0,r.jsx)(u.Z,{value:e,children:null==w?void 0:w[e]},e))}),(0,r.jsx)(h.Z,{className:"cursor-pointer",title:R,placement:"top",variant:"outlined",children:(0,r.jsx)(f.Z,{})})]}),(0,r.jsx)(d.ZP,{sx:{width:"100%"},variant:"outlined",endDecorator:(0,r.jsx)(m.ZP,{type:"submit",disabled:k,children:(0,r.jsx)(a.Z,{})}),...E.register("query")})]})]})})},w=l(91440),N=l(50645),P=l(5737),k=l(45642),S=l(26974),T=l(22046),C=l(78417),R=l(66487);let O=(0,N.Z)(P.Z)(e=>{let{theme:t}=e;return{...t.typography.body2,padding:t.spacing(1),textAlign:"center",borderRadius:4,color:t.vars.palette.text.secondary}});var E=()=>{let{handleChatSubmit:e,history:t}=(0,R.Z)({queryAgentURL:"/v1/chat/completions"}),l=[{year:"1951 年",sales:0},{year:"1952 年",sales:52},{year:"1956 年",sales:61},{year:"1957 年",sales:45},{year:"1958 年",sales:48},{year:"1959 年",sales:38},{year:"1960 年",sales:38},{year:"1962 年",sales:38}];return(0,r.jsx)("div",{className:"p-4 flex flex-row gap-6 min-h-full w-full",children:(0,r.jsx)("div",{className:"flex w-full",children:(0,r.jsxs)(k.Z,{container:!0,spacing:2,sx:{flexGrow:1},children:[(0,r.jsx)(k.Z,{xs:8,children:(0,r.jsxs)(C.Z,{spacing:2,className:"h-full",children:[(0,r.jsx)(O,{children:(0,r.jsx)(k.Z,{container:!0,spacing:2,children:[{label:"Revenue Won",value:"$7,811,851"},{label:"Close %",value:"37.7%"},{label:"AVG Days to Close",value:"121"},{label:"Opportunities Won",value:"526"}].map(e=>(0,r.jsx)(k.Z,{xs:3,children:(0,r.jsx)(o.Z,{className:"flex-1 h-full",children:(0,r.jsxs)(S.Z,{className:"justify-around",children:[(0,r.jsx)(T.ZP,{gutterBottom:!0,component:"div",children:e.label}),(0,r.jsx)(T.ZP,{children:e.value})]})})},e.label))})}),(0,r.jsx)(O,{className:"flex-1",children:(0,r.jsx)(o.Z,{className:"h-full",children:(0,r.jsxs)(S.Z,{className:"h-full",children:[(0,r.jsx)(T.ZP,{gutterBottom:!0,component:"div",children:"Revenue Won by Month"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsx)(w.Chart,{padding:[10,20,50,40],autoFit:!0,data:[{month:"Jan",city:"Tokyo",temperature:7},{month:"Feb",city:"Tokyo",temperature:13},{month:"Mar",city:"Tokyo",temperature:16.5},{month:"Apr",city:"Tokyo",temperature:14.5},{month:"May",city:"Tokyo",temperature:10},{month:"Jun",city:"Tokyo",temperature:7.5},{month:"Jul",city:"Tokyo",temperature:9.2},{month:"Aug",city:"Tokyo",temperature:14.5},{month:"Sep",city:"Tokyo",temperature:9.3},{month:"Oct",city:"Tokyo",temperature:8.3},{month:"Nov",city:"Tokyo",temperature:8.9},{month:"Dec",city:"Tokyo",temperature:5.6}],children:(0,r.jsx)(w.LineAdvance,{shape:"smooth",point:!0,area:!0,position:"month*temperature",color:"city"})})})]})})}),(0,r.jsx)(O,{className:"flex-1",children:(0,r.jsxs)(k.Z,{container:!0,spacing:2,className:"h-full",children:[(0,r.jsx)(k.Z,{xs:4,className:"h-full",children:(0,r.jsx)(o.Z,{className:"flex-1 h-full",children:(0,r.jsxs)(S.Z,{className:"h-full",children:[(0,r.jsx)(T.ZP,{gutterBottom:!0,component:"div",children:"Close % by Month"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsxs)(w.Chart,{autoFit:!0,data:l,children:[(0,r.jsx)(w.Interval,{position:"year*sales",style:{lineWidth:3,stroke:(0,w.getTheme)().colors10[0]}}),(0,r.jsx)(w.Tooltip,{shared:!0})]})})]})})}),(0,r.jsx)(k.Z,{xs:4,className:"h-full",children:(0,r.jsx)(o.Z,{className:"flex-1 h-full",children:(0,r.jsxs)(S.Z,{className:"h-full",children:[(0,r.jsx)(T.ZP,{gutterBottom:!0,component:"div",children:"Close % by Month"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsxs)(w.Chart,{autoFit:!0,data:l,children:[(0,r.jsx)(w.Interval,{position:"year*sales",style:{lineWidth:3,stroke:(0,w.getTheme)().colors10[0]}}),(0,r.jsx)(w.Tooltip,{shared:!0})]})})]})})}),(0,r.jsx)(k.Z,{xs:4,className:"h-full",children:(0,r.jsx)(o.Z,{className:"flex-1 h-full",children:(0,r.jsxs)(S.Z,{className:"h-full",children:[(0,r.jsx)(T.ZP,{gutterBottom:!0,component:"div",children:"Close % by Month"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsxs)(w.Chart,{autoFit:!0,data:l,children:[(0,r.jsx)(w.Interval,{position:"year*sales",style:{lineWidth:3,stroke:(0,w.getTheme)().colors10[0]}}),(0,r.jsx)(w.Tooltip,{shared:!0})]})})]})})})]})})]})}),(0,r.jsx)(k.Z,{xs:4,children:(0,r.jsx)(b,{messages:t,onSubmit:e})})]})})})}},57931:function(e,t,l){"use strict";l.d(t,{ZP:function(){return c},Cg:function(){return o}});var r=l(9268),s=l(89081),a=l(78915),n=l(86006);let[o,i]=function(){let e=n.createContext(void 0);return[function(){let t=n.useContext(e);if(void 0===t)throw Error("useCtx must be inside a Provider with a value");return t},e.Provider]}();var c=e=>{let{children:t}=e,{run:l,data:n,refresh:o}=(0,s.Z)(async()=>await (0,a.Tk)("/v1/chat/dialogue/list"),{manual:!0});return(0,r.jsx)(i,{value:{dialogueList:n,queryDialogueList:l,refreshDialogList:o},children:t})}},66487:function(e,t,l){"use strict";l.d(t,{Z:function(){return i}});var r=l(71990),s=l(86006),a=e=>{let t=(0,s.useReducer)((e,t)=>({...e,...t}),{...e});return t},n=l(57931),o=l(52040),i=e=>{let{queryAgentURL:t,channel:l,queryBody:i,initHistory:c}=e,[u,h]=a({history:c||[]}),{refreshDialogList:d}=(0,n.Cg)();(0,s.useEffect)(()=>{c&&h({history:c})},[c]);let m=async(e,s)=>{if(!e)return;let a=[...u.history,{role:"human",context:e}],n=a.length;h({history:a});try{let c=new AbortController;await (0,r.L)("".concat(o.env.API_BASE_URL?o.env.API_BASE_URL:"").concat("/api"+t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...s,...i,user_input:e,channel:l}),signal:c.signal,async onopen(e){if(a.length<=1){d();let e=new URLSearchParams(window.location.search);e.delete("initMessage"),window.history.replaceState(null,null,"?".concat(e.toString()))}(!e.ok||e.headers.get("content-type")!==r.a)&&e.status>=400&&e.status<500&&429!==e.status&&e.status},onclose(){console.log("onclose")},onerror(e){throw Error(e)},onmessage:e=>{var t;if(console.log(e,"e"),e.data=e.data.replaceAll("\\n","\n"),"[DONE]"===e.data)c.abort();else if(null===(t=e.data)||void 0===t?void 0:t.startsWith("[ERROR]"))c.abort(),h({history:[...a,{role:"view",context:e.data.replace("[ERROR]","")}]});else{let t=[...a];e.data&&((null==t?void 0:t[n])?t[n].context="".concat(e.data):t.push({role:"view",context:e.data}),h({history:t}))}}})}catch(e){console.log("---e",e),h({history:[...a,{role:"view",context:"请求出错"}]})}};return{handleChatSubmit:m,history:u.history}}},78915:function(e,t,l){"use strict";l.d(t,{Tk:function(){return u},Kw:function(){return h},PR:function(){return d},Ej:function(){return m}});var r=l(21628),s=l(24214),a=l(52040);let n=s.Z.create({baseURL:a.env.API_BASE_URL});n.defaults.timeout=1e4,n.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var o=l(84835);let i={"content-type":"application/json"},c=e=>{if(!(0,o.isPlainObject)(e))return JSON.stringify(e);let t={...e};for(let e in t){let l=t[e];"string"==typeof l&&(t[e]=l.trim())}return JSON.stringify(t)},u=(e,t)=>{if(t){let l=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");l&&(e+="?".concat(l))}return n.get("/api"+e,{headers:i}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},h=(e,t)=>{let l=c(t);return n.post("/api"+e,{body:l,headers:i}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},d=(e,t)=>(c(t),n.post(e,t,{headers:i}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})),m=(e,t)=>n.post(e,t).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})}},function(e){e.O(0,[180,757,106,685,86,316,259,751,662,481,253,769,744],function(){return e(e.s=15175)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/agents/page-6d44808b4e4c145f.js b/pilot/server/static/_next/static/chunks/app/agents/page-6d44808b4e4c145f.js new file mode 100644 index 000000000..4c82a8aeb --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/agents/page-6d44808b4e4c145f.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[718],{15175:function(e,t,l){Promise.resolve().then(l.bind(l,4191))},4191:function(e,t,l){"use strict";l.r(t),l.d(t,{default:function(){return E}});var r=l(9268),s=l(67830),a=l(54842),n=l(70900),o=l(62414),i=l(94244),c=l(33155),u=l(7354),h=l(35891),d=l(35086),m=l(53047),x=l(86006),p=l(19700),y=l(92391),f=l(70321),j=l(75403),v=l(99398),g=l(49064);let Z=y.z.object({query:y.z.string().min(1)});var b=e=>{let{messages:t,onSubmit:l,initialMessage:y,readOnly:b,paramsList:w,clearIntialMessage:N}=e,P=x.useRef(null),[k,S]=(0,x.useState)(!1),[T,C]=(0,x.useState)(),[R,O]=(0,x.useState)(),E=(0,p.cI)({resolver:(0,s.F)(Z),defaultValues:{}}),A=async e=>{let{query:t}=e;try{S(!0),E.reset(),await l(t,{select_param:null==w?void 0:w[R]})}catch(e){}finally{S(!1)}},_=async()=>{try{let e=new URLSearchParams(window.location.search);e.delete("initMessage"),window.history.replaceState(null,null,"?".concat(e.toString())),await A({query:y})}catch(e){console.log(e)}finally{null==N||N()}},L={overrides:{code:e=>{let{children:t}=e;return(0,r.jsx)(v.Z,{language:"javascript",style:g.Z,children:t})}}};return x.useEffect(()=>{P.current&&P.current.scrollTo(0,P.current.scrollHeight)},[null==t?void 0:t.length]),x.useEffect(()=>{y&&t.length<=0&&_()},[y]),x.useEffect(()=>{var e,t;w&&(null===(e=Object.keys(w||{}))||void 0===e?void 0:e.length)>0&&O(null===(t=Object.keys(w||{}))||void 0===t?void 0:t[0])},[w]),(0,r.jsx)("div",{className:"mx-auto flex h-full max-w-3xl flex-col gap-6 px-5 py-6 sm:gap-8 xl:max-w-5xl",children:(0,r.jsxs)(n.Z,{direction:"column",gap:2,sx:{display:"flex",flex:1,flexBasis:"100%",width:"100%",height:"100%",maxHeight:"100%",minHeight:"100%",mx:"auto"},children:[(0,r.jsxs)(n.Z,{ref:P,direction:"column",gap:2,sx:{boxSizing:"border-box",maxWidth:"100%",width:"100%",mx:"auto",flex:1,maxHeight:"100%",overflowY:"auto",p:2,border:"1px solid",borderColor:"var(--joy-palette-divider)"},children:[T&&(0,r.jsx)(o.Z,{size:"sm",variant:"outlined",color:"primary",className:"message-agent",sx:{mr:"auto",ml:"none",whiteSpace:"pre-wrap"},children:null==T?void 0:T.context}),t.filter(e=>["view","human"].includes(e.role)).map((e,t)=>{var l;return(0,r.jsx)(n.Z,{sx:{mr:"view"===e.role?"auto":"none",ml:"human"===e.role?"auto":"none"},children:(0,r.jsx)(o.Z,{size:"sm",variant:"outlined",className:"view"===e.role?"message-agent":"message-human",color:"view"===e.role?"primary":"neutral",sx:e=>({px:2,"ol, ul":{my:0,pl:2},ol:{listStyle:"numeric"},ul:{listStyle:"disc",mb:2},li:{my:1},a:{textDecoration:"underline"}}),children:(0,r.jsx)(j.Z,{options:L,children:null===(l=e.context)||void 0===l?void 0:l.replaceAll("\\n","\n")})})},t)}),k&&(0,r.jsx)(i.Z,{variant:"soft",color:"neutral",size:"sm",sx:{mx:"auto",my:2}})]}),!b&&(0,r.jsxs)("form",{style:{maxWidth:"100%",width:"100%",position:"relative",display:"flex",marginTop:"auto",overflow:"visible",background:"none",justifyContent:"center",marginLeft:"auto",marginRight:"auto",flexDirection:"column",gap:"12px"},onSubmit:e=>{e.stopPropagation(),E.handleSubmit(A)(e)},children:[Object.keys(w||{}).length>0&&(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(c.Z,{value:R,onChange:(e,t)=>{O(t)},className:"max-w-xs",children:Object.keys(w||{}).map(e=>(0,r.jsx)(u.Z,{value:e,children:null==w?void 0:w[e]},e))}),(0,r.jsx)(h.Z,{className:"cursor-pointer",title:R,placement:"top",variant:"outlined",children:(0,r.jsx)(f.Z,{})})]}),(0,r.jsx)(d.ZP,{sx:{width:"100%"},variant:"outlined",endDecorator:(0,r.jsx)(m.ZP,{type:"submit",disabled:k,children:(0,r.jsx)(a.Z,{})}),...E.register("query")})]})]})})},w=l(91440),N=l(50645),P=l(5737),k=l(45642),S=l(26974),T=l(22046),C=l(78417),R=l(66487);let O=(0,N.Z)(P.Z)(e=>{let{theme:t}=e;return{...t.typography.body2,padding:t.spacing(1),textAlign:"center",borderRadius:4,color:t.vars.palette.text.secondary}});var E=()=>{let{handleChatSubmit:e,history:t}=(0,R.Z)({queryAgentURL:"/v1/chat/completions"}),l=[{year:"1951 年",sales:0},{year:"1952 年",sales:52},{year:"1956 年",sales:61},{year:"1957 年",sales:45},{year:"1958 年",sales:48},{year:"1959 年",sales:38},{year:"1960 年",sales:38},{year:"1962 年",sales:38}];return(0,r.jsx)("div",{className:"p-4 flex flex-row gap-6 min-h-full w-full",children:(0,r.jsx)("div",{className:"flex w-full",children:(0,r.jsxs)(k.Z,{container:!0,spacing:2,sx:{flexGrow:1},children:[(0,r.jsx)(k.Z,{xs:8,children:(0,r.jsxs)(C.Z,{spacing:2,className:"h-full",children:[(0,r.jsx)(O,{children:(0,r.jsx)(k.Z,{container:!0,spacing:2,children:[{label:"Revenue Won",value:"$7,811,851"},{label:"Close %",value:"37.7%"},{label:"AVG Days to Close",value:"121"},{label:"Opportunities Won",value:"526"}].map(e=>(0,r.jsx)(k.Z,{xs:3,children:(0,r.jsx)(o.Z,{className:"flex-1 h-full",children:(0,r.jsxs)(S.Z,{className:"justify-around",children:[(0,r.jsx)(T.ZP,{gutterBottom:!0,component:"div",children:e.label}),(0,r.jsx)(T.ZP,{children:e.value})]})})},e.label))})}),(0,r.jsx)(O,{className:"flex-1",children:(0,r.jsx)(o.Z,{className:"h-full",children:(0,r.jsxs)(S.Z,{className:"h-full",children:[(0,r.jsx)(T.ZP,{gutterBottom:!0,component:"div",children:"Revenue Won by Month"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsx)(w.Chart,{padding:[10,20,50,40],autoFit:!0,data:[{month:"Jan",city:"Tokyo",temperature:7},{month:"Feb",city:"Tokyo",temperature:13},{month:"Mar",city:"Tokyo",temperature:16.5},{month:"Apr",city:"Tokyo",temperature:14.5},{month:"May",city:"Tokyo",temperature:10},{month:"Jun",city:"Tokyo",temperature:7.5},{month:"Jul",city:"Tokyo",temperature:9.2},{month:"Aug",city:"Tokyo",temperature:14.5},{month:"Sep",city:"Tokyo",temperature:9.3},{month:"Oct",city:"Tokyo",temperature:8.3},{month:"Nov",city:"Tokyo",temperature:8.9},{month:"Dec",city:"Tokyo",temperature:5.6}],children:(0,r.jsx)(w.LineAdvance,{shape:"smooth",point:!0,area:!0,position:"month*temperature",color:"city"})})})]})})}),(0,r.jsx)(O,{className:"flex-1",children:(0,r.jsxs)(k.Z,{container:!0,spacing:2,className:"h-full",children:[(0,r.jsx)(k.Z,{xs:4,className:"h-full",children:(0,r.jsx)(o.Z,{className:"flex-1 h-full",children:(0,r.jsxs)(S.Z,{className:"h-full",children:[(0,r.jsx)(T.ZP,{gutterBottom:!0,component:"div",children:"Close % by Month"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsxs)(w.Chart,{autoFit:!0,data:l,children:[(0,r.jsx)(w.Interval,{position:"year*sales",style:{lineWidth:3,stroke:(0,w.getTheme)().colors10[0]}}),(0,r.jsx)(w.Tooltip,{shared:!0})]})})]})})}),(0,r.jsx)(k.Z,{xs:4,className:"h-full",children:(0,r.jsx)(o.Z,{className:"flex-1 h-full",children:(0,r.jsxs)(S.Z,{className:"h-full",children:[(0,r.jsx)(T.ZP,{gutterBottom:!0,component:"div",children:"Close % by Month"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsxs)(w.Chart,{autoFit:!0,data:l,children:[(0,r.jsx)(w.Interval,{position:"year*sales",style:{lineWidth:3,stroke:(0,w.getTheme)().colors10[0]}}),(0,r.jsx)(w.Tooltip,{shared:!0})]})})]})})}),(0,r.jsx)(k.Z,{xs:4,className:"h-full",children:(0,r.jsx)(o.Z,{className:"flex-1 h-full",children:(0,r.jsxs)(S.Z,{className:"h-full",children:[(0,r.jsx)(T.ZP,{gutterBottom:!0,component:"div",children:"Close % by Month"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsxs)(w.Chart,{autoFit:!0,data:l,children:[(0,r.jsx)(w.Interval,{position:"year*sales",style:{lineWidth:3,stroke:(0,w.getTheme)().colors10[0]}}),(0,r.jsx)(w.Tooltip,{shared:!0})]})})]})})})]})})]})}),(0,r.jsx)(k.Z,{xs:4,children:(0,r.jsx)(b,{messages:t,onSubmit:e})})]})})})}},57931:function(e,t,l){"use strict";l.d(t,{ZP:function(){return c},Cg:function(){return o}});var r=l(9268),s=l(89081),a=l(78915),n=l(86006);let[o,i]=function(){let e=n.createContext(void 0);return[function(){let t=n.useContext(e);if(void 0===t)throw Error("useCtx must be inside a Provider with a value");return t},e.Provider]}();var c=e=>{let{children:t}=e,{run:l,data:n,refresh:o}=(0,s.Z)(async()=>await (0,a.Tk)("/v1/chat/dialogue/list"),{manual:!0});return(0,r.jsx)(i,{value:{dialogueList:n,queryDialogueList:l,refreshDialogList:o},children:t})}},66487:function(e,t,l){"use strict";l.d(t,{Z:function(){return i}});var r=l(71990),s=l(86006),a=e=>{let t=(0,s.useReducer)((e,t)=>({...e,...t}),{...e});return t},n=l(57931),o=l(52040),i=e=>{let{queryAgentURL:t,channel:l,queryBody:i,initHistory:c}=e,[u,h]=a({history:c||[]}),{refreshDialogList:d}=(0,n.Cg)();(0,s.useEffect)(()=>{c&&h({history:c})},[c]);let m=async(e,s)=>{if(!e)return;let a=[...u.history,{role:"human",context:e}],n=a.length;h({history:a});try{let c=new AbortController;await (0,r.L)("".concat(o.env.API_BASE_URL?o.env.API_BASE_URL:"").concat("/api"+t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...s,...i,user_input:e,channel:l}),signal:c.signal,async onopen(e){if(a.length<=1){d();let e=new URLSearchParams(window.location.search);e.delete("initMessage"),window.history.replaceState(null,null,"?".concat(e.toString()))}(!e.ok||e.headers.get("content-type")!==r.a)&&e.status>=400&&e.status<500&&429!==e.status&&e.status},onclose(){console.log("onclose")},onerror(e){throw Error(e)},onmessage:e=>{var t;if(console.log(e,"e"),e.data=e.data.replaceAll("\\n","\n"),"[DONE]"===e.data)c.abort();else if(null===(t=e.data)||void 0===t?void 0:t.startsWith("[ERROR]"))c.abort(),h({history:[...a,{role:"view",context:e.data.replace("[ERROR]","")}]});else{let t=[...a];e.data&&((null==t?void 0:t[n])?t[n].context="".concat(e.data):t.push({role:"view",context:e.data}),h({history:t}))}}})}catch(e){console.log("---e",e),h({history:[...a,{role:"view",context:"请求出错"}]})}};return{handleChatSubmit:m,history:u.history}}},78915:function(e,t,l){"use strict";l.d(t,{Tk:function(){return u},Kw:function(){return h},PR:function(){return d},Ej:function(){return m}});var r=l(21628),s=l(24214),a=l(52040);let n=s.Z.create({baseURL:a.env.API_BASE_URL});n.defaults.timeout=1e4,n.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var o=l(84835);let i={"content-type":"application/json"},c=e=>{if(!(0,o.isPlainObject)(e))return JSON.stringify(e);let t={...e};for(let e in t){let l=t[e];"string"==typeof l&&(t[e]=l.trim())}return JSON.stringify(t)},u=(e,t)=>{if(t){let l=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");l&&(e+="?".concat(l))}return n.get("/api"+e,{headers:i}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},h=(e,t)=>{let l=c(t);return n.post("/api"+e,{body:l,headers:i}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},d=(e,t)=>{let l=c(t);return n.post(e,{body:l,headers:i}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},m=(e,t)=>n.post(e,{body:t}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})}},function(e){e.O(0,[180,757,106,685,86,316,259,751,662,481,253,769,744],function(){return e(e.s=15175)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/agents/page-be8535b52f884573.js b/pilot/server/static/_next/static/chunks/app/agents/page-be8535b52f884573.js new file mode 100644 index 000000000..5ccd05842 --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/agents/page-be8535b52f884573.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[718],{15175:function(e,t,l){Promise.resolve().then(l.bind(l,4191))},4191:function(e,t,l){"use strict";l.r(t),l.d(t,{default:function(){return E}});var r=l(9268),s=l(67830),a=l(54842),n=l(70900),o=l(62414),i=l(94244),c=l(33155),u=l(7354),h=l(35891),d=l(35086),m=l(53047),x=l(86006),p=l(19700),y=l(92391),f=l(70321),j=l(75403),v=l(99398),g=l(49064);let Z=y.z.object({query:y.z.string().min(1)});var b=e=>{let{messages:t,onSubmit:l,initialMessage:y,readOnly:b,paramsList:w,clearIntialMessage:N}=e,k=x.useRef(null),[P,T]=(0,x.useState)(!1),[C,S]=(0,x.useState)(),[O,R]=(0,x.useState)(),E=(0,p.cI)({resolver:(0,s.F)(Z),defaultValues:{}}),A=async e=>{let{query:t}=e;try{T(!0),E.reset(),await l(t,{select_param:null==w?void 0:w[O]})}catch(e){}finally{T(!1)}},W=async()=>{try{let e=new URLSearchParams(window.location.search);e.delete("initMessage"),window.history.replaceState(null,null,"?".concat(e.toString())),await A({query:y})}catch(e){console.log(e)}finally{null==N||N()}},M={overrides:{code:e=>{let{children:t}=e;return(0,r.jsx)(v.Z,{language:"javascript",style:g.Z,children:t})}}};return x.useEffect(()=>{k.current&&k.current.scrollTo(0,k.current.scrollHeight)},[null==t?void 0:t.length]),x.useEffect(()=>{y&&t.length<=0&&W()},[y]),x.useEffect(()=>{var e,t;w&&(null===(e=Object.keys(w||{}))||void 0===e?void 0:e.length)>0&&R(null===(t=Object.keys(w||{}))||void 0===t?void 0:t[0])},[w]),(0,r.jsx)("div",{className:"mx-auto flex h-full max-w-3xl flex-col gap-6 px-5 py-6 sm:gap-8 xl:max-w-5xl",children:(0,r.jsxs)(n.Z,{direction:"column",gap:2,sx:{display:"flex",flex:1,flexBasis:"100%",width:"100%",height:"100%",maxHeight:"100%",minHeight:"100%",mx:"auto"},children:[(0,r.jsxs)(n.Z,{ref:k,direction:"column",gap:2,sx:{boxSizing:"border-box",maxWidth:"100%",width:"100%",mx:"auto",flex:1,maxHeight:"100%",overflowY:"auto",p:2,border:"1px solid",borderColor:"var(--joy-palette-divider)"},children:[C&&(0,r.jsx)(o.Z,{size:"sm",variant:"outlined",color:"primary",className:"message-agent",sx:{mr:"auto",ml:"none",whiteSpace:"pre-wrap"},children:null==C?void 0:C.context}),t.filter(e=>["view","human"].includes(e.role)).map((e,t)=>{var l;return(0,r.jsx)(n.Z,{sx:{mr:"view"===e.role?"auto":"none",ml:"human"===e.role?"auto":"none"},children:(0,r.jsx)(o.Z,{size:"sm",variant:"outlined",className:"view"===e.role?"message-agent":"message-human",color:"view"===e.role?"primary":"neutral",sx:e=>({px:2,"ol, ul":{my:0,pl:2},ol:{listStyle:"numeric"},ul:{listStyle:"disc",mb:2},li:{my:1},a:{textDecoration:"underline"}}),children:(0,r.jsx)(j.Z,{options:M,children:null===(l=e.context)||void 0===l?void 0:l.replaceAll("\\n","\n")})})},t)}),P&&(0,r.jsx)(i.Z,{variant:"soft",color:"neutral",size:"sm",sx:{mx:"auto",my:2}})]}),!b&&(0,r.jsxs)("form",{style:{maxWidth:"100%",width:"100%",position:"relative",display:"flex",marginTop:"auto",overflow:"visible",background:"none",justifyContent:"center",marginLeft:"auto",marginRight:"auto",flexDirection:"column",gap:"12px"},onSubmit:e=>{e.stopPropagation(),E.handleSubmit(A)(e)},children:[Object.keys(w||{}).length>0&&(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(c.Z,{value:O,onChange:(e,t)=>{R(t)},className:"max-w-xs",children:Object.keys(w||{}).map(e=>(0,r.jsx)(u.Z,{value:e,children:null==w?void 0:w[e]},e))}),(0,r.jsx)(h.Z,{className:"cursor-pointer",title:O,placement:"top",variant:"outlined",children:(0,r.jsx)(f.Z,{})})]}),(0,r.jsx)(d.ZP,{sx:{width:"100%"},variant:"outlined",endDecorator:(0,r.jsx)(m.ZP,{type:"submit",disabled:P,children:(0,r.jsx)(a.Z,{})}),...E.register("query")})]})]})})},w=l(91440),N=l(50645),k=l(5737),P=l(45642),T=l(26974),C=l(22046),S=l(78417),O=l(66487);let R=(0,N.Z)(k.Z)(e=>{let{theme:t}=e;return{...t.typography.body2,padding:t.spacing(1),textAlign:"center",borderRadius:4,color:t.vars.palette.text.secondary}});var E=()=>{let{handleChatSubmit:e,history:t}=(0,O.Z)({queryAgentURL:"/v1/chat/completions"}),l=[{year:"1951 年",sales:0},{year:"1952 年",sales:52},{year:"1956 年",sales:61},{year:"1957 年",sales:45},{year:"1958 年",sales:48},{year:"1959 年",sales:38},{year:"1960 年",sales:38},{year:"1962 年",sales:38}];return(0,r.jsx)("div",{className:"p-4 flex flex-row gap-6 min-h-full w-full",children:(0,r.jsx)("div",{className:"flex w-full",children:(0,r.jsxs)(P.Z,{container:!0,spacing:2,sx:{flexGrow:1},children:[(0,r.jsx)(P.Z,{xs:8,children:(0,r.jsxs)(S.Z,{spacing:2,className:"h-full",children:[(0,r.jsx)(R,{children:(0,r.jsx)(P.Z,{container:!0,spacing:2,children:[{label:"Revenue Won",value:"$7,811,851"},{label:"Close %",value:"37.7%"},{label:"AVG Days to Close",value:"121"},{label:"Opportunities Won",value:"526"}].map(e=>(0,r.jsx)(P.Z,{xs:3,children:(0,r.jsx)(o.Z,{className:"flex-1 h-full",children:(0,r.jsxs)(T.Z,{className:"justify-around",children:[(0,r.jsx)(C.ZP,{gutterBottom:!0,component:"div",children:e.label}),(0,r.jsx)(C.ZP,{children:e.value})]})})},e.label))})}),(0,r.jsx)(R,{className:"flex-1",children:(0,r.jsx)(o.Z,{className:"h-full",children:(0,r.jsxs)(T.Z,{className:"h-full",children:[(0,r.jsx)(C.ZP,{gutterBottom:!0,component:"div",children:"Revenue Won by Month"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsx)(w.Chart,{padding:[10,20,50,40],autoFit:!0,data:[{month:"Jan",city:"Tokyo",temperature:7},{month:"Feb",city:"Tokyo",temperature:13},{month:"Mar",city:"Tokyo",temperature:16.5},{month:"Apr",city:"Tokyo",temperature:14.5},{month:"May",city:"Tokyo",temperature:10},{month:"Jun",city:"Tokyo",temperature:7.5},{month:"Jul",city:"Tokyo",temperature:9.2},{month:"Aug",city:"Tokyo",temperature:14.5},{month:"Sep",city:"Tokyo",temperature:9.3},{month:"Oct",city:"Tokyo",temperature:8.3},{month:"Nov",city:"Tokyo",temperature:8.9},{month:"Dec",city:"Tokyo",temperature:5.6}],children:(0,r.jsx)(w.LineAdvance,{shape:"smooth",point:!0,area:!0,position:"month*temperature",color:"city"})})})]})})}),(0,r.jsx)(R,{className:"flex-1",children:(0,r.jsxs)(P.Z,{container:!0,spacing:2,className:"h-full",children:[(0,r.jsx)(P.Z,{xs:4,className:"h-full",children:(0,r.jsx)(o.Z,{className:"flex-1 h-full",children:(0,r.jsxs)(T.Z,{className:"h-full",children:[(0,r.jsx)(C.ZP,{gutterBottom:!0,component:"div",children:"Close % by Month"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsxs)(w.Chart,{autoFit:!0,data:l,children:[(0,r.jsx)(w.Interval,{position:"year*sales",style:{lineWidth:3,stroke:(0,w.getTheme)().colors10[0]}}),(0,r.jsx)(w.Tooltip,{shared:!0})]})})]})})}),(0,r.jsx)(P.Z,{xs:4,className:"h-full",children:(0,r.jsx)(o.Z,{className:"flex-1 h-full",children:(0,r.jsxs)(T.Z,{className:"h-full",children:[(0,r.jsx)(C.ZP,{gutterBottom:!0,component:"div",children:"Close % by Month"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsxs)(w.Chart,{autoFit:!0,data:l,children:[(0,r.jsx)(w.Interval,{position:"year*sales",style:{lineWidth:3,stroke:(0,w.getTheme)().colors10[0]}}),(0,r.jsx)(w.Tooltip,{shared:!0})]})})]})})}),(0,r.jsx)(P.Z,{xs:4,className:"h-full",children:(0,r.jsx)(o.Z,{className:"flex-1 h-full",children:(0,r.jsxs)(T.Z,{className:"h-full",children:[(0,r.jsx)(C.ZP,{gutterBottom:!0,component:"div",children:"Close % by Month"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsxs)(w.Chart,{autoFit:!0,data:l,children:[(0,r.jsx)(w.Interval,{position:"year*sales",style:{lineWidth:3,stroke:(0,w.getTheme)().colors10[0]}}),(0,r.jsx)(w.Tooltip,{shared:!0})]})})]})})})]})})]})}),(0,r.jsx)(P.Z,{xs:4,children:(0,r.jsx)(b,{messages:t,onSubmit:e})})]})})})}},57931:function(e,t,l){"use strict";l.d(t,{ZP:function(){return c},Cg:function(){return o}});var r=l(9268),s=l(89081),a=l(78915),n=l(86006);let[o,i]=function(){let e=n.createContext(void 0);return[function(){let t=n.useContext(e);if(void 0===t)throw Error("useCtx must be inside a Provider with a value");return t},e.Provider]}();var c=e=>{let{children:t}=e,{run:l,data:n,refresh:o}=(0,s.Z)(async()=>await (0,a.Tk)("/v1/chat/dialogue/list"),{manual:!0});return(0,r.jsx)(i,{value:{dialogueList:n,queryDialogueList:l,refreshDialogList:o},children:t})}},66487:function(e,t,l){"use strict";l.d(t,{Z:function(){return o}});var r=l(71990),s=l(86006),a=e=>{let t=(0,s.useReducer)((e,t)=>({...e,...t}),{...e});return t},n=l(57931),o=e=>{let{queryAgentURL:t,channel:l,queryBody:o,initHistory:i}=e,[c,u]=a({history:i||[]}),{refreshDialogList:h}=(0,n.Cg)();(0,s.useEffect)(()=>{i&&u({history:i})},[i]);let d=async(e,s)=>{if(!e)return;let a=[...c.history,{role:"human",context:e}],n=a.length;u({history:a});try{let i=new AbortController;await (0,r.L)("".concat("http://127.0.0.1:5000").concat("/api"+t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...s,...o,user_input:e,channel:l}),signal:i.signal,async onopen(e){if(a.length<=1){h();let e=new URLSearchParams(window.location.search);e.delete("initMessage"),window.history.replaceState(null,null,"?".concat(e.toString()))}(!e.ok||e.headers.get("content-type")!==r.a)&&e.status>=400&&e.status<500&&429!==e.status&&e.status},onclose(){console.log("onclose")},onerror(e){throw Error(e)},onmessage:e=>{var t;if(console.log(e,"e"),e.data=e.data.replaceAll("\\n","\n"),"[DONE]"===e.data)i.abort();else if(null===(t=e.data)||void 0===t?void 0:t.startsWith("[ERROR]"))i.abort(),u({history:[...a,{role:"view",context:e.data.replace("[ERROR]","")}]});else{let t=[...a];e.data&&((null==t?void 0:t[n])?t[n].context="".concat(e.data):t.push({role:"view",context:e.data}),u({history:t}))}}})}catch(e){console.log("---e",e),u({history:[...a,{role:"view",context:"请求出错"}]})}};return{handleChatSubmit:d,history:c.history}}},78915:function(e,t,l){"use strict";l.d(t,{Tk:function(){return c},Kw:function(){return u},PR:function(){return h},Ej:function(){return d}});var r=l(21628),s=l(24214);let a=s.Z.create({baseURL:"http://127.0.0.1:5000"});a.defaults.timeout=1e4,a.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var n=l(84835);let o={"content-type":"application/json"},i=e=>{if(!(0,n.isPlainObject)(e))return JSON.stringify(e);let t={...e};for(let e in t){let l=t[e];"string"==typeof l&&(t[e]=l.trim())}return JSON.stringify(t)},c=(e,t)=>{if(t){let l=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");l&&(e+="?".concat(l))}return a.get("/api"+e,{headers:o}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},u=(e,t)=>{let l=i(t);return a.post("/api"+e,{body:l,headers:o}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},h=(e,t)=>{let l=i(t);return a.post(e,{body:l,headers:o}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},d=(e,t)=>a.post(e,{body:t}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})}},function(e){e.O(0,[180,757,752,685,86,316,259,751,662,481,253,769,744],function(){return e(e.s=15175)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/agents/page-d6862c5163b688e4.js b/pilot/server/static/_next/static/chunks/app/agents/page-d6862c5163b688e4.js new file mode 100644 index 000000000..889aa78c9 --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/agents/page-d6862c5163b688e4.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[718],{15175:function(e,t,l){Promise.resolve().then(l.bind(l,4191))},4191:function(e,t,l){"use strict";l.r(t),l.d(t,{default:function(){return E}});var s=l(9268),r=l(67830),a=l(54842),n=l(70900),o=l(62414),i=l(94244),c=l(33155),u=l(7354),h=l(35891),d=l(35086),m=l(53047),x=l(86006),p=l(19700),y=l(92391),f=l(70321),j=l(75403),v=l(99398),g=l(49064);let Z=y.z.object({query:y.z.string().min(1)});var b=e=>{let{messages:t,onSubmit:l,initialMessage:y,readOnly:b,paramsList:w,clearIntialMessage:N}=e,k=x.useRef(null),[T,P]=(0,x.useState)(!1),[C,S]=(0,x.useState)(),[O,R]=(0,x.useState)(),E=(0,p.cI)({resolver:(0,r.F)(Z),defaultValues:{}}),A=async e=>{let{query:t}=e;try{P(!0),E.reset(),await l(t,{select_param:null==w?void 0:w[O]})}catch(e){}finally{P(!1)}},W=async()=>{try{let e=new URLSearchParams(window.location.search);e.delete("initMessage"),window.history.replaceState(null,null,"?".concat(e.toString())),await A({query:y})}catch(e){console.log(e)}finally{null==N||N()}},M={overrides:{code:e=>{let{children:t}=e;return(0,s.jsx)(v.Z,{language:"javascript",style:g.Z,children:t})}}};return x.useEffect(()=>{k.current&&k.current.scrollTo(0,k.current.scrollHeight)},[null==t?void 0:t.length]),x.useEffect(()=>{y&&t.length<=0&&W()},[y]),x.useEffect(()=>{var e,t;w&&(null===(e=Object.keys(w||{}))||void 0===e?void 0:e.length)>0&&R(null===(t=Object.keys(w||{}))||void 0===t?void 0:t[0])},[w]),(0,s.jsx)("div",{className:"mx-auto flex h-full max-w-3xl flex-col gap-6 px-5 py-6 sm:gap-8 xl:max-w-5xl",children:(0,s.jsxs)(n.Z,{direction:"column",gap:2,sx:{display:"flex",flex:1,flexBasis:"100%",width:"100%",height:"100%",maxHeight:"100%",minHeight:"100%",mx:"auto"},children:[(0,s.jsxs)(n.Z,{ref:k,direction:"column",gap:2,sx:{boxSizing:"border-box",maxWidth:"100%",width:"100%",mx:"auto",flex:1,maxHeight:"100%",overflowY:"auto",p:2,border:"1px solid",borderColor:"var(--joy-palette-divider)"},children:[C&&(0,s.jsx)(o.Z,{size:"sm",variant:"outlined",color:"primary",className:"message-agent",sx:{mr:"auto",ml:"none",whiteSpace:"pre-wrap"},children:null==C?void 0:C.context}),t.filter(e=>["view","human"].includes(e.role)).map((e,t)=>{var l;return(0,s.jsx)(n.Z,{sx:{mr:"view"===e.role?"auto":"none",ml:"human"===e.role?"auto":"none"},children:(0,s.jsx)(o.Z,{size:"sm",variant:"outlined",className:"view"===e.role?"message-agent":"message-human",color:"view"===e.role?"primary":"neutral",sx:e=>({px:2,"ol, ul":{my:0,pl:2},ol:{listStyle:"numeric"},ul:{listStyle:"disc",mb:2},li:{my:1},a:{textDecoration:"underline"}}),children:(0,s.jsx)(j.Z,{options:M,children:null===(l=e.context)||void 0===l?void 0:l.replaceAll("\\n","\n")})})},t)}),T&&(0,s.jsx)(i.Z,{variant:"soft",color:"neutral",size:"sm",sx:{mx:"auto",my:2}})]}),!b&&(0,s.jsxs)("form",{style:{maxWidth:"100%",width:"100%",position:"relative",display:"flex",marginTop:"auto",overflow:"visible",background:"none",justifyContent:"center",marginLeft:"auto",marginRight:"auto",flexDirection:"column",gap:"12px"},onSubmit:e=>{e.stopPropagation(),E.handleSubmit(A)(e)},children:[Object.keys(w||{}).length>0&&(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(c.Z,{value:O,onChange:(e,t)=>{R(t)},className:"max-w-xs",children:Object.keys(w||{}).map(e=>(0,s.jsx)(u.Z,{value:e,children:null==w?void 0:w[e]},e))}),(0,s.jsx)(h.Z,{className:"cursor-pointer",title:O,placement:"top",variant:"outlined",children:(0,s.jsx)(f.Z,{})})]}),(0,s.jsx)(d.ZP,{sx:{width:"100%"},variant:"outlined",endDecorator:(0,s.jsx)(m.ZP,{type:"submit",disabled:T,children:(0,s.jsx)(a.Z,{})}),...E.register("query")})]})]})})},w=l(91440),N=l(50645),k=l(5737),T=l(45642),P=l(26974),C=l(22046),S=l(78417),O=l(66487);let R=(0,N.Z)(k.Z)(e=>{let{theme:t}=e;return{...t.typography.body2,padding:t.spacing(1),textAlign:"center",borderRadius:4,color:t.vars.palette.text.secondary}});var E=()=>{let{handleChatSubmit:e,history:t}=(0,O.Z)({queryAgentURL:"/v1/chat/completions"}),l=[{year:"1951 年",sales:0},{year:"1952 年",sales:52},{year:"1956 年",sales:61},{year:"1957 年",sales:45},{year:"1958 年",sales:48},{year:"1959 年",sales:38},{year:"1960 年",sales:38},{year:"1962 年",sales:38}];return(0,s.jsx)("div",{className:"p-4 flex flex-row gap-6 min-h-full w-full",children:(0,s.jsx)("div",{className:"flex w-full",children:(0,s.jsxs)(T.Z,{container:!0,spacing:2,sx:{flexGrow:1},children:[(0,s.jsx)(T.Z,{xs:8,children:(0,s.jsxs)(S.Z,{spacing:2,className:"h-full",children:[(0,s.jsx)(R,{children:(0,s.jsx)(T.Z,{container:!0,spacing:2,children:[{label:"Revenue Won",value:"$7,811,851"},{label:"Close %",value:"37.7%"},{label:"AVG Days to Close",value:"121"},{label:"Opportunities Won",value:"526"}].map(e=>(0,s.jsx)(T.Z,{xs:3,children:(0,s.jsx)(o.Z,{className:"flex-1 h-full",children:(0,s.jsxs)(P.Z,{className:"justify-around",children:[(0,s.jsx)(C.ZP,{gutterBottom:!0,component:"div",children:e.label}),(0,s.jsx)(C.ZP,{children:e.value})]})})},e.label))})}),(0,s.jsx)(R,{className:"flex-1",children:(0,s.jsx)(o.Z,{className:"h-full",children:(0,s.jsxs)(P.Z,{className:"h-full",children:[(0,s.jsx)(C.ZP,{gutterBottom:!0,component:"div",children:"Revenue Won by Month"}),(0,s.jsx)("div",{className:"flex-1",children:(0,s.jsx)(w.Chart,{padding:[10,20,50,40],autoFit:!0,data:[{month:"Jan",city:"Tokyo",temperature:7},{month:"Feb",city:"Tokyo",temperature:13},{month:"Mar",city:"Tokyo",temperature:16.5},{month:"Apr",city:"Tokyo",temperature:14.5},{month:"May",city:"Tokyo",temperature:10},{month:"Jun",city:"Tokyo",temperature:7.5},{month:"Jul",city:"Tokyo",temperature:9.2},{month:"Aug",city:"Tokyo",temperature:14.5},{month:"Sep",city:"Tokyo",temperature:9.3},{month:"Oct",city:"Tokyo",temperature:8.3},{month:"Nov",city:"Tokyo",temperature:8.9},{month:"Dec",city:"Tokyo",temperature:5.6}],children:(0,s.jsx)(w.LineAdvance,{shape:"smooth",point:!0,area:!0,position:"month*temperature",color:"city"})})})]})})}),(0,s.jsx)(R,{className:"flex-1",children:(0,s.jsxs)(T.Z,{container:!0,spacing:2,className:"h-full",children:[(0,s.jsx)(T.Z,{xs:4,className:"h-full",children:(0,s.jsx)(o.Z,{className:"flex-1 h-full",children:(0,s.jsxs)(P.Z,{className:"h-full",children:[(0,s.jsx)(C.ZP,{gutterBottom:!0,component:"div",children:"Close % by Month"}),(0,s.jsx)("div",{className:"flex-1",children:(0,s.jsxs)(w.Chart,{autoFit:!0,data:l,children:[(0,s.jsx)(w.Interval,{position:"year*sales",style:{lineWidth:3,stroke:(0,w.getTheme)().colors10[0]}}),(0,s.jsx)(w.Tooltip,{shared:!0})]})})]})})}),(0,s.jsx)(T.Z,{xs:4,className:"h-full",children:(0,s.jsx)(o.Z,{className:"flex-1 h-full",children:(0,s.jsxs)(P.Z,{className:"h-full",children:[(0,s.jsx)(C.ZP,{gutterBottom:!0,component:"div",children:"Close % by Month"}),(0,s.jsx)("div",{className:"flex-1",children:(0,s.jsxs)(w.Chart,{autoFit:!0,data:l,children:[(0,s.jsx)(w.Interval,{position:"year*sales",style:{lineWidth:3,stroke:(0,w.getTheme)().colors10[0]}}),(0,s.jsx)(w.Tooltip,{shared:!0})]})})]})})}),(0,s.jsx)(T.Z,{xs:4,className:"h-full",children:(0,s.jsx)(o.Z,{className:"flex-1 h-full",children:(0,s.jsxs)(P.Z,{className:"h-full",children:[(0,s.jsx)(C.ZP,{gutterBottom:!0,component:"div",children:"Close % by Month"}),(0,s.jsx)("div",{className:"flex-1",children:(0,s.jsxs)(w.Chart,{autoFit:!0,data:l,children:[(0,s.jsx)(w.Interval,{position:"year*sales",style:{lineWidth:3,stroke:(0,w.getTheme)().colors10[0]}}),(0,s.jsx)(w.Tooltip,{shared:!0})]})})]})})})]})})]})}),(0,s.jsx)(T.Z,{xs:4,children:(0,s.jsx)(b,{messages:t,onSubmit:e})})]})})})}},57931:function(e,t,l){"use strict";l.d(t,{ZP:function(){return c},Cg:function(){return o}});var s=l(9268),r=l(89081),a=l(78915),n=l(86006);let[o,i]=function(){let e=n.createContext(void 0);return[function(){let t=n.useContext(e);if(void 0===t)throw Error("useCtx must be inside a Provider with a value");return t},e.Provider]}();var c=e=>{let{children:t}=e,{run:l,data:n,refresh:o}=(0,r.Z)(async()=>await (0,a.T)("/v1/chat/dialogue/list"),{manual:!0});return(0,s.jsx)(i,{value:{dialogueList:n,queryDialogueList:l,refreshDialogList:o},children:t})}},66487:function(e,t,l){"use strict";l.d(t,{Z:function(){return o}});var s=l(71990),r=l(86006),a=e=>{let t=(0,r.useReducer)((e,t)=>({...e,...t}),{...e});return t},n=l(57931),o=e=>{let{queryAgentURL:t,channel:l,queryBody:o,initHistory:i}=e,[c,u]=a({history:i||[]}),{refreshDialogList:h}=(0,n.Cg)();(0,r.useEffect)(()=>{i&&u({history:i})},[i]);let d=async(e,r)=>{if(!e)return;let a=[...c.history,{role:"human",context:e}],n=a.length;u({history:a});try{let i=new AbortController;await (0,s.L)("".concat("http://127.0.0.1:5000").concat("/api"+t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...r,...o,user_input:e,channel:l}),signal:i.signal,async onopen(e){if(a.length<=1){h();let e=new URLSearchParams(window.location.search);e.delete("initMessage"),window.history.replaceState(null,null,"?".concat(e.toString()))}(!e.ok||e.headers.get("content-type")!==s.a)&&e.status>=400&&e.status<500&&429!==e.status&&e.status},onclose(){console.log("onclose")},onerror(e){throw Error(e)},onmessage:e=>{var t;if(console.log(e,"e"),e.data=e.data.replaceAll("\\n","\n"),"[DONE]"===e.data)i.abort();else if(null===(t=e.data)||void 0===t?void 0:t.startsWith("[ERROR]"))i.abort(),u({history:[...a,{role:"view",context:e.data.replace("[ERROR]","")}]});else{let t=[...a];e.data&&((null==t?void 0:t[n])?t[n].context="".concat(e.data):t.push({role:"view",context:e.data}),u({history:t}))}}})}catch(e){console.log("---e",e),u({history:[...a,{role:"view",context:"请求出错"}]})}};return{handleChatSubmit:d,history:c.history}}},78915:function(e,t,l){"use strict";l.d(t,{T:function(){return c},K:function(){return u}});var s=l(21628),r=l(24214);let a=r.Z.create({baseURL:"http://127.0.0.1:5000"});a.defaults.timeout=1e4,a.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var n=l(84835);let o={"content-type":"application/json"},i=e=>{if(!(0,n.isPlainObject)(e))return JSON.stringify(e);let t={...e};for(let e in t){let l=t[e];"string"==typeof l&&(t[e]=l.trim())}return JSON.stringify(t)},c=(e,t)=>{if(t){let l=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");l&&(e+="?".concat(l))}return a.get("/api"+e,{headers:o}).then(e=>e).catch(e=>{s.ZP.error(e),Promise.reject(e)})},u=(e,t)=>{let l=i(t);return a.post("/api"+e,{body:l,headers:o}).then(e=>e).catch(e=>{s.ZP.error(e),Promise.reject(e)})}}},function(e){e.O(0,[180,757,430,577,86,562,259,751,662,481,253,769,744],function(){return e(e.s=15175)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/agents/page-f27b3fa0b7362062.js b/pilot/server/static/_next/static/chunks/app/agents/page-f27b3fa0b7362062.js new file mode 100644 index 000000000..350203eaf --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/agents/page-f27b3fa0b7362062.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[718],{15175:function(e,t,l){Promise.resolve().then(l.bind(l,4191))},4191:function(e,t,l){"use strict";l.r(t),l.d(t,{default:function(){return E}});var r=l(9268),s=l(67830),a=l(54842),n=l(70900),o=l(62414),i=l(94244),c=l(33155),u=l(7354),h=l(35891),d=l(35086),m=l(53047),x=l(86006),p=l(19700),y=l(92391),f=l(70321),j=l(75403),v=l(99398),g=l(49064);let Z=y.z.object({query:y.z.string().min(1)});var b=e=>{let{messages:t,onSubmit:l,initialMessage:y,readOnly:b,paramsList:w,clearIntialMessage:N}=e,k=x.useRef(null),[P,T]=(0,x.useState)(!1),[C,S]=(0,x.useState)(),[O,R]=(0,x.useState)(),E=(0,p.cI)({resolver:(0,s.F)(Z),defaultValues:{}}),A=async e=>{let{query:t}=e;try{T(!0),E.reset(),await l(t,{select_param:null==w?void 0:w[O]})}catch(e){}finally{T(!1)}},W=async()=>{try{let e=new URLSearchParams(window.location.search);e.delete("initMessage"),window.history.replaceState(null,null,"?".concat(e.toString())),await A({query:y})}catch(e){console.log(e)}finally{null==N||N()}},M={overrides:{code:e=>{let{children:t}=e;return(0,r.jsx)(v.Z,{language:"javascript",style:g.Z,children:t})}}};return x.useEffect(()=>{k.current&&k.current.scrollTo(0,k.current.scrollHeight)},[null==t?void 0:t.length]),x.useEffect(()=>{y&&t.length<=0&&W()},[y]),x.useEffect(()=>{var e,t;w&&(null===(e=Object.keys(w||{}))||void 0===e?void 0:e.length)>0&&R(null===(t=Object.keys(w||{}))||void 0===t?void 0:t[0])},[w]),(0,r.jsx)("div",{className:"mx-auto flex h-full max-w-3xl flex-col gap-6 px-5 py-6 sm:gap-8 xl:max-w-5xl",children:(0,r.jsxs)(n.Z,{direction:"column",gap:2,sx:{display:"flex",flex:1,flexBasis:"100%",width:"100%",height:"100%",maxHeight:"100%",minHeight:"100%",mx:"auto"},children:[(0,r.jsxs)(n.Z,{ref:k,direction:"column",gap:2,sx:{boxSizing:"border-box",maxWidth:"100%",width:"100%",mx:"auto",flex:1,maxHeight:"100%",overflowY:"auto",p:2,border:"1px solid",borderColor:"var(--joy-palette-divider)"},children:[C&&(0,r.jsx)(o.Z,{size:"sm",variant:"outlined",color:"primary",className:"message-agent",sx:{mr:"auto",ml:"none",whiteSpace:"pre-wrap"},children:null==C?void 0:C.context}),t.filter(e=>["view","human"].includes(e.role)).map((e,t)=>{var l;return(0,r.jsx)(n.Z,{sx:{mr:"view"===e.role?"auto":"none",ml:"human"===e.role?"auto":"none"},children:(0,r.jsx)(o.Z,{size:"sm",variant:"outlined",className:"view"===e.role?"message-agent":"message-human",color:"view"===e.role?"primary":"neutral",sx:e=>({px:2,"ol, ul":{my:0,pl:2},ol:{listStyle:"numeric"},ul:{listStyle:"disc",mb:2},li:{my:1},a:{textDecoration:"underline"}}),children:(0,r.jsx)(j.Z,{options:M,children:null===(l=e.context)||void 0===l?void 0:l.replaceAll("\\n","\n")})})},t)}),P&&(0,r.jsx)(i.Z,{variant:"soft",color:"neutral",size:"sm",sx:{mx:"auto",my:2}})]}),!b&&(0,r.jsxs)("form",{style:{maxWidth:"100%",width:"100%",position:"relative",display:"flex",marginTop:"auto",overflow:"visible",background:"none",justifyContent:"center",marginLeft:"auto",marginRight:"auto",flexDirection:"column",gap:"12px"},onSubmit:e=>{e.stopPropagation(),E.handleSubmit(A)(e)},children:[Object.keys(w||{}).length>0&&(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(c.Z,{value:O,onChange:(e,t)=>{R(t)},className:"max-w-xs",children:Object.keys(w||{}).map(e=>(0,r.jsx)(u.Z,{value:e,children:null==w?void 0:w[e]},e))}),(0,r.jsx)(h.Z,{className:"cursor-pointer",title:O,placement:"top",variant:"outlined",children:(0,r.jsx)(f.Z,{})})]}),(0,r.jsx)(d.ZP,{sx:{width:"100%"},variant:"outlined",endDecorator:(0,r.jsx)(m.ZP,{type:"submit",disabled:P,children:(0,r.jsx)(a.Z,{})}),...E.register("query")})]})]})})},w=l(91440),N=l(50645),k=l(5737),P=l(45642),T=l(26974),C=l(22046),S=l(78417),O=l(66487);let R=(0,N.Z)(k.Z)(e=>{let{theme:t}=e;return{...t.typography.body2,padding:t.spacing(1),textAlign:"center",borderRadius:4,color:t.vars.palette.text.secondary}});var E=()=>{let{handleChatSubmit:e,history:t}=(0,O.Z)({queryAgentURL:"/v1/chat/completions"}),l=[{year:"1951 年",sales:0},{year:"1952 年",sales:52},{year:"1956 年",sales:61},{year:"1957 年",sales:45},{year:"1958 年",sales:48},{year:"1959 年",sales:38},{year:"1960 年",sales:38},{year:"1962 年",sales:38}];return(0,r.jsx)("div",{className:"p-4 flex flex-row gap-6 min-h-full w-full",children:(0,r.jsx)("div",{className:"flex w-full",children:(0,r.jsxs)(P.Z,{container:!0,spacing:2,sx:{flexGrow:1},children:[(0,r.jsx)(P.Z,{xs:8,children:(0,r.jsxs)(S.Z,{spacing:2,className:"h-full",children:[(0,r.jsx)(R,{children:(0,r.jsx)(P.Z,{container:!0,spacing:2,children:[{label:"Revenue Won",value:"$7,811,851"},{label:"Close %",value:"37.7%"},{label:"AVG Days to Close",value:"121"},{label:"Opportunities Won",value:"526"}].map(e=>(0,r.jsx)(P.Z,{xs:3,children:(0,r.jsx)(o.Z,{className:"flex-1 h-full",children:(0,r.jsxs)(T.Z,{className:"justify-around",children:[(0,r.jsx)(C.ZP,{gutterBottom:!0,component:"div",children:e.label}),(0,r.jsx)(C.ZP,{children:e.value})]})})},e.label))})}),(0,r.jsx)(R,{className:"flex-1",children:(0,r.jsx)(o.Z,{className:"h-full",children:(0,r.jsxs)(T.Z,{className:"h-full",children:[(0,r.jsx)(C.ZP,{gutterBottom:!0,component:"div",children:"Revenue Won by Month"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsx)(w.Chart,{padding:[10,20,50,40],autoFit:!0,data:[{month:"Jan",city:"Tokyo",temperature:7},{month:"Feb",city:"Tokyo",temperature:13},{month:"Mar",city:"Tokyo",temperature:16.5},{month:"Apr",city:"Tokyo",temperature:14.5},{month:"May",city:"Tokyo",temperature:10},{month:"Jun",city:"Tokyo",temperature:7.5},{month:"Jul",city:"Tokyo",temperature:9.2},{month:"Aug",city:"Tokyo",temperature:14.5},{month:"Sep",city:"Tokyo",temperature:9.3},{month:"Oct",city:"Tokyo",temperature:8.3},{month:"Nov",city:"Tokyo",temperature:8.9},{month:"Dec",city:"Tokyo",temperature:5.6}],children:(0,r.jsx)(w.LineAdvance,{shape:"smooth",point:!0,area:!0,position:"month*temperature",color:"city"})})})]})})}),(0,r.jsx)(R,{className:"flex-1",children:(0,r.jsxs)(P.Z,{container:!0,spacing:2,className:"h-full",children:[(0,r.jsx)(P.Z,{xs:4,className:"h-full",children:(0,r.jsx)(o.Z,{className:"flex-1 h-full",children:(0,r.jsxs)(T.Z,{className:"h-full",children:[(0,r.jsx)(C.ZP,{gutterBottom:!0,component:"div",children:"Close % by Month"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsxs)(w.Chart,{autoFit:!0,data:l,children:[(0,r.jsx)(w.Interval,{position:"year*sales",style:{lineWidth:3,stroke:(0,w.getTheme)().colors10[0]}}),(0,r.jsx)(w.Tooltip,{shared:!0})]})})]})})}),(0,r.jsx)(P.Z,{xs:4,className:"h-full",children:(0,r.jsx)(o.Z,{className:"flex-1 h-full",children:(0,r.jsxs)(T.Z,{className:"h-full",children:[(0,r.jsx)(C.ZP,{gutterBottom:!0,component:"div",children:"Close % by Month"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsxs)(w.Chart,{autoFit:!0,data:l,children:[(0,r.jsx)(w.Interval,{position:"year*sales",style:{lineWidth:3,stroke:(0,w.getTheme)().colors10[0]}}),(0,r.jsx)(w.Tooltip,{shared:!0})]})})]})})}),(0,r.jsx)(P.Z,{xs:4,className:"h-full",children:(0,r.jsx)(o.Z,{className:"flex-1 h-full",children:(0,r.jsxs)(T.Z,{className:"h-full",children:[(0,r.jsx)(C.ZP,{gutterBottom:!0,component:"div",children:"Close % by Month"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsxs)(w.Chart,{autoFit:!0,data:l,children:[(0,r.jsx)(w.Interval,{position:"year*sales",style:{lineWidth:3,stroke:(0,w.getTheme)().colors10[0]}}),(0,r.jsx)(w.Tooltip,{shared:!0})]})})]})})})]})})]})}),(0,r.jsx)(P.Z,{xs:4,children:(0,r.jsx)(b,{messages:t,onSubmit:e})})]})})})}},57931:function(e,t,l){"use strict";l.d(t,{ZP:function(){return c},Cg:function(){return o}});var r=l(9268),s=l(89081),a=l(78915),n=l(86006);let[o,i]=function(){let e=n.createContext(void 0);return[function(){let t=n.useContext(e);if(void 0===t)throw Error("useCtx must be inside a Provider with a value");return t},e.Provider]}();var c=e=>{let{children:t}=e,{run:l,data:n,refresh:o}=(0,s.Z)(async()=>await (0,a.Tk)("/v1/chat/dialogue/list"),{manual:!0});return(0,r.jsx)(i,{value:{dialogueList:n,queryDialogueList:l,refreshDialogList:o},children:t})}},66487:function(e,t,l){"use strict";l.d(t,{Z:function(){return o}});var r=l(71990),s=l(86006),a=e=>{let t=(0,s.useReducer)((e,t)=>({...e,...t}),{...e});return t},n=l(57931),o=e=>{let{queryAgentURL:t,channel:l,queryBody:o,initHistory:i}=e,[c,u]=a({history:i||[]}),{refreshDialogList:h}=(0,n.Cg)();(0,s.useEffect)(()=>{i&&u({history:i})},[i]);let d=async(e,s)=>{if(!e)return;let a=[...c.history,{role:"human",context:e}],n=a.length;u({history:a});try{let i=new AbortController;await (0,r.L)("".concat("http://127.0.0.1:5000").concat("/api"+t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...s,...o,user_input:e,channel:l}),signal:i.signal,async onopen(e){if(a.length<=1){h();let e=new URLSearchParams(window.location.search);e.delete("initMessage"),window.history.replaceState(null,null,"?".concat(e.toString()))}(!e.ok||e.headers.get("content-type")!==r.a)&&e.status>=400&&e.status<500&&429!==e.status&&e.status},onclose(){console.log("onclose")},onerror(e){throw Error(e)},onmessage:e=>{var t;if(console.log(e,"e"),e.data=e.data.replaceAll("\\n","\n"),"[DONE]"===e.data)i.abort();else if(null===(t=e.data)||void 0===t?void 0:t.startsWith("[ERROR]"))i.abort(),u({history:[...a,{role:"view",context:e.data.replace("[ERROR]","")}]});else{let t=[...a];e.data&&((null==t?void 0:t[n])?t[n].context="".concat(e.data):t.push({role:"view",context:e.data}),u({history:t}))}}})}catch(e){console.log("---e",e),u({history:[...a,{role:"view",context:"请求出错"}]})}};return{handleChatSubmit:d,history:c.history}}},78915:function(e,t,l){"use strict";l.d(t,{Tk:function(){return c},Kw:function(){return u},PR:function(){return h},Ej:function(){return d}});var r=l(21628),s=l(24214);let a=s.Z.create({baseURL:"http://127.0.0.1:5000"});a.defaults.timeout=1e4,a.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var n=l(84835);let o={"content-type":"application/json"},i=e=>{if(!(0,n.isPlainObject)(e))return JSON.stringify(e);let t={...e};for(let e in t){let l=t[e];"string"==typeof l&&(t[e]=l.trim())}return JSON.stringify(t)},c=(e,t)=>{if(t){let l=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");l&&(e+="?".concat(l))}return a.get("/api"+e,{headers:o}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},u=(e,t)=>{let l=i(t);return a.post("/api"+e,{body:l,headers:o}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},h=(e,t)=>{let l=i(t);return a.post(e,{body:l,headers:o}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},d=(e,t)=>a.post(e,{body:t}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})}},function(e){e.O(0,[180,757,430,577,214,86,316,259,751,662,481,253,769,744],function(){return e(e.s=15175)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/chat/page-14d13e4afadab0d9.js b/pilot/server/static/_next/static/chunks/app/chat/page-14d13e4afadab0d9.js new file mode 100644 index 000000000..2fa8d1ce2 --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/chat/page-14d13e4afadab0d9.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[929],{55749:function(e,t,r){"use strict";var a=r(78997);t.Z=void 0;var n=a(r(76906)),o=r(9268),s=(0,n.default)([(0,o.jsx)("path",{d:"M19.89 10.75c.07.41.11.82.11 1.25 0 4.41-3.59 8-8 8s-8-3.59-8-8c0-.05.01-.1 0-.14 2.6-.98 4.69-2.99 5.74-5.55 3.38 4.14 7.97 3.73 8.99 3.61l-.89-1.93c-.13.01-4.62.38-7.18-3.86 1.01-.16 1.71-.15 2.59-.01 2.52-1.15 1.93-.89 2.76-1.26C14.78 2.3 13.43 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-1.43-.3-2.78-.84-4.01l-1.27 2.76zM8.08 5.03C7.45 6.92 6.13 8.5 4.42 9.47 5.05 7.58 6.37 6 8.08 5.03z"},"0"),(0,o.jsx)("circle",{cx:"15",cy:"13",r:"1.25"},"1"),(0,o.jsx)("circle",{cx:"9",cy:"13",r:"1.25"},"2"),(0,o.jsx)("path",{d:"m23 4.5-2.4-1.1L19.5 1l-1.1 2.4L16 4.5l2.4 1.1L19.5 8l1.1-2.4z"},"3")],"FaceRetouchingNaturalOutlined");t.Z=s},70781:function(e,t,r){"use strict";var a=r(78997);t.Z=void 0;var n=a(r(76906)),o=r(9268),s=(0,n.default)((0,o.jsx)("path",{d:"M20 9V7c0-1.1-.9-2-2-2h-3c0-1.66-1.34-3-3-3S9 3.34 9 5H6c-1.1 0-2 .9-2 2v2c-1.66 0-3 1.34-3 3s1.34 3 3 3v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c1.66 0 3-1.34 3-3s-1.34-3-3-3zm-2 10H6V7h12v12zm-9-6c-.83 0-1.5-.67-1.5-1.5S8.17 10 9 10s1.5.67 1.5 1.5S9.83 13 9 13zm7.5-1.5c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5.67-1.5 1.5-1.5 1.5.67 1.5 1.5zM8 15h8v2H8v-2z"}),"SmartToyOutlined");t.Z=s},90545:function(e,t,r){"use strict";r.d(t,{Z:function(){return p}});var a=r(40431),n=r(46750),o=r(86006),s=r(89791),i=r(4323),l=r(51579),c=r(86601),u=r(95887),d=r(9268);let h=["className","component"];var f=r(47327),v=r(98918);let m=function(e={}){let{themeId:t,defaultTheme:r,defaultClassName:f="MuiBox-root",generateClassName:v}=e,m=(0,i.ZP)("div",{shouldForwardProp:e=>"theme"!==e&&"sx"!==e&&"as"!==e})(l.Z),p=o.forwardRef(function(e,o){let i=(0,u.Z)(r),l=(0,c.Z)(e),{className:p,component:g="div"}=l,x=(0,n.Z)(l,h);return(0,d.jsx)(m,(0,a.Z)({as:g,ref:o,className:(0,s.Z)(p,v?v(f):f),theme:t&&i[t]||i},x))});return p}({defaultTheme:v.Z,defaultClassName:"MuiBox-root",generateClassName:f.Z.generate});var p=m},80966:function(e,t,r){Promise.resolve().then(r.bind(r,59498))},59498:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return k}});var a=r(9268),n=r(89081),o=r(78915),s=r(66487),i=r(67830),l=r(54842),c=r(70900),u=r(62414),d=r(90545),h=r(94244),f=r(33155),v=r(7354),m=r(35086),p=r(53047),g=r(86006),x=r(19700),y=r(92391),j=r(55749),w=r(70781),b=r(75403),Z=r(99398),P=r(49064),S=r(56008);let N=y.z.object({query:y.z.string().min(1)});var R=e=>{var t;let{messages:r,onSubmit:n,readOnly:o,paramsList:s,clearIntialMessage:y}=e,R=(0,S.useSearchParams)(),_=R.get("initMessage"),k=g.useRef(null),[C,O]=(0,g.useState)(!1),[E,z]=(0,g.useState)(),L=(0,x.cI)({resolver:(0,i.F)(N),defaultValues:{}}),A=async e=>{let{query:t}=e;try{console.log("submit"),O(!0),L.reset(),await n(t,{select_param:null==s?void 0:s[E]})}catch(e){}finally{O(!1)}},M=async()=>{try{let e=new URLSearchParams(window.location.search),t=e.get("initMessage");e.delete("initMessage"),window.history.replaceState(null,null,"?".concat(e.toString())),await A({query:t})}catch(e){console.log(e)}finally{null==y||y()}},T={overrides:{code:e=>{let{children:t}=e;return(0,a.jsx)(Z.Z,{language:"javascript",style:P.Z,children:t})}},wrapper:g.Fragment};return g.useEffect(()=>{k.current&&k.current.scrollTo(0,k.current.scrollHeight)},[null==r?void 0:r.length]),g.useEffect(()=>{_&&r.length<=0&&M()},[_,r.length]),g.useEffect(()=>{var e,t;s&&(null===(e=Object.keys(s||{}))||void 0===e?void 0:e.length)>0&&z(null===(t=Object.keys(s||{}))||void 0===t?void 0:t[0])},[s]),(0,a.jsx)("div",{className:"w-full h-full",children:(0,a.jsxs)(c.Z,{className:"w-full h-full bg-[#fefefe] dark:bg-[#212121]",sx:{table:{borderCollapse:"collapse",border:"1px solid #ccc",width:"100%"},"th, td":{border:"1px solid #ccc",padding:"10px",textAlign:"center"}},children:[(0,a.jsxs)(c.Z,{ref:k,direction:"column",sx:{overflowY:"auto",maxHeight:"100%",flex:1},children:[null===(t=r.filter(e=>["view","human"].includes(e.role)))||void 0===t?void 0:t.map((e,t)=>{var r;return(0,a.jsx)(c.Z,{children:(0,a.jsx)(u.Z,{size:"sm",variant:"outlined",color:"view"===e.role?"primary":"neutral",sx:t=>({background:"view"===e.role?"var(--joy-palette-primary-softBg, var(--joy-palette-primary-100, #DDF1FF))":"unset",border:"unset",borderRadius:"unset",padding:"24px 0 26px 0",lineHeight:"24px"}),children:(0,a.jsxs)(d.Z,{sx:{width:"76%",margin:"0 auto"},className:"flex flex-row",children:[(0,a.jsx)("div",{className:"mr-3 inline",children:"view"===e.role?(0,a.jsx)(w.Z,{}):(0,a.jsx)(j.Z,{})}),(0,a.jsx)("div",{className:"inline align-middle mt-0.5 max-w-full flex-1 overflow-auto",children:(0,a.jsx)(b.Z,{options:T,children:null===(r=e.context)||void 0===r?void 0:r.replaceAll("\\n","\n")})})]})})},t)}),C&&(0,a.jsx)(h.Z,{variant:"soft",color:"neutral",size:"sm",sx:{mx:"auto",my:2}})]}),!o&&(0,a.jsx)(d.Z,{className:"bg-[#fefefe] dark:bg-[#212121] before:bg-[#fefefe] before:dark:bg-[#212121]",sx:{position:"relative","&::before":{content:'" "',position:"absolute",top:"-18px",left:"0",right:"0",width:"100%",margin:"0 auto",height:"20px",filter:"blur(10px)",zIndex:2}},children:(0,a.jsxs)("form",{style:{maxWidth:"100%",width:"76%",position:"relative",display:"flex",marginTop:"auto",overflow:"visible",background:"none",justifyContent:"center",marginLeft:"auto",marginRight:"auto",flexDirection:"column",gap:"12px",paddingBottom:"58px",paddingTop:"20px"},onSubmit:e=>{e.stopPropagation(),L.handleSubmit(A)(e)},children:[Object.keys(s||{}).length>0&&(0,a.jsx)("div",{className:"flex items-center gap-3",children:(0,a.jsx)(f.Z,{value:E,onChange:(e,t)=>{z(t)},sx:{maxWidth:"100%"},children:Object.keys(s||{}).map(e=>(0,a.jsx)(v.Z,{value:e,children:e},e))})}),(0,a.jsx)(m.ZP,{className:"w-full h-12",variant:"outlined",endDecorator:(0,a.jsx)(p.ZP,{type:"submit",disabled:C,children:(0,a.jsx)(l.Z,{})}),...L.register("query")})]})})]})})},_=r(57931),k=()=>{let e=(0,S.useSearchParams)(),{refreshDialogList:t}=(0,_.Cg)(),r=e.get("id"),i=e.get("scene"),{data:l}=(0,n.Z)(async()=>await (0,o.Tk)("/v1/chat/dialogue/messages/history",{con_uid:r}),{ready:!!r,refreshDeps:[r]}),{data:c}=(0,n.Z)(async()=>await (0,o.Kw)("/v1/chat/mode/params/list?chat_mode=".concat(i)),{ready:!!i,refreshDeps:[r,i]}),{history:u,handleChatSubmit:d}=(0,s.Z)({queryAgentURL:"/v1/chat/completions",queryBody:{conv_uid:r,chat_mode:i||"chat_normal"},initHistory:null==l?void 0:l.data});return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(R,{clearIntialMessage:async()=>{await t()},messages:u||[],onSubmit:d,paramsList:null==c?void 0:c.data})})}},57931:function(e,t,r){"use strict";r.d(t,{ZP:function(){return c},Cg:function(){return i}});var a=r(9268),n=r(89081),o=r(78915),s=r(86006);let[i,l]=function(){let e=s.createContext(void 0);return[function(){let t=s.useContext(e);if(void 0===t)throw Error("useCtx must be inside a Provider with a value");return t},e.Provider]}();var c=e=>{let{children:t}=e,{run:r,data:s,refresh:i}=(0,n.Z)(async()=>await (0,o.Tk)("/v1/chat/dialogue/list"),{manual:!0});return(0,a.jsx)(l,{value:{dialogueList:s,queryDialogueList:r,refreshDialogList:i},children:t})}},66487:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});var a=r(71990),n=r(86006),o=e=>{let t=(0,n.useReducer)((e,t)=>({...e,...t}),{...e});return t},s=r(57931),i=r(52040),l=e=>{let{queryAgentURL:t,channel:r,queryBody:l,initHistory:c}=e,[u,d]=o({history:c||[]}),{refreshDialogList:h}=(0,s.Cg)();(0,n.useEffect)(()=>{c&&d({history:c})},[c]);let f=async(e,n)=>{if(!e)return;let o=[...u.history,{role:"human",context:e}],s=o.length;d({history:o});try{let c=new AbortController;await (0,a.L)("".concat(i.env.API_BASE_URL?i.env.API_BASE_URL:"").concat("/api"+t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...l,user_input:e,channel:r}),signal:c.signal,async onopen(e){if(o.length<=1){h();let e=new URLSearchParams(window.location.search);e.delete("initMessage"),window.history.replaceState(null,null,"?".concat(e.toString()))}(!e.ok||e.headers.get("content-type")!==a.a)&&e.status>=400&&e.status<500&&429!==e.status&&e.status},onclose(){console.log("onclose")},onerror(e){throw Error(e)},onmessage:e=>{var t;if(console.log(e,"e"),e.data=e.data.replaceAll("\\n","\n"),"[DONE]"===e.data)c.abort();else if(null===(t=e.data)||void 0===t?void 0:t.startsWith("[ERROR]"))c.abort(),d({history:[...o,{role:"view",context:e.data.replace("[ERROR]","")}]});else{let t=[...o];e.data&&((null==t?void 0:t[s])?t[s].context="".concat(e.data):t.push({role:"view",context:e.data}),d({history:t}))}}})}catch(e){console.log("---e",e),d({history:[...o,{role:"view",context:"请求出错"}]})}};return{handleChatSubmit:f,history:u.history}}},78915:function(e,t,r){"use strict";r.d(t,{Tk:function(){return u},Kw:function(){return d},PR:function(){return h},Ej:function(){return f}});var a=r(21628),n=r(24214),o=r(52040);let s=n.Z.create({baseURL:o.env.API_BASE_URL});s.defaults.timeout=1e4,s.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var i=r(84835);let l={"content-type":"application/json"},c=e=>{if(!(0,i.isPlainObject)(e))return JSON.stringify(e);let t={...e};for(let e in t){let r=t[e];"string"==typeof r&&(t[e]=r.trim())}return JSON.stringify(t)},u=(e,t)=>{if(t){let r=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");r&&(e+="?".concat(r))}return s.get("/api"+e,{headers:l}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})},d=(e,t)=>{let r=c(t);return s.post("/api"+e,{body:r,headers:l}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})},h=(e,t)=>{let r=c(t);return s.post(e,{body:r,headers:l}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})},f=(e,t)=>s.post(e,{body:t}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})},56008:function(e,t,r){e.exports=r(30794)}},function(e){e.O(0,[180,106,685,86,316,259,751,662,253,769,744],function(){return e(e.s=80966)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/chat/page-2e1552efc36cf945.js b/pilot/server/static/_next/static/chunks/app/chat/page-2e1552efc36cf945.js new file mode 100644 index 000000000..e3f3a9861 --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/chat/page-2e1552efc36cf945.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[929],{55749:function(e,t,r){"use strict";var a=r(78997);t.Z=void 0;var n=a(r(76906)),o=r(9268),s=(0,n.default)([(0,o.jsx)("path",{d:"M19.89 10.75c.07.41.11.82.11 1.25 0 4.41-3.59 8-8 8s-8-3.59-8-8c0-.05.01-.1 0-.14 2.6-.98 4.69-2.99 5.74-5.55 3.38 4.14 7.97 3.73 8.99 3.61l-.89-1.93c-.13.01-4.62.38-7.18-3.86 1.01-.16 1.71-.15 2.59-.01 2.52-1.15 1.93-.89 2.76-1.26C14.78 2.3 13.43 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-1.43-.3-2.78-.84-4.01l-1.27 2.76zM8.08 5.03C7.45 6.92 6.13 8.5 4.42 9.47 5.05 7.58 6.37 6 8.08 5.03z"},"0"),(0,o.jsx)("circle",{cx:"15",cy:"13",r:"1.25"},"1"),(0,o.jsx)("circle",{cx:"9",cy:"13",r:"1.25"},"2"),(0,o.jsx)("path",{d:"m23 4.5-2.4-1.1L19.5 1l-1.1 2.4L16 4.5l2.4 1.1L19.5 8l1.1-2.4z"},"3")],"FaceRetouchingNaturalOutlined");t.Z=s},70781:function(e,t,r){"use strict";var a=r(78997);t.Z=void 0;var n=a(r(76906)),o=r(9268),s=(0,n.default)((0,o.jsx)("path",{d:"M20 9V7c0-1.1-.9-2-2-2h-3c0-1.66-1.34-3-3-3S9 3.34 9 5H6c-1.1 0-2 .9-2 2v2c-1.66 0-3 1.34-3 3s1.34 3 3 3v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c1.66 0 3-1.34 3-3s-1.34-3-3-3zm-2 10H6V7h12v12zm-9-6c-.83 0-1.5-.67-1.5-1.5S8.17 10 9 10s1.5.67 1.5 1.5S9.83 13 9 13zm7.5-1.5c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5.67-1.5 1.5-1.5 1.5.67 1.5 1.5zM8 15h8v2H8v-2z"}),"SmartToyOutlined");t.Z=s},90545:function(e,t,r){"use strict";r.d(t,{Z:function(){return v}});var a=r(40431),n=r(46750),o=r(86006),s=r(89791),i=r(4323),l=r(51579),c=r(86601),u=r(95887),d=r(9268);let h=["className","component"];var f=r(47327),m=r(98918);let p=function(e={}){let{themeId:t,defaultTheme:r,defaultClassName:f="MuiBox-root",generateClassName:m}=e,p=(0,i.ZP)("div",{shouldForwardProp:e=>"theme"!==e&&"sx"!==e&&"as"!==e})(l.Z),v=o.forwardRef(function(e,o){let i=(0,u.Z)(r),l=(0,c.Z)(e),{className:v,component:g="div"}=l,x=(0,n.Z)(l,h);return(0,d.jsx)(p,(0,a.Z)({as:g,ref:o,className:(0,s.Z)(v,m?m(f):f),theme:t&&i[t]||i},x))});return v}({defaultTheme:m.Z,defaultClassName:"MuiBox-root",generateClassName:f.Z.generate});var v=p},80966:function(e,t,r){Promise.resolve().then(r.bind(r,59498))},59498:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return O}});var a=r(9268),n=r(89081),o=r(78915),s=r(66487),i=r(67830),l=r(54842),c=r(70900),u=r(62414),d=r(90545),h=r(94244),f=r(33155),m=r(7354),p=r(35086),v=r(53047),g=r(86006),x=r(19700),y=r(92391),j=r(55749),w=r(70781),b=r(75403),Z=r(99398),P=r(49064),S=r(56008);let N=y.z.object({query:y.z.string().min(1)});var k=e=>{var t;let{messages:r,onSubmit:n,readOnly:o,paramsList:s,clearIntialMessage:y}=e,k=(0,S.useSearchParams)(),C=k.get("initMessage"),O=g.useRef(null),[R,z]=(0,g.useState)(!1),[E,_]=(0,g.useState)(),M=(0,x.cI)({resolver:(0,i.F)(N),defaultValues:{}}),L=async e=>{let{query:t}=e;try{console.log("submit"),z(!0),M.reset(),await n(t,{select_param:null==s?void 0:s[E]})}catch(e){}finally{z(!1)}},T=async()=>{try{let e=new URLSearchParams(window.location.search),t=e.get("initMessage");e.delete("initMessage"),window.history.replaceState(null,null,"?".concat(e.toString())),await L({query:t})}catch(e){console.log(e)}finally{null==y||y()}},F={overrides:{code:e=>{let{children:t}=e;return(0,a.jsx)(Z.Z,{language:"javascript",style:P.Z,children:t})}},wrapper:g.Fragment};return g.useEffect(()=>{O.current&&O.current.scrollTo(0,O.current.scrollHeight)},[null==r?void 0:r.length]),g.useEffect(()=>{C&&r.length<=0&&T()},[C,r.length]),g.useEffect(()=>{var e,t;s&&(null===(e=Object.keys(s||{}))||void 0===e?void 0:e.length)>0&&_(null===(t=Object.keys(s||{}))||void 0===t?void 0:t[0])},[s]),(0,a.jsx)("div",{className:"w-full h-full",children:(0,a.jsxs)(c.Z,{className:"w-full h-full bg-[#fefefe] dark:bg-[#212121]",sx:{table:{borderCollapse:"collapse",border:"1px solid #ccc",width:"100%"},"th, td":{border:"1px solid #ccc",padding:"10px",textAlign:"center"}},children:[(0,a.jsxs)(c.Z,{ref:O,direction:"column",sx:{overflowY:"auto",maxHeight:"100%",flex:1},children:[null===(t=r.filter(e=>["view","human"].includes(e.role)))||void 0===t?void 0:t.map((e,t)=>{var r;return(0,a.jsx)(c.Z,{children:(0,a.jsx)(u.Z,{size:"sm",variant:"outlined",color:"view"===e.role?"primary":"neutral",sx:t=>({background:"view"===e.role?"var(--joy-palette-primary-softBg, var(--joy-palette-primary-100, #DDF1FF))":"unset",border:"unset",borderRadius:"unset",padding:"24px 0 26px 0",lineHeight:"24px"}),children:(0,a.jsxs)(d.Z,{sx:{width:"76%",margin:"0 auto"},className:"flex flex-row",children:[(0,a.jsx)("div",{className:"mr-3 inline",children:"view"===e.role?(0,a.jsx)(w.Z,{}):(0,a.jsx)(j.Z,{})}),(0,a.jsx)("div",{className:"inline align-middle mt-0.5 max-w-full flex-1 overflow-auto",children:(0,a.jsx)(b.Z,{options:F,children:null===(r=e.context)||void 0===r?void 0:r.replaceAll("\\n","\n")})})]})})},t)}),R&&(0,a.jsx)(h.Z,{variant:"soft",color:"neutral",size:"sm",sx:{mx:"auto",my:2}})]}),!o&&(0,a.jsx)(d.Z,{className:"bg-[#fefefe] dark:bg-[#212121] before:bg-[#fefefe] before:dark:bg-[#212121]",sx:{position:"relative","&::before":{content:'" "',position:"absolute",top:"-18px",left:"0",right:"0",width:"100%",margin:"0 auto",height:"20px",filter:"blur(10px)",zIndex:2}},children:(0,a.jsxs)("form",{style:{maxWidth:"100%",width:"76%",position:"relative",display:"flex",marginTop:"auto",overflow:"visible",background:"none",justifyContent:"center",marginLeft:"auto",marginRight:"auto",flexDirection:"column",gap:"12px",paddingBottom:"58px",paddingTop:"20px"},onSubmit:e=>{e.stopPropagation(),M.handleSubmit(L)(e)},children:[Object.keys(s||{}).length>0&&(0,a.jsx)("div",{className:"flex items-center gap-3",children:(0,a.jsx)(f.Z,{value:E,onChange:(e,t)=>{_(t)},sx:{maxWidth:"100%"},children:Object.keys(s||{}).map(e=>(0,a.jsx)(m.Z,{value:e,children:e},e))})}),(0,a.jsx)(p.ZP,{className:"w-full h-12",variant:"outlined",endDecorator:(0,a.jsx)(v.ZP,{type:"submit",disabled:R,children:(0,a.jsx)(l.Z,{})}),...M.register("query")})]})})]})})},C=r(57931),O=()=>{let e=(0,S.useSearchParams)(),{refreshDialogList:t}=(0,C.Cg)(),r=e.get("id"),i=e.get("scene"),{data:l}=(0,n.Z)(async()=>await (0,o.Tk)("/v1/chat/dialogue/messages/history",{con_uid:r}),{ready:!!r,refreshDeps:[r]}),{data:c}=(0,n.Z)(async()=>await (0,o.Kw)("/v1/chat/mode/params/list?chat_mode=".concat(i)),{ready:!!i,refreshDeps:[r,i]}),{history:u,handleChatSubmit:d}=(0,s.Z)({queryAgentURL:"/v1/chat/completions",queryBody:{conv_uid:r,chat_mode:i||"chat_normal"},initHistory:null==l?void 0:l.data});return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(k,{clearIntialMessage:async()=>{await t()},messages:u||[],onSubmit:d,paramsList:null==c?void 0:c.data})})}},57931:function(e,t,r){"use strict";r.d(t,{ZP:function(){return c},Cg:function(){return i}});var a=r(9268),n=r(89081),o=r(78915),s=r(86006);let[i,l]=function(){let e=s.createContext(void 0);return[function(){let t=s.useContext(e);if(void 0===t)throw Error("useCtx must be inside a Provider with a value");return t},e.Provider]}();var c=e=>{let{children:t}=e,{run:r,data:s,refresh:i}=(0,n.Z)(async()=>await (0,o.Tk)("/v1/chat/dialogue/list"),{manual:!0});return(0,a.jsx)(l,{value:{dialogueList:s,queryDialogueList:r,refreshDialogList:i},children:t})}},66487:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var a=r(71990),n=r(86006),o=e=>{let t=(0,n.useReducer)((e,t)=>({...e,...t}),{...e});return t},s=r(57931),i=e=>{let{queryAgentURL:t,channel:r,queryBody:i,initHistory:l}=e,[c,u]=o({history:l||[]}),{refreshDialogList:d}=(0,s.Cg)();(0,n.useEffect)(()=>{l&&u({history:l})},[l]);let h=async(e,n)=>{if(!e)return;let o=[...c.history,{role:"human",context:e}],s=o.length;u({history:o});try{let l=new AbortController;await (0,a.L)("".concat("http://127.0.0.1:5000").concat("/api"+t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...i,user_input:e,channel:r}),signal:l.signal,async onopen(e){if(o.length<=1){d();let e=new URLSearchParams(window.location.search);e.delete("initMessage"),window.history.replaceState(null,null,"?".concat(e.toString()))}(!e.ok||e.headers.get("content-type")!==a.a)&&e.status>=400&&e.status<500&&429!==e.status&&e.status},onclose(){console.log("onclose")},onerror(e){throw Error(e)},onmessage:e=>{var t;if(console.log(e,"e"),e.data=e.data.replaceAll("\\n","\n"),"[DONE]"===e.data)l.abort();else if(null===(t=e.data)||void 0===t?void 0:t.startsWith("[ERROR]"))l.abort(),u({history:[...o,{role:"view",context:e.data.replace("[ERROR]","")}]});else{let t=[...o];e.data&&((null==t?void 0:t[s])?t[s].context="".concat(e.data):t.push({role:"view",context:e.data}),u({history:t}))}}})}catch(e){console.log("---e",e),u({history:[...o,{role:"view",context:"请求出错"}]})}};return{handleChatSubmit:h,history:c.history}}},78915:function(e,t,r){"use strict";r.d(t,{Tk:function(){return c},Kw:function(){return u},PR:function(){return d},Ej:function(){return h}});var a=r(21628),n=r(24214);let o=n.Z.create({baseURL:"http://127.0.0.1:5000"});o.defaults.timeout=1e4,o.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var s=r(84835);let i={"content-type":"application/json"},l=e=>{if(!(0,s.isPlainObject)(e))return JSON.stringify(e);let t={...e};for(let e in t){let r=t[e];"string"==typeof r&&(t[e]=r.trim())}return JSON.stringify(t)},c=(e,t)=>{if(t){let r=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");r&&(e+="?".concat(r))}return o.get("/api"+e,{headers:i}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})},u=(e,t)=>{let r=l(t);return o.post("/api"+e,{body:r,headers:i}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})},d=(e,t)=>{let r=l(t);return o.post(e,{body:r,headers:i}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})},h=(e,t)=>o.post(e,{body:t}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})},56008:function(e,t,r){e.exports=r(30794)}},function(e){e.O(0,[180,430,577,214,86,316,259,751,662,253,769,744],function(){return e(e.s=80966)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/chat/page-3e777250a1bf7cac.js b/pilot/server/static/_next/static/chunks/app/chat/page-3e777250a1bf7cac.js new file mode 100644 index 000000000..13a040559 --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/chat/page-3e777250a1bf7cac.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[929],{55749:function(e,t,r){"use strict";var a=r(78997);t.Z=void 0;var n=a(r(76906)),o=r(9268),s=(0,n.default)([(0,o.jsx)("path",{d:"M19.89 10.75c.07.41.11.82.11 1.25 0 4.41-3.59 8-8 8s-8-3.59-8-8c0-.05.01-.1 0-.14 2.6-.98 4.69-2.99 5.74-5.55 3.38 4.14 7.97 3.73 8.99 3.61l-.89-1.93c-.13.01-4.62.38-7.18-3.86 1.01-.16 1.71-.15 2.59-.01 2.52-1.15 1.93-.89 2.76-1.26C14.78 2.3 13.43 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-1.43-.3-2.78-.84-4.01l-1.27 2.76zM8.08 5.03C7.45 6.92 6.13 8.5 4.42 9.47 5.05 7.58 6.37 6 8.08 5.03z"},"0"),(0,o.jsx)("circle",{cx:"15",cy:"13",r:"1.25"},"1"),(0,o.jsx)("circle",{cx:"9",cy:"13",r:"1.25"},"2"),(0,o.jsx)("path",{d:"m23 4.5-2.4-1.1L19.5 1l-1.1 2.4L16 4.5l2.4 1.1L19.5 8l1.1-2.4z"},"3")],"FaceRetouchingNaturalOutlined");t.Z=s},70781:function(e,t,r){"use strict";var a=r(78997);t.Z=void 0;var n=a(r(76906)),o=r(9268),s=(0,n.default)((0,o.jsx)("path",{d:"M20 9V7c0-1.1-.9-2-2-2h-3c0-1.66-1.34-3-3-3S9 3.34 9 5H6c-1.1 0-2 .9-2 2v2c-1.66 0-3 1.34-3 3s1.34 3 3 3v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c1.66 0 3-1.34 3-3s-1.34-3-3-3zm-2 10H6V7h12v12zm-9-6c-.83 0-1.5-.67-1.5-1.5S8.17 10 9 10s1.5.67 1.5 1.5S9.83 13 9 13zm7.5-1.5c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5.67-1.5 1.5-1.5 1.5.67 1.5 1.5zM8 15h8v2H8v-2z"}),"SmartToyOutlined");t.Z=s},90545:function(e,t,r){"use strict";r.d(t,{Z:function(){return v}});var a=r(40431),n=r(46750),o=r(86006),s=r(89791),i=r(4323),l=r(51579),c=r(86601),u=r(95887),d=r(9268);let h=["className","component"];var f=r(47327),m=r(98918);let p=function(e={}){let{themeId:t,defaultTheme:r,defaultClassName:f="MuiBox-root",generateClassName:m}=e,p=(0,i.ZP)("div",{shouldForwardProp:e=>"theme"!==e&&"sx"!==e&&"as"!==e})(l.Z),v=o.forwardRef(function(e,o){let i=(0,u.Z)(r),l=(0,c.Z)(e),{className:v,component:g="div"}=l,x=(0,n.Z)(l,h);return(0,d.jsx)(p,(0,a.Z)({as:g,ref:o,className:(0,s.Z)(v,m?m(f):f),theme:t&&i[t]||i},x))});return v}({defaultTheme:m.Z,defaultClassName:"MuiBox-root",generateClassName:f.Z.generate});var v=p},80966:function(e,t,r){Promise.resolve().then(r.bind(r,59498))},59498:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return O}});var a=r(9268),n=r(89081),o=r(78915),s=r(66487),i=r(67830),l=r(54842),c=r(70900),u=r(62414),d=r(90545),h=r(94244),f=r(33155),m=r(7354),p=r(35086),v=r(53047),g=r(86006),x=r(19700),y=r(92391),j=r(55749),w=r(70781),b=r(75403),Z=r(99398),P=r(49064),S=r(56008);let N=y.z.object({query:y.z.string().min(1)});var k=e=>{var t;let{messages:r,onSubmit:n,readOnly:o,paramsList:s,clearIntialMessage:y}=e,k=(0,S.useSearchParams)(),C=k.get("initMessage"),O=g.useRef(null),[R,z]=(0,g.useState)(!1),[E,_]=(0,g.useState)(),M=(0,x.cI)({resolver:(0,i.F)(N),defaultValues:{}}),L=async e=>{let{query:t}=e;try{console.log("submit"),z(!0),M.reset(),await n(t,{select_param:null==s?void 0:s[E]})}catch(e){}finally{z(!1)}},T=async()=>{try{let e=new URLSearchParams(window.location.search),t=e.get("initMessage");e.delete("initMessage"),window.history.replaceState(null,null,"?".concat(e.toString())),await L({query:t})}catch(e){console.log(e)}finally{null==y||y()}},F={overrides:{code:e=>{let{children:t}=e;return(0,a.jsx)(Z.Z,{language:"javascript",style:P.Z,children:t})}},wrapper:g.Fragment};return g.useEffect(()=>{O.current&&O.current.scrollTo(0,O.current.scrollHeight)},[null==r?void 0:r.length]),g.useEffect(()=>{C&&r.length<=0&&T()},[C,r.length]),g.useEffect(()=>{var e,t;s&&(null===(e=Object.keys(s||{}))||void 0===e?void 0:e.length)>0&&_(null===(t=Object.keys(s||{}))||void 0===t?void 0:t[0])},[s]),(0,a.jsx)("div",{className:"w-full h-full",children:(0,a.jsxs)(c.Z,{className:"w-full h-full bg-[#fefefe] dark:bg-[#212121]",sx:{table:{borderCollapse:"collapse",border:"1px solid #ccc",width:"100%"},"th, td":{border:"1px solid #ccc",padding:"10px",textAlign:"center"}},children:[(0,a.jsxs)(c.Z,{ref:O,direction:"column",sx:{overflowY:"auto",maxHeight:"100%",flex:1},children:[null===(t=r.filter(e=>["view","human"].includes(e.role)))||void 0===t?void 0:t.map((e,t)=>{var r;return(0,a.jsx)(c.Z,{children:(0,a.jsx)(u.Z,{size:"sm",variant:"outlined",color:"view"===e.role?"primary":"neutral",sx:t=>({background:"view"===e.role?"var(--joy-palette-primary-softBg, var(--joy-palette-primary-100, #DDF1FF))":"unset",border:"unset",borderRadius:"unset",padding:"24px 0 26px 0",lineHeight:"24px"}),children:(0,a.jsxs)(d.Z,{sx:{width:"76%",margin:"0 auto"},className:"flex flex-row",children:[(0,a.jsx)("div",{className:"mr-3 inline",children:"view"===e.role?(0,a.jsx)(w.Z,{}):(0,a.jsx)(j.Z,{})}),(0,a.jsx)("div",{className:"inline align-middle mt-0.5 max-w-full flex-1 overflow-auto",children:(0,a.jsx)(b.Z,{options:F,children:null===(r=e.context)||void 0===r?void 0:r.replaceAll("\\n","\n")})})]})})},t)}),R&&(0,a.jsx)(h.Z,{variant:"soft",color:"neutral",size:"sm",sx:{mx:"auto",my:2}})]}),!o&&(0,a.jsx)(d.Z,{className:"bg-[#fefefe] dark:bg-[#212121] before:bg-[#fefefe] before:dark:bg-[#212121]",sx:{position:"relative","&::before":{content:'" "',position:"absolute",top:"-18px",left:"0",right:"0",width:"100%",margin:"0 auto",height:"20px",filter:"blur(10px)",zIndex:2}},children:(0,a.jsxs)("form",{style:{maxWidth:"100%",width:"76%",position:"relative",display:"flex",marginTop:"auto",overflow:"visible",background:"none",justifyContent:"center",marginLeft:"auto",marginRight:"auto",flexDirection:"column",gap:"12px",paddingBottom:"58px",paddingTop:"20px"},onSubmit:e=>{e.stopPropagation(),M.handleSubmit(L)(e)},children:[Object.keys(s||{}).length>0&&(0,a.jsx)("div",{className:"flex items-center gap-3",children:(0,a.jsx)(f.Z,{value:E,onChange:(e,t)=>{_(t)},sx:{maxWidth:"100%"},children:Object.keys(s||{}).map(e=>(0,a.jsx)(m.Z,{value:e,children:e},e))})}),(0,a.jsx)(p.ZP,{className:"w-full h-12",variant:"outlined",endDecorator:(0,a.jsx)(v.ZP,{type:"submit",disabled:R,children:(0,a.jsx)(l.Z,{})}),...M.register("query")})]})})]})})},C=r(57931),O=()=>{let e=(0,S.useSearchParams)(),{refreshDialogList:t}=(0,C.Cg)(),r=e.get("id"),i=e.get("scene"),{data:l}=(0,n.Z)(async()=>await (0,o.Tk)("/v1/chat/dialogue/messages/history",{con_uid:r}),{ready:!!r,refreshDeps:[r]}),{data:c}=(0,n.Z)(async()=>await (0,o.Kw)("/v1/chat/mode/params/list?chat_mode=".concat(i)),{ready:!!i,refreshDeps:[r,i]}),{history:u,handleChatSubmit:d}=(0,s.Z)({queryAgentURL:"/v1/chat/completions",queryBody:{conv_uid:r,chat_mode:i||"chat_normal"},initHistory:null==l?void 0:l.data});return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(k,{clearIntialMessage:async()=>{await t()},messages:u||[],onSubmit:d,paramsList:null==c?void 0:c.data})})}},57931:function(e,t,r){"use strict";r.d(t,{ZP:function(){return c},Cg:function(){return i}});var a=r(9268),n=r(89081),o=r(78915),s=r(86006);let[i,l]=function(){let e=s.createContext(void 0);return[function(){let t=s.useContext(e);if(void 0===t)throw Error("useCtx must be inside a Provider with a value");return t},e.Provider]}();var c=e=>{let{children:t}=e,{run:r,data:s,refresh:i}=(0,n.Z)(async()=>await (0,o.Tk)("/v1/chat/dialogue/list"),{manual:!0});return(0,a.jsx)(l,{value:{dialogueList:s,queryDialogueList:r,refreshDialogList:i},children:t})}},66487:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var a=r(71990),n=r(86006),o=e=>{let t=(0,n.useReducer)((e,t)=>({...e,...t}),{...e});return t},s=r(57931),i=e=>{let{queryAgentURL:t,channel:r,queryBody:i,initHistory:l}=e,[c,u]=o({history:l||[]}),{refreshDialogList:d}=(0,s.Cg)();(0,n.useEffect)(()=>{l&&u({history:l})},[l]);let h=async(e,n)=>{if(!e)return;let o=[...c.history,{role:"human",context:e}],s=o.length;u({history:o});try{let l=new AbortController;await (0,a.L)("".concat("http://127.0.0.1:5000").concat("/api"+t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...i,user_input:e,channel:r}),signal:l.signal,async onopen(e){if(o.length<=1){d();let e=new URLSearchParams(window.location.search);e.delete("initMessage"),window.history.replaceState(null,null,"?".concat(e.toString()))}(!e.ok||e.headers.get("content-type")!==a.a)&&e.status>=400&&e.status<500&&429!==e.status&&e.status},onclose(){console.log("onclose")},onerror(e){throw Error(e)},onmessage:e=>{var t;if(console.log(e,"e"),e.data=e.data.replaceAll("\\n","\n"),"[DONE]"===e.data)l.abort();else if(null===(t=e.data)||void 0===t?void 0:t.startsWith("[ERROR]"))l.abort(),u({history:[...o,{role:"view",context:e.data.replace("[ERROR]","")}]});else{let t=[...o];e.data&&((null==t?void 0:t[s])?t[s].context="".concat(e.data):t.push({role:"view",context:e.data}),u({history:t}))}}})}catch(e){console.log("---e",e),u({history:[...o,{role:"view",context:"请求出错"}]})}};return{handleChatSubmit:h,history:c.history}}},78915:function(e,t,r){"use strict";r.d(t,{Tk:function(){return c},Kw:function(){return u},PR:function(){return d},Ej:function(){return h}});var a=r(21628),n=r(24214);let o=n.Z.create({baseURL:"http://127.0.0.1:5000"});o.defaults.timeout=1e4,o.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var s=r(84835);let i={"content-type":"application/json"},l=e=>{if(!(0,s.isPlainObject)(e))return JSON.stringify(e);let t={...e};for(let e in t){let r=t[e];"string"==typeof r&&(t[e]=r.trim())}return JSON.stringify(t)},c=(e,t)=>{if(t){let r=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");r&&(e+="?".concat(r))}return o.get("/api"+e,{headers:i}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})},u=(e,t)=>{let r=l(t);return o.post("/api"+e,{body:r,headers:i}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})},d=(e,t)=>{let r=l(t);return o.post(e,{body:r,headers:i}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})},h=(e,t)=>o.post(e,{body:t}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})},56008:function(e,t,r){e.exports=r(30794)}},function(e){e.O(0,[180,752,685,86,316,259,751,662,253,769,744],function(){return e(e.s=80966)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/chat/page-b40d471c401058a0.js b/pilot/server/static/_next/static/chunks/app/chat/page-b40d471c401058a0.js new file mode 100644 index 000000000..4012ca1b2 --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/chat/page-b40d471c401058a0.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[929],{55749:function(e,t,r){"use strict";var a=r(78997);t.Z=void 0;var n=a(r(76906)),s=r(9268),i=(0,n.default)([(0,s.jsx)("path",{d:"M19.89 10.75c.07.41.11.82.11 1.25 0 4.41-3.59 8-8 8s-8-3.59-8-8c0-.05.01-.1 0-.14 2.6-.98 4.69-2.99 5.74-5.55 3.38 4.14 7.97 3.73 8.99 3.61l-.89-1.93c-.13.01-4.62.38-7.18-3.86 1.01-.16 1.71-.15 2.59-.01 2.52-1.15 1.93-.89 2.76-1.26C14.78 2.3 13.43 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-1.43-.3-2.78-.84-4.01l-1.27 2.76zM8.08 5.03C7.45 6.92 6.13 8.5 4.42 9.47 5.05 7.58 6.37 6 8.08 5.03z"},"0"),(0,s.jsx)("circle",{cx:"15",cy:"13",r:"1.25"},"1"),(0,s.jsx)("circle",{cx:"9",cy:"13",r:"1.25"},"2"),(0,s.jsx)("path",{d:"m23 4.5-2.4-1.1L19.5 1l-1.1 2.4L16 4.5l2.4 1.1L19.5 8l1.1-2.4z"},"3")],"FaceRetouchingNaturalOutlined");t.Z=i},70781:function(e,t,r){"use strict";var a=r(78997);t.Z=void 0;var n=a(r(76906)),s=r(9268),i=(0,n.default)((0,s.jsx)("path",{d:"M20 9V7c0-1.1-.9-2-2-2h-3c0-1.66-1.34-3-3-3S9 3.34 9 5H6c-1.1 0-2 .9-2 2v2c-1.66 0-3 1.34-3 3s1.34 3 3 3v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c1.66 0 3-1.34 3-3s-1.34-3-3-3zm-2 10H6V7h12v12zm-9-6c-.83 0-1.5-.67-1.5-1.5S8.17 10 9 10s1.5.67 1.5 1.5S9.83 13 9 13zm7.5-1.5c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5.67-1.5 1.5-1.5 1.5.67 1.5 1.5zM8 15h8v2H8v-2z"}),"SmartToyOutlined");t.Z=i},90545:function(e,t,r){"use strict";r.d(t,{Z:function(){return p}});var a=r(40431),n=r(46750),s=r(86006),i=r(89791),o=r(4323),l=r(51579),c=r(86601),u=r(95887),d=r(9268);let h=["className","component"];var f=r(47327),v=r(98918);let m=function(e={}){let{themeId:t,defaultTheme:r,defaultClassName:f="MuiBox-root",generateClassName:v}=e,m=(0,o.ZP)("div",{shouldForwardProp:e=>"theme"!==e&&"sx"!==e&&"as"!==e})(l.Z),p=s.forwardRef(function(e,s){let o=(0,u.Z)(r),l=(0,c.Z)(e),{className:p,component:g="div"}=l,x=(0,n.Z)(l,h);return(0,d.jsx)(m,(0,a.Z)({as:g,ref:s,className:(0,i.Z)(p,v?v(f):f),theme:t&&o[t]||o},x))});return p}({defaultTheme:v.Z,defaultClassName:"MuiBox-root",generateClassName:f.Z.generate});var p=m},80966:function(e,t,r){Promise.resolve().then(r.bind(r,59498))},59498:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return R}});var a=r(9268),n=r(89081),s=r(78915),i=r(66487),o=r(67830),l=r(54842),c=r(70900),u=r(62414),d=r(90545),h=r(94244),f=r(33155),v=r(7354),m=r(35086),p=r(53047),g=r(86006),x=r(19700),y=r(92391),j=r(55749),w=r(70781),b=r(75403),Z=r(99398),S=r(49064),N=r(56008);let P=y.z.object({query:y.z.string().min(1)});var C=e=>{var t;let{messages:r,onSubmit:n,readOnly:s,paramsList:i,clearIntialMessage:y}=e,C=(0,N.useSearchParams)(),O=C.get("initMessage"),R=g.useRef(null),[k,z]=(0,g.useState)(!1),[_,E]=(0,g.useState)(),M=(0,x.cI)({resolver:(0,o.F)(P),defaultValues:{}}),L=async e=>{let{query:t}=e;try{console.log("submit"),z(!0),M.reset(),await n(t,{select_param:null==i?void 0:i[_]})}catch(e){}finally{z(!1)}},T=async()=>{try{let e=new URLSearchParams(window.location.search),t=e.get("initMessage");e.delete("initMessage"),window.history.replaceState(null,null,"?".concat(e.toString())),await L({query:t})}catch(e){console.log(e)}finally{null==y||y()}},F={overrides:{code:e=>{let{children:t}=e;return(0,a.jsx)(Z.Z,{language:"javascript",style:S.Z,children:t})}},wrapper:g.Fragment};return g.useEffect(()=>{R.current&&R.current.scrollTo(0,R.current.scrollHeight)},[null==r?void 0:r.length]),g.useEffect(()=>{O&&r.length<=0&&T()},[O,r.length]),g.useEffect(()=>{var e,t;i&&(null===(e=Object.keys(i||{}))||void 0===e?void 0:e.length)>0&&E(null===(t=Object.keys(i||{}))||void 0===t?void 0:t[0])},[i]),(0,a.jsx)("div",{className:"w-full h-full",children:(0,a.jsxs)(c.Z,{className:"w-full h-full bg-[#fefefe] dark:bg-[#212121]",sx:{table:{borderCollapse:"collapse",border:"1px solid #ccc",width:"100%"},"th, td":{border:"1px solid #ccc",padding:"10px",textAlign:"center"}},children:[(0,a.jsxs)(c.Z,{ref:R,direction:"column",sx:{overflowY:"auto",maxHeight:"100%",flex:1},children:[null===(t=r.filter(e=>["view","human"].includes(e.role)))||void 0===t?void 0:t.map((e,t)=>{var r;return(0,a.jsx)(c.Z,{children:(0,a.jsx)(u.Z,{size:"sm",variant:"outlined",color:"view"===e.role?"primary":"neutral",sx:t=>({background:"view"===e.role?"var(--joy-palette-primary-softBg, var(--joy-palette-primary-100, #DDF1FF))":"unset",border:"unset",borderRadius:"unset",padding:"24px 0 26px 0",lineHeight:"24px"}),children:(0,a.jsxs)(d.Z,{sx:{width:"76%",margin:"0 auto"},className:"flex flex-row",children:[(0,a.jsx)("div",{className:"mr-3 inline",children:"view"===e.role?(0,a.jsx)(w.Z,{}):(0,a.jsx)(j.Z,{})}),(0,a.jsx)("div",{className:"inline align-middle mt-0.5 max-w-full flex-1 overflow-auto",children:(0,a.jsx)(b.Z,{options:F,children:null===(r=e.context)||void 0===r?void 0:r.replaceAll("\\n","\n")})})]})})},t)}),k&&(0,a.jsx)(h.Z,{variant:"soft",color:"neutral",size:"sm",sx:{mx:"auto",my:2}})]}),!s&&(0,a.jsx)(d.Z,{className:"bg-[#fefefe] dark:bg-[#212121] before:bg-[#fefefe] before:dark:bg-[#212121]",sx:{position:"relative","&::before":{content:'" "',position:"absolute",top:"-18px",left:"0",right:"0",width:"100%",margin:"0 auto",height:"20px",filter:"blur(10px)",zIndex:2}},children:(0,a.jsxs)("form",{style:{maxWidth:"100%",width:"76%",position:"relative",display:"flex",marginTop:"auto",overflow:"visible",background:"none",justifyContent:"center",marginLeft:"auto",marginRight:"auto",flexDirection:"column",gap:"12px",paddingBottom:"58px",paddingTop:"20px"},onSubmit:e=>{e.stopPropagation(),M.handleSubmit(L)(e)},children:[Object.keys(i||{}).length>0&&(0,a.jsx)("div",{className:"flex items-center gap-3",children:(0,a.jsx)(f.Z,{value:_,onChange:(e,t)=>{E(t)},sx:{maxWidth:"100%"},children:Object.keys(i||{}).map(e=>(0,a.jsx)(v.Z,{value:e,children:e},e))})}),(0,a.jsx)(m.ZP,{className:"w-full h-12",variant:"outlined",endDecorator:(0,a.jsx)(p.ZP,{type:"submit",disabled:k,children:(0,a.jsx)(l.Z,{})}),...M.register("query")})]})})]})})},O=r(57931),R=()=>{let e=(0,N.useSearchParams)(),{refreshDialogList:t}=(0,O.Cg)(),r=e.get("id"),o=e.get("scene"),{data:l}=(0,n.Z)(async()=>await (0,s.T)("/v1/chat/dialogue/messages/history",{con_uid:r}),{ready:!!r,refreshDeps:[r]}),{data:c}=(0,n.Z)(async()=>await (0,s.K)("/v1/chat/mode/params/list?chat_mode=".concat(o)),{ready:!!o,refreshDeps:[r,o]}),{history:u,handleChatSubmit:d}=(0,i.Z)({queryAgentURL:"/v1/chat/completions",queryBody:{conv_uid:r,chat_mode:o||"chat_normal"},initHistory:null==l?void 0:l.data});return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(C,{clearIntialMessage:async()=>{await t()},messages:u||[],onSubmit:d,paramsList:null==c?void 0:c.data})})}},57931:function(e,t,r){"use strict";r.d(t,{ZP:function(){return c},Cg:function(){return o}});var a=r(9268),n=r(89081),s=r(78915),i=r(86006);let[o,l]=function(){let e=i.createContext(void 0);return[function(){let t=i.useContext(e);if(void 0===t)throw Error("useCtx must be inside a Provider with a value");return t},e.Provider]}();var c=e=>{let{children:t}=e,{run:r,data:i,refresh:o}=(0,n.Z)(async()=>await (0,s.T)("/v1/chat/dialogue/list"),{manual:!0});return(0,a.jsx)(l,{value:{dialogueList:i,queryDialogueList:r,refreshDialogList:o},children:t})}},66487:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var a=r(71990),n=r(86006),s=e=>{let t=(0,n.useReducer)((e,t)=>({...e,...t}),{...e});return t},i=r(57931),o=e=>{let{queryAgentURL:t,channel:r,queryBody:o,initHistory:l}=e,[c,u]=s({history:l||[]}),{refreshDialogList:d}=(0,i.Cg)();(0,n.useEffect)(()=>{l&&u({history:l})},[l]);let h=async(e,n)=>{if(!e)return;let s=[...c.history,{role:"human",context:e}],i=s.length;u({history:s});try{let l=new AbortController;await (0,a.L)("".concat("http://127.0.0.1:5000").concat("/api"+t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...o,user_input:e,channel:r}),signal:l.signal,async onopen(e){if(s.length<=1){d();let e=new URLSearchParams(window.location.search);e.delete("initMessage"),window.history.replaceState(null,null,"?".concat(e.toString()))}(!e.ok||e.headers.get("content-type")!==a.a)&&e.status>=400&&e.status<500&&429!==e.status&&e.status},onclose(){console.log("onclose")},onerror(e){throw Error(e)},onmessage:e=>{var t;if(console.log(e,"e"),e.data=e.data.replaceAll("\\n","\n"),"[DONE]"===e.data)l.abort();else if(null===(t=e.data)||void 0===t?void 0:t.startsWith("[ERROR]"))l.abort(),u({history:[...s,{role:"view",context:e.data.replace("[ERROR]","")}]});else{let t=[...s];e.data&&((null==t?void 0:t[i])?t[i].context="".concat(e.data):t.push({role:"view",context:e.data}),u({history:t}))}}})}catch(e){console.log("---e",e),u({history:[...s,{role:"view",context:"请求出错"}]})}};return{handleChatSubmit:h,history:c.history}}},78915:function(e,t,r){"use strict";r.d(t,{T:function(){return c},K:function(){return u}});var a=r(21628),n=r(24214);let s=n.Z.create({baseURL:"http://127.0.0.1:5000"});s.defaults.timeout=1e4,s.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var i=r(84835);let o={"content-type":"application/json"},l=e=>{if(!(0,i.isPlainObject)(e))return JSON.stringify(e);let t={...e};for(let e in t){let r=t[e];"string"==typeof r&&(t[e]=r.trim())}return JSON.stringify(t)},c=(e,t)=>{if(t){let r=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");r&&(e+="?".concat(r))}return s.get("/api"+e,{headers:o}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})},u=(e,t)=>{let r=l(t);return s.post("/api"+e,{body:r,headers:o}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})}},56008:function(e,t,r){e.exports=r(30794)}},function(e){e.O(0,[180,430,577,86,562,259,751,662,253,769,744],function(){return e(e.s=80966)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/chat/page-dbd994bed3394f35.js b/pilot/server/static/_next/static/chunks/app/chat/page-dbd994bed3394f35.js new file mode 100644 index 000000000..af6ff3a62 --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/chat/page-dbd994bed3394f35.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[929],{55749:function(e,t,r){"use strict";var a=r(78997);t.Z=void 0;var n=a(r(76906)),s=r(9268),i=(0,n.default)([(0,s.jsx)("path",{d:"M19.89 10.75c.07.41.11.82.11 1.25 0 4.41-3.59 8-8 8s-8-3.59-8-8c0-.05.01-.1 0-.14 2.6-.98 4.69-2.99 5.74-5.55 3.38 4.14 7.97 3.73 8.99 3.61l-.89-1.93c-.13.01-4.62.38-7.18-3.86 1.01-.16 1.71-.15 2.59-.01 2.52-1.15 1.93-.89 2.76-1.26C14.78 2.3 13.43 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-1.43-.3-2.78-.84-4.01l-1.27 2.76zM8.08 5.03C7.45 6.92 6.13 8.5 4.42 9.47 5.05 7.58 6.37 6 8.08 5.03z"},"0"),(0,s.jsx)("circle",{cx:"15",cy:"13",r:"1.25"},"1"),(0,s.jsx)("circle",{cx:"9",cy:"13",r:"1.25"},"2"),(0,s.jsx)("path",{d:"m23 4.5-2.4-1.1L19.5 1l-1.1 2.4L16 4.5l2.4 1.1L19.5 8l1.1-2.4z"},"3")],"FaceRetouchingNaturalOutlined");t.Z=i},70781:function(e,t,r){"use strict";var a=r(78997);t.Z=void 0;var n=a(r(76906)),s=r(9268),i=(0,n.default)((0,s.jsx)("path",{d:"M20 9V7c0-1.1-.9-2-2-2h-3c0-1.66-1.34-3-3-3S9 3.34 9 5H6c-1.1 0-2 .9-2 2v2c-1.66 0-3 1.34-3 3s1.34 3 3 3v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c1.66 0 3-1.34 3-3s-1.34-3-3-3zm-2 10H6V7h12v12zm-9-6c-.83 0-1.5-.67-1.5-1.5S8.17 10 9 10s1.5.67 1.5 1.5S9.83 13 9 13zm7.5-1.5c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5.67-1.5 1.5-1.5 1.5.67 1.5 1.5zM8 15h8v2H8v-2z"}),"SmartToyOutlined");t.Z=i},90545:function(e,t,r){"use strict";r.d(t,{Z:function(){return p}});var a=r(40431),n=r(46750),s=r(86006),i=r(89791),o=r(4323),l=r(51579),c=r(86601),u=r(95887),d=r(9268);let h=["className","component"];var f=r(47327),v=r(98918);let m=function(e={}){let{themeId:t,defaultTheme:r,defaultClassName:f="MuiBox-root",generateClassName:v}=e,m=(0,o.ZP)("div",{shouldForwardProp:e=>"theme"!==e&&"sx"!==e&&"as"!==e})(l.Z),p=s.forwardRef(function(e,s){let o=(0,u.Z)(r),l=(0,c.Z)(e),{className:p,component:g="div"}=l,x=(0,n.Z)(l,h);return(0,d.jsx)(m,(0,a.Z)({as:g,ref:s,className:(0,i.Z)(p,v?v(f):f),theme:t&&o[t]||o},x))});return p}({defaultTheme:v.Z,defaultClassName:"MuiBox-root",generateClassName:f.Z.generate});var p=m},80966:function(e,t,r){Promise.resolve().then(r.bind(r,59498))},59498:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return k}});var a=r(9268),n=r(89081),s=r(78915),i=r(66487),o=r(67830),l=r(54842),c=r(70900),u=r(62414),d=r(90545),h=r(94244),f=r(33155),v=r(7354),m=r(35086),p=r(53047),g=r(86006),x=r(19700),y=r(92391),j=r(55749),w=r(70781),b=r(75403),Z=r(99398),P=r(49064),S=r(56008);let N=y.z.object({query:y.z.string().min(1)});var R=e=>{var t;let{messages:r,onSubmit:n,readOnly:s,paramsList:i,clearIntialMessage:y}=e,R=(0,S.useSearchParams)(),_=R.get("initMessage"),k=g.useRef(null),[C,O]=(0,g.useState)(!1),[E,z]=(0,g.useState)(),L=(0,x.cI)({resolver:(0,o.F)(N),defaultValues:{}}),A=async e=>{let{query:t}=e;try{console.log("submit"),O(!0),L.reset(),await n(t,{select_param:null==i?void 0:i[E]})}catch(e){}finally{O(!1)}},M=async()=>{try{let e=new URLSearchParams(window.location.search),t=e.get("initMessage");e.delete("initMessage"),window.history.replaceState(null,null,"?".concat(e.toString())),await A({query:t})}catch(e){console.log(e)}finally{null==y||y()}},T={overrides:{code:e=>{let{children:t}=e;return(0,a.jsx)(Z.Z,{language:"javascript",style:P.Z,children:t})}},wrapper:g.Fragment};return g.useEffect(()=>{k.current&&k.current.scrollTo(0,k.current.scrollHeight)},[null==r?void 0:r.length]),g.useEffect(()=>{_&&r.length<=0&&M()},[_,r.length]),g.useEffect(()=>{var e,t;i&&(null===(e=Object.keys(i||{}))||void 0===e?void 0:e.length)>0&&z(null===(t=Object.keys(i||{}))||void 0===t?void 0:t[0])},[i]),(0,a.jsx)("div",{className:"w-full h-full",children:(0,a.jsxs)(c.Z,{className:"w-full h-full bg-[#fefefe] dark:bg-[#212121]",sx:{table:{borderCollapse:"collapse",border:"1px solid #ccc",width:"100%"},"th, td":{border:"1px solid #ccc",padding:"10px",textAlign:"center"}},children:[(0,a.jsxs)(c.Z,{ref:k,direction:"column",sx:{overflowY:"auto",maxHeight:"100%",flex:1},children:[null===(t=r.filter(e=>["view","human"].includes(e.role)))||void 0===t?void 0:t.map((e,t)=>{var r;return(0,a.jsx)(c.Z,{children:(0,a.jsx)(u.Z,{size:"sm",variant:"outlined",color:"view"===e.role?"primary":"neutral",sx:t=>({background:"view"===e.role?"var(--joy-palette-primary-softBg, var(--joy-palette-primary-100, #DDF1FF))":"unset",border:"unset",borderRadius:"unset",padding:"24px 0 26px 0",lineHeight:"24px"}),children:(0,a.jsxs)(d.Z,{sx:{width:"76%",margin:"0 auto"},className:"flex flex-row",children:[(0,a.jsx)("div",{className:"mr-3 inline",children:"view"===e.role?(0,a.jsx)(w.Z,{}):(0,a.jsx)(j.Z,{})}),(0,a.jsx)("div",{className:"inline align-middle mt-0.5 max-w-full flex-1 overflow-auto",children:(0,a.jsx)(b.Z,{options:T,children:null===(r=e.context)||void 0===r?void 0:r.replaceAll("\\n","\n")})})]})})},t)}),C&&(0,a.jsx)(h.Z,{variant:"soft",color:"neutral",size:"sm",sx:{mx:"auto",my:2}})]}),!s&&(0,a.jsx)(d.Z,{className:"bg-[#fefefe] dark:bg-[#212121] before:bg-[#fefefe] before:dark:bg-[#212121]",sx:{position:"relative","&::before":{content:'" "',position:"absolute",top:"-18px",left:"0",right:"0",width:"100%",margin:"0 auto",height:"20px",filter:"blur(10px)",zIndex:2}},children:(0,a.jsxs)("form",{style:{maxWidth:"100%",width:"76%",position:"relative",display:"flex",marginTop:"auto",overflow:"visible",background:"none",justifyContent:"center",marginLeft:"auto",marginRight:"auto",flexDirection:"column",gap:"12px",paddingBottom:"58px",paddingTop:"20px"},onSubmit:e=>{e.stopPropagation(),L.handleSubmit(A)(e)},children:[Object.keys(i||{}).length>0&&(0,a.jsx)("div",{className:"flex items-center gap-3",children:(0,a.jsx)(f.Z,{value:E,onChange:(e,t)=>{z(t)},sx:{maxWidth:"100%"},children:Object.keys(i||{}).map(e=>(0,a.jsx)(v.Z,{value:e,children:e},e))})}),(0,a.jsx)(m.ZP,{className:"w-full h-12",variant:"outlined",endDecorator:(0,a.jsx)(p.ZP,{type:"submit",disabled:C,children:(0,a.jsx)(l.Z,{})}),...L.register("query")})]})})]})})},_=r(57931),k=()=>{let e=(0,S.useSearchParams)(),{refreshDialogList:t}=(0,_.Cg)(),r=e.get("id"),o=e.get("scene"),{data:l}=(0,n.Z)(async()=>await (0,s.Tk)("/v1/chat/dialogue/messages/history",{con_uid:r}),{ready:!!r,refreshDeps:[r]}),{data:c}=(0,n.Z)(async()=>await (0,s.Kw)("/v1/chat/mode/params/list?chat_mode=".concat(o)),{ready:!!o,refreshDeps:[r,o]}),{history:u,handleChatSubmit:d}=(0,i.Z)({queryAgentURL:"/v1/chat/completions",queryBody:{conv_uid:r,chat_mode:o||"chat_normal"},initHistory:null==l?void 0:l.data});return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(R,{clearIntialMessage:async()=>{await t()},messages:u||[],onSubmit:d,paramsList:null==c?void 0:c.data})})}},57931:function(e,t,r){"use strict";r.d(t,{ZP:function(){return c},Cg:function(){return o}});var a=r(9268),n=r(89081),s=r(78915),i=r(86006);let[o,l]=function(){let e=i.createContext(void 0);return[function(){let t=i.useContext(e);if(void 0===t)throw Error("useCtx must be inside a Provider with a value");return t},e.Provider]}();var c=e=>{let{children:t}=e,{run:r,data:i,refresh:o}=(0,n.Z)(async()=>await (0,s.Tk)("/v1/chat/dialogue/list"),{manual:!0});return(0,a.jsx)(l,{value:{dialogueList:i,queryDialogueList:r,refreshDialogList:o},children:t})}},66487:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});var a=r(71990),n=r(86006),s=e=>{let t=(0,n.useReducer)((e,t)=>({...e,...t}),{...e});return t},i=r(57931),o=r(52040),l=e=>{let{queryAgentURL:t,channel:r,queryBody:l,initHistory:c}=e,[u,d]=s({history:c||[]}),{refreshDialogList:h}=(0,i.Cg)();(0,n.useEffect)(()=>{c&&d({history:c})},[c]);let f=async(e,n)=>{if(!e)return;let s=[...u.history,{role:"human",context:e}],i=s.length;d({history:s});try{let c=new AbortController;await (0,a.L)("".concat(o.env.API_BASE_URL?o.env.API_BASE_URL:"").concat("/api"+t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...l,user_input:e,channel:r}),signal:c.signal,async onopen(e){if(s.length<=1){h();let e=new URLSearchParams(window.location.search);e.delete("initMessage"),window.history.replaceState(null,null,"?".concat(e.toString()))}(!e.ok||e.headers.get("content-type")!==a.a)&&e.status>=400&&e.status<500&&429!==e.status&&e.status},onclose(){console.log("onclose")},onerror(e){throw Error(e)},onmessage:e=>{var t;if(console.log(e,"e"),e.data=e.data.replaceAll("\\n","\n"),"[DONE]"===e.data)c.abort();else if(null===(t=e.data)||void 0===t?void 0:t.startsWith("[ERROR]"))c.abort(),d({history:[...s,{role:"view",context:e.data.replace("[ERROR]","")}]});else{let t=[...s];e.data&&((null==t?void 0:t[i])?t[i].context="".concat(e.data):t.push({role:"view",context:e.data}),d({history:t}))}}})}catch(e){console.log("---e",e),d({history:[...s,{role:"view",context:"请求出错"}]})}};return{handleChatSubmit:f,history:u.history}}},78915:function(e,t,r){"use strict";r.d(t,{Tk:function(){return u},Kw:function(){return d},PR:function(){return h},Ej:function(){return f}});var a=r(21628),n=r(24214),s=r(52040);let i=n.Z.create({baseURL:s.env.API_BASE_URL});i.defaults.timeout=1e4,i.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var o=r(84835);let l={"content-type":"application/json"},c=e=>{if(!(0,o.isPlainObject)(e))return JSON.stringify(e);let t={...e};for(let e in t){let r=t[e];"string"==typeof r&&(t[e]=r.trim())}return JSON.stringify(t)},u=(e,t)=>{if(t){let r=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");r&&(e+="?".concat(r))}return i.get("/api"+e,{headers:l}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})},d=(e,t)=>{let r=c(t);return i.post("/api"+e,{body:r,headers:l}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})},h=(e,t)=>(c(t),i.post(e,t,{headers:l}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})),f=(e,t)=>i.post(e,t).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})},56008:function(e,t,r){e.exports=r(30794)}},function(e){e.O(0,[180,106,685,86,316,259,751,662,253,769,744],function(){return e(e.s=80966)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/datastores/documents/chunklist/page-24d5ddd85fb15398.js b/pilot/server/static/_next/static/chunks/app/datastores/documents/chunklist/page-24d5ddd85fb15398.js new file mode 100644 index 000000000..e34a88ca6 --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/datastores/documents/chunklist/page-24d5ddd85fb15398.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[538],{18885:function(e,t,n){Promise.resolve().then(n.bind(n,26257))},26257:function(e,t,n){"use strict";n.r(t);var r=n(9268),a=n(56008),i=n(86006),c=n(78635),s=n(70900),o=n(44334),l=n(311),d=n(22046),h=n(83192),u=n(23910),g=n(1031),f=n(78915);t.default=()=>{let e=(0,a.useRouter)(),{mode:t}=(0,c.tv)(),n=(0,a.useSearchParams)().get("spacename"),j=(0,a.useSearchParams)().get("documentid"),[m,p]=(0,i.useState)(0),[x,P]=(0,i.useState)(0),[S,_]=(0,i.useState)([]);return(0,i.useEffect)(()=>{(async function(){let e=await (0,f.PR)("/knowledge/".concat(n,"/chunk/list"),{document_id:j,page:1,page_size:20});e.success&&(_(e.data.data),p(e.data.total),P(e.data.page))})()},[]),(0,r.jsxs)("div",{className:"p-4",children:[(0,r.jsx)(s.Z,{direction:"row",justifyContent:"flex-start",alignItems:"center",sx:{marginBottom:"20px"},children:(0,r.jsxs)(o.Z,{"aria-label":"breadcrumbs",children:[(0,r.jsx)(l.Z,{onClick:()=>{e.push("/datastores")},underline:"hover",color:"neutral",fontSize:"inherit",children:"Knowledge Space"},"Knowledge Space"),(0,r.jsx)(l.Z,{onClick:()=>{e.push("/datastores/documents?name=".concat(n))},underline:"hover",color:"neutral",fontSize:"inherit",children:"Documents"},"Knowledge Space"),(0,r.jsx)(d.ZP,{fontSize:"inherit",children:"Chunks"})]})}),(0,r.jsx)("div",{className:"p-4",children:S.length?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(h.Z,{color:"primary",variant:"plain",size:"lg",sx:{"& tbody tr: hover":{backgroundColor:"light"===t?"rgb(246, 246, 246)":"rgb(33, 33, 40)"},"& tbody tr: hover a":{textDecoration:"underline"}},children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"Name"}),(0,r.jsx)("th",{children:"Content"}),(0,r.jsx)("th",{children:"Meta Data"})]})}),(0,r.jsx)("tbody",{children:S.map(e=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:e.doc_name}),(0,r.jsx)("td",{children:(0,r.jsx)(u.Z,{content:e.content,trigger:"hover",children:e.content.length>10?"".concat(e.content.slice(0,10),"..."):e.content})}),(0,r.jsx)("td",{children:(0,r.jsx)(u.Z,{content:JSON.stringify(e.meta_info||"{}",null,2),trigger:"hover",children:e.meta_info.length>10?"".concat(e.meta_info.slice(0,10),"..."):e.meta_info})})]},e.id))})]}),(0,r.jsx)(s.Z,{direction:"row",justifyContent:"flex-end",sx:{marginTop:"20px"},children:(0,r.jsx)(g.Z,{defaultPageSize:20,showSizeChanger:!1,current:x,total:m,onChange:async e=>{let t=await (0,f.PR)("/knowledge/".concat(n,"/chunk/list"),{document_id:j,page:e,page_size:20});t.success&&(_(t.data.data),p(t.data.total),P(t.data.page))},hideOnSinglePage:!0})})]}):(0,r.jsx)(r.Fragment,{})})]})}},78915:function(e,t,n){"use strict";n.d(t,{Tk:function(){return d},Kw:function(){return h},PR:function(){return u},Ej:function(){return g}});var r=n(21628),a=n(24214),i=n(52040);let c=a.Z.create({baseURL:i.env.API_BASE_URL});c.defaults.timeout=1e4,c.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var s=n(84835);let o={"content-type":"application/json"},l=e=>{if(!(0,s.isPlainObject)(e))return JSON.stringify(e);let t={...e};for(let e in t){let n=t[e];"string"==typeof n&&(t[e]=n.trim())}return JSON.stringify(t)},d=(e,t)=>{if(t){let n=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");n&&(e+="?".concat(n))}return c.get("/api"+e,{headers:o}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},h=(e,t)=>{let n=l(t);return c.post("/api"+e,{body:n,headers:o}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},u=(e,t)=>(l(t),c.post(e,t,{headers:o}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})),g=(e,t)=>c.post(e,t).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})}},function(e){e.O(0,[180,106,693,118,440,55,253,769,744],function(){return e(e.s=18885)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/datastores/documents/chunklist/page-3982cee8b1dd0f20.js b/pilot/server/static/_next/static/chunks/app/datastores/documents/chunklist/page-3982cee8b1dd0f20.js new file mode 100644 index 000000000..fb48bd287 --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/datastores/documents/chunklist/page-3982cee8b1dd0f20.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[538],{18885:function(e,t,n){Promise.resolve().then(n.bind(n,26257))},26257:function(e,t,n){"use strict";n.r(t);var r=n(9268),a=n(56008),i=n(86006),c=n(78635),s=n(70900),o=n(44334),l=n(311),d=n(22046),h=n(83192),u=n(23910),g=n(1031),f=n(78915);t.default=()=>{let e=(0,a.useRouter)(),{mode:t}=(0,c.tv)(),n=(0,a.useSearchParams)().get("spacename"),j=(0,a.useSearchParams)().get("documentid"),[m,p]=(0,i.useState)(0),[x,P]=(0,i.useState)(0),[b,S]=(0,i.useState)([]);return(0,i.useEffect)(()=>{(async function(){let e=await (0,f.PR)("/knowledge/".concat(n,"/chunk/list"),{document_id:j,page:1,page_size:20});e.success&&(S(e.data.data),p(e.data.total),P(e.data.page))})()},[]),(0,r.jsxs)("div",{className:"p-4",children:[(0,r.jsx)(s.Z,{direction:"row",justifyContent:"flex-start",alignItems:"center",sx:{marginBottom:"20px"},children:(0,r.jsxs)(o.Z,{"aria-label":"breadcrumbs",children:[(0,r.jsx)(l.Z,{onClick:()=>{e.push("/datastores")},underline:"hover",color:"neutral",fontSize:"inherit",children:"Knowledge Space"},"Knowledge Space"),(0,r.jsx)(l.Z,{onClick:()=>{e.push("/datastores/documents?name=".concat(n))},underline:"hover",color:"neutral",fontSize:"inherit",children:"Documents"},"Knowledge Space"),(0,r.jsx)(d.ZP,{fontSize:"inherit",children:"Chunks"})]})}),(0,r.jsx)("div",{className:"p-4",children:b.length?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(h.Z,{color:"primary",variant:"plain",size:"lg",sx:{"& tbody tr: hover":{backgroundColor:"light"===t?"rgb(246, 246, 246)":"rgb(33, 33, 40)"},"& tbody tr: hover a":{textDecoration:"underline"}},children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"Name"}),(0,r.jsx)("th",{children:"Content"}),(0,r.jsx)("th",{children:"Meta Data"})]})}),(0,r.jsx)("tbody",{children:b.map(e=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:e.doc_name}),(0,r.jsx)("td",{children:(0,r.jsx)(u.Z,{content:e.content,trigger:"hover",children:e.content.length>10?"".concat(e.content.slice(0,10),"..."):e.content})}),(0,r.jsx)("td",{children:(0,r.jsx)(u.Z,{content:JSON.stringify(e.meta_info||"{}",null,2),trigger:"hover",children:e.meta_info.length>10?"".concat(e.meta_info.slice(0,10),"..."):e.meta_info})})]},e.id))})]}),(0,r.jsx)(s.Z,{direction:"row",justifyContent:"flex-end",sx:{marginTop:"20px"},children:(0,r.jsx)(g.Z,{defaultPageSize:20,showSizeChanger:!1,current:x,total:m,onChange:async e=>{let t=await (0,f.PR)("/knowledge/".concat(n,"/chunk/list"),{document_id:j,page:e,page_size:20});t.success&&(S(t.data.data),p(t.data.total),P(t.data.page))},hideOnSinglePage:!0})})]}):(0,r.jsx)(r.Fragment,{})})]})}},78915:function(e,t,n){"use strict";n.d(t,{Tk:function(){return d},Kw:function(){return h},PR:function(){return u},Ej:function(){return g}});var r=n(21628),a=n(24214),i=n(52040);let c=a.Z.create({baseURL:i.env.API_BASE_URL});c.defaults.timeout=1e4,c.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var s=n(84835);let o={"content-type":"application/json"},l=e=>{if(!(0,s.isPlainObject)(e))return JSON.stringify(e);let t={...e};for(let e in t){let n=t[e];"string"==typeof n&&(t[e]=n.trim())}return JSON.stringify(t)},d=(e,t)=>{if(t){let n=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");n&&(e+="?".concat(n))}return c.get("/api"+e,{headers:o}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},h=(e,t)=>{let n=l(t);return c.post("/api"+e,{body:n,headers:o}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},u=(e,t)=>{let n=l(t);return c.post(e,{body:n,headers:o}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},g=(e,t)=>c.post(e,{body:t}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})}},function(e){e.O(0,[180,106,693,118,440,55,253,769,744],function(){return e(e.s=18885)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/datastores/documents/chunklist/page-b421768c79fe106d.js b/pilot/server/static/_next/static/chunks/app/datastores/documents/chunklist/page-b421768c79fe106d.js new file mode 100644 index 000000000..565f4057e --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/datastores/documents/chunklist/page-b421768c79fe106d.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[538],{18885:function(e,t,n){Promise.resolve().then(n.bind(n,26257))},26257:function(e,t,n){"use strict";n.r(t);var a=n(9268),i=n(56008),s=n(86006),r=n(78635),c=n(70900),o=n(44334),d=n(311),l=n(22046),h=n(83192),u=n(23910),g=n(1031);t.default=()=>{let e=(0,i.useRouter)(),{mode:t}=(0,r.tv)(),n=(0,i.useSearchParams)().get("spacename"),x=(0,i.useSearchParams)().get("documentid"),[j,p]=(0,s.useState)(0),[m,f]=(0,s.useState)(0),[S,y]=(0,s.useState)([]);return(0,s.useEffect)(()=>{(async function(){let e=await fetch("".concat("http://127.0.0.1:5000","/knowledge/").concat(n,"/chunk/list"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({document_id:x,page:1,page_size:20})}),t=await e.json();t.success&&(y(t.data.data),p(t.data.total),f(t.data.page))})()},[]),(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsx)(c.Z,{direction:"row",justifyContent:"flex-start",alignItems:"center",sx:{marginBottom:"20px"},children:(0,a.jsxs)(o.Z,{"aria-label":"breadcrumbs",children:[(0,a.jsx)(d.Z,{onClick:()=>{e.push("/datastores")},underline:"hover",color:"neutral",fontSize:"inherit",children:"Knowledge Space"},"Knowledge Space"),(0,a.jsx)(d.Z,{onClick:()=>{e.push("/datastores/documents?name=".concat(n))},underline:"hover",color:"neutral",fontSize:"inherit",children:"Documents"},"Knowledge Space"),(0,a.jsx)(l.ZP,{fontSize:"inherit",children:"Chunks"})]})}),(0,a.jsx)("div",{className:"p-4",children:S.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(h.Z,{color:"primary",variant:"plain",size:"lg",sx:{"& tbody tr: hover":{backgroundColor:"light"===t?"rgb(246, 246, 246)":"rgb(33, 33, 40)"},"& tbody tr: hover a":{textDecoration:"underline"}},children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{children:"Name"}),(0,a.jsx)("th",{children:"Content"}),(0,a.jsx)("th",{children:"Meta Data"})]})}),(0,a.jsx)("tbody",{children:S.map(e=>(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{children:e.doc_name}),(0,a.jsx)("td",{children:(0,a.jsx)(u.Z,{content:e.content,trigger:"hover",children:e.content.length>10?"".concat(e.content.slice(0,10),"..."):e.content})}),(0,a.jsx)("td",{children:(0,a.jsx)(u.Z,{content:JSON.stringify(e.meta_info||"{}",null,2),trigger:"hover",children:e.meta_info.length>10?"".concat(e.meta_info.slice(0,10),"..."):e.meta_info})})]},e.id))})]}),(0,a.jsx)(c.Z,{direction:"row",justifyContent:"flex-end",sx:{marginTop:"20px"},children:(0,a.jsx)(g.Z,{defaultPageSize:20,showSizeChanger:!1,current:m,total:j,onChange:async e=>{let t=await fetch("".concat("http://127.0.0.1:5000","/knowledge/").concat(n,"/chunk/list"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({document_id:x,page:e,page_size:20})}),a=await t.json();a.success&&(y(a.data.data),p(a.data.total),f(a.data.page))},hideOnSinglePage:!0})})]}):(0,a.jsx)(a.Fragment,{})})]})}}},function(e){e.O(0,[430,693,118,440,55,253,769,744],function(){return e(e.s=18885)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/datastores/documents/chunklist/page-b46a6ee909214feb.js b/pilot/server/static/_next/static/chunks/app/datastores/documents/chunklist/page-b46a6ee909214feb.js new file mode 100644 index 000000000..f5d5ae12e --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/datastores/documents/chunklist/page-b46a6ee909214feb.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[538],{18885:function(e,t,n){Promise.resolve().then(n.bind(n,26257))},26257:function(e,t,n){"use strict";n.r(t);var a=n(9268),s=n(56008),i=n(86006),c=n(78635),o=n(70900),r=n(44334),d=n(311),l=n(22046),h=n(83192),u=n(23910),g=n(1031);t.default=()=>{let e=(0,s.useRouter)(),{mode:t}=(0,c.tv)(),n=(0,s.useSearchParams)().get("spacename"),x=(0,s.useSearchParams)().get("documentid"),[m,j]=(0,i.useState)(0),[p,f]=(0,i.useState)(0),[S,w]=(0,i.useState)([]);return(0,i.useEffect)(()=>{(async function(){let e=await fetch("".concat("https://u158074-879a-d00019a9.westa.seetacloud.com:8443","/knowledge/").concat(n,"/chunk/list"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({document_id:x,page:1,page_size:20})}),t=await e.json();t.success&&(w(t.data.data),j(t.data.total),f(t.data.page))})()},[]),(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsx)(o.Z,{direction:"row",justifyContent:"flex-start",alignItems:"center",sx:{marginBottom:"20px"},children:(0,a.jsxs)(r.Z,{"aria-label":"breadcrumbs",children:[(0,a.jsx)(d.Z,{onClick:()=>{e.push("/datastores")},underline:"hover",color:"neutral",fontSize:"inherit",children:"Knowledge Space"},"Knowledge Space"),(0,a.jsx)(d.Z,{onClick:()=>{e.push("/datastores/documents?name=".concat(n))},underline:"hover",color:"neutral",fontSize:"inherit",children:"Documents"},"Knowledge Space"),(0,a.jsx)(l.ZP,{fontSize:"inherit",children:"Chunks"})]})}),(0,a.jsx)("div",{className:"p-4",children:S.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(h.Z,{color:"primary",variant:"plain",size:"lg",sx:{"& tbody tr: hover":{backgroundColor:"light"===t?"rgb(246, 246, 246)":"rgb(33, 33, 40)"},"& tbody tr: hover a":{textDecoration:"underline"}},children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{children:"Name"}),(0,a.jsx)("th",{children:"Content"}),(0,a.jsx)("th",{children:"Meta Data"})]})}),(0,a.jsx)("tbody",{children:S.map(e=>(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{children:e.doc_name}),(0,a.jsx)("td",{children:(0,a.jsx)(u.Z,{content:e.content,trigger:"hover",children:e.content.length>10?"".concat(e.content.slice(0,10),"..."):e.content})}),(0,a.jsx)("td",{children:(0,a.jsx)(u.Z,{content:JSON.stringify(e.meta_info||"{}",null,2),trigger:"hover",children:e.meta_info.length>10?"".concat(e.meta_info.slice(0,10),"..."):e.meta_info})})]},e.id))})]}),(0,a.jsx)(o.Z,{direction:"row",justifyContent:"flex-end",sx:{marginTop:"20px"},children:(0,a.jsx)(g.Z,{defaultPageSize:20,showSizeChanger:!1,current:p,total:m,onChange:async e=>{let t=await fetch("".concat("https://u158074-879a-d00019a9.westa.seetacloud.com:8443","/knowledge/").concat(n,"/chunk/list"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({document_id:x,page:e,page_size:20})}),a=await t.json();a.success&&(w(a.data.data),j(a.data.total),f(a.data.page))},hideOnSinglePage:!0})})]}):(0,a.jsx)(a.Fragment,{})})]})}}},function(e){e.O(0,[430,693,118,440,55,253,769,744],function(){return e(e.s=18885)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/datastores/documents/chunklist/page-ee2eebc9c2955630.js b/pilot/server/static/_next/static/chunks/app/datastores/documents/chunklist/page-ee2eebc9c2955630.js new file mode 100644 index 000000000..e5c7ffe4b --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/datastores/documents/chunklist/page-ee2eebc9c2955630.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[538],{18885:function(e,t,n){Promise.resolve().then(n.bind(n,26257))},26257:function(e,t,n){"use strict";n.r(t);var r=n(9268),a=n(56008),i=n(86006),c=n(78635),s=n(70900),o=n(44334),l=n(311),d=n(22046),h=n(83192),u=n(23910),g=n(1031),f=n(78915);t.default=()=>{let e=(0,a.useRouter)(),{mode:t}=(0,c.tv)(),n=(0,a.useSearchParams)().get("spacename"),j=(0,a.useSearchParams)().get("documentid"),[m,p]=(0,i.useState)(0),[x,P]=(0,i.useState)(0),[b,y]=(0,i.useState)([]);return(0,i.useEffect)(()=>{(async function(){let e=await (0,f.PR)("/knowledge/".concat(n,"/chunk/list"),{document_id:j,page:1,page_size:20});e.success&&(y(e.data.data),p(e.data.total),P(e.data.page))})()},[]),(0,r.jsxs)("div",{className:"p-4",children:[(0,r.jsx)(s.Z,{direction:"row",justifyContent:"flex-start",alignItems:"center",sx:{marginBottom:"20px"},children:(0,r.jsxs)(o.Z,{"aria-label":"breadcrumbs",children:[(0,r.jsx)(l.Z,{onClick:()=>{e.push("/datastores")},underline:"hover",color:"neutral",fontSize:"inherit",children:"Knowledge Space"},"Knowledge Space"),(0,r.jsx)(l.Z,{onClick:()=>{e.push("/datastores/documents?name=".concat(n))},underline:"hover",color:"neutral",fontSize:"inherit",children:"Documents"},"Knowledge Space"),(0,r.jsx)(d.ZP,{fontSize:"inherit",children:"Chunks"})]})}),(0,r.jsx)("div",{className:"p-4",children:b.length?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(h.Z,{color:"primary",variant:"plain",size:"lg",sx:{"& tbody tr: hover":{backgroundColor:"light"===t?"rgb(246, 246, 246)":"rgb(33, 33, 40)"},"& tbody tr: hover a":{textDecoration:"underline"}},children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"Name"}),(0,r.jsx)("th",{children:"Content"}),(0,r.jsx)("th",{children:"Meta Data"})]})}),(0,r.jsx)("tbody",{children:b.map(e=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:e.doc_name}),(0,r.jsx)("td",{children:(0,r.jsx)(u.Z,{content:e.content,trigger:"hover",children:e.content.length>10?"".concat(e.content.slice(0,10),"..."):e.content})}),(0,r.jsx)("td",{children:(0,r.jsx)(u.Z,{content:JSON.stringify(e.meta_info||"{}",null,2),trigger:"hover",children:e.meta_info.length>10?"".concat(e.meta_info.slice(0,10),"..."):e.meta_info})})]},e.id))})]}),(0,r.jsx)(s.Z,{direction:"row",justifyContent:"flex-end",sx:{marginTop:"20px"},children:(0,r.jsx)(g.Z,{defaultPageSize:20,showSizeChanger:!1,current:x,total:m,onChange:async e=>{let t=await (0,f.PR)("/knowledge/".concat(n,"/chunk/list"),{document_id:j,page:e,page_size:20});t.success&&(y(t.data.data),p(t.data.total),P(t.data.page))},hideOnSinglePage:!0})})]}):(0,r.jsx)(r.Fragment,{})})]})}},78915:function(e,t,n){"use strict";n.d(t,{Tk:function(){return l},Kw:function(){return d},PR:function(){return h},Ej:function(){return u}});var r=n(21628),a=n(24214);let i=a.Z.create({baseURL:"http://127.0.0.1:5000"});i.defaults.timeout=1e4,i.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var c=n(84835);let s={"content-type":"application/json"},o=e=>{if(!(0,c.isPlainObject)(e))return JSON.stringify(e);let t={...e};for(let e in t){let n=t[e];"string"==typeof n&&(t[e]=n.trim())}return JSON.stringify(t)},l=(e,t)=>{if(t){let n=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");n&&(e+="?".concat(n))}return i.get("/api"+e,{headers:s}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},d=(e,t)=>{let n=o(t);return i.post("/api"+e,{body:n,headers:s}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},h=(e,t)=>{let n=o(t);return i.post(e,{body:n,headers:s}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},u=(e,t)=>i.post(e,{body:t}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})}},function(e){e.O(0,[180,752,693,118,440,55,253,769,744],function(){return e(e.s=18885)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/datastores/documents/page-203014d14b30836a.js b/pilot/server/static/_next/static/chunks/app/datastores/documents/page-203014d14b30836a.js new file mode 100644 index 000000000..901da9915 --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/datastores/documents/page-203014d14b30836a.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[470],{78141:function(e,t,a){"use strict";var i=a(78997);t.Z=void 0;var n=i(a(76906)),o=a(9268),r=(0,n.default)((0,o.jsx)("path",{d:"m19 8-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3l-4-4zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4H6z"}),"Cached");t.Z=r},78273:function(e,t,a){Promise.resolve().then(a.bind(a,16692))},16692:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return et}});var i=a(9268),n=a(56008),o=a(86006),r=a(50645),s=a(5737),l=a(78635),c=a(70900),d=a(44334),h=a(311),p=a(22046),u=a(53113),g=a(83192),m=a(46750),x=a(40431),v=a(89791),f=a(47562),C=a(46319),b=a(53832),y=a(49657),j=a(88930),S=a(47093),Z=a(18587);function w(e){return(0,Z.d6)("MuiChip",e)}let P=(0,Z.sI)("MuiChip",["root","clickable","colorPrimary","colorNeutral","colorDanger","colorInfo","colorSuccess","colorWarning","colorContext","disabled","endDecorator","focusVisible","label","labelSm","labelMd","labelLg","sizeSm","sizeMd","sizeLg","startDecorator","variantPlain","variantSolid","variantSoft","variantOutlined"]),_=o.createContext({disabled:void 0,variant:void 0,color:void 0});var D=a(326);let T=["children","className","color","slotProps","onClick","disabled","size","variant","startDecorator","endDecorator"],k=e=>{let{disabled:t,size:a,color:i,clickable:n,variant:o,focusVisible:r}=e,s={root:["root",t&&"disabled",i&&`color${(0,b.Z)(i)}`,a&&`size${(0,b.Z)(a)}`,o&&`variant${(0,b.Z)(o)}`,n&&"clickable"],action:["action",t&&"disabled",r&&"focusVisible"],label:["label",a&&`label${(0,b.Z)(a)}`],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return(0,f.Z)(s,w,{})},z=(0,r.Z)("div",{name:"JoyChip",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var a,i,n,o,r,s;return[(0,x.Z)({"--Chip-decoratorChildOffset":"min(calc(var(--Chip-paddingInline) - (var(--_Chip-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Chip-decoratorChildHeight)) / 2), var(--Chip-paddingInline))","--Chip-decoratorChildRadius":"max(var(--_Chip-radius) - var(--variant-borderWidth, 0px) - var(--_Chip-paddingBlock), min(var(--_Chip-paddingBlock) + var(--variant-borderWidth, 0px), var(--_Chip-radius) / 2))","--Chip-deleteRadius":"var(--Chip-decoratorChildRadius)","--Chip-deleteSize":"var(--Chip-decoratorChildHeight)","--Avatar-radius":"var(--Chip-decoratorChildRadius)","--Avatar-size":"var(--Chip-decoratorChildHeight)","--Icon-margin":"initial","--unstable_actionRadius":"var(--_Chip-radius)"},"sm"===t.size&&{"--Chip-gap":"0.25rem","--Chip-paddingInline":"0.5rem","--Chip-decoratorChildHeight":"calc(min(1.125rem, var(--_Chip-minHeight)) - 2 * var(--variant-borderWidth, 0px))","--Icon-fontSize":"calc(var(--_Chip-minHeight) / 1.714)","--_Chip-minHeight":"var(--Chip-minHeight, 1.5rem)",fontSize:e.vars.fontSize.xs},"md"===t.size&&{"--Chip-gap":"0.375rem","--Chip-paddingInline":"0.75rem","--Chip-decoratorChildHeight":"min(1.375rem, var(--_Chip-minHeight))","--Icon-fontSize":"calc(var(--_Chip-minHeight) / 1.778)","--_Chip-minHeight":"var(--Chip-minHeight, 2rem)",fontSize:e.vars.fontSize.sm},"lg"===t.size&&{"--Chip-gap":"0.5rem","--Chip-paddingInline":"1rem","--Chip-decoratorChildHeight":"min(1.75rem, var(--_Chip-minHeight))","--Icon-fontSize":"calc(var(--_Chip-minHeight) / 2)","--_Chip-minHeight":"var(--Chip-minHeight, 2.5rem)",fontSize:e.vars.fontSize.md},{"--_Chip-radius":"var(--Chip-radius, 1.5rem)","--_Chip-paddingBlock":"max((var(--_Chip-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Chip-decoratorChildHeight)) / 2, 0px)",minHeight:"var(--_Chip-minHeight)",paddingInline:"var(--Chip-paddingInline)",borderRadius:"var(--_Chip-radius)",position:"relative",fontWeight:e.vars.fontWeight.md,fontFamily:e.vars.fontFamily.body,display:"inline-flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap",textDecoration:"none",verticalAlign:"middle",boxSizing:"border-box",[`&.${P.disabled}`]:{color:null==(a=e.variants[`${t.variant}Disabled`])?void 0:null==(i=a[t.color])?void 0:i.color}}),...t.clickable?[{"--variant-borderWidth":"0px",color:null==(r=e.variants[t.variant])?void 0:null==(s=r[t.color])?void 0:s.color}]:[null==(n=e.variants[t.variant])?void 0:n[t.color],{[`&.${P.disabled}`]:null==(o=e.variants[`${t.variant}Disabled`])?void 0:o[t.color]}]]}),O=(0,r.Z)("span",{name:"JoyChip",slot:"Label",overridesResolver:(e,t)=>t.label})(({ownerState:e})=>(0,x.Z)({display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",order:1,minInlineSize:0,flexGrow:1},e.clickable&&{zIndex:1,pointerEvents:"none"})),I=(0,r.Z)("button",{name:"JoyChip",slot:"Action",overridesResolver:(e,t)=>t.action})(({theme:e,ownerState:t})=>{var a,i,n,o;return[{position:"absolute",zIndex:0,top:0,left:0,bottom:0,right:0,border:"none",cursor:"pointer",padding:"initial",margin:"initial",backgroundColor:"initial",textDecoration:"none",borderRadius:"inherit",[e.focus.selector]:e.focus.default},null==(a=e.variants[t.variant])?void 0:a[t.color],{"&:hover":null==(i=e.variants[`${t.variant}Hover`])?void 0:i[t.color]},{"&:active":null==(n=e.variants[`${t.variant}Active`])?void 0:n[t.color]},{[`&.${P.disabled}`]:null==(o=e.variants[`${t.variant}Disabled`])?void 0:o[t.color]}]}),N=(0,r.Z)("span",{name:"JoyChip",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({"--Avatar-marginInlineStart":"calc(var(--Chip-decoratorChildOffset) * -1)","--Chip-deleteMargin":"0 0 0 calc(var(--Chip-decoratorChildOffset) * -1)","--Icon-margin":"0 0 0 calc(var(--Chip-paddingInline) / -4)",display:"inherit",marginInlineEnd:"var(--Chip-gap)",order:0,zIndex:1,pointerEvents:"none"}),R=(0,r.Z)("span",{name:"JoyChip",slot:"EndDecorator",overridesResolver:(e,t)=>t.endDecorator})({"--Chip-deleteMargin":"0 calc(var(--Chip-decoratorChildOffset) * -1) 0 0","--Icon-margin":"0 calc(var(--Chip-paddingInline) / -4) 0 0",display:"inherit",marginInlineStart:"var(--Chip-gap)",order:2,zIndex:1,pointerEvents:"none"}),H=o.forwardRef(function(e,t){let a=(0,j.Z)({props:e,name:"JoyChip"}),{children:n,className:r,color:s="primary",slotProps:l={},onClick:c,disabled:d=!1,size:h="md",variant:p="solid",startDecorator:u,endDecorator:g}=a,f=(0,m.Z)(a,T),{getColor:b}=(0,S.VT)(p),Z=b(e.color,s),w=!!c||!!l.action,P=(0,x.Z)({},a,{disabled:d,size:h,color:Z,variant:p,clickable:w,focusVisible:!1}),H="function"==typeof l.action?l.action(P):l.action,F=o.useRef(null),{focusVisible:E,getRootProps:J}=(0,C.Z)((0,x.Z)({},H,{disabled:d,ref:F}));P.focusVisible=E;let W=k(P),M=(0,x.Z)({},f,{slotProps:l}),[L,$]=(0,D.Z)("root",{ref:t,className:(0,v.Z)(W.root,r),elementType:z,externalForwardedProps:M,ownerState:P}),[U,A]=(0,D.Z)("label",{className:W.label,elementType:O,externalForwardedProps:M,ownerState:P}),B=(0,y.Z)(A.id),[V,Y]=(0,D.Z)("action",{className:W.action,elementType:I,externalForwardedProps:M,ownerState:P,getSlotProps:J,additionalProps:{"aria-labelledby":B,as:null==H?void 0:H.component,onClick:c}}),[G,K]=(0,D.Z)("startDecorator",{className:W.startDecorator,elementType:N,externalForwardedProps:M,ownerState:P}),[X,q]=(0,D.Z)("endDecorator",{className:W.endDecorator,elementType:R,externalForwardedProps:M,ownerState:P}),Q=o.useMemo(()=>({disabled:d,variant:p,color:"context"===Z?void 0:Z}),[Z,d,p]);return(0,i.jsx)(_.Provider,{value:Q,children:(0,i.jsxs)(L,(0,x.Z)({},$,{children:[w&&(0,i.jsx)(V,(0,x.Z)({},Y)),(0,i.jsx)(U,(0,x.Z)({},A,{id:B,children:n})),u&&(0,i.jsx)(G,(0,x.Z)({},K,{children:u})),g&&(0,i.jsx)(X,(0,x.Z)({},q,{children:g}))]}))})});var F=a(11437),E=a(90545),J=a(35086),W=a(866),M=a(28086),L=a(65326),$=a.n(L),U=a(72474),A=a(59534),B=a(78141),V=a(50157),Y=a(23910),G=a(21628),K=a(1031);let{Dragger:X}=V.default,q=(0,r.Z)(s.Z)(e=>{let{theme:t}=e;return{width:"50%",backgroundColor:"dark"===t.palette.mode?t.palette.background.level1:"#fff",...t.typography.body2,padding:t.spacing(1),textAlign:"center",borderRadius:4,color:t.vars.palette.text.secondary}}),Q=["Choose a Datasource type","Setup the Datasource"],ee=[{type:"text",title:"Text",subTitle:"Fill your raw text"},{type:"webPage",title:"URL",subTitle:"Fetch the content of a URL"},{type:"file",title:"Document",subTitle:"Upload a document, document type can be PDF, CSV, Text, PowerPoint, Word, Markdown"}];var et=()=>{let e=(0,n.useRouter)(),t=(0,n.useSearchParams)().get("name"),{mode:a}=(0,l.tv)(),[r,m]=(0,o.useState)(!1),[x,v]=(0,o.useState)(0),[f,C]=(0,o.useState)(""),[b,y]=(0,o.useState)([]),[j,S]=(0,o.useState)(""),[Z,w]=(0,o.useState)(""),[P,_]=(0,o.useState)(""),[D,T]=(0,o.useState)(""),[k,z]=(0,o.useState)(null),[O,I]=(0,o.useState)(0),[N,R]=(0,o.useState)(0),[L,V]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{(async function(){let e=await fetch("".concat("http://127.0.0.1:5000","/knowledge/").concat(t,"/document/list"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({page:1,page_size:20})}),a=await e.json();a.success&&(y(a.data.data),I(a.data.total),R(a.data.page))})()},[]),(0,i.jsxs)("div",{className:"p-4",children:[(0,i.jsxs)(c.Z,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{marginBottom:"20px"},children:[(0,i.jsxs)(d.Z,{"aria-label":"breadcrumbs",children:[(0,i.jsx)(h.Z,{onClick:()=>{e.push("/datastores")},underline:"hover",color:"neutral",fontSize:"inherit",children:"Knowledge Space"},"Knowledge Space"),(0,i.jsx)(p.ZP,{fontSize:"inherit",children:"Documents"})]}),(0,i.jsx)(u.Z,{variant:"outlined",onClick:()=>m(!0),children:"+ Add Datasource"})]}),b.length?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(g.Z,{color:"primary",variant:"plain",size:"lg",sx:{"& tbody tr: hover":{backgroundColor:"light"===a?"rgb(246, 246, 246)":"rgb(33, 33, 40)"},"& tbody tr: hover a":{textDecoration:"underline"}},children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:"Name"}),(0,i.jsx)("th",{children:"Type"}),(0,i.jsx)("th",{children:"Size"}),(0,i.jsx)("th",{children:"Last Synch"}),(0,i.jsx)("th",{children:"Status"}),(0,i.jsx)("th",{children:"Result"}),(0,i.jsx)("th",{children:"Operation"})]})}),(0,i.jsx)("tbody",{children:b.map(a=>(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:a.doc_name}),(0,i.jsx)("td",{children:(0,i.jsx)(H,{variant:"solid",color:"neutral",sx:{opacity:.5},children:a.doc_type})}),(0,i.jsxs)("td",{children:[a.chunk_size," chunks"]}),(0,i.jsx)("td",{children:$()(a.last_sync).format("YYYY-MM-DD HH:MM:SS")}),(0,i.jsx)("td",{children:(0,i.jsx)(H,{sx:{opacity:.5},variant:"solid",color:function(){switch(a.status){case"TODO":return"neutral";case"RUNNING":return"primary";case"FINISHED":return"success";case"FAILED":return"danger"}}(),children:a.status})}),(0,i.jsx)("td",{children:"TODO"===a.status||"RUNNING"===a.status?"":"FINISHED"===a.status?(0,i.jsx)(Y.Z,{content:a.result,trigger:"hover",children:(0,i.jsx)(H,{variant:"solid",color:"success",sx:{opacity:.5},children:"SUCCESS"})}):(0,i.jsx)(Y.Z,{content:a.result,trigger:"hover",children:(0,i.jsx)(H,{variant:"solid",color:"danger",sx:{opacity:.5},children:"FAILED"})})}),(0,i.jsx)("td",{children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(u.Z,{variant:"outlined",size:"sm",sx:{marginRight:"20px"},onClick:async()=>{let e=await fetch("".concat("http://127.0.0.1:5000","/knowledge/").concat(t,"/document/sync"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({doc_ids:[a.id]})}),i=await e.json();i.success?G.ZP.success("success"):G.ZP.error(i.err_msg||"failed")},children:["Synch",(0,i.jsx)(B.Z,{})]}),(0,i.jsx)(u.Z,{variant:"outlined",size:"sm",onClick:()=>{e.push("/datastores/documents/chunklist?spacename=".concat(t,"&documentid=").concat(a.id))},children:"Details"})]})})]},a.id))})]}),(0,i.jsx)(c.Z,{direction:"row",justifyContent:"flex-end",sx:{marginTop:"20px"},children:(0,i.jsx)(K.Z,{defaultPageSize:20,showSizeChanger:!1,current:N,total:O,onChange:async e=>{let a=await fetch("".concat("http://127.0.0.1:5000","/knowledge/").concat(t,"/document/list"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({page:e,page_size:20})}),i=await a.json();i.success&&(y(i.data.data),I(i.data.total),R(i.data.page))},hideOnSinglePage:!0})})]}):(0,i.jsx)(i.Fragment,{}),(0,i.jsx)(F.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center","z-index":1e3},open:r,onClose:()=>m(!1),children:(0,i.jsxs)(s.Z,{variant:"outlined",sx:{width:800,borderRadius:"md",p:3,boxShadow:"lg"},children:[(0,i.jsx)(E.Z,{sx:{width:"100%"},children:(0,i.jsx)(c.Z,{spacing:2,direction:"row",children:Q.map((e,t)=>(0,i.jsxs)(q,{sx:{fontWeight:x===t?"bold":"",color:x===t?"#814DDE":""},children:[t(0,i.jsxs)(s.Z,{sx:{boxSizing:"border-box",height:"80px",padding:"12px",display:"flex",flexDirection:"column",justifyContent:"space-between",border:"1px solid gray",borderRadius:"6px",marginBottom:"20px",cursor:"pointer"},onClick:()=>{C(e.type),v(1)},children:[(0,i.jsx)(s.Z,{sx:{fontSize:"20px",fontWeight:"bold"},children:e.title}),(0,i.jsx)(s.Z,{children:e.subTitle})]},e.type))})}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(E.Z,{sx:{margin:"30px auto"},children:["Name:",(0,i.jsx)(J.ZP,{placeholder:"Please input the name",onChange:e=>w(e.target.value),sx:{marginBottom:"20px"}}),"webPage"===f?(0,i.jsxs)(i.Fragment,{children:["Web Page URL:",(0,i.jsx)(J.ZP,{placeholder:"Please input the Web Page URL",onChange:e=>S(e.target.value)})]}):"file"===f?(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(X,{name:"file",multiple:!1,onChange(e){var t;if(console.log(e),0===e.fileList.length){z(null),w("");return}z(e.file.originFileObj),w(null===(t=e.file.originFileObj)||void 0===t?void 0:t.name)},children:[(0,i.jsx)("p",{className:"ant-upload-drag-icon",children:(0,i.jsx)(U.Z,{})}),(0,i.jsx)("p",{style:{color:"rgb(22, 108, 255)",fontSize:"20px"},children:"Select or Drop file"}),(0,i.jsx)("p",{className:"ant-upload-hint",style:{color:"rgb(22, 108, 255)"},children:"PDF, PowerPoint, Excel, Word, Text, Markdown,"})]})}):(0,i.jsxs)(i.Fragment,{children:["Text Source(Optional):",(0,i.jsx)(J.ZP,{placeholder:"Please input the text source",onChange:e=>_(e.target.value),sx:{marginBottom:"20px"}}),"Text:",(0,i.jsx)(W.Z,{onChange:e=>T(e.target.value),minRows:4,sx:{marginBottom:"20px"}})]}),(0,i.jsx)(p.ZP,{component:"label",sx:{marginTop:"20px"},endDecorator:(0,i.jsx)(M.Z,{checked:L,onChange:e=>V(e.target.checked)}),children:"Synch:"})]}),(0,i.jsxs)(c.Z,{direction:"row",justifyContent:"flex-start",alignItems:"center",sx:{marginBottom:"20px"},children:[(0,i.jsx)(u.Z,{variant:"outlined",sx:{marginRight:"20px"},onClick:()=>v(0),children:"< Back"}),(0,i.jsx)(u.Z,{variant:"outlined",onClick:async()=>{if(""===Z){G.ZP.error("Please input the name");return}if("webPage"===f){if(""===j){G.ZP.error("Please input the Web Page URL");return}let e=await fetch("".concat("http://127.0.0.1:5000","/knowledge/").concat(t,"/document/add"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({doc_name:Z,content:j,doc_type:"URL"})}),a=await e.json();if(a.success&&L&&fetch("".concat("http://127.0.0.1:5000","/knowledge/").concat(t,"/document/sync"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({doc_ids:[a.data]})}),a.success){G.ZP.success("success"),m(!1);let e=await fetch("".concat("http://127.0.0.1:5000","/knowledge/").concat(t,"/document/list"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({page:N,page_size:20})}),a=await e.json();a.success&&(y(a.data.data),I(a.data.total),R(a.data.page))}else G.ZP.error(a.err_msg||"failed")}else if("file"===f){if(!k){G.ZP.error("Please select a file");return}let e=new FormData;e.append("doc_name",Z),e.append("doc_file",k),e.append("doc_type","DOCUMENT");let a=await fetch("".concat("http://127.0.0.1:5000","/knowledge/").concat(t,"/document/upload"),{method:"POST",body:e}),i=await a.json();if(i.success&&L&&fetch("".concat("http://127.0.0.1:5000","/knowledge/").concat(t,"/document/sync"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({doc_ids:[i.data]})}),i.success){G.ZP.success("success"),m(!1);let e=await fetch("".concat("http://127.0.0.1:5000","/knowledge/").concat(t,"/document/list"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({page:N,page_size:20})}),a=await e.json();a.success&&(y(a.data.data),I(a.data.total),R(a.data.page))}else G.ZP.error(i.err_msg||"failed")}else{if(""===D){G.ZP.error("Please input the text");return}let e=await fetch("".concat("http://127.0.0.1:5000","/knowledge/").concat(t,"/document/add"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({doc_name:Z,source:P,content:D,doc_type:"TEXT"})}),a=await e.json();if(a.success&&L&&fetch("".concat("http://127.0.0.1:5000","/knowledge/").concat(t,"/document/sync"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({doc_ids:[a.data]})}),a.success){G.ZP.success("success"),m(!1);let e=await fetch("".concat("http://127.0.0.1:5000","/knowledge/").concat(t,"/document/list"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({page:N,page_size:20})}),a=await e.json();a.success&&(y(a.data.data),I(a.data.total),R(a.data.page))}else G.ZP.error(a.err_msg||"failed")}},children:"Finish"})]})]})]})})]})}}},function(e){e.O(0,[550,430,577,86,693,118,440,672,55,642,253,769,744],function(){return e(e.s=78273)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/datastores/documents/page-5f79f7bb1372ffbb.js b/pilot/server/static/_next/static/chunks/app/datastores/documents/page-5f79f7bb1372ffbb.js new file mode 100644 index 000000000..c008eab3e --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/datastores/documents/page-5f79f7bb1372ffbb.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[470],{78141:function(e,t,a){"use strict";var i=a(78997);t.Z=void 0;var n=i(a(76906)),o=a(9268),r=(0,n.default)((0,o.jsx)("path",{d:"m19 8-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3l-4-4zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4H6z"}),"Cached");t.Z=r},78273:function(e,t,a){Promise.resolve().then(a.bind(a,16692))},16692:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return et}});var i=a(9268),n=a(56008),o=a(86006),r=a(50645),s=a(5737),c=a(78635),l=a(70900),d=a(44334),h=a(311),p=a(22046),u=a(53113),g=a(83192),m=a(46750),x=a(40431),v=a(89791),f=a(47562),C=a(46319),b=a(53832),y=a(49657),j=a(88930),S=a(47093),Z=a(18587);function w(e){return(0,Z.d6)("MuiChip",e)}let P=(0,Z.sI)("MuiChip",["root","clickable","colorPrimary","colorNeutral","colorDanger","colorInfo","colorSuccess","colorWarning","colorContext","disabled","endDecorator","focusVisible","label","labelSm","labelMd","labelLg","sizeSm","sizeMd","sizeLg","startDecorator","variantPlain","variantSolid","variantSoft","variantOutlined"]),_=o.createContext({disabled:void 0,variant:void 0,color:void 0});var D=a(326);let T=["children","className","color","slotProps","onClick","disabled","size","variant","startDecorator","endDecorator"],k=e=>{let{disabled:t,size:a,color:i,clickable:n,variant:o,focusVisible:r}=e,s={root:["root",t&&"disabled",i&&`color${(0,b.Z)(i)}`,a&&`size${(0,b.Z)(a)}`,o&&`variant${(0,b.Z)(o)}`,n&&"clickable"],action:["action",t&&"disabled",r&&"focusVisible"],label:["label",a&&`label${(0,b.Z)(a)}`],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return(0,f.Z)(s,w,{})},z=(0,r.Z)("div",{name:"JoyChip",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var a,i,n,o,r,s;return[(0,x.Z)({"--Chip-decoratorChildOffset":"min(calc(var(--Chip-paddingInline) - (var(--_Chip-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Chip-decoratorChildHeight)) / 2), var(--Chip-paddingInline))","--Chip-decoratorChildRadius":"max(var(--_Chip-radius) - var(--variant-borderWidth, 0px) - var(--_Chip-paddingBlock), min(var(--_Chip-paddingBlock) + var(--variant-borderWidth, 0px), var(--_Chip-radius) / 2))","--Chip-deleteRadius":"var(--Chip-decoratorChildRadius)","--Chip-deleteSize":"var(--Chip-decoratorChildHeight)","--Avatar-radius":"var(--Chip-decoratorChildRadius)","--Avatar-size":"var(--Chip-decoratorChildHeight)","--Icon-margin":"initial","--unstable_actionRadius":"var(--_Chip-radius)"},"sm"===t.size&&{"--Chip-gap":"0.25rem","--Chip-paddingInline":"0.5rem","--Chip-decoratorChildHeight":"calc(min(1.125rem, var(--_Chip-minHeight)) - 2 * var(--variant-borderWidth, 0px))","--Icon-fontSize":"calc(var(--_Chip-minHeight) / 1.714)","--_Chip-minHeight":"var(--Chip-minHeight, 1.5rem)",fontSize:e.vars.fontSize.xs},"md"===t.size&&{"--Chip-gap":"0.375rem","--Chip-paddingInline":"0.75rem","--Chip-decoratorChildHeight":"min(1.375rem, var(--_Chip-minHeight))","--Icon-fontSize":"calc(var(--_Chip-minHeight) / 1.778)","--_Chip-minHeight":"var(--Chip-minHeight, 2rem)",fontSize:e.vars.fontSize.sm},"lg"===t.size&&{"--Chip-gap":"0.5rem","--Chip-paddingInline":"1rem","--Chip-decoratorChildHeight":"min(1.75rem, var(--_Chip-minHeight))","--Icon-fontSize":"calc(var(--_Chip-minHeight) / 2)","--_Chip-minHeight":"var(--Chip-minHeight, 2.5rem)",fontSize:e.vars.fontSize.md},{"--_Chip-radius":"var(--Chip-radius, 1.5rem)","--_Chip-paddingBlock":"max((var(--_Chip-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Chip-decoratorChildHeight)) / 2, 0px)",minHeight:"var(--_Chip-minHeight)",paddingInline:"var(--Chip-paddingInline)",borderRadius:"var(--_Chip-radius)",position:"relative",fontWeight:e.vars.fontWeight.md,fontFamily:e.vars.fontFamily.body,display:"inline-flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap",textDecoration:"none",verticalAlign:"middle",boxSizing:"border-box",[`&.${P.disabled}`]:{color:null==(a=e.variants[`${t.variant}Disabled`])?void 0:null==(i=a[t.color])?void 0:i.color}}),...t.clickable?[{"--variant-borderWidth":"0px",color:null==(r=e.variants[t.variant])?void 0:null==(s=r[t.color])?void 0:s.color}]:[null==(n=e.variants[t.variant])?void 0:n[t.color],{[`&.${P.disabled}`]:null==(o=e.variants[`${t.variant}Disabled`])?void 0:o[t.color]}]]}),O=(0,r.Z)("span",{name:"JoyChip",slot:"Label",overridesResolver:(e,t)=>t.label})(({ownerState:e})=>(0,x.Z)({display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",order:1,minInlineSize:0,flexGrow:1},e.clickable&&{zIndex:1,pointerEvents:"none"})),I=(0,r.Z)("button",{name:"JoyChip",slot:"Action",overridesResolver:(e,t)=>t.action})(({theme:e,ownerState:t})=>{var a,i,n,o;return[{position:"absolute",zIndex:0,top:0,left:0,bottom:0,right:0,border:"none",cursor:"pointer",padding:"initial",margin:"initial",backgroundColor:"initial",textDecoration:"none",borderRadius:"inherit",[e.focus.selector]:e.focus.default},null==(a=e.variants[t.variant])?void 0:a[t.color],{"&:hover":null==(i=e.variants[`${t.variant}Hover`])?void 0:i[t.color]},{"&:active":null==(n=e.variants[`${t.variant}Active`])?void 0:n[t.color]},{[`&.${P.disabled}`]:null==(o=e.variants[`${t.variant}Disabled`])?void 0:o[t.color]}]}),N=(0,r.Z)("span",{name:"JoyChip",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({"--Avatar-marginInlineStart":"calc(var(--Chip-decoratorChildOffset) * -1)","--Chip-deleteMargin":"0 0 0 calc(var(--Chip-decoratorChildOffset) * -1)","--Icon-margin":"0 0 0 calc(var(--Chip-paddingInline) / -4)",display:"inherit",marginInlineEnd:"var(--Chip-gap)",order:0,zIndex:1,pointerEvents:"none"}),R=(0,r.Z)("span",{name:"JoyChip",slot:"EndDecorator",overridesResolver:(e,t)=>t.endDecorator})({"--Chip-deleteMargin":"0 calc(var(--Chip-decoratorChildOffset) * -1) 0 0","--Icon-margin":"0 calc(var(--Chip-paddingInline) / -4) 0 0",display:"inherit",marginInlineStart:"var(--Chip-gap)",order:2,zIndex:1,pointerEvents:"none"}),H=o.forwardRef(function(e,t){let a=(0,j.Z)({props:e,name:"JoyChip"}),{children:n,className:r,color:s="primary",slotProps:c={},onClick:l,disabled:d=!1,size:h="md",variant:p="solid",startDecorator:u,endDecorator:g}=a,f=(0,m.Z)(a,T),{getColor:b}=(0,S.VT)(p),Z=b(e.color,s),w=!!l||!!c.action,P=(0,x.Z)({},a,{disabled:d,size:h,color:Z,variant:p,clickable:w,focusVisible:!1}),H="function"==typeof c.action?c.action(P):c.action,F=o.useRef(null),{focusVisible:E,getRootProps:J}=(0,C.Z)((0,x.Z)({},H,{disabled:d,ref:F}));P.focusVisible=E;let W=k(P),M=(0,x.Z)({},f,{slotProps:c}),[L,$]=(0,D.Z)("root",{ref:t,className:(0,v.Z)(W.root,r),elementType:z,externalForwardedProps:M,ownerState:P}),[U,A]=(0,D.Z)("label",{className:W.label,elementType:O,externalForwardedProps:M,ownerState:P}),B=(0,y.Z)(A.id),[V,Y]=(0,D.Z)("action",{className:W.action,elementType:I,externalForwardedProps:M,ownerState:P,getSlotProps:J,additionalProps:{"aria-labelledby":B,as:null==H?void 0:H.component,onClick:l}}),[G,K]=(0,D.Z)("startDecorator",{className:W.startDecorator,elementType:N,externalForwardedProps:M,ownerState:P}),[X,q]=(0,D.Z)("endDecorator",{className:W.endDecorator,elementType:R,externalForwardedProps:M,ownerState:P}),Q=o.useMemo(()=>({disabled:d,variant:p,color:"context"===Z?void 0:Z}),[Z,d,p]);return(0,i.jsx)(_.Provider,{value:Q,children:(0,i.jsxs)(L,(0,x.Z)({},$,{children:[w&&(0,i.jsx)(V,(0,x.Z)({},Y)),(0,i.jsx)(U,(0,x.Z)({},A,{id:B,children:n})),u&&(0,i.jsx)(G,(0,x.Z)({},K,{children:u})),g&&(0,i.jsx)(X,(0,x.Z)({},q,{children:g}))]}))})});var F=a(11437),E=a(90545),J=a(35086),W=a(866),M=a(28086),L=a(65326),$=a.n(L),U=a(72474),A=a(59534),B=a(78141),V=a(50157),Y=a(23910),G=a(21628),K=a(1031);let{Dragger:X}=V.default,q=(0,r.Z)(s.Z)(e=>{let{theme:t}=e;return{width:"50%",backgroundColor:"dark"===t.palette.mode?t.palette.background.level1:"#fff",...t.typography.body2,padding:t.spacing(1),textAlign:"center",borderRadius:4,color:t.vars.palette.text.secondary}}),Q=["Choose a Datasource type","Setup the Datasource"],ee=[{type:"text",title:"Text",subTitle:"Fill your raw text"},{type:"webPage",title:"URL",subTitle:"Fetch the content of a URL"},{type:"file",title:"Document",subTitle:"Upload a document, document type can be PDF, CSV, Text, PowerPoint, Word, Markdown"}];var et=()=>{let e=(0,n.useRouter)(),t=(0,n.useSearchParams)().get("name"),{mode:a}=(0,c.tv)(),[r,m]=(0,o.useState)(!1),[x,v]=(0,o.useState)(0),[f,C]=(0,o.useState)(""),[b,y]=(0,o.useState)([]),[j,S]=(0,o.useState)(""),[Z,w]=(0,o.useState)(""),[P,_]=(0,o.useState)(""),[D,T]=(0,o.useState)(""),[k,z]=(0,o.useState)(null),[O,I]=(0,o.useState)(0),[N,R]=(0,o.useState)(0),[L,V]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{(async function(){let e=await fetch("".concat("https://u158074-879a-d00019a9.westa.seetacloud.com:8443","/knowledge/").concat(t,"/document/list"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({page:1,page_size:20})}),a=await e.json();a.success&&(y(a.data.data),I(a.data.total),R(a.data.page))})()},[]),(0,i.jsxs)("div",{className:"p-4",children:[(0,i.jsxs)(l.Z,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{marginBottom:"20px"},children:[(0,i.jsxs)(d.Z,{"aria-label":"breadcrumbs",children:[(0,i.jsx)(h.Z,{onClick:()=>{e.push("/datastores")},underline:"hover",color:"neutral",fontSize:"inherit",children:"Knowledge Space"},"Knowledge Space"),(0,i.jsx)(p.ZP,{fontSize:"inherit",children:"Documents"})]}),(0,i.jsx)(u.Z,{variant:"outlined",onClick:()=>m(!0),children:"+ Add Datasource"})]}),b.length?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(g.Z,{color:"primary",variant:"plain",size:"lg",sx:{"& tbody tr: hover":{backgroundColor:"light"===a?"rgb(246, 246, 246)":"rgb(33, 33, 40)"},"& tbody tr: hover a":{textDecoration:"underline"}},children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:"Name"}),(0,i.jsx)("th",{children:"Type"}),(0,i.jsx)("th",{children:"Size"}),(0,i.jsx)("th",{children:"Last Synch"}),(0,i.jsx)("th",{children:"Status"}),(0,i.jsx)("th",{children:"Result"}),(0,i.jsx)("th",{children:"Operation"})]})}),(0,i.jsx)("tbody",{children:b.map(a=>(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:a.doc_name}),(0,i.jsx)("td",{children:(0,i.jsx)(H,{variant:"solid",color:"neutral",sx:{opacity:.5},children:a.doc_type})}),(0,i.jsxs)("td",{children:[a.chunk_size," chunks"]}),(0,i.jsx)("td",{children:$()(a.last_sync).format("YYYY-MM-DD HH:MM:SS")}),(0,i.jsx)("td",{children:(0,i.jsx)(H,{sx:{opacity:.5},variant:"solid",color:function(){switch(a.status){case"TODO":return"neutral";case"RUNNING":return"primary";case"FINISHED":return"success";case"FAILED":return"danger"}}(),children:a.status})}),(0,i.jsx)("td",{children:"TODO"===a.status||"RUNNING"===a.status?"":"FINISHED"===a.status?(0,i.jsx)(Y.Z,{content:a.result,trigger:"hover",children:(0,i.jsx)(H,{variant:"solid",color:"success",sx:{opacity:.5},children:"SUCCESS"})}):(0,i.jsx)(Y.Z,{content:a.result,trigger:"hover",children:(0,i.jsx)(H,{variant:"solid",color:"danger",sx:{opacity:.5},children:"FAILED"})})}),(0,i.jsx)("td",{children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(u.Z,{variant:"outlined",size:"sm",sx:{marginRight:"20px"},onClick:async()=>{let e=await fetch("".concat("https://u158074-879a-d00019a9.westa.seetacloud.com:8443","/knowledge/").concat(t,"/document/sync"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({doc_ids:[a.id]})}),i=await e.json();i.success?G.ZP.success("success"):G.ZP.error(i.err_msg||"failed")},children:["Synch",(0,i.jsx)(B.Z,{})]}),(0,i.jsx)(u.Z,{variant:"outlined",size:"sm",onClick:()=>{e.push("/datastores/documents/chunklist?spacename=".concat(t,"&documentid=").concat(a.id))},children:"Details"})]})})]},a.id))})]}),(0,i.jsx)(l.Z,{direction:"row",justifyContent:"flex-end",sx:{marginTop:"20px"},children:(0,i.jsx)(K.Z,{defaultPageSize:20,showSizeChanger:!1,current:N,total:O,onChange:async e=>{let a=await fetch("".concat("https://u158074-879a-d00019a9.westa.seetacloud.com:8443","/knowledge/").concat(t,"/document/list"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({page:e,page_size:20})}),i=await a.json();i.success&&(y(i.data.data),I(i.data.total),R(i.data.page))},hideOnSinglePage:!0})})]}):(0,i.jsx)(i.Fragment,{}),(0,i.jsx)(F.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center","z-index":1e3},open:r,onClose:()=>m(!1),children:(0,i.jsxs)(s.Z,{variant:"outlined",sx:{width:800,borderRadius:"md",p:3,boxShadow:"lg"},children:[(0,i.jsx)(E.Z,{sx:{width:"100%"},children:(0,i.jsx)(l.Z,{spacing:2,direction:"row",children:Q.map((e,t)=>(0,i.jsxs)(q,{sx:{fontWeight:x===t?"bold":"",color:x===t?"#814DDE":""},children:[t(0,i.jsxs)(s.Z,{sx:{boxSizing:"border-box",height:"80px",padding:"12px",display:"flex",flexDirection:"column",justifyContent:"space-between",border:"1px solid gray",borderRadius:"6px",marginBottom:"20px",cursor:"pointer"},onClick:()=>{C(e.type),v(1)},children:[(0,i.jsx)(s.Z,{sx:{fontSize:"20px",fontWeight:"bold"},children:e.title}),(0,i.jsx)(s.Z,{children:e.subTitle})]},e.type))})}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(E.Z,{sx:{margin:"30px auto"},children:["Name:",(0,i.jsx)(J.ZP,{placeholder:"Please input the name",onChange:e=>w(e.target.value),sx:{marginBottom:"20px"}}),"webPage"===f?(0,i.jsxs)(i.Fragment,{children:["Web Page URL:",(0,i.jsx)(J.ZP,{placeholder:"Please input the Web Page URL",onChange:e=>S(e.target.value)})]}):"file"===f?(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(X,{name:"file",multiple:!1,onChange(e){var t;if(console.log(e),0===e.fileList.length){z(null),w("");return}z(e.file.originFileObj),w(null===(t=e.file.originFileObj)||void 0===t?void 0:t.name)},children:[(0,i.jsx)("p",{className:"ant-upload-drag-icon",children:(0,i.jsx)(U.Z,{})}),(0,i.jsx)("p",{style:{color:"rgb(22, 108, 255)",fontSize:"20px"},children:"Select or Drop file"}),(0,i.jsx)("p",{className:"ant-upload-hint",style:{color:"rgb(22, 108, 255)"},children:"PDF, PowerPoint, Excel, Word, Text, Markdown,"})]})}):(0,i.jsxs)(i.Fragment,{children:["Text Source(Optional):",(0,i.jsx)(J.ZP,{placeholder:"Please input the text source",onChange:e=>_(e.target.value),sx:{marginBottom:"20px"}}),"Text:",(0,i.jsx)(W.Z,{onChange:e=>T(e.target.value),minRows:4,sx:{marginBottom:"20px"}})]}),(0,i.jsx)(p.ZP,{component:"label",sx:{marginTop:"20px"},endDecorator:(0,i.jsx)(M.Z,{checked:L,onChange:e=>V(e.target.checked)}),children:"Synch:"})]}),(0,i.jsxs)(l.Z,{direction:"row",justifyContent:"flex-start",alignItems:"center",sx:{marginBottom:"20px"},children:[(0,i.jsx)(u.Z,{variant:"outlined",sx:{marginRight:"20px"},onClick:()=>v(0),children:"< Back"}),(0,i.jsx)(u.Z,{variant:"outlined",onClick:async()=>{if(""===Z){G.ZP.error("Please input the name");return}if("webPage"===f){if(""===j){G.ZP.error("Please input the Web Page URL");return}let e=await fetch("".concat("https://u158074-879a-d00019a9.westa.seetacloud.com:8443","/knowledge/").concat(t,"/document/add"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({doc_name:Z,content:j,doc_type:"URL"})}),a=await e.json();if(a.success&&L&&fetch("".concat("https://u158074-879a-d00019a9.westa.seetacloud.com:8443","/knowledge/").concat(t,"/document/sync"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({doc_ids:[a.data]})}),a.success){G.ZP.success("success"),m(!1);let e=await fetch("".concat("https://u158074-879a-d00019a9.westa.seetacloud.com:8443","/knowledge/").concat(t,"/document/list"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({page:N,page_size:20})}),a=await e.json();a.success&&(y(a.data.data),I(a.data.total),R(a.data.page))}else G.ZP.error(a.err_msg||"failed")}else if("file"===f){if(!k){G.ZP.error("Please select a file");return}let e=new FormData;e.append("doc_name",Z),e.append("doc_file",k),e.append("doc_type","DOCUMENT");let a=await fetch("".concat("https://u158074-879a-d00019a9.westa.seetacloud.com:8443","/knowledge/").concat(t,"/document/upload"),{method:"POST",body:e}),i=await a.json();if(i.success&&L&&fetch("".concat("https://u158074-879a-d00019a9.westa.seetacloud.com:8443","/knowledge/").concat(t,"/document/sync"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({doc_ids:[i.data]})}),i.success){G.ZP.success("success"),m(!1);let e=await fetch("".concat("https://u158074-879a-d00019a9.westa.seetacloud.com:8443","/knowledge/").concat(t,"/document/list"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({page:N,page_size:20})}),a=await e.json();a.success&&(y(a.data.data),I(a.data.total),R(a.data.page))}else G.ZP.error(i.err_msg||"failed")}else{if(""===D){G.ZP.error("Please input the text");return}let e=await fetch("".concat("https://u158074-879a-d00019a9.westa.seetacloud.com:8443","/knowledge/").concat(t,"/document/add"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({doc_name:Z,source:P,content:D,doc_type:"TEXT"})}),a=await e.json();if(a.success&&L&&fetch("".concat("https://u158074-879a-d00019a9.westa.seetacloud.com:8443","/knowledge/").concat(t,"/document/sync"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({doc_ids:[a.data]})}),a.success){G.ZP.success("success"),m(!1);let e=await fetch("".concat("https://u158074-879a-d00019a9.westa.seetacloud.com:8443","/knowledge/").concat(t,"/document/list"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({page:N,page_size:20})}),a=await e.json();a.success&&(y(a.data.data),I(a.data.total),R(a.data.page))}else G.ZP.error(a.err_msg||"failed")}},children:"Finish"})]})]})]})})]})}}},function(e){e.O(0,[550,430,577,86,693,118,440,672,55,642,253,769,744],function(){return e(e.s=78273)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/datastores/documents/page-8115d00a8bdfbea1.js b/pilot/server/static/_next/static/chunks/app/datastores/documents/page-8115d00a8bdfbea1.js new file mode 100644 index 000000000..bd0b42f1e --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/datastores/documents/page-8115d00a8bdfbea1.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[470],{78141:function(e,t,i){"use strict";var a=i(78997);t.Z=void 0;var r=a(i(76906)),n=i(9268),o=(0,r.default)((0,n.jsx)("path",{d:"m19 8-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3l-4-4zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4H6z"}),"Cached");t.Z=o},78273:function(e,t,i){Promise.resolve().then(i.bind(i,16692))},16692:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return ei}});var a=i(9268),r=i(56008),n=i(86006),o=i(50645),s=i(5737),l=i(78635),c=i(70900),d=i(44334),h=i(311),p=i(22046),u=i(53113),g=i(83192),m=i(46750),x=i(40431),v=i(89791),f=i(47562),C=i(46319),b=i(53832),j=i(49657),Z=i(88930),y=i(47093),P=i(18587);function S(e){return(0,P.d6)("MuiChip",e)}let w=(0,P.sI)("MuiChip",["root","clickable","colorPrimary","colorNeutral","colorDanger","colorInfo","colorSuccess","colorWarning","colorContext","disabled","endDecorator","focusVisible","label","labelSm","labelMd","labelLg","sizeSm","sizeMd","sizeLg","startDecorator","variantPlain","variantSolid","variantSoft","variantOutlined"]),_=n.createContext({disabled:void 0,variant:void 0,color:void 0});var k=i(326);let z=["children","className","color","slotProps","onClick","disabled","size","variant","startDecorator","endDecorator"],R=e=>{let{disabled:t,size:i,color:a,clickable:r,variant:n,focusVisible:o}=e,s={root:["root",t&&"disabled",a&&`color${(0,b.Z)(a)}`,i&&`size${(0,b.Z)(i)}`,n&&`variant${(0,b.Z)(n)}`,r&&"clickable"],action:["action",t&&"disabled",o&&"focusVisible"],label:["label",i&&`label${(0,b.Z)(i)}`],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return(0,f.Z)(s,S,{})},D=(0,o.Z)("div",{name:"JoyChip",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var i,a,r,n,o,s;return[(0,x.Z)({"--Chip-decoratorChildOffset":"min(calc(var(--Chip-paddingInline) - (var(--_Chip-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Chip-decoratorChildHeight)) / 2), var(--Chip-paddingInline))","--Chip-decoratorChildRadius":"max(var(--_Chip-radius) - var(--variant-borderWidth, 0px) - var(--_Chip-paddingBlock), min(var(--_Chip-paddingBlock) + var(--variant-borderWidth, 0px), var(--_Chip-radius) / 2))","--Chip-deleteRadius":"var(--Chip-decoratorChildRadius)","--Chip-deleteSize":"var(--Chip-decoratorChildHeight)","--Avatar-radius":"var(--Chip-decoratorChildRadius)","--Avatar-size":"var(--Chip-decoratorChildHeight)","--Icon-margin":"initial","--unstable_actionRadius":"var(--_Chip-radius)"},"sm"===t.size&&{"--Chip-gap":"0.25rem","--Chip-paddingInline":"0.5rem","--Chip-decoratorChildHeight":"calc(min(1.125rem, var(--_Chip-minHeight)) - 2 * var(--variant-borderWidth, 0px))","--Icon-fontSize":"calc(var(--_Chip-minHeight) / 1.714)","--_Chip-minHeight":"var(--Chip-minHeight, 1.5rem)",fontSize:e.vars.fontSize.xs},"md"===t.size&&{"--Chip-gap":"0.375rem","--Chip-paddingInline":"0.75rem","--Chip-decoratorChildHeight":"min(1.375rem, var(--_Chip-minHeight))","--Icon-fontSize":"calc(var(--_Chip-minHeight) / 1.778)","--_Chip-minHeight":"var(--Chip-minHeight, 2rem)",fontSize:e.vars.fontSize.sm},"lg"===t.size&&{"--Chip-gap":"0.5rem","--Chip-paddingInline":"1rem","--Chip-decoratorChildHeight":"min(1.75rem, var(--_Chip-minHeight))","--Icon-fontSize":"calc(var(--_Chip-minHeight) / 2)","--_Chip-minHeight":"var(--Chip-minHeight, 2.5rem)",fontSize:e.vars.fontSize.md},{"--_Chip-radius":"var(--Chip-radius, 1.5rem)","--_Chip-paddingBlock":"max((var(--_Chip-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Chip-decoratorChildHeight)) / 2, 0px)",minHeight:"var(--_Chip-minHeight)",paddingInline:"var(--Chip-paddingInline)",borderRadius:"var(--_Chip-radius)",position:"relative",fontWeight:e.vars.fontWeight.md,fontFamily:e.vars.fontFamily.body,display:"inline-flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap",textDecoration:"none",verticalAlign:"middle",boxSizing:"border-box",[`&.${w.disabled}`]:{color:null==(i=e.variants[`${t.variant}Disabled`])?void 0:null==(a=i[t.color])?void 0:a.color}}),...t.clickable?[{"--variant-borderWidth":"0px",color:null==(o=e.variants[t.variant])?void 0:null==(s=o[t.color])?void 0:s.color}]:[null==(r=e.variants[t.variant])?void 0:r[t.color],{[`&.${w.disabled}`]:null==(n=e.variants[`${t.variant}Disabled`])?void 0:n[t.color]}]]}),I=(0,o.Z)("span",{name:"JoyChip",slot:"Label",overridesResolver:(e,t)=>t.label})(({ownerState:e})=>(0,x.Z)({display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",order:1,minInlineSize:0,flexGrow:1},e.clickable&&{zIndex:1,pointerEvents:"none"})),H=(0,o.Z)("button",{name:"JoyChip",slot:"Action",overridesResolver:(e,t)=>t.action})(({theme:e,ownerState:t})=>{var i,a,r,n;return[{position:"absolute",zIndex:0,top:0,left:0,bottom:0,right:0,border:"none",cursor:"pointer",padding:"initial",margin:"initial",backgroundColor:"initial",textDecoration:"none",borderRadius:"inherit",[e.focus.selector]:e.focus.default},null==(i=e.variants[t.variant])?void 0:i[t.color],{"&:hover":null==(a=e.variants[`${t.variant}Hover`])?void 0:a[t.color]},{"&:active":null==(r=e.variants[`${t.variant}Active`])?void 0:r[t.color]},{[`&.${w.disabled}`]:null==(n=e.variants[`${t.variant}Disabled`])?void 0:n[t.color]}]}),N=(0,o.Z)("span",{name:"JoyChip",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({"--Avatar-marginInlineStart":"calc(var(--Chip-decoratorChildOffset) * -1)","--Chip-deleteMargin":"0 0 0 calc(var(--Chip-decoratorChildOffset) * -1)","--Icon-margin":"0 0 0 calc(var(--Chip-paddingInline) / -4)",display:"inherit",marginInlineEnd:"var(--Chip-gap)",order:0,zIndex:1,pointerEvents:"none"}),F=(0,o.Z)("span",{name:"JoyChip",slot:"EndDecorator",overridesResolver:(e,t)=>t.endDecorator})({"--Chip-deleteMargin":"0 calc(var(--Chip-decoratorChildOffset) * -1) 0 0","--Icon-margin":"0 calc(var(--Chip-paddingInline) / -4) 0 0",display:"inherit",marginInlineStart:"var(--Chip-gap)",order:2,zIndex:1,pointerEvents:"none"}),T=n.forwardRef(function(e,t){let i=(0,Z.Z)({props:e,name:"JoyChip"}),{children:r,className:o,color:s="primary",slotProps:l={},onClick:c,disabled:d=!1,size:h="md",variant:p="solid",startDecorator:u,endDecorator:g}=i,f=(0,m.Z)(i,z),{getColor:b}=(0,y.VT)(p),P=b(e.color,s),S=!!c||!!l.action,w=(0,x.Z)({},i,{disabled:d,size:h,color:P,variant:p,clickable:S,focusVisible:!1}),T="function"==typeof l.action?l.action(w):l.action,O=n.useRef(null),{focusVisible:E,getRootProps:W}=(0,C.Z)((0,x.Z)({},T,{disabled:d,ref:O}));w.focusVisible=E;let L=R(w),M=(0,x.Z)({},f,{slotProps:l}),[A,U]=(0,k.Z)("root",{ref:t,className:(0,v.Z)(L.root,o),elementType:D,externalForwardedProps:M,ownerState:w}),[$,B]=(0,k.Z)("label",{className:L.label,elementType:I,externalForwardedProps:M,ownerState:w}),J=(0,j.Z)(B.id),[V,Y]=(0,k.Z)("action",{className:L.action,elementType:H,externalForwardedProps:M,ownerState:w,getSlotProps:W,additionalProps:{"aria-labelledby":J,as:null==T?void 0:T.component,onClick:c}}),[G,K]=(0,k.Z)("startDecorator",{className:L.startDecorator,elementType:N,externalForwardedProps:M,ownerState:w}),[X,q]=(0,k.Z)("endDecorator",{className:L.endDecorator,elementType:F,externalForwardedProps:M,ownerState:w}),Q=n.useMemo(()=>({disabled:d,variant:p,color:"context"===P?void 0:P}),[P,d,p]);return(0,a.jsx)(_.Provider,{value:Q,children:(0,a.jsxs)(A,(0,x.Z)({},U,{children:[S&&(0,a.jsx)(V,(0,x.Z)({},Y)),(0,a.jsx)($,(0,x.Z)({},B,{id:J,children:r})),u&&(0,a.jsx)(G,(0,x.Z)({},K,{children:u})),g&&(0,a.jsx)(X,(0,x.Z)({},q,{children:g}))]}))})});var O=i(11437),E=i(90545),W=i(35086),L=i(866),M=i(28086),A=i(65326),U=i.n(A),$=i(72474),B=i(59534),J=i(78141),V=i(50157),Y=i(23910),G=i(21628),K=i(1031),X=i(78915);let{Dragger:q}=V.default,Q=(0,o.Z)(s.Z)(e=>{let{theme:t}=e;return{width:"50%",backgroundColor:"dark"===t.palette.mode?t.palette.background.level1:"#fff",...t.typography.body2,padding:t.spacing(1),textAlign:"center",borderRadius:4,color:t.vars.palette.text.secondary}}),ee=["Choose a Datasource type","Setup the Datasource"],et=[{type:"text",title:"Text",subTitle:"Fill your raw text"},{type:"webPage",title:"URL",subTitle:"Fetch the content of a URL"},{type:"file",title:"Document",subTitle:"Upload a document, document type can be PDF, CSV, Text, PowerPoint, Word, Markdown"}];var ei=()=>{let e=(0,r.useRouter)(),t=(0,r.useSearchParams)().get("name"),{mode:i}=(0,l.tv)(),[o,m]=(0,n.useState)(!1),[x,v]=(0,n.useState)(0),[f,C]=(0,n.useState)(""),[b,j]=(0,n.useState)([]),[Z,y]=(0,n.useState)(""),[P,S]=(0,n.useState)(""),[w,_]=(0,n.useState)(""),[k,z]=(0,n.useState)(""),[R,D]=(0,n.useState)(null),[I,H]=(0,n.useState)(0),[N,F]=(0,n.useState)(0),[A,V]=(0,n.useState)(!0);return(0,n.useEffect)(()=>{(async function(){let e=await (0,X.PR)("/knowledge/".concat(t,"/document/list"),{page:1,page_size:20});e.success&&(j(e.data.data),H(e.data.total),F(e.data.page))})()},[]),(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsxs)(c.Z,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{marginBottom:"20px"},children:[(0,a.jsxs)(d.Z,{"aria-label":"breadcrumbs",children:[(0,a.jsx)(h.Z,{onClick:()=>{e.push("/datastores")},underline:"hover",color:"neutral",fontSize:"inherit",children:"Knowledge Space"},"Knowledge Space"),(0,a.jsx)(p.ZP,{fontSize:"inherit",children:"Documents"})]}),(0,a.jsx)(u.Z,{variant:"outlined",onClick:()=>m(!0),children:"+ Add Datasource"})]}),b.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(g.Z,{color:"primary",variant:"plain",size:"lg",sx:{"& tbody tr: hover":{backgroundColor:"light"===i?"rgb(246, 246, 246)":"rgb(33, 33, 40)"},"& tbody tr: hover a":{textDecoration:"underline"}},children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{children:"Name"}),(0,a.jsx)("th",{children:"Type"}),(0,a.jsx)("th",{children:"Size"}),(0,a.jsx)("th",{children:"Last Synch"}),(0,a.jsx)("th",{children:"Status"}),(0,a.jsx)("th",{children:"Result"}),(0,a.jsx)("th",{children:"Operation"})]})}),(0,a.jsx)("tbody",{children:b.map(i=>(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{children:i.doc_name}),(0,a.jsx)("td",{children:(0,a.jsx)(T,{variant:"solid",color:"neutral",sx:{opacity:.5},children:i.doc_type})}),(0,a.jsxs)("td",{children:[i.chunk_size," chunks"]}),(0,a.jsx)("td",{children:U()(i.last_sync).format("YYYY-MM-DD HH:MM:SS")}),(0,a.jsx)("td",{children:(0,a.jsx)(T,{sx:{opacity:.5},variant:"solid",color:function(){switch(i.status){case"TODO":return"neutral";case"RUNNING":return"primary";case"FINISHED":return"success";case"FAILED":return"danger"}}(),children:i.status})}),(0,a.jsx)("td",{children:"TODO"===i.status||"RUNNING"===i.status?"":"FINISHED"===i.status?(0,a.jsx)(Y.Z,{content:i.result,trigger:"hover",children:(0,a.jsx)(T,{variant:"solid",color:"success",sx:{opacity:.5},children:"SUCCESS"})}):(0,a.jsx)(Y.Z,{content:i.result,trigger:"hover",children:(0,a.jsx)(T,{variant:"solid",color:"danger",sx:{opacity:.5},children:"FAILED"})})}),(0,a.jsx)("td",{children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(u.Z,{variant:"outlined",size:"sm",sx:{marginRight:"20px"},onClick:async()=>{let e=await (0,X.PR)("/knowledge/".concat(t,"/document/sync"),{doc_ids:[i.id]});e.success?G.ZP.success("success"):G.ZP.error(e.err_msg||"failed")},children:["Synch",(0,a.jsx)(J.Z,{})]}),(0,a.jsx)(u.Z,{variant:"outlined",size:"sm",onClick:()=>{e.push("/datastores/documents/chunklist?spacename=".concat(t,"&documentid=").concat(i.id))},children:"Details"})]})})]},i.id))})]}),(0,a.jsx)(c.Z,{direction:"row",justifyContent:"flex-end",sx:{marginTop:"20px"},children:(0,a.jsx)(K.Z,{defaultPageSize:20,showSizeChanger:!1,current:N,total:I,onChange:async e=>{let i=await (0,X.PR)("/knowledge/".concat(t,"/document/list"),{page:e,page_size:20});i.success&&(j(i.data.data),H(i.data.total),F(i.data.page))},hideOnSinglePage:!0})})]}):(0,a.jsx)(a.Fragment,{}),(0,a.jsx)(O.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center","z-index":1e3},open:o,onClose:()=>m(!1),children:(0,a.jsxs)(s.Z,{variant:"outlined",sx:{width:800,borderRadius:"md",p:3,boxShadow:"lg"},children:[(0,a.jsx)(E.Z,{sx:{width:"100%"},children:(0,a.jsx)(c.Z,{spacing:2,direction:"row",children:ee.map((e,t)=>(0,a.jsxs)(Q,{sx:{fontWeight:x===t?"bold":"",color:x===t?"#2AA3FF":""},children:[t(0,a.jsxs)(s.Z,{sx:{boxSizing:"border-box",height:"80px",padding:"12px",display:"flex",flexDirection:"column",justifyContent:"space-between",border:"1px solid gray",borderRadius:"6px",marginBottom:"20px",cursor:"pointer"},onClick:()=>{C(e.type),v(1)},children:[(0,a.jsx)(s.Z,{sx:{fontSize:"20px",fontWeight:"bold"},children:e.title}),(0,a.jsx)(s.Z,{children:e.subTitle})]},e.type))})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(E.Z,{sx:{margin:"30px auto"},children:["Name:",(0,a.jsx)(W.ZP,{placeholder:"Please input the name",onChange:e=>S(e.target.value),sx:{marginBottom:"20px"}}),"webPage"===f?(0,a.jsxs)(a.Fragment,{children:["Web Page URL:",(0,a.jsx)(W.ZP,{placeholder:"Please input the Web Page URL",onChange:e=>y(e.target.value)})]}):"file"===f?(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(q,{name:"file",multiple:!1,onChange(e){var t;if(console.log(e),0===e.fileList.length){D(null),S("");return}D(e.file.originFileObj),S(null===(t=e.file.originFileObj)||void 0===t?void 0:t.name)},children:[(0,a.jsx)("p",{className:"ant-upload-drag-icon",children:(0,a.jsx)($.Z,{})}),(0,a.jsx)("p",{style:{color:"rgb(22, 108, 255)",fontSize:"20px"},children:"Select or Drop file"}),(0,a.jsx)("p",{className:"ant-upload-hint",style:{color:"rgb(22, 108, 255)"},children:"PDF, PowerPoint, Excel, Word, Text, Markdown,"})]})}):(0,a.jsxs)(a.Fragment,{children:["Text Source(Optional):",(0,a.jsx)(W.ZP,{placeholder:"Please input the text source",onChange:e=>_(e.target.value),sx:{marginBottom:"20px"}}),"Text:",(0,a.jsx)(L.Z,{onChange:e=>z(e.target.value),minRows:4,sx:{marginBottom:"20px"}})]}),(0,a.jsx)(p.ZP,{component:"label",sx:{marginTop:"20px"},endDecorator:(0,a.jsx)(M.Z,{checked:A,onChange:e=>V(e.target.checked)}),children:"Synch:"})]}),(0,a.jsxs)(c.Z,{direction:"row",justifyContent:"flex-start",alignItems:"center",sx:{marginBottom:"20px"},children:[(0,a.jsx)(u.Z,{variant:"outlined",sx:{marginRight:"20px"},onClick:()=>v(0),children:"< Back"}),(0,a.jsx)(u.Z,{variant:"outlined",onClick:async()=>{if(""===P){G.ZP.error("Please input the name");return}if("webPage"===f){if(""===Z){G.ZP.error("Please input the Web Page URL");return}let e=await (0,X.PR)("/knowledge/".concat(t,"/document/add"),{doc_name:P,content:Z,doc_type:"URL"});if(e.success&&A&&(0,X.PR)("/knowledge/".concat(t,"/document/sync"),{doc_ids:[e.data]}),e.success){G.ZP.success("success"),m(!1);let e=await (0,X.PR)("/knowledge/".concat(t,"/document/list"),{page:N,page_size:20});e.success&&(j(e.data.data),H(e.data.total),F(e.data.page))}else G.ZP.error(e.err_msg||"failed")}else if("file"===f){if(!R){G.ZP.error("Please select a file");return}let e=new FormData;e.append("doc_name",P),e.append("doc_file",R),e.append("doc_type","DOCUMENT");let i=await (0,X.Ej)("/knowledge/".concat(t,"/document/upload"),e);if(i.success&&A&&(0,X.PR)("/knowledge/".concat(t,"/document/sync"),{doc_ids:[i.data]}),i.success){G.ZP.success("success"),m(!1);let e=await (0,X.PR)("/knowledge/".concat(t,"/document/list"),{page:N,page_size:20});e.success&&(j(e.data.data),H(e.data.total),F(e.data.page))}else G.ZP.error(i.err_msg||"failed")}else{if(""===k){G.ZP.error("Please input the text");return}let e=await (0,X.PR)("/knowledge/".concat(t,"/document/add"),{doc_name:P,source:w,content:k,doc_type:"TEXT"});if(e.success&&A&&(0,X.PR)("/knowledge/".concat(t,"/document/sync"),{doc_ids:[e.data]}),e.success){G.ZP.success("success"),m(!1);let e=await (0,X.PR)("/knowledge/".concat(t,"/document/list"),{page:N,page_size:20});e.success&&(j(e.data.data),H(e.data.total),F(e.data.page))}else G.ZP.error(e.err_msg||"failed")}},children:"Finish"})]})]})]})})]})}},78915:function(e,t,i){"use strict";i.d(t,{Tk:function(){return d},Kw:function(){return h},PR:function(){return p},Ej:function(){return u}});var a=i(21628),r=i(24214),n=i(52040);let o=r.Z.create({baseURL:n.env.API_BASE_URL});o.defaults.timeout=1e4,o.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var s=i(84835);let l={"content-type":"application/json"},c=e=>{if(!(0,s.isPlainObject)(e))return JSON.stringify(e);let t={...e};for(let e in t){let i=t[e];"string"==typeof i&&(t[e]=i.trim())}return JSON.stringify(t)},d=(e,t)=>{if(t){let i=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");i&&(e+="?".concat(i))}return o.get("/api"+e,{headers:l}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})},h=(e,t)=>{let i=c(t);return o.post("/api"+e,{body:i,headers:l}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})},p=(e,t)=>(c(t),o.post(e,t,{headers:l}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})),u=(e,t)=>o.post(e,t).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})}},function(e){e.O(0,[180,550,106,685,86,693,118,440,672,55,642,253,769,744],function(){return e(e.s=78273)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/datastores/documents/page-f2924b84161ca39e.js b/pilot/server/static/_next/static/chunks/app/datastores/documents/page-f2924b84161ca39e.js new file mode 100644 index 000000000..6e7e2046a --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/datastores/documents/page-f2924b84161ca39e.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[470],{78141:function(e,t,i){"use strict";var a=i(78997);t.Z=void 0;var r=a(i(76906)),n=i(9268),o=(0,r.default)((0,n.jsx)("path",{d:"m19 8-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3l-4-4zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4H6z"}),"Cached");t.Z=o},78273:function(e,t,i){Promise.resolve().then(i.bind(i,16692))},16692:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return ei}});var a=i(9268),r=i(56008),n=i(86006),o=i(50645),s=i(5737),l=i(78635),c=i(70900),d=i(44334),h=i(311),p=i(22046),u=i(53113),g=i(83192),m=i(46750),x=i(40431),v=i(89791),f=i(47562),C=i(46319),b=i(53832),j=i(49657),Z=i(88930),y=i(47093),P=i(18587);function S(e){return(0,P.d6)("MuiChip",e)}let w=(0,P.sI)("MuiChip",["root","clickable","colorPrimary","colorNeutral","colorDanger","colorInfo","colorSuccess","colorWarning","colorContext","disabled","endDecorator","focusVisible","label","labelSm","labelMd","labelLg","sizeSm","sizeMd","sizeLg","startDecorator","variantPlain","variantSolid","variantSoft","variantOutlined"]),_=n.createContext({disabled:void 0,variant:void 0,color:void 0});var k=i(326);let D=["children","className","color","slotProps","onClick","disabled","size","variant","startDecorator","endDecorator"],z=e=>{let{disabled:t,size:i,color:a,clickable:r,variant:n,focusVisible:o}=e,s={root:["root",t&&"disabled",a&&`color${(0,b.Z)(a)}`,i&&`size${(0,b.Z)(i)}`,n&&`variant${(0,b.Z)(n)}`,r&&"clickable"],action:["action",t&&"disabled",o&&"focusVisible"],label:["label",i&&`label${(0,b.Z)(i)}`],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return(0,f.Z)(s,S,{})},R=(0,o.Z)("div",{name:"JoyChip",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var i,a,r,n,o,s;return[(0,x.Z)({"--Chip-decoratorChildOffset":"min(calc(var(--Chip-paddingInline) - (var(--_Chip-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Chip-decoratorChildHeight)) / 2), var(--Chip-paddingInline))","--Chip-decoratorChildRadius":"max(var(--_Chip-radius) - var(--variant-borderWidth, 0px) - var(--_Chip-paddingBlock), min(var(--_Chip-paddingBlock) + var(--variant-borderWidth, 0px), var(--_Chip-radius) / 2))","--Chip-deleteRadius":"var(--Chip-decoratorChildRadius)","--Chip-deleteSize":"var(--Chip-decoratorChildHeight)","--Avatar-radius":"var(--Chip-decoratorChildRadius)","--Avatar-size":"var(--Chip-decoratorChildHeight)","--Icon-margin":"initial","--unstable_actionRadius":"var(--_Chip-radius)"},"sm"===t.size&&{"--Chip-gap":"0.25rem","--Chip-paddingInline":"0.5rem","--Chip-decoratorChildHeight":"calc(min(1.125rem, var(--_Chip-minHeight)) - 2 * var(--variant-borderWidth, 0px))","--Icon-fontSize":"calc(var(--_Chip-minHeight) / 1.714)","--_Chip-minHeight":"var(--Chip-minHeight, 1.5rem)",fontSize:e.vars.fontSize.xs},"md"===t.size&&{"--Chip-gap":"0.375rem","--Chip-paddingInline":"0.75rem","--Chip-decoratorChildHeight":"min(1.375rem, var(--_Chip-minHeight))","--Icon-fontSize":"calc(var(--_Chip-minHeight) / 1.778)","--_Chip-minHeight":"var(--Chip-minHeight, 2rem)",fontSize:e.vars.fontSize.sm},"lg"===t.size&&{"--Chip-gap":"0.5rem","--Chip-paddingInline":"1rem","--Chip-decoratorChildHeight":"min(1.75rem, var(--_Chip-minHeight))","--Icon-fontSize":"calc(var(--_Chip-minHeight) / 2)","--_Chip-minHeight":"var(--Chip-minHeight, 2.5rem)",fontSize:e.vars.fontSize.md},{"--_Chip-radius":"var(--Chip-radius, 1.5rem)","--_Chip-paddingBlock":"max((var(--_Chip-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Chip-decoratorChildHeight)) / 2, 0px)",minHeight:"var(--_Chip-minHeight)",paddingInline:"var(--Chip-paddingInline)",borderRadius:"var(--_Chip-radius)",position:"relative",fontWeight:e.vars.fontWeight.md,fontFamily:e.vars.fontFamily.body,display:"inline-flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap",textDecoration:"none",verticalAlign:"middle",boxSizing:"border-box",[`&.${w.disabled}`]:{color:null==(i=e.variants[`${t.variant}Disabled`])?void 0:null==(a=i[t.color])?void 0:a.color}}),...t.clickable?[{"--variant-borderWidth":"0px",color:null==(o=e.variants[t.variant])?void 0:null==(s=o[t.color])?void 0:s.color}]:[null==(r=e.variants[t.variant])?void 0:r[t.color],{[`&.${w.disabled}`]:null==(n=e.variants[`${t.variant}Disabled`])?void 0:n[t.color]}]]}),I=(0,o.Z)("span",{name:"JoyChip",slot:"Label",overridesResolver:(e,t)=>t.label})(({ownerState:e})=>(0,x.Z)({display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",order:1,minInlineSize:0,flexGrow:1},e.clickable&&{zIndex:1,pointerEvents:"none"})),H=(0,o.Z)("button",{name:"JoyChip",slot:"Action",overridesResolver:(e,t)=>t.action})(({theme:e,ownerState:t})=>{var i,a,r,n;return[{position:"absolute",zIndex:0,top:0,left:0,bottom:0,right:0,border:"none",cursor:"pointer",padding:"initial",margin:"initial",backgroundColor:"initial",textDecoration:"none",borderRadius:"inherit",[e.focus.selector]:e.focus.default},null==(i=e.variants[t.variant])?void 0:i[t.color],{"&:hover":null==(a=e.variants[`${t.variant}Hover`])?void 0:a[t.color]},{"&:active":null==(r=e.variants[`${t.variant}Active`])?void 0:r[t.color]},{[`&.${w.disabled}`]:null==(n=e.variants[`${t.variant}Disabled`])?void 0:n[t.color]}]}),N=(0,o.Z)("span",{name:"JoyChip",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({"--Avatar-marginInlineStart":"calc(var(--Chip-decoratorChildOffset) * -1)","--Chip-deleteMargin":"0 0 0 calc(var(--Chip-decoratorChildOffset) * -1)","--Icon-margin":"0 0 0 calc(var(--Chip-paddingInline) / -4)",display:"inherit",marginInlineEnd:"var(--Chip-gap)",order:0,zIndex:1,pointerEvents:"none"}),T=(0,o.Z)("span",{name:"JoyChip",slot:"EndDecorator",overridesResolver:(e,t)=>t.endDecorator})({"--Chip-deleteMargin":"0 calc(var(--Chip-decoratorChildOffset) * -1) 0 0","--Icon-margin":"0 calc(var(--Chip-paddingInline) / -4) 0 0",display:"inherit",marginInlineStart:"var(--Chip-gap)",order:2,zIndex:1,pointerEvents:"none"}),F=n.forwardRef(function(e,t){let i=(0,Z.Z)({props:e,name:"JoyChip"}),{children:r,className:o,color:s="primary",slotProps:l={},onClick:c,disabled:d=!1,size:h="md",variant:p="solid",startDecorator:u,endDecorator:g}=i,f=(0,m.Z)(i,D),{getColor:b}=(0,y.VT)(p),P=b(e.color,s),S=!!c||!!l.action,w=(0,x.Z)({},i,{disabled:d,size:h,color:P,variant:p,clickable:S,focusVisible:!1}),F="function"==typeof l.action?l.action(w):l.action,O=n.useRef(null),{focusVisible:E,getRootProps:W}=(0,C.Z)((0,x.Z)({},F,{disabled:d,ref:O}));w.focusVisible=E;let M=z(w),L=(0,x.Z)({},f,{slotProps:l}),[U,$]=(0,k.Z)("root",{ref:t,className:(0,v.Z)(M.root,o),elementType:R,externalForwardedProps:L,ownerState:w}),[A,B]=(0,k.Z)("label",{className:M.label,elementType:I,externalForwardedProps:L,ownerState:w}),J=(0,j.Z)(B.id),[V,Y]=(0,k.Z)("action",{className:M.action,elementType:H,externalForwardedProps:L,ownerState:w,getSlotProps:W,additionalProps:{"aria-labelledby":J,as:null==F?void 0:F.component,onClick:c}}),[G,K]=(0,k.Z)("startDecorator",{className:M.startDecorator,elementType:N,externalForwardedProps:L,ownerState:w}),[X,q]=(0,k.Z)("endDecorator",{className:M.endDecorator,elementType:T,externalForwardedProps:L,ownerState:w}),Q=n.useMemo(()=>({disabled:d,variant:p,color:"context"===P?void 0:P}),[P,d,p]);return(0,a.jsx)(_.Provider,{value:Q,children:(0,a.jsxs)(U,(0,x.Z)({},$,{children:[S&&(0,a.jsx)(V,(0,x.Z)({},Y)),(0,a.jsx)(A,(0,x.Z)({},B,{id:J,children:r})),u&&(0,a.jsx)(G,(0,x.Z)({},K,{children:u})),g&&(0,a.jsx)(X,(0,x.Z)({},q,{children:g}))]}))})});var O=i(11437),E=i(90545),W=i(35086),M=i(866),L=i(28086),U=i(65326),$=i.n(U),A=i(72474),B=i(59534),J=i(78141),V=i(50157),Y=i(23910),G=i(21628),K=i(1031),X=i(78915);let{Dragger:q}=V.default,Q=(0,o.Z)(s.Z)(e=>{let{theme:t}=e;return{width:"50%",backgroundColor:"dark"===t.palette.mode?t.palette.background.level1:"#fff",...t.typography.body2,padding:t.spacing(1),textAlign:"center",borderRadius:4,color:t.vars.palette.text.secondary}}),ee=["Choose a Datasource type","Setup the Datasource"],et=[{type:"text",title:"Text",subTitle:"Fill your raw text"},{type:"webPage",title:"URL",subTitle:"Fetch the content of a URL"},{type:"file",title:"Document",subTitle:"Upload a document, document type can be PDF, CSV, Text, PowerPoint, Word, Markdown"}];var ei=()=>{let e=(0,r.useRouter)(),t=(0,r.useSearchParams)().get("name"),{mode:i}=(0,l.tv)(),[o,m]=(0,n.useState)(!1),[x,v]=(0,n.useState)(0),[f,C]=(0,n.useState)(""),[b,j]=(0,n.useState)([]),[Z,y]=(0,n.useState)(""),[P,S]=(0,n.useState)(""),[w,_]=(0,n.useState)(""),[k,D]=(0,n.useState)(""),[z,R]=(0,n.useState)(null),[I,H]=(0,n.useState)(0),[N,T]=(0,n.useState)(0),[U,V]=(0,n.useState)(!0);return(0,n.useEffect)(()=>{(async function(){let e=await (0,X.PR)("/knowledge/".concat(t,"/document/list"),{page:1,page_size:20});e.success&&(j(e.data.data),H(e.data.total),T(e.data.page))})()},[]),(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsxs)(c.Z,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{marginBottom:"20px"},children:[(0,a.jsxs)(d.Z,{"aria-label":"breadcrumbs",children:[(0,a.jsx)(h.Z,{onClick:()=>{e.push("/datastores")},underline:"hover",color:"neutral",fontSize:"inherit",children:"Knowledge Space"},"Knowledge Space"),(0,a.jsx)(p.ZP,{fontSize:"inherit",children:"Documents"})]}),(0,a.jsx)(u.Z,{variant:"outlined",onClick:()=>m(!0),children:"+ Add Datasource"})]}),b.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(g.Z,{color:"primary",variant:"plain",size:"lg",sx:{"& tbody tr: hover":{backgroundColor:"light"===i?"rgb(246, 246, 246)":"rgb(33, 33, 40)"},"& tbody tr: hover a":{textDecoration:"underline"}},children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{children:"Name"}),(0,a.jsx)("th",{children:"Type"}),(0,a.jsx)("th",{children:"Size"}),(0,a.jsx)("th",{children:"Last Synch"}),(0,a.jsx)("th",{children:"Status"}),(0,a.jsx)("th",{children:"Result"}),(0,a.jsx)("th",{children:"Operation"})]})}),(0,a.jsx)("tbody",{children:b.map(i=>(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{children:i.doc_name}),(0,a.jsx)("td",{children:(0,a.jsx)(F,{variant:"solid",color:"neutral",sx:{opacity:.5},children:i.doc_type})}),(0,a.jsxs)("td",{children:[i.chunk_size," chunks"]}),(0,a.jsx)("td",{children:$()(i.last_sync).format("YYYY-MM-DD HH:MM:SS")}),(0,a.jsx)("td",{children:(0,a.jsx)(F,{sx:{opacity:.5},variant:"solid",color:function(){switch(i.status){case"TODO":return"neutral";case"RUNNING":return"primary";case"FINISHED":return"success";case"FAILED":return"danger"}}(),children:i.status})}),(0,a.jsx)("td",{children:"TODO"===i.status||"RUNNING"===i.status?"":"FINISHED"===i.status?(0,a.jsx)(Y.Z,{content:i.result,trigger:"hover",children:(0,a.jsx)(F,{variant:"solid",color:"success",sx:{opacity:.5},children:"SUCCESS"})}):(0,a.jsx)(Y.Z,{content:i.result,trigger:"hover",children:(0,a.jsx)(F,{variant:"solid",color:"danger",sx:{opacity:.5},children:"FAILED"})})}),(0,a.jsx)("td",{children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(u.Z,{variant:"outlined",size:"sm",sx:{marginRight:"20px"},onClick:async()=>{let e=await (0,X.PR)("/knowledge/".concat(t,"/document/sync"),{doc_ids:[i.id]});e.success?G.ZP.success("success"):G.ZP.error(e.err_msg||"failed")},children:["Synch",(0,a.jsx)(J.Z,{})]}),(0,a.jsx)(u.Z,{variant:"outlined",size:"sm",onClick:()=>{e.push("/datastores/documents/chunklist?spacename=".concat(t,"&documentid=").concat(i.id))},children:"Details"})]})})]},i.id))})]}),(0,a.jsx)(c.Z,{direction:"row",justifyContent:"flex-end",sx:{marginTop:"20px"},children:(0,a.jsx)(K.Z,{defaultPageSize:20,showSizeChanger:!1,current:N,total:I,onChange:async e=>{let i=await (0,X.PR)("/knowledge/".concat(t,"/document/list"),{page:e,page_size:20});i.success&&(j(i.data.data),H(i.data.total),T(i.data.page))},hideOnSinglePage:!0})})]}):(0,a.jsx)(a.Fragment,{}),(0,a.jsx)(O.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center","z-index":1e3},open:o,onClose:()=>m(!1),children:(0,a.jsxs)(s.Z,{variant:"outlined",sx:{width:800,borderRadius:"md",p:3,boxShadow:"lg"},children:[(0,a.jsx)(E.Z,{sx:{width:"100%"},children:(0,a.jsx)(c.Z,{spacing:2,direction:"row",children:ee.map((e,t)=>(0,a.jsxs)(Q,{sx:{fontWeight:x===t?"bold":"",color:x===t?"#814DDE":""},children:[t(0,a.jsxs)(s.Z,{sx:{boxSizing:"border-box",height:"80px",padding:"12px",display:"flex",flexDirection:"column",justifyContent:"space-between",border:"1px solid gray",borderRadius:"6px",marginBottom:"20px",cursor:"pointer"},onClick:()=>{C(e.type),v(1)},children:[(0,a.jsx)(s.Z,{sx:{fontSize:"20px",fontWeight:"bold"},children:e.title}),(0,a.jsx)(s.Z,{children:e.subTitle})]},e.type))})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(E.Z,{sx:{margin:"30px auto"},children:["Name:",(0,a.jsx)(W.ZP,{placeholder:"Please input the name",onChange:e=>S(e.target.value),sx:{marginBottom:"20px"}}),"webPage"===f?(0,a.jsxs)(a.Fragment,{children:["Web Page URL:",(0,a.jsx)(W.ZP,{placeholder:"Please input the Web Page URL",onChange:e=>y(e.target.value)})]}):"file"===f?(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(q,{name:"file",multiple:!1,onChange(e){var t;if(console.log(e),0===e.fileList.length){R(null),S("");return}R(e.file.originFileObj),S(null===(t=e.file.originFileObj)||void 0===t?void 0:t.name)},children:[(0,a.jsx)("p",{className:"ant-upload-drag-icon",children:(0,a.jsx)(A.Z,{})}),(0,a.jsx)("p",{style:{color:"rgb(22, 108, 255)",fontSize:"20px"},children:"Select or Drop file"}),(0,a.jsx)("p",{className:"ant-upload-hint",style:{color:"rgb(22, 108, 255)"},children:"PDF, PowerPoint, Excel, Word, Text, Markdown,"})]})}):(0,a.jsxs)(a.Fragment,{children:["Text Source(Optional):",(0,a.jsx)(W.ZP,{placeholder:"Please input the text source",onChange:e=>_(e.target.value),sx:{marginBottom:"20px"}}),"Text:",(0,a.jsx)(M.Z,{onChange:e=>D(e.target.value),minRows:4,sx:{marginBottom:"20px"}})]}),(0,a.jsx)(p.ZP,{component:"label",sx:{marginTop:"20px"},endDecorator:(0,a.jsx)(L.Z,{checked:U,onChange:e=>V(e.target.checked)}),children:"Synch:"})]}),(0,a.jsxs)(c.Z,{direction:"row",justifyContent:"flex-start",alignItems:"center",sx:{marginBottom:"20px"},children:[(0,a.jsx)(u.Z,{variant:"outlined",sx:{marginRight:"20px"},onClick:()=>v(0),children:"< Back"}),(0,a.jsx)(u.Z,{variant:"outlined",onClick:async()=>{if(""===P){G.ZP.error("Please input the name");return}if("webPage"===f){if(""===Z){G.ZP.error("Please input the Web Page URL");return}let e=await (0,X.PR)("/knowledge/".concat(t,"/document/add"),{doc_name:P,content:Z,doc_type:"URL"});if(e.success&&U&&(0,X.PR)("/knowledge/".concat(t,"/document/sync"),{doc_ids:[e.data]}),e.success){G.ZP.success("success"),m(!1);let e=await (0,X.PR)("/knowledge/".concat(t,"/document/list"),{page:N,page_size:20});e.success&&(j(e.data.data),H(e.data.total),T(e.data.page))}else G.ZP.error(e.err_msg||"failed")}else if("file"===f){if(!z){G.ZP.error("Please select a file");return}let e=new FormData;e.append("doc_name",P),e.append("doc_file",z),e.append("doc_type","DOCUMENT");let i=await (0,X.Ej)("/knowledge/".concat(t,"/document/upload"),e);if(i.success&&U&&(0,X.PR)("/knowledge/".concat(t,"/document/sync"),{doc_ids:[i.data]}),i.success){G.ZP.success("success"),m(!1);let e=await (0,X.PR)("/knowledge/".concat(t,"/document/list"),{page:N,page_size:20});e.success&&(j(e.data.data),H(e.data.total),T(e.data.page))}else G.ZP.error(i.err_msg||"failed")}else{if(""===k){G.ZP.error("Please input the text");return}let e=await (0,X.PR)("/knowledge/".concat(t,"/document/add"),{doc_name:P,source:w,content:k,doc_type:"TEXT"});if(e.success&&U&&(0,X.PR)("/knowledge/".concat(t,"/document/sync"),{doc_ids:[e.data]}),e.success){G.ZP.success("success"),m(!1);let e=await (0,X.PR)("/knowledge/".concat(t,"/document/list"),{page:N,page_size:20});e.success&&(j(e.data.data),H(e.data.total),T(e.data.page))}else G.ZP.error(e.err_msg||"failed")}},children:"Finish"})]})]})]})})]})}},78915:function(e,t,i){"use strict";i.d(t,{Tk:function(){return c},Kw:function(){return d},PR:function(){return h},Ej:function(){return p}});var a=i(21628),r=i(24214);let n=r.Z.create({baseURL:"http://127.0.0.1:5000"});n.defaults.timeout=1e4,n.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var o=i(84835);let s={"content-type":"application/json"},l=e=>{if(!(0,o.isPlainObject)(e))return JSON.stringify(e);let t={...e};for(let e in t){let i=t[e];"string"==typeof i&&(t[e]=i.trim())}return JSON.stringify(t)},c=(e,t)=>{if(t){let i=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");i&&(e+="?".concat(i))}return n.get("/api"+e,{headers:s}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})},d=(e,t)=>{let i=l(t);return n.post("/api"+e,{body:i,headers:s}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})},h=(e,t)=>{let i=l(t);return n.post(e,{body:i,headers:s}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})},p=(e,t)=>n.post(e,{body:t}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})}},function(e){e.O(0,[180,550,752,685,86,693,118,440,672,55,642,253,769,744],function(){return e(e.s=78273)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/datastores/documents/page-fb24fdddd1218ddd.js b/pilot/server/static/_next/static/chunks/app/datastores/documents/page-fb24fdddd1218ddd.js new file mode 100644 index 000000000..6cfabf2eb --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/datastores/documents/page-fb24fdddd1218ddd.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[470],{78141:function(e,t,i){"use strict";var a=i(78997);t.Z=void 0;var r=a(i(76906)),n=i(9268),o=(0,r.default)((0,n.jsx)("path",{d:"m19 8-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3l-4-4zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4H6z"}),"Cached");t.Z=o},78273:function(e,t,i){Promise.resolve().then(i.bind(i,16692))},16692:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return ei}});var a=i(9268),r=i(56008),n=i(86006),o=i(50645),s=i(5737),l=i(78635),c=i(70900),d=i(44334),h=i(311),p=i(22046),u=i(53113),g=i(83192),m=i(46750),x=i(40431),v=i(89791),f=i(47562),C=i(46319),b=i(53832),j=i(49657),Z=i(88930),y=i(47093),P=i(18587);function S(e){return(0,P.d6)("MuiChip",e)}let w=(0,P.sI)("MuiChip",["root","clickable","colorPrimary","colorNeutral","colorDanger","colorInfo","colorSuccess","colorWarning","colorContext","disabled","endDecorator","focusVisible","label","labelSm","labelMd","labelLg","sizeSm","sizeMd","sizeLg","startDecorator","variantPlain","variantSolid","variantSoft","variantOutlined"]),_=n.createContext({disabled:void 0,variant:void 0,color:void 0});var k=i(326);let z=["children","className","color","slotProps","onClick","disabled","size","variant","startDecorator","endDecorator"],R=e=>{let{disabled:t,size:i,color:a,clickable:r,variant:n,focusVisible:o}=e,s={root:["root",t&&"disabled",a&&`color${(0,b.Z)(a)}`,i&&`size${(0,b.Z)(i)}`,n&&`variant${(0,b.Z)(n)}`,r&&"clickable"],action:["action",t&&"disabled",o&&"focusVisible"],label:["label",i&&`label${(0,b.Z)(i)}`],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return(0,f.Z)(s,S,{})},D=(0,o.Z)("div",{name:"JoyChip",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var i,a,r,n,o,s;return[(0,x.Z)({"--Chip-decoratorChildOffset":"min(calc(var(--Chip-paddingInline) - (var(--_Chip-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Chip-decoratorChildHeight)) / 2), var(--Chip-paddingInline))","--Chip-decoratorChildRadius":"max(var(--_Chip-radius) - var(--variant-borderWidth, 0px) - var(--_Chip-paddingBlock), min(var(--_Chip-paddingBlock) + var(--variant-borderWidth, 0px), var(--_Chip-radius) / 2))","--Chip-deleteRadius":"var(--Chip-decoratorChildRadius)","--Chip-deleteSize":"var(--Chip-decoratorChildHeight)","--Avatar-radius":"var(--Chip-decoratorChildRadius)","--Avatar-size":"var(--Chip-decoratorChildHeight)","--Icon-margin":"initial","--unstable_actionRadius":"var(--_Chip-radius)"},"sm"===t.size&&{"--Chip-gap":"0.25rem","--Chip-paddingInline":"0.5rem","--Chip-decoratorChildHeight":"calc(min(1.125rem, var(--_Chip-minHeight)) - 2 * var(--variant-borderWidth, 0px))","--Icon-fontSize":"calc(var(--_Chip-minHeight) / 1.714)","--_Chip-minHeight":"var(--Chip-minHeight, 1.5rem)",fontSize:e.vars.fontSize.xs},"md"===t.size&&{"--Chip-gap":"0.375rem","--Chip-paddingInline":"0.75rem","--Chip-decoratorChildHeight":"min(1.375rem, var(--_Chip-minHeight))","--Icon-fontSize":"calc(var(--_Chip-minHeight) / 1.778)","--_Chip-minHeight":"var(--Chip-minHeight, 2rem)",fontSize:e.vars.fontSize.sm},"lg"===t.size&&{"--Chip-gap":"0.5rem","--Chip-paddingInline":"1rem","--Chip-decoratorChildHeight":"min(1.75rem, var(--_Chip-minHeight))","--Icon-fontSize":"calc(var(--_Chip-minHeight) / 2)","--_Chip-minHeight":"var(--Chip-minHeight, 2.5rem)",fontSize:e.vars.fontSize.md},{"--_Chip-radius":"var(--Chip-radius, 1.5rem)","--_Chip-paddingBlock":"max((var(--_Chip-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Chip-decoratorChildHeight)) / 2, 0px)",minHeight:"var(--_Chip-minHeight)",paddingInline:"var(--Chip-paddingInline)",borderRadius:"var(--_Chip-radius)",position:"relative",fontWeight:e.vars.fontWeight.md,fontFamily:e.vars.fontFamily.body,display:"inline-flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap",textDecoration:"none",verticalAlign:"middle",boxSizing:"border-box",[`&.${w.disabled}`]:{color:null==(i=e.variants[`${t.variant}Disabled`])?void 0:null==(a=i[t.color])?void 0:a.color}}),...t.clickable?[{"--variant-borderWidth":"0px",color:null==(o=e.variants[t.variant])?void 0:null==(s=o[t.color])?void 0:s.color}]:[null==(r=e.variants[t.variant])?void 0:r[t.color],{[`&.${w.disabled}`]:null==(n=e.variants[`${t.variant}Disabled`])?void 0:n[t.color]}]]}),I=(0,o.Z)("span",{name:"JoyChip",slot:"Label",overridesResolver:(e,t)=>t.label})(({ownerState:e})=>(0,x.Z)({display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",order:1,minInlineSize:0,flexGrow:1},e.clickable&&{zIndex:1,pointerEvents:"none"})),H=(0,o.Z)("button",{name:"JoyChip",slot:"Action",overridesResolver:(e,t)=>t.action})(({theme:e,ownerState:t})=>{var i,a,r,n;return[{position:"absolute",zIndex:0,top:0,left:0,bottom:0,right:0,border:"none",cursor:"pointer",padding:"initial",margin:"initial",backgroundColor:"initial",textDecoration:"none",borderRadius:"inherit",[e.focus.selector]:e.focus.default},null==(i=e.variants[t.variant])?void 0:i[t.color],{"&:hover":null==(a=e.variants[`${t.variant}Hover`])?void 0:a[t.color]},{"&:active":null==(r=e.variants[`${t.variant}Active`])?void 0:r[t.color]},{[`&.${w.disabled}`]:null==(n=e.variants[`${t.variant}Disabled`])?void 0:n[t.color]}]}),N=(0,o.Z)("span",{name:"JoyChip",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({"--Avatar-marginInlineStart":"calc(var(--Chip-decoratorChildOffset) * -1)","--Chip-deleteMargin":"0 0 0 calc(var(--Chip-decoratorChildOffset) * -1)","--Icon-margin":"0 0 0 calc(var(--Chip-paddingInline) / -4)",display:"inherit",marginInlineEnd:"var(--Chip-gap)",order:0,zIndex:1,pointerEvents:"none"}),F=(0,o.Z)("span",{name:"JoyChip",slot:"EndDecorator",overridesResolver:(e,t)=>t.endDecorator})({"--Chip-deleteMargin":"0 calc(var(--Chip-decoratorChildOffset) * -1) 0 0","--Icon-margin":"0 calc(var(--Chip-paddingInline) / -4) 0 0",display:"inherit",marginInlineStart:"var(--Chip-gap)",order:2,zIndex:1,pointerEvents:"none"}),T=n.forwardRef(function(e,t){let i=(0,Z.Z)({props:e,name:"JoyChip"}),{children:r,className:o,color:s="primary",slotProps:l={},onClick:c,disabled:d=!1,size:h="md",variant:p="solid",startDecorator:u,endDecorator:g}=i,f=(0,m.Z)(i,z),{getColor:b}=(0,y.VT)(p),P=b(e.color,s),S=!!c||!!l.action,w=(0,x.Z)({},i,{disabled:d,size:h,color:P,variant:p,clickable:S,focusVisible:!1}),T="function"==typeof l.action?l.action(w):l.action,O=n.useRef(null),{focusVisible:E,getRootProps:W}=(0,C.Z)((0,x.Z)({},T,{disabled:d,ref:O}));w.focusVisible=E;let L=R(w),M=(0,x.Z)({},f,{slotProps:l}),[A,U]=(0,k.Z)("root",{ref:t,className:(0,v.Z)(L.root,o),elementType:D,externalForwardedProps:M,ownerState:w}),[$,B]=(0,k.Z)("label",{className:L.label,elementType:I,externalForwardedProps:M,ownerState:w}),J=(0,j.Z)(B.id),[V,Y]=(0,k.Z)("action",{className:L.action,elementType:H,externalForwardedProps:M,ownerState:w,getSlotProps:W,additionalProps:{"aria-labelledby":J,as:null==T?void 0:T.component,onClick:c}}),[G,K]=(0,k.Z)("startDecorator",{className:L.startDecorator,elementType:N,externalForwardedProps:M,ownerState:w}),[X,q]=(0,k.Z)("endDecorator",{className:L.endDecorator,elementType:F,externalForwardedProps:M,ownerState:w}),Q=n.useMemo(()=>({disabled:d,variant:p,color:"context"===P?void 0:P}),[P,d,p]);return(0,a.jsx)(_.Provider,{value:Q,children:(0,a.jsxs)(A,(0,x.Z)({},U,{children:[S&&(0,a.jsx)(V,(0,x.Z)({},Y)),(0,a.jsx)($,(0,x.Z)({},B,{id:J,children:r})),u&&(0,a.jsx)(G,(0,x.Z)({},K,{children:u})),g&&(0,a.jsx)(X,(0,x.Z)({},q,{children:g}))]}))})});var O=i(11437),E=i(90545),W=i(35086),L=i(866),M=i(28086),A=i(65326),U=i.n(A),$=i(72474),B=i(59534),J=i(78141),V=i(50157),Y=i(23910),G=i(21628),K=i(1031),X=i(78915);let{Dragger:q}=V.default,Q=(0,o.Z)(s.Z)(e=>{let{theme:t}=e;return{width:"50%",backgroundColor:"dark"===t.palette.mode?t.palette.background.level1:"#fff",...t.typography.body2,padding:t.spacing(1),textAlign:"center",borderRadius:4,color:t.vars.palette.text.secondary}}),ee=["Choose a Datasource type","Setup the Datasource"],et=[{type:"text",title:"Text",subTitle:"Fill your raw text"},{type:"webPage",title:"URL",subTitle:"Fetch the content of a URL"},{type:"file",title:"Document",subTitle:"Upload a document, document type can be PDF, CSV, Text, PowerPoint, Word, Markdown"}];var ei=()=>{let e=(0,r.useRouter)(),t=(0,r.useSearchParams)().get("name"),{mode:i}=(0,l.tv)(),[o,m]=(0,n.useState)(!1),[x,v]=(0,n.useState)(0),[f,C]=(0,n.useState)(""),[b,j]=(0,n.useState)([]),[Z,y]=(0,n.useState)(""),[P,S]=(0,n.useState)(""),[w,_]=(0,n.useState)(""),[k,z]=(0,n.useState)(""),[R,D]=(0,n.useState)(null),[I,H]=(0,n.useState)(0),[N,F]=(0,n.useState)(0),[A,V]=(0,n.useState)(!0);return(0,n.useEffect)(()=>{(async function(){let e=await (0,X.PR)("/knowledge/".concat(t,"/document/list"),{page:1,page_size:20});e.success&&(j(e.data.data),H(e.data.total),F(e.data.page))})()},[]),(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsxs)(c.Z,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{marginBottom:"20px"},children:[(0,a.jsxs)(d.Z,{"aria-label":"breadcrumbs",children:[(0,a.jsx)(h.Z,{onClick:()=>{e.push("/datastores")},underline:"hover",color:"neutral",fontSize:"inherit",children:"Knowledge Space"},"Knowledge Space"),(0,a.jsx)(p.ZP,{fontSize:"inherit",children:"Documents"})]}),(0,a.jsx)(u.Z,{variant:"outlined",onClick:()=>m(!0),children:"+ Add Datasource"})]}),b.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(g.Z,{color:"primary",variant:"plain",size:"lg",sx:{"& tbody tr: hover":{backgroundColor:"light"===i?"rgb(246, 246, 246)":"rgb(33, 33, 40)"},"& tbody tr: hover a":{textDecoration:"underline"}},children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{children:"Name"}),(0,a.jsx)("th",{children:"Type"}),(0,a.jsx)("th",{children:"Size"}),(0,a.jsx)("th",{children:"Last Synch"}),(0,a.jsx)("th",{children:"Status"}),(0,a.jsx)("th",{children:"Result"}),(0,a.jsx)("th",{children:"Operation"})]})}),(0,a.jsx)("tbody",{children:b.map(i=>(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{children:i.doc_name}),(0,a.jsx)("td",{children:(0,a.jsx)(T,{variant:"solid",color:"neutral",sx:{opacity:.5},children:i.doc_type})}),(0,a.jsxs)("td",{children:[i.chunk_size," chunks"]}),(0,a.jsx)("td",{children:U()(i.last_sync).format("YYYY-MM-DD HH:MM:SS")}),(0,a.jsx)("td",{children:(0,a.jsx)(T,{sx:{opacity:.5},variant:"solid",color:function(){switch(i.status){case"TODO":return"neutral";case"RUNNING":return"primary";case"FINISHED":return"success";case"FAILED":return"danger"}}(),children:i.status})}),(0,a.jsx)("td",{children:"TODO"===i.status||"RUNNING"===i.status?"":"FINISHED"===i.status?(0,a.jsx)(Y.Z,{content:i.result,trigger:"hover",children:(0,a.jsx)(T,{variant:"solid",color:"success",sx:{opacity:.5},children:"SUCCESS"})}):(0,a.jsx)(Y.Z,{content:i.result,trigger:"hover",children:(0,a.jsx)(T,{variant:"solid",color:"danger",sx:{opacity:.5},children:"FAILED"})})}),(0,a.jsx)("td",{children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(u.Z,{variant:"outlined",size:"sm",sx:{marginRight:"20px"},onClick:async()=>{let e=await (0,X.PR)("/knowledge/".concat(t,"/document/sync"),{doc_ids:[i.id]});e.success?G.ZP.success("success"):G.ZP.error(e.err_msg||"failed")},children:["Synch",(0,a.jsx)(J.Z,{})]}),(0,a.jsx)(u.Z,{variant:"outlined",size:"sm",onClick:()=>{e.push("/datastores/documents/chunklist?spacename=".concat(t,"&documentid=").concat(i.id))},children:"Details"})]})})]},i.id))})]}),(0,a.jsx)(c.Z,{direction:"row",justifyContent:"flex-end",sx:{marginTop:"20px"},children:(0,a.jsx)(K.Z,{defaultPageSize:20,showSizeChanger:!1,current:N,total:I,onChange:async e=>{let i=await (0,X.PR)("/knowledge/".concat(t,"/document/list"),{page:e,page_size:20});i.success&&(j(i.data.data),H(i.data.total),F(i.data.page))},hideOnSinglePage:!0})})]}):(0,a.jsx)(a.Fragment,{}),(0,a.jsx)(O.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center","z-index":1e3},open:o,onClose:()=>m(!1),children:(0,a.jsxs)(s.Z,{variant:"outlined",sx:{width:800,borderRadius:"md",p:3,boxShadow:"lg"},children:[(0,a.jsx)(E.Z,{sx:{width:"100%"},children:(0,a.jsx)(c.Z,{spacing:2,direction:"row",children:ee.map((e,t)=>(0,a.jsxs)(Q,{sx:{fontWeight:x===t?"bold":"",color:x===t?"#2AA3FF":""},children:[t(0,a.jsxs)(s.Z,{sx:{boxSizing:"border-box",height:"80px",padding:"12px",display:"flex",flexDirection:"column",justifyContent:"space-between",border:"1px solid gray",borderRadius:"6px",marginBottom:"20px",cursor:"pointer"},onClick:()=>{C(e.type),v(1)},children:[(0,a.jsx)(s.Z,{sx:{fontSize:"20px",fontWeight:"bold"},children:e.title}),(0,a.jsx)(s.Z,{children:e.subTitle})]},e.type))})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(E.Z,{sx:{margin:"30px auto"},children:["Name:",(0,a.jsx)(W.ZP,{placeholder:"Please input the name",onChange:e=>S(e.target.value),sx:{marginBottom:"20px"}}),"webPage"===f?(0,a.jsxs)(a.Fragment,{children:["Web Page URL:",(0,a.jsx)(W.ZP,{placeholder:"Please input the Web Page URL",onChange:e=>y(e.target.value)})]}):"file"===f?(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(q,{name:"file",multiple:!1,onChange(e){var t;if(console.log(e),0===e.fileList.length){D(null),S("");return}D(e.file.originFileObj),S(null===(t=e.file.originFileObj)||void 0===t?void 0:t.name)},children:[(0,a.jsx)("p",{className:"ant-upload-drag-icon",children:(0,a.jsx)($.Z,{})}),(0,a.jsx)("p",{style:{color:"rgb(22, 108, 255)",fontSize:"20px"},children:"Select or Drop file"}),(0,a.jsx)("p",{className:"ant-upload-hint",style:{color:"rgb(22, 108, 255)"},children:"PDF, PowerPoint, Excel, Word, Text, Markdown,"})]})}):(0,a.jsxs)(a.Fragment,{children:["Text Source(Optional):",(0,a.jsx)(W.ZP,{placeholder:"Please input the text source",onChange:e=>_(e.target.value),sx:{marginBottom:"20px"}}),"Text:",(0,a.jsx)(L.Z,{onChange:e=>z(e.target.value),minRows:4,sx:{marginBottom:"20px"}})]}),(0,a.jsx)(p.ZP,{component:"label",sx:{marginTop:"20px"},endDecorator:(0,a.jsx)(M.Z,{checked:A,onChange:e=>V(e.target.checked)}),children:"Synch:"})]}),(0,a.jsxs)(c.Z,{direction:"row",justifyContent:"flex-start",alignItems:"center",sx:{marginBottom:"20px"},children:[(0,a.jsx)(u.Z,{variant:"outlined",sx:{marginRight:"20px"},onClick:()=>v(0),children:"< Back"}),(0,a.jsx)(u.Z,{variant:"outlined",onClick:async()=>{if(""===P){G.ZP.error("Please input the name");return}if("webPage"===f){if(""===Z){G.ZP.error("Please input the Web Page URL");return}let e=await (0,X.PR)("/knowledge/".concat(t,"/document/add"),{doc_name:P,content:Z,doc_type:"URL"});if(e.success&&A&&(0,X.PR)("/knowledge/".concat(t,"/document/sync"),{doc_ids:[e.data]}),e.success){G.ZP.success("success"),m(!1);let e=await (0,X.PR)("/knowledge/".concat(t,"/document/list"),{page:N,page_size:20});e.success&&(j(e.data.data),H(e.data.total),F(e.data.page))}else G.ZP.error(e.err_msg||"failed")}else if("file"===f){if(!R){G.ZP.error("Please select a file");return}let e=new FormData;e.append("doc_name",P),e.append("doc_file",R),e.append("doc_type","DOCUMENT");let i=await (0,X.Ej)("/knowledge/".concat(t,"/document/upload"),e);if(i.success&&A&&(0,X.PR)("/knowledge/".concat(t,"/document/sync"),{doc_ids:[i.data]}),i.success){G.ZP.success("success"),m(!1);let e=await (0,X.PR)("/knowledge/".concat(t,"/document/list"),{page:N,page_size:20});e.success&&(j(e.data.data),H(e.data.total),F(e.data.page))}else G.ZP.error(i.err_msg||"failed")}else{if(""===k){G.ZP.error("Please input the text");return}let e=await (0,X.PR)("/knowledge/".concat(t,"/document/add"),{doc_name:P,source:w,content:k,doc_type:"TEXT"});if(e.success&&A&&(0,X.PR)("/knowledge/".concat(t,"/document/sync"),{doc_ids:[e.data]}),e.success){G.ZP.success("success"),m(!1);let e=await (0,X.PR)("/knowledge/".concat(t,"/document/list"),{page:N,page_size:20});e.success&&(j(e.data.data),H(e.data.total),F(e.data.page))}else G.ZP.error(e.err_msg||"failed")}},children:"Finish"})]})]})]})})]})}},78915:function(e,t,i){"use strict";i.d(t,{Tk:function(){return d},Kw:function(){return h},PR:function(){return p},Ej:function(){return u}});var a=i(21628),r=i(24214),n=i(52040);let o=r.Z.create({baseURL:n.env.API_BASE_URL});o.defaults.timeout=1e4,o.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var s=i(84835);let l={"content-type":"application/json"},c=e=>{if(!(0,s.isPlainObject)(e))return JSON.stringify(e);let t={...e};for(let e in t){let i=t[e];"string"==typeof i&&(t[e]=i.trim())}return JSON.stringify(t)},d=(e,t)=>{if(t){let i=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");i&&(e+="?".concat(i))}return o.get("/api"+e,{headers:l}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})},h=(e,t)=>{let i=c(t);return o.post("/api"+e,{body:i,headers:l}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})},p=(e,t)=>{let i=c(t);return o.post(e,{body:i,headers:l}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})},u=(e,t)=>o.post(e,{body:t}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})}},function(e){e.O(0,[180,550,106,685,86,693,118,440,672,55,642,253,769,744],function(){return e(e.s=78273)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/datastores/page-05b1e6cf2f3137c5.js b/pilot/server/static/_next/static/chunks/app/datastores/page-05b1e6cf2f3137c5.js new file mode 100644 index 000000000..30d8c15d8 --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/datastores/page-05b1e6cf2f3137c5.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[43],{25123:function(e,t,n){"use strict";var o=n(78997);t.Z=void 0;var a=o(n(76906)),s=n(9268),c=(0,a.default)((0,s.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zm-8-2h2v-4h4v-2h-4V7h-2v4H7v2h4z"}),"AddBoxOutlined");t.Z=c},29382:function(e,t,n){"use strict";var o=n(78997);t.Z=void 0;var a=o(n(76906)),s=n(9268),c=(0,a.default)([(0,s.jsx)("path",{d:"M5 5h2v3h10V5h2v5h2V5c0-1.1-.9-2-2-2h-4.18C14.4 1.84 13.3 1 12 1s-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h5v-2H5V5zm7-2c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1z"},"0"),(0,s.jsx)("path",{d:"M20.3 18.9c.4-.7.7-1.5.7-2.4 0-2.5-2-4.5-4.5-4.5S12 14 12 16.5s2 4.5 4.5 4.5c.9 0 1.7-.3 2.4-.7l2.7 2.7 1.4-1.4-2.7-2.7zm-3.8.1c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5z"},"1")],"ContentPasteSearchOutlined");t.Z=c},20198:function(e,t,n){Promise.resolve().then(n.bind(n,44323))},44323:function(e,t,n){"use strict";n.r(t);var o=n(9268),a=n(56008),s=n(86006),c=n(72474),i=n(59534),r=n(25123),l=n(29382),d=n(50157),x=n(21628),p=n(50645),h=n(5737),u=n(78635),g=n(90545),m=n(70900),f=n(11437),j=n(35086),b=n(53113),w=n(866),y=n(22046),Z=n(28086);let{Dragger:S}=d.default,P=(0,p.Z)(h.Z)(e=>{let{theme:t}=e;return{width:"33%",backgroundColor:"dark"===t.palette.mode?t.palette.background.level1:"#fff",...t.typography.body2,padding:t.spacing(1),textAlign:"center",borderRadius:4,color:t.vars.palette.text.secondary}}),k=["Knowledge Space Config","Choose a Datasource type","Setup the Datasource"],C=[{type:"text",title:"Text",subTitle:"Fill your raw text"},{type:"webPage",title:"URL",subTitle:"Fetch the content of a URL"},{type:"file",title:"Document",subTitle:"Upload a document, document type can be PDF, CSV, Text, PowerPoint, Word, Markdown"}];t.default=()=>{let e=(0,a.useRouter)(),{mode:t}=(0,u.tv)(),[n,d]=(0,s.useState)(0),[p,v]=(0,s.useState)(""),[T,O]=(0,s.useState)([]),[_,z]=(0,s.useState)(!1),[N,R]=(0,s.useState)(""),[F,D]=(0,s.useState)(""),[B,W]=(0,s.useState)(""),[E,J]=(0,s.useState)(""),[U,V]=(0,s.useState)(""),[L,M]=(0,s.useState)(null),[G,H]=(0,s.useState)(!0);return(0,s.useEffect)(()=>{(async function(){let e=await fetch("".concat("https://u158074-879a-d00019a9.westa.seetacloud.com:8443","/knowledge/space/list"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),t=await e.json();t.success&&O(t.data)})()},[]),(0,o.jsxs)(g.Z,{sx:{width:"100%",height:"100%",backgroundColor:"light"===t?"rgb(238, 240, 245)":"rgb(33, 33, 33)"},children:[(0,o.jsx)(g.Z,{className:"page-body p-4",sx:{"&":{height:"90%",overflow:"auto"},"&::-webkit-scrollbar":{display:"none"}},children:(0,o.jsxs)(m.Z,{direction:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",sx:{"& i":{width:"430px",marginRight:"30px"}},children:[(0,o.jsxs)(g.Z,{sx:{boxSizing:"content-box",width:"390px",height:"79px",padding:"33px 20px 40px",marginRight:"30px",marginBottom:"30px",fontSize:"18px",fontWeight:"bold",color:"black",backgroundColor:"light"===t?"rgb(224, 228, 237)":"rgb(72, 72, 72)",flexShrink:0,flexGrow:0,cursor:"pointer","&: hover":{boxShadow:"0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);"}},onClick:()=>z(!0),children:[(0,o.jsx)(r.Z,{sx:{marginRight:"10px",fontSize:"30px"}}),"Space"]}),T.map((n,a)=>(0,o.jsxs)(g.Z,{sx:{padding:"30px 20px 40px",marginRight:"30px",marginBottom:"30px",backgroundColor:"light"===t?"rgb(255, 255, 255)":"rgb(72, 72, 72)",borderTop:"3px solid rgb(82, 196, 26)",flexShrink:0,flexGrow:0,cursor:"pointer","&: hover":{boxShadow:"0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);"}},onClick:()=>{e.push("/datastores/documents?name=".concat(n.name))},children:[(0,o.jsxs)(g.Z,{sx:{fontSize:"18px",marginBottom:"10px",fontWeight:"bold",color:"black"},children:[(0,o.jsx)(l.Z,{sx:{marginRight:"5px"}}),n.name]}),(0,o.jsxs)(g.Z,{sx:{display:"flex",justifyContent:"flex-start"},children:[(0,o.jsxs)(g.Z,{sx:{width:"130px",flexGrow:0,flexShrink:0},children:[(0,o.jsx)(g.Z,{sx:{color:"black"},children:n.vector_type}),(0,o.jsx)(g.Z,{sx:{fontSize:"12px",color:"black"},children:"Vector"})]}),(0,o.jsxs)(g.Z,{sx:{width:"130px",flexGrow:0,flexShrink:0},children:[(0,o.jsx)(g.Z,{sx:{color:"black"},children:n.owner}),(0,o.jsx)(g.Z,{sx:{fontSize:"12px",color:"black"},children:"Owner"})]}),(0,o.jsxs)(g.Z,{sx:{width:"130px",flexGrow:0,flexShrink:0},children:[(0,o.jsx)(g.Z,{sx:{color:"black"},children:n.docs||0}),(0,o.jsx)(g.Z,{sx:{fontSize:"12px",color:"black"},children:"Docs"})]})]})]},a)),(0,o.jsx)("i",{}),(0,o.jsx)("i",{}),(0,o.jsx)("i",{}),(0,o.jsx)("i",{}),(0,o.jsx)("i",{})]})}),(0,o.jsx)(f.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center","z-index":1e3},open:_,onClose:()=>z(!1),children:(0,o.jsxs)(h.Z,{variant:"outlined",sx:{width:800,borderRadius:"md",p:3,boxShadow:"lg"},children:[(0,o.jsx)(g.Z,{sx:{width:"100%"},children:(0,o.jsx)(m.Z,{spacing:2,direction:"row",children:k.map((e,t)=>(0,o.jsxs)(P,{sx:{fontWeight:n===t?"bold":"",color:n===t?"#814DDE":""},children:[tR(e.target.value)})]}),(0,o.jsx)(b.Z,{variant:"outlined",onClick:async()=>{if(""===N){x.ZP.error("please input the name");return}let e=await fetch("".concat("https://u158074-879a-d00019a9.westa.seetacloud.com:8443","/knowledge/space/add"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:N,vector_type:"Chroma",owner:"keting",desc:"test1"})}),t=await e.json();if(t.success){x.ZP.success("success"),d(1);let e=await fetch("".concat("https://u158074-879a-d00019a9.westa.seetacloud.com:8443","/knowledge/space/list"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),t=await e.json();t.success&&O(t.data)}else x.ZP.error(t.err_msg||"failed")},children:"Next"})]}):1===n?(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(g.Z,{sx:{margin:"30px auto"},children:C.map(e=>(0,o.jsxs)(h.Z,{sx:{boxSizing:"border-box",height:"80px",padding:"12px",display:"flex",flexDirection:"column",justifyContent:"space-between",border:"1px solid gray",borderRadius:"6px",marginBottom:"20px",cursor:"pointer"},onClick:()=>{v(e.type),d(2)},children:[(0,o.jsx)(h.Z,{sx:{fontSize:"20px",fontWeight:"bold"},children:e.title}),(0,o.jsx)(h.Z,{children:e.subTitle})]},e.type))})}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(g.Z,{sx:{margin:"30px auto"},children:["Name:",(0,o.jsx)(j.ZP,{placeholder:"Please input the name",onChange:e=>W(e.target.value),sx:{marginBottom:"20px"}}),"webPage"===p?(0,o.jsxs)(o.Fragment,{children:["Web Page URL:",(0,o.jsx)(j.ZP,{placeholder:"Please input the Web Page URL",onChange:e=>D(e.target.value)})]}):"file"===p?(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(S,{name:"file",multiple:!1,onChange(e){var t;if(console.log(e),0===e.fileList.length){M(null),W("");return}M(e.file.originFileObj),W(null===(t=e.file.originFileObj)||void 0===t?void 0:t.name)},children:[(0,o.jsx)("p",{className:"ant-upload-drag-icon",children:(0,o.jsx)(c.Z,{})}),(0,o.jsx)("p",{style:{color:"rgb(22, 108, 255)",fontSize:"20px"},children:"Select or Drop file"}),(0,o.jsx)("p",{className:"ant-upload-hint",style:{color:"rgb(22, 108, 255)"},children:"PDF, PowerPoint, Excel, Word, Text, Markdown,"})]})}):(0,o.jsxs)(o.Fragment,{children:["Text Source(Optional):",(0,o.jsx)(j.ZP,{placeholder:"Please input the text source",onChange:e=>J(e.target.value),sx:{marginBottom:"20px"}}),"Text:",(0,o.jsx)(w.Z,{onChange:e=>V(e.target.value),minRows:4,sx:{marginBottom:"20px"}})]}),(0,o.jsx)(y.ZP,{component:"label",sx:{marginTop:"20px"},endDecorator:(0,o.jsx)(Z.Z,{checked:G,onChange:e=>H(e.target.checked)}),children:"Synch:"})]}),(0,o.jsxs)(m.Z,{direction:"row",justifyContent:"flex-start",alignItems:"center",sx:{marginBottom:"20px"},children:[(0,o.jsx)(b.Z,{variant:"outlined",sx:{marginRight:"20px"},onClick:()=>d(1),children:"< Back"}),(0,o.jsx)(b.Z,{variant:"outlined",onClick:async()=>{if(""===B){x.ZP.error("Please input the name");return}if("webPage"===p){if(""===F){x.ZP.error("Please input the Web Page URL");return}let e=await fetch("".concat("https://u158074-879a-d00019a9.westa.seetacloud.com:8443","/knowledge/").concat(N,"/document/add"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({doc_name:B,content:F,doc_type:"URL"})}),t=await e.json();t.success?(x.ZP.success("success"),z(!1),G&&fetch("".concat("https://u158074-879a-d00019a9.westa.seetacloud.com:8443","/knowledge/").concat(N,"/document/sync"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({doc_ids:[t.data]})})):x.ZP.error(t.err_msg||"failed")}else if("file"===p){if(!L){x.ZP.error("Please select a file");return}let e=new FormData;e.append("doc_name",B),e.append("doc_file",L),e.append("doc_type","DOCUMENT");let t=await fetch("".concat("https://u158074-879a-d00019a9.westa.seetacloud.com:8443","/knowledge/").concat(N,"/document/upload"),{method:"POST",body:e}),n=await t.json();n.success?(x.ZP.success("success"),z(!1),G&&fetch("".concat("https://u158074-879a-d00019a9.westa.seetacloud.com:8443","/knowledge/").concat(N,"/document/sync"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({doc_ids:[n.data]})})):x.ZP.error(n.err_msg||"failed")}else{if(""===U){x.ZP.error("Please input the text");return}let e=await fetch("".concat("https://u158074-879a-d00019a9.westa.seetacloud.com:8443","/knowledge/").concat(N,"/document/add"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({doc_name:B,source:E,content:U,doc_type:"TEXT"})}),t=await e.json();t.success?(x.ZP.success("success"),z(!1),G&&fetch("".concat("https://u158074-879a-d00019a9.westa.seetacloud.com:8443","/knowledge/").concat(N,"/document/sync"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({doc_ids:[t.data]})})):x.ZP.error(t.err_msg||"failed")}},children:"Finish"})]})]})]})})]})}}},function(e){e.O(0,[430,577,86,693,118,672,642,253,769,744],function(){return e(e.s=20198)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/datastores/page-0ad92a94a235eabf.js b/pilot/server/static/_next/static/chunks/app/datastores/page-0ad92a94a235eabf.js new file mode 100644 index 000000000..6b2233902 --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/datastores/page-0ad92a94a235eabf.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[43],{29382:function(e,t,n){"use strict";var r=n(78997);t.Z=void 0;var s=r(n(76906)),o=n(9268),a=(0,s.default)([(0,o.jsx)("path",{d:"M5 5h2v3h10V5h2v5h2V5c0-1.1-.9-2-2-2h-4.18C14.4 1.84 13.3 1 12 1s-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h5v-2H5V5zm7-2c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1z"},"0"),(0,o.jsx)("path",{d:"M20.3 18.9c.4-.7.7-1.5.7-2.4 0-2.5-2-4.5-4.5-4.5S12 14 12 16.5s2 4.5 4.5 4.5c.9 0 1.7-.3 2.4-.7l2.7 2.7 1.4-1.4-2.7-2.7zm-3.8.1c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5z"},"1")],"ContentPasteSearchOutlined");t.Z=a},20198:function(e,t,n){Promise.resolve().then(n.bind(n,44323))},44323:function(e,t,n){"use strict";n.r(t);var r=n(9268),s=n(56008),o=n(86006),a=n(72474),i=n(59534),c=n(29382),l=n(50157),d=n(21628),x=n(50645),p=n(5737),h=n(78635),u=n(90545),g=n(70900),m=n(11437),f=n(35086),j=n(53113),b=n(866),Z=n(22046),P=n(28086),w=n(78915);let{Dragger:y}=l.default,k=(0,x.Z)(p.Z)(e=>{let{theme:t}=e;return{width:"33%",backgroundColor:"dark"===t.palette.mode?t.palette.background.level1:"#fff",...t.typography.body2,padding:t.spacing(1),textAlign:"center",borderRadius:4,color:t.vars.palette.text.secondary}}),S=["Knowledge Space Config","Choose a Datasource type","Setup the Datasource"],F=[{type:"text",title:"Text",subTitle:"Fill your raw text"},{type:"webPage",title:"URL",subTitle:"Fetch the content of a URL"},{type:"file",title:"Document",subTitle:"Upload a document, document type can be PDF, CSV, Text, PowerPoint, Word, Markdown"}];t.default=()=>{let e=(0,s.useRouter)(),{mode:t}=(0,h.tv)(),[n,l]=(0,o.useState)(0),[x,v]=(0,o.useState)(""),[C,R]=(0,o.useState)([]),[_,A]=(0,o.useState)(!1),[z,N]=(0,o.useState)(""),[T,B]=(0,o.useState)(""),[E,O]=(0,o.useState)(""),[D,W]=(0,o.useState)(""),[U,L]=(0,o.useState)(""),[G,M]=(0,o.useState)(""),[V,I]=(0,o.useState)(""),[H,K]=(0,o.useState)(null),[J,X]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{(async function(){let e=await (0,w.PR)("/knowledge/space/list",{});e.success&&R(e.data)})()},[]),(0,r.jsxs)(u.Z,{sx:{width:"100%",height:"100%"},className:"bg-[#F1F2F5] dark:bg-[#212121]",children:[(0,r.jsx)(u.Z,{className:"page-body p-4",sx:{"&":{height:"90%",overflow:"auto"},"&::-webkit-scrollbar":{display:"none"}},children:(0,r.jsxs)(g.Z,{direction:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",sx:{"& i":{width:"430px",marginRight:"30px"}},children:[(0,r.jsxs)(u.Z,{sx:{display:"flex",alignContent:"start",boxSizing:"content-box",width:"390px",height:"79px",padding:"33px 20px 40px",marginRight:"30px",marginBottom:"30px",fontSize:"18px",fontWeight:"bold",color:"black",flexShrink:0,flexGrow:0,cursor:"pointer",borderRadius:"16px","&: hover":{boxShadow:"0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);"}},onClick:()=>A(!0),className:"bg-[#E9EBEE] dark:bg-[#484848]",children:[(0,r.jsx)(u.Z,{sx:{width:"32px",height:"32px",lineHeight:"28px",border:"1px solid #2AA3FF",textAlign:"center",borderRadius:"5px",marginRight:"5px",fontWeight:"300",color:"#2AA3FF"},children:"+"}),(0,r.jsx)(u.Z,{sx:{fontSize:"16px"},children:"space"})]}),C.map((t,n)=>(0,r.jsxs)(u.Z,{sx:{padding:"30px 20px 40px",marginRight:"30px",marginBottom:"30px",borderTop:"4px solid rgb(84, 164, 248)",flexShrink:0,flexGrow:0,cursor:"pointer",borderRadius:"10px","&: hover":{boxShadow:"0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);"}},onClick:()=>{e.push("/datastores/documents?name=".concat(t.name))},className:"bg-[#FFFFFF] dark:bg-[#484848]",children:[(0,r.jsxs)(u.Z,{sx:{fontSize:"18px",marginBottom:"10px",fontWeight:"bold",color:"black"},children:[(0,r.jsx)(c.Z,{sx:{marginRight:"5px",color:"#2AA3FF"}}),t.name]}),(0,r.jsxs)(u.Z,{sx:{display:"flex",justifyContent:"flex-start"},children:[(0,r.jsxs)(u.Z,{sx:{width:"130px",flexGrow:0,flexShrink:0},children:[(0,r.jsx)(u.Z,{sx:{color:"#2AA3FF"},children:t.vector_type}),(0,r.jsx)(u.Z,{sx:{fontSize:"12px",color:"black"},children:"Vector"})]}),(0,r.jsxs)(u.Z,{sx:{width:"130px",flexGrow:0,flexShrink:0},children:[(0,r.jsx)(u.Z,{sx:{color:"#2AA3FF"},children:t.owner}),(0,r.jsx)(u.Z,{sx:{fontSize:"12px",color:"black"},children:"Owner"})]}),(0,r.jsxs)(u.Z,{sx:{width:"130px",flexGrow:0,flexShrink:0},children:[(0,r.jsx)(u.Z,{sx:{color:"#2AA3FF"},children:t.docs||0}),(0,r.jsx)(u.Z,{sx:{fontSize:"12px",color:"black"},children:"Docs"})]})]})]},n)),(0,r.jsx)("i",{}),(0,r.jsx)("i",{}),(0,r.jsx)("i",{}),(0,r.jsx)("i",{}),(0,r.jsx)("i",{})]})}),(0,r.jsx)(m.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center","z-index":1e3},open:_,onClose:()=>A(!1),children:(0,r.jsxs)(p.Z,{variant:"outlined",sx:{width:800,borderRadius:"md",p:3,boxShadow:"lg"},children:[(0,r.jsx)(u.Z,{sx:{width:"100%"},children:(0,r.jsx)(g.Z,{spacing:2,direction:"row",children:S.map((e,t)=>(0,r.jsxs)(k,{sx:{fontWeight:n===t?"bold":"",color:n===t?"#2AA3FF":""},children:[tN(e.target.value),sx:{marginBottom:"20px"}}),"Owner:",(0,r.jsx)(f.ZP,{placeholder:"Please input the owner",onChange:e=>B(e.target.value),sx:{marginBottom:"20px"}}),"Description:",(0,r.jsx)(f.ZP,{placeholder:"Please input the description",onChange:e=>O(e.target.value),sx:{marginBottom:"20px"}})]}),(0,r.jsx)(j.Z,{variant:"outlined",onClick:async()=>{if(""===z){d.ZP.error("please input the name");return}if(""===T){d.ZP.error("please input the owner");return}if(""===E){d.ZP.error("please input the description");return}let e=await (0,w.PR)("/knowledge/space/add",{name:z,vector_type:"Chroma",owner:T,desc:E});if(e.success){d.ZP.success("success"),l(1);let e=await (0,w.PR)("/knowledge/space/list",{});e.success&&R(e.data)}else d.ZP.error(e.err_msg||"failed")},children:"Next"})]}):1===n?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(u.Z,{sx:{margin:"30px auto"},children:F.map(e=>(0,r.jsxs)(p.Z,{sx:{boxSizing:"border-box",height:"80px",padding:"12px",display:"flex",flexDirection:"column",justifyContent:"space-between",border:"1px solid gray",borderRadius:"6px",marginBottom:"20px",cursor:"pointer"},onClick:()=>{v(e.type),l(2)},children:[(0,r.jsx)(p.Z,{sx:{fontSize:"20px",fontWeight:"bold"},children:e.title}),(0,r.jsx)(p.Z,{children:e.subTitle})]},e.type))})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(u.Z,{sx:{margin:"30px auto"},children:["Name:",(0,r.jsx)(f.ZP,{placeholder:"Please input the name",onChange:e=>L(e.target.value),sx:{marginBottom:"20px"}}),"webPage"===x?(0,r.jsxs)(r.Fragment,{children:["Web Page URL:",(0,r.jsx)(f.ZP,{placeholder:"Please input the Web Page URL",onChange:e=>W(e.target.value)})]}):"file"===x?(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(y,{name:"file",multiple:!1,onChange(e){var t;if(console.log(e),0===e.fileList.length){K(null),L("");return}K(e.file.originFileObj),L(null===(t=e.file.originFileObj)||void 0===t?void 0:t.name)},children:[(0,r.jsx)("p",{className:"ant-upload-drag-icon",children:(0,r.jsx)(a.Z,{})}),(0,r.jsx)("p",{style:{color:"rgb(22, 108, 255)",fontSize:"20px"},children:"Select or Drop file"}),(0,r.jsx)("p",{className:"ant-upload-hint",style:{color:"rgb(22, 108, 255)"},children:"PDF, PowerPoint, Excel, Word, Text, Markdown,"})]})}):(0,r.jsxs)(r.Fragment,{children:["Text Source(Optional):",(0,r.jsx)(f.ZP,{placeholder:"Please input the text source",onChange:e=>M(e.target.value),sx:{marginBottom:"20px"}}),"Text:",(0,r.jsx)(b.Z,{onChange:e=>I(e.target.value),minRows:4,sx:{marginBottom:"20px"}})]}),(0,r.jsx)(Z.ZP,{component:"label",sx:{marginTop:"20px"},endDecorator:(0,r.jsx)(P.Z,{checked:J,onChange:e=>X(e.target.checked)}),children:"Synch:"})]}),(0,r.jsxs)(g.Z,{direction:"row",justifyContent:"flex-start",alignItems:"center",sx:{marginBottom:"20px"},children:[(0,r.jsx)(j.Z,{variant:"outlined",sx:{marginRight:"20px"},onClick:()=>l(1),children:"< Back"}),(0,r.jsx)(j.Z,{variant:"outlined",onClick:async()=>{if(""===U){d.ZP.error("Please input the name");return}if("webPage"===x){if(""===D){d.ZP.error("Please input the Web Page URL");return}let e=await (0,w.PR)("/knowledge/".concat(z,"/document/add"),{doc_name:U,content:D,doc_type:"URL"});e.success?(d.ZP.success("success"),A(!1),J&&(0,w.PR)("/knowledge/".concat(z,"/document/sync"),{doc_ids:[e.data]})):d.ZP.error(e.err_msg||"failed")}else if("file"===x){if(!H){d.ZP.error("Please select a file");return}let e=new FormData;e.append("doc_name",U),e.append("doc_file",H),e.append("doc_type","DOCUMENT");let t=await (0,w.Ej)("/knowledge/".concat(z,"/document/upload"),e);t.success?(d.ZP.success("success"),A(!1),J&&(0,w.PR)("/knowledge/".concat(z,"/document/sync"),{doc_ids:[t.data]})):d.ZP.error(t.err_msg||"failed")}else{if(""===V){d.ZP.error("Please input the text");return}let e=await (0,w.PR)("/knowledge/".concat(z,"/document/add"),{doc_name:U,source:G,content:V,doc_type:"TEXT"});e.success?(d.ZP.success("success"),A(!1),J&&(0,w.PR)("/knowledge/".concat(z,"/document/sync"),{doc_ids:[e.data]})):d.ZP.error(e.err_msg||"failed")}},children:"Finish"})]})]})]})})]})}},78915:function(e,t,n){"use strict";n.d(t,{Tk:function(){return d},Kw:function(){return x},PR:function(){return p},Ej:function(){return h}});var r=n(21628),s=n(24214),o=n(52040);let a=s.Z.create({baseURL:o.env.API_BASE_URL});a.defaults.timeout=1e4,a.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var i=n(84835);let c={"content-type":"application/json"},l=e=>{if(!(0,i.isPlainObject)(e))return JSON.stringify(e);let t={...e};for(let e in t){let n=t[e];"string"==typeof n&&(t[e]=n.trim())}return JSON.stringify(t)},d=(e,t)=>{if(t){let n=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");n&&(e+="?".concat(n))}return a.get("/api"+e,{headers:c}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},x=(e,t)=>{let n=l(t);return a.post("/api"+e,{body:n,headers:c}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},p=(e,t)=>(l(t),a.post(e,t,{headers:c}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})),h=(e,t)=>a.post(e,t).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})}},function(e){e.O(0,[180,106,685,86,693,118,672,642,253,769,744],function(){return e(e.s=20198)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/datastores/page-11d29321901ce95f.js b/pilot/server/static/_next/static/chunks/app/datastores/page-11d29321901ce95f.js new file mode 100644 index 000000000..095f72431 --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/datastores/page-11d29321901ce95f.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[43],{29382:function(e,t,n){"use strict";var r=n(78997);t.Z=void 0;var s=r(n(76906)),o=n(9268),i=(0,s.default)([(0,o.jsx)("path",{d:"M5 5h2v3h10V5h2v5h2V5c0-1.1-.9-2-2-2h-4.18C14.4 1.84 13.3 1 12 1s-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h5v-2H5V5zm7-2c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1z"},"0"),(0,o.jsx)("path",{d:"M20.3 18.9c.4-.7.7-1.5.7-2.4 0-2.5-2-4.5-4.5-4.5S12 14 12 16.5s2 4.5 4.5 4.5c.9 0 1.7-.3 2.4-.7l2.7 2.7 1.4-1.4-2.7-2.7zm-3.8.1c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5z"},"1")],"ContentPasteSearchOutlined");t.Z=i},20198:function(e,t,n){Promise.resolve().then(n.bind(n,44323))},44323:function(e,t,n){"use strict";n.r(t);var r=n(9268),s=n(56008),o=n(86006),i=n(72474),a=n(59534),c=n(29382),l=n(50157),d=n(21628),x=n(50645),p=n(5737),h=n(78635),u=n(90545),g=n(70900),m=n(11437),f=n(35086),j=n(53113),b=n(866),Z=n(22046),w=n(28086),P=n(78915);let{Dragger:y}=l.default,k=(0,x.Z)(p.Z)(e=>{let{theme:t}=e;return{width:"33%",backgroundColor:"dark"===t.palette.mode?t.palette.background.level1:"#fff",...t.typography.body2,padding:t.spacing(1),textAlign:"center",borderRadius:4,color:t.vars.palette.text.secondary}}),S=["Knowledge Space Config","Choose a Datasource type","Setup the Datasource"],v=[{type:"text",title:"Text",subTitle:"Fill your raw text"},{type:"webPage",title:"URL",subTitle:"Fetch the content of a URL"},{type:"file",title:"Document",subTitle:"Upload a document, document type can be PDF, CSV, Text, PowerPoint, Word, Markdown"}];t.default=()=>{let e=(0,s.useRouter)(),{mode:t}=(0,h.tv)(),[n,l]=(0,o.useState)(0),[x,F]=(0,o.useState)(""),[C,R]=(0,o.useState)([]),[_,z]=(0,o.useState)(!1),[N,T]=(0,o.useState)(""),[E,D]=(0,o.useState)(""),[O,W]=(0,o.useState)(""),[A,B]=(0,o.useState)(""),[U,L]=(0,o.useState)(""),[G,M]=(0,o.useState)(null),[V,H]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{(async function(){let e=await (0,P.PR)("/knowledge/space/list");e.success&&R(e.data)})()},[]),(0,r.jsxs)(u.Z,{sx:{width:"100%",height:"100%"},className:"bg-[#F1F2F5] dark:bg-[#212121]",children:[(0,r.jsx)(u.Z,{className:"page-body p-4",sx:{"&":{height:"90%",overflow:"auto"},"&::-webkit-scrollbar":{display:"none"}},children:(0,r.jsxs)(g.Z,{direction:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",sx:{"& i":{width:"430px",marginRight:"30px"}},children:[(0,r.jsxs)(u.Z,{sx:{display:"flex",alignContent:"start",boxSizing:"content-box",width:"390px",height:"79px",padding:"33px 20px 40px",marginRight:"30px",marginBottom:"30px",fontSize:"18px",fontWeight:"bold",color:"black",flexShrink:0,flexGrow:0,cursor:"pointer",borderRadius:"16px","&: hover":{boxShadow:"0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);"}},onClick:()=>z(!0),className:"bg-[#E9EBEE] dark:bg-[#484848]",children:[(0,r.jsx)(u.Z,{sx:{width:"32px",height:"32px",lineHeight:"28px",border:"1px solid gray",textAlign:"center",borderRadius:"5px",marginRight:"5px",fontWeight:"300"},children:"+"}),(0,r.jsx)(u.Z,{sx:{fontSize:"16px"},children:"space"})]}),C.map((t,n)=>(0,r.jsxs)(u.Z,{sx:{padding:"30px 20px 40px",marginRight:"30px",marginBottom:"30px",borderTop:"4px solid rgb(84, 164, 248)",flexShrink:0,flexGrow:0,cursor:"pointer",borderRadius:"10px","&: hover":{boxShadow:"0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);"}},onClick:()=>{e.push("/datastores/documents?name=".concat(t.name))},className:"bg-[#FFFFFF] dark:bg-[#484848]",children:[(0,r.jsxs)(u.Z,{sx:{fontSize:"18px",marginBottom:"10px",fontWeight:"bold",color:"black"},children:[(0,r.jsx)(c.Z,{sx:{marginRight:"5px",color:"#2AA3FF"}}),t.name]}),(0,r.jsxs)(u.Z,{sx:{display:"flex",justifyContent:"flex-start"},children:[(0,r.jsxs)(u.Z,{sx:{width:"130px",flexGrow:0,flexShrink:0},children:[(0,r.jsx)(u.Z,{sx:{color:"#2AA3FF"},children:t.vector_type}),(0,r.jsx)(u.Z,{sx:{fontSize:"12px",color:"black"},children:"Vector"})]}),(0,r.jsxs)(u.Z,{sx:{width:"130px",flexGrow:0,flexShrink:0},children:[(0,r.jsx)(u.Z,{sx:{color:"#2AA3FF"},children:t.owner}),(0,r.jsx)(u.Z,{sx:{fontSize:"12px",color:"black"},children:"Owner"})]}),(0,r.jsxs)(u.Z,{sx:{width:"130px",flexGrow:0,flexShrink:0},children:[(0,r.jsx)(u.Z,{sx:{color:"#2AA3FF"},children:t.docs||0}),(0,r.jsx)(u.Z,{sx:{fontSize:"12px",color:"black"},children:"Docs"})]})]})]},n)),(0,r.jsx)("i",{}),(0,r.jsx)("i",{}),(0,r.jsx)("i",{}),(0,r.jsx)("i",{}),(0,r.jsx)("i",{})]})}),(0,r.jsx)(m.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center","z-index":1e3},open:_,onClose:()=>z(!1),children:(0,r.jsxs)(p.Z,{variant:"outlined",sx:{width:800,borderRadius:"md",p:3,boxShadow:"lg"},children:[(0,r.jsx)(u.Z,{sx:{width:"100%"},children:(0,r.jsx)(g.Z,{spacing:2,direction:"row",children:S.map((e,t)=>(0,r.jsxs)(k,{sx:{fontWeight:n===t?"bold":"",color:n===t?"#814DDE":""},children:[tT(e.target.value)})]}),(0,r.jsx)(j.Z,{variant:"outlined",onClick:async()=>{if(""===N){d.ZP.error("please input the name");return}let e=await (0,P.PR)("/knowledge/space/add",{name:N,vector_type:"Chroma",owner:"keting",desc:"test1"});if(e.success){d.ZP.success("success"),l(1);let e=await (0,P.PR)("/knowledge/space/list");e.success&&R(e.data)}else d.ZP.error(e.err_msg||"failed")},children:"Next"})]}):1===n?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(u.Z,{sx:{margin:"30px auto"},children:v.map(e=>(0,r.jsxs)(p.Z,{sx:{boxSizing:"border-box",height:"80px",padding:"12px",display:"flex",flexDirection:"column",justifyContent:"space-between",border:"1px solid gray",borderRadius:"6px",marginBottom:"20px",cursor:"pointer"},onClick:()=>{F(e.type),l(2)},children:[(0,r.jsx)(p.Z,{sx:{fontSize:"20px",fontWeight:"bold"},children:e.title}),(0,r.jsx)(p.Z,{children:e.subTitle})]},e.type))})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(u.Z,{sx:{margin:"30px auto"},children:["Name:",(0,r.jsx)(f.ZP,{placeholder:"Please input the name",onChange:e=>W(e.target.value),sx:{marginBottom:"20px"}}),"webPage"===x?(0,r.jsxs)(r.Fragment,{children:["Web Page URL:",(0,r.jsx)(f.ZP,{placeholder:"Please input the Web Page URL",onChange:e=>D(e.target.value)})]}):"file"===x?(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(y,{name:"file",multiple:!1,onChange(e){var t;if(console.log(e),0===e.fileList.length){M(null),W("");return}M(e.file.originFileObj),W(null===(t=e.file.originFileObj)||void 0===t?void 0:t.name)},children:[(0,r.jsx)("p",{className:"ant-upload-drag-icon",children:(0,r.jsx)(i.Z,{})}),(0,r.jsx)("p",{style:{color:"rgb(22, 108, 255)",fontSize:"20px"},children:"Select or Drop file"}),(0,r.jsx)("p",{className:"ant-upload-hint",style:{color:"rgb(22, 108, 255)"},children:"PDF, PowerPoint, Excel, Word, Text, Markdown,"})]})}):(0,r.jsxs)(r.Fragment,{children:["Text Source(Optional):",(0,r.jsx)(f.ZP,{placeholder:"Please input the text source",onChange:e=>B(e.target.value),sx:{marginBottom:"20px"}}),"Text:",(0,r.jsx)(b.Z,{onChange:e=>L(e.target.value),minRows:4,sx:{marginBottom:"20px"}})]}),(0,r.jsx)(Z.ZP,{component:"label",sx:{marginTop:"20px"},endDecorator:(0,r.jsx)(w.Z,{checked:V,onChange:e=>H(e.target.checked)}),children:"Synch:"})]}),(0,r.jsxs)(g.Z,{direction:"row",justifyContent:"flex-start",alignItems:"center",sx:{marginBottom:"20px"},children:[(0,r.jsx)(j.Z,{variant:"outlined",sx:{marginRight:"20px"},onClick:()=>l(1),children:"< Back"}),(0,r.jsx)(j.Z,{variant:"outlined",onClick:async()=>{if(""===O){d.ZP.error("Please input the name");return}if("webPage"===x){if(""===E){d.ZP.error("Please input the Web Page URL");return}let e=await (0,P.PR)("/knowledge/".concat(N,"/document/add"),{doc_name:O,content:E,doc_type:"URL"});e.success?(d.ZP.success("success"),z(!1),V&&(0,P.PR)("/knowledge/".concat(N,"/document/sync"),{doc_ids:[e.data]})):d.ZP.error(e.err_msg||"failed")}else if("file"===x){if(!G){d.ZP.error("Please select a file");return}let e=new FormData;e.append("doc_name",O),e.append("doc_file",G),e.append("doc_type","DOCUMENT");let t=await (0,P.Ej)("/knowledge/".concat(N,"/document/upload"),e);t.success?(d.ZP.success("success"),z(!1),V&&(0,P.PR)("/knowledge/".concat(N,"/document/sync"),{doc_ids:[t.data]})):d.ZP.error(t.err_msg||"failed")}else{if(""===U){d.ZP.error("Please input the text");return}let e=await (0,P.PR)("/knowledge/".concat(N,"/document/add"),{doc_name:O,source:A,content:U,doc_type:"TEXT"});e.success?(d.ZP.success("success"),z(!1),V&&(0,P.PR)("/knowledge/".concat(N,"/document/sync"),{doc_ids:[e.data]})):d.ZP.error(e.err_msg||"failed")}},children:"Finish"})]})]})]})})]})}},78915:function(e,t,n){"use strict";n.d(t,{Tk:function(){return l},Kw:function(){return d},PR:function(){return x},Ej:function(){return p}});var r=n(21628),s=n(24214);let o=s.Z.create({baseURL:"http://127.0.0.1:5000"});o.defaults.timeout=1e4,o.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var i=n(84835);let a={"content-type":"application/json"},c=e=>{if(!(0,i.isPlainObject)(e))return JSON.stringify(e);let t={...e};for(let e in t){let n=t[e];"string"==typeof n&&(t[e]=n.trim())}return JSON.stringify(t)},l=(e,t)=>{if(t){let n=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");n&&(e+="?".concat(n))}return o.get("/api"+e,{headers:a}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},d=(e,t)=>{let n=c(t);return o.post("/api"+e,{body:n,headers:a}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},x=(e,t)=>{let n=c(t);return o.post(e,{body:n,headers:a}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},p=(e,t)=>o.post(e,{body:t}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})}},function(e){e.O(0,[180,752,685,86,693,118,672,642,253,769,744],function(){return e(e.s=20198)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/datastores/page-28fc3593a72aacf4.js b/pilot/server/static/_next/static/chunks/app/datastores/page-28fc3593a72aacf4.js new file mode 100644 index 000000000..e98db47a0 --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/datastores/page-28fc3593a72aacf4.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[43],{29382:function(e,t,r){"use strict";var n=r(78997);t.Z=void 0;var s=n(r(76906)),o=r(9268),a=(0,s.default)([(0,o.jsx)("path",{d:"M5 5h2v3h10V5h2v5h2V5c0-1.1-.9-2-2-2h-4.18C14.4 1.84 13.3 1 12 1s-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h5v-2H5V5zm7-2c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1z"},"0"),(0,o.jsx)("path",{d:"M20.3 18.9c.4-.7.7-1.5.7-2.4 0-2.5-2-4.5-4.5-4.5S12 14 12 16.5s2 4.5 4.5 4.5c.9 0 1.7-.3 2.4-.7l2.7 2.7 1.4-1.4-2.7-2.7zm-3.8.1c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5z"},"1")],"ContentPasteSearchOutlined");t.Z=a},20198:function(e,t,r){Promise.resolve().then(r.bind(r,44323))},44323:function(e,t,r){"use strict";r.r(t);var n=r(9268),s=r(56008),o=r(86006),a=r(72474),i=r(59534),c=r(29382),l=r(50157),d=r(21628),x=r(50645),p=r(5737),h=r(78635),u=r(90545),g=r(70900),m=r(11437),f=r(35086),j=r(53113),b=r(866),Z=r(22046),P=r(28086),w=r(78915);let{Dragger:y}=l.default,k=(0,x.Z)(p.Z)(e=>{let{theme:t}=e;return{width:"33%",backgroundColor:"dark"===t.palette.mode?t.palette.background.level1:"#fff",...t.typography.body2,padding:t.spacing(1),textAlign:"center",borderRadius:4,color:t.vars.palette.text.secondary}}),S=["Knowledge Space Config","Choose a Datasource type","Setup the Datasource"],F=[{type:"text",title:"Text",subTitle:"Fill your raw text"},{type:"webPage",title:"URL",subTitle:"Fetch the content of a URL"},{type:"file",title:"Document",subTitle:"Upload a document, document type can be PDF, CSV, Text, PowerPoint, Word, Markdown"}];t.default=()=>{let e=(0,s.useRouter)(),{mode:t}=(0,h.tv)(),[r,l]=(0,o.useState)(0),[x,v]=(0,o.useState)(""),[C,R]=(0,o.useState)([]),[_,A]=(0,o.useState)(!1),[z,N]=(0,o.useState)(""),[T,B]=(0,o.useState)(""),[E,O]=(0,o.useState)(""),[D,W]=(0,o.useState)(""),[U,L]=(0,o.useState)(""),[G,M]=(0,o.useState)(""),[V,I]=(0,o.useState)(""),[H,K]=(0,o.useState)(null),[J,X]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{(async function(){let e=await (0,w.PR)("/knowledge/space/list");e.success&&R(e.data)})()},[]),(0,n.jsxs)(u.Z,{sx:{width:"100%",height:"100%"},className:"bg-[#F1F2F5] dark:bg-[#212121]",children:[(0,n.jsx)(u.Z,{className:"page-body p-4",sx:{"&":{height:"90%",overflow:"auto"},"&::-webkit-scrollbar":{display:"none"}},children:(0,n.jsxs)(g.Z,{direction:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",sx:{"& i":{width:"430px",marginRight:"30px"}},children:[(0,n.jsxs)(u.Z,{sx:{display:"flex",alignContent:"start",boxSizing:"content-box",width:"390px",height:"79px",padding:"33px 20px 40px",marginRight:"30px",marginBottom:"30px",fontSize:"18px",fontWeight:"bold",color:"black",flexShrink:0,flexGrow:0,cursor:"pointer",borderRadius:"16px","&: hover":{boxShadow:"0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);"}},onClick:()=>A(!0),className:"bg-[#E9EBEE] dark:bg-[#484848]",children:[(0,n.jsx)(u.Z,{sx:{width:"32px",height:"32px",lineHeight:"28px",border:"1px solid #2AA3FF",textAlign:"center",borderRadius:"5px",marginRight:"5px",fontWeight:"300",color:"#2AA3FF"},children:"+"}),(0,n.jsx)(u.Z,{sx:{fontSize:"16px"},children:"space"})]}),C.map((t,r)=>(0,n.jsxs)(u.Z,{sx:{padding:"30px 20px 40px",marginRight:"30px",marginBottom:"30px",borderTop:"4px solid rgb(84, 164, 248)",flexShrink:0,flexGrow:0,cursor:"pointer",borderRadius:"10px","&: hover":{boxShadow:"0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);"}},onClick:()=>{e.push("/datastores/documents?name=".concat(t.name))},className:"bg-[#FFFFFF] dark:bg-[#484848]",children:[(0,n.jsxs)(u.Z,{sx:{fontSize:"18px",marginBottom:"10px",fontWeight:"bold",color:"black"},children:[(0,n.jsx)(c.Z,{sx:{marginRight:"5px",color:"#2AA3FF"}}),t.name]}),(0,n.jsxs)(u.Z,{sx:{display:"flex",justifyContent:"flex-start"},children:[(0,n.jsxs)(u.Z,{sx:{width:"130px",flexGrow:0,flexShrink:0},children:[(0,n.jsx)(u.Z,{sx:{color:"#2AA3FF"},children:t.vector_type}),(0,n.jsx)(u.Z,{sx:{fontSize:"12px",color:"black"},children:"Vector"})]}),(0,n.jsxs)(u.Z,{sx:{width:"130px",flexGrow:0,flexShrink:0},children:[(0,n.jsx)(u.Z,{sx:{color:"#2AA3FF"},children:t.owner}),(0,n.jsx)(u.Z,{sx:{fontSize:"12px",color:"black"},children:"Owner"})]}),(0,n.jsxs)(u.Z,{sx:{width:"130px",flexGrow:0,flexShrink:0},children:[(0,n.jsx)(u.Z,{sx:{color:"#2AA3FF"},children:t.docs||0}),(0,n.jsx)(u.Z,{sx:{fontSize:"12px",color:"black"},children:"Docs"})]})]})]},r)),(0,n.jsx)("i",{}),(0,n.jsx)("i",{}),(0,n.jsx)("i",{}),(0,n.jsx)("i",{}),(0,n.jsx)("i",{})]})}),(0,n.jsx)(m.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center","z-index":1e3},open:_,onClose:()=>A(!1),children:(0,n.jsxs)(p.Z,{variant:"outlined",sx:{width:800,borderRadius:"md",p:3,boxShadow:"lg"},children:[(0,n.jsx)(u.Z,{sx:{width:"100%"},children:(0,n.jsx)(g.Z,{spacing:2,direction:"row",children:S.map((e,t)=>(0,n.jsxs)(k,{sx:{fontWeight:r===t?"bold":"",color:r===t?"#2AA3FF":""},children:[tN(e.target.value),sx:{marginBottom:"20px"}}),"Owner:",(0,n.jsx)(f.ZP,{placeholder:"Please input the owner",onChange:e=>B(e.target.value),sx:{marginBottom:"20px"}}),"Description:",(0,n.jsx)(f.ZP,{placeholder:"Please input the description",onChange:e=>O(e.target.value),sx:{marginBottom:"20px"}})]}),(0,n.jsx)(j.Z,{variant:"outlined",onClick:async()=>{if(""===z){d.ZP.error("please input the name");return}if(""===T){d.ZP.error("please input the owner");return}if(""===E){d.ZP.error("please input the description");return}let e=await (0,w.PR)("/knowledge/space/add",{name:z,vector_type:"Chroma",owner:T,desc:E});if(e.success){d.ZP.success("success"),l(1);let e=await (0,w.PR)("/knowledge/space/list");e.success&&R(e.data)}else d.ZP.error(e.err_msg||"failed")},children:"Next"})]}):1===r?(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(u.Z,{sx:{margin:"30px auto"},children:F.map(e=>(0,n.jsxs)(p.Z,{sx:{boxSizing:"border-box",height:"80px",padding:"12px",display:"flex",flexDirection:"column",justifyContent:"space-between",border:"1px solid gray",borderRadius:"6px",marginBottom:"20px",cursor:"pointer"},onClick:()=>{v(e.type),l(2)},children:[(0,n.jsx)(p.Z,{sx:{fontSize:"20px",fontWeight:"bold"},children:e.title}),(0,n.jsx)(p.Z,{children:e.subTitle})]},e.type))})}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(u.Z,{sx:{margin:"30px auto"},children:["Name:",(0,n.jsx)(f.ZP,{placeholder:"Please input the name",onChange:e=>L(e.target.value),sx:{marginBottom:"20px"}}),"webPage"===x?(0,n.jsxs)(n.Fragment,{children:["Web Page URL:",(0,n.jsx)(f.ZP,{placeholder:"Please input the Web Page URL",onChange:e=>W(e.target.value)})]}):"file"===x?(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(y,{name:"file",multiple:!1,onChange(e){var t;if(console.log(e),0===e.fileList.length){K(null),L("");return}K(e.file.originFileObj),L(null===(t=e.file.originFileObj)||void 0===t?void 0:t.name)},children:[(0,n.jsx)("p",{className:"ant-upload-drag-icon",children:(0,n.jsx)(a.Z,{})}),(0,n.jsx)("p",{style:{color:"rgb(22, 108, 255)",fontSize:"20px"},children:"Select or Drop file"}),(0,n.jsx)("p",{className:"ant-upload-hint",style:{color:"rgb(22, 108, 255)"},children:"PDF, PowerPoint, Excel, Word, Text, Markdown,"})]})}):(0,n.jsxs)(n.Fragment,{children:["Text Source(Optional):",(0,n.jsx)(f.ZP,{placeholder:"Please input the text source",onChange:e=>M(e.target.value),sx:{marginBottom:"20px"}}),"Text:",(0,n.jsx)(b.Z,{onChange:e=>I(e.target.value),minRows:4,sx:{marginBottom:"20px"}})]}),(0,n.jsx)(Z.ZP,{component:"label",sx:{marginTop:"20px"},endDecorator:(0,n.jsx)(P.Z,{checked:J,onChange:e=>X(e.target.checked)}),children:"Synch:"})]}),(0,n.jsxs)(g.Z,{direction:"row",justifyContent:"flex-start",alignItems:"center",sx:{marginBottom:"20px"},children:[(0,n.jsx)(j.Z,{variant:"outlined",sx:{marginRight:"20px"},onClick:()=>l(1),children:"< Back"}),(0,n.jsx)(j.Z,{variant:"outlined",onClick:async()=>{if(""===U){d.ZP.error("Please input the name");return}if("webPage"===x){if(""===D){d.ZP.error("Please input the Web Page URL");return}let e=await (0,w.PR)("/knowledge/".concat(z,"/document/add"),{doc_name:U,content:D,doc_type:"URL"});e.success?(d.ZP.success("success"),A(!1),J&&(0,w.PR)("/knowledge/".concat(z,"/document/sync"),{doc_ids:[e.data]})):d.ZP.error(e.err_msg||"failed")}else if("file"===x){if(!H){d.ZP.error("Please select a file");return}let e=new FormData;e.append("doc_name",U),e.append("doc_file",H),e.append("doc_type","DOCUMENT");let t=await (0,w.Ej)("/knowledge/".concat(z,"/document/upload"),e);t.success?(d.ZP.success("success"),A(!1),J&&(0,w.PR)("/knowledge/".concat(z,"/document/sync"),{doc_ids:[t.data]})):d.ZP.error(t.err_msg||"failed")}else{if(""===V){d.ZP.error("Please input the text");return}let e=await (0,w.PR)("/knowledge/".concat(z,"/document/add"),{doc_name:U,source:G,content:V,doc_type:"TEXT"});e.success?(d.ZP.success("success"),A(!1),J&&(0,w.PR)("/knowledge/".concat(z,"/document/sync"),{doc_ids:[e.data]})):d.ZP.error(e.err_msg||"failed")}},children:"Finish"})]})]})]})})]})}},78915:function(e,t,r){"use strict";r.d(t,{Tk:function(){return d},Kw:function(){return x},PR:function(){return p},Ej:function(){return h}});var n=r(21628),s=r(24214),o=r(52040);let a=s.Z.create({baseURL:o.env.API_BASE_URL});a.defaults.timeout=1e4,a.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var i=r(84835);let c={"content-type":"application/json"},l=e=>{if(!(0,i.isPlainObject)(e))return JSON.stringify(e);let t={...e};for(let e in t){let r=t[e];"string"==typeof r&&(t[e]=r.trim())}return JSON.stringify(t)},d=(e,t)=>{if(t){let r=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");r&&(e+="?".concat(r))}return a.get("/api"+e,{headers:c}).then(e=>e).catch(e=>{n.ZP.error(e),Promise.reject(e)})},x=(e,t)=>{let r=l(t);return a.post("/api"+e,{body:r,headers:c}).then(e=>e).catch(e=>{n.ZP.error(e),Promise.reject(e)})},p=(e,t)=>{let r=l(t);return a.post(e,{body:r,headers:c}).then(e=>e).catch(e=>{n.ZP.error(e),Promise.reject(e)})},h=(e,t)=>a.post(e,{body:t}).then(e=>e).catch(e=>{n.ZP.error(e),Promise.reject(e)})}},function(e){e.O(0,[180,106,685,86,693,118,672,642,253,769,744],function(){return e(e.s=20198)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/datastores/page-61000a09b00d15a3.js b/pilot/server/static/_next/static/chunks/app/datastores/page-61000a09b00d15a3.js new file mode 100644 index 000000000..8c4e8326e --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/datastores/page-61000a09b00d15a3.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[43],{29382:function(e,t,n){"use strict";var r=n(78997);t.Z=void 0;var s=r(n(76906)),o=n(9268),i=(0,s.default)([(0,o.jsx)("path",{d:"M5 5h2v3h10V5h2v5h2V5c0-1.1-.9-2-2-2h-4.18C14.4 1.84 13.3 1 12 1s-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h5v-2H5V5zm7-2c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1z"},"0"),(0,o.jsx)("path",{d:"M20.3 18.9c.4-.7.7-1.5.7-2.4 0-2.5-2-4.5-4.5-4.5S12 14 12 16.5s2 4.5 4.5 4.5c.9 0 1.7-.3 2.4-.7l2.7 2.7 1.4-1.4-2.7-2.7zm-3.8.1c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5z"},"1")],"ContentPasteSearchOutlined");t.Z=i},20198:function(e,t,n){Promise.resolve().then(n.bind(n,44323))},44323:function(e,t,n){"use strict";n.r(t);var r=n(9268),s=n(56008),o=n(86006),i=n(72474),a=n(59534),c=n(29382),l=n(50157),d=n(21628),x=n(50645),p=n(5737),h=n(78635),u=n(90545),g=n(70900),m=n(11437),f=n(35086),j=n(53113),b=n(866),Z=n(22046),w=n(28086),P=n(78915);let{Dragger:y}=l.default,k=(0,x.Z)(p.Z)(e=>{let{theme:t}=e;return{width:"33%",backgroundColor:"dark"===t.palette.mode?t.palette.background.level1:"#fff",...t.typography.body2,padding:t.spacing(1),textAlign:"center",borderRadius:4,color:t.vars.palette.text.secondary}}),S=["Knowledge Space Config","Choose a Datasource type","Setup the Datasource"],v=[{type:"text",title:"Text",subTitle:"Fill your raw text"},{type:"webPage",title:"URL",subTitle:"Fetch the content of a URL"},{type:"file",title:"Document",subTitle:"Upload a document, document type can be PDF, CSV, Text, PowerPoint, Word, Markdown"}];t.default=()=>{let e=(0,s.useRouter)(),{mode:t}=(0,h.tv)(),[n,l]=(0,o.useState)(0),[x,F]=(0,o.useState)(""),[C,R]=(0,o.useState)([]),[_,z]=(0,o.useState)(!1),[N,T]=(0,o.useState)(""),[E,D]=(0,o.useState)(""),[O,W]=(0,o.useState)(""),[A,B]=(0,o.useState)(""),[U,L]=(0,o.useState)(""),[G,M]=(0,o.useState)(null),[V,H]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{(async function(){let e=await (0,P.PR)("/knowledge/space/list");e.success&&R(e.data)})()},[]),(0,r.jsxs)(u.Z,{sx:{width:"100%",height:"100%"},className:"bg-[#F1F2F5] dark:bg-[#212121]",children:[(0,r.jsx)(u.Z,{className:"page-body p-4",sx:{"&":{height:"90%",overflow:"auto"},"&::-webkit-scrollbar":{display:"none"}},children:(0,r.jsxs)(g.Z,{direction:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",sx:{"& i":{width:"430px",marginRight:"30px"}},children:[(0,r.jsxs)(u.Z,{sx:{display:"flex",alignContent:"start",boxSizing:"content-box",width:"390px",height:"79px",padding:"33px 20px 40px",marginRight:"30px",marginBottom:"30px",fontSize:"18px",fontWeight:"bold",color:"black",flexShrink:0,flexGrow:0,cursor:"pointer",borderRadius:"16px","&: hover":{boxShadow:"0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);"}},onClick:()=>z(!0),className:"bg-[#E9EBEE] dark:bg-[#484848]",children:[(0,r.jsx)(u.Z,{sx:{width:"32px",height:"32px",lineHeight:"28px",border:"1px solid gray",textAlign:"center",borderRadius:"5px",marginRight:"5px",fontWeight:"300"},children:"+"}),(0,r.jsx)(u.Z,{sx:{fontSize:"16px"},children:"space"})]}),C.map((t,n)=>(0,r.jsxs)(u.Z,{sx:{padding:"30px 20px 40px",marginRight:"30px",marginBottom:"30px",borderTop:"4px solid rgb(84, 164, 248)",flexShrink:0,flexGrow:0,cursor:"pointer",borderRadius:"10px","&: hover":{boxShadow:"0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);"}},onClick:()=>{e.push("/datastores/documents?name=".concat(t.name))},className:"bg-[#FFFFFF] dark:bg-[#484848]",children:[(0,r.jsxs)(u.Z,{sx:{fontSize:"18px",marginBottom:"10px",fontWeight:"bold",color:"black"},children:[(0,r.jsx)(c.Z,{sx:{marginRight:"5px",color:"#2AA3FF"}}),t.name]}),(0,r.jsxs)(u.Z,{sx:{display:"flex",justifyContent:"flex-start"},children:[(0,r.jsxs)(u.Z,{sx:{width:"130px",flexGrow:0,flexShrink:0},children:[(0,r.jsx)(u.Z,{sx:{color:"#2AA3FF"},children:t.vector_type}),(0,r.jsx)(u.Z,{sx:{fontSize:"12px",color:"black"},children:"Vector"})]}),(0,r.jsxs)(u.Z,{sx:{width:"130px",flexGrow:0,flexShrink:0},children:[(0,r.jsx)(u.Z,{sx:{color:"#2AA3FF"},children:t.owner}),(0,r.jsx)(u.Z,{sx:{fontSize:"12px",color:"black"},children:"Owner"})]}),(0,r.jsxs)(u.Z,{sx:{width:"130px",flexGrow:0,flexShrink:0},children:[(0,r.jsx)(u.Z,{sx:{color:"#2AA3FF"},children:t.docs||0}),(0,r.jsx)(u.Z,{sx:{fontSize:"12px",color:"black"},children:"Docs"})]})]})]},n)),(0,r.jsx)("i",{}),(0,r.jsx)("i",{}),(0,r.jsx)("i",{}),(0,r.jsx)("i",{}),(0,r.jsx)("i",{})]})}),(0,r.jsx)(m.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center","z-index":1e3},open:_,onClose:()=>z(!1),children:(0,r.jsxs)(p.Z,{variant:"outlined",sx:{width:800,borderRadius:"md",p:3,boxShadow:"lg"},children:[(0,r.jsx)(u.Z,{sx:{width:"100%"},children:(0,r.jsx)(g.Z,{spacing:2,direction:"row",children:S.map((e,t)=>(0,r.jsxs)(k,{sx:{fontWeight:n===t?"bold":"",color:n===t?"#814DDE":""},children:[tT(e.target.value)})]}),(0,r.jsx)(j.Z,{variant:"outlined",onClick:async()=>{if(""===N){d.ZP.error("please input the name");return}let e=await (0,P.PR)("/knowledge/space/add",{name:N,vector_type:"Chroma",owner:"keting",desc:"test1"});if(e.success){d.ZP.success("success"),l(1);let e=await (0,P.PR)("/knowledge/space/list");e.success&&R(e.data)}else d.ZP.error(e.err_msg||"failed")},children:"Next"})]}):1===n?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(u.Z,{sx:{margin:"30px auto"},children:v.map(e=>(0,r.jsxs)(p.Z,{sx:{boxSizing:"border-box",height:"80px",padding:"12px",display:"flex",flexDirection:"column",justifyContent:"space-between",border:"1px solid gray",borderRadius:"6px",marginBottom:"20px",cursor:"pointer"},onClick:()=>{F(e.type),l(2)},children:[(0,r.jsx)(p.Z,{sx:{fontSize:"20px",fontWeight:"bold"},children:e.title}),(0,r.jsx)(p.Z,{children:e.subTitle})]},e.type))})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(u.Z,{sx:{margin:"30px auto"},children:["Name:",(0,r.jsx)(f.ZP,{placeholder:"Please input the name",onChange:e=>W(e.target.value),sx:{marginBottom:"20px"}}),"webPage"===x?(0,r.jsxs)(r.Fragment,{children:["Web Page URL:",(0,r.jsx)(f.ZP,{placeholder:"Please input the Web Page URL",onChange:e=>D(e.target.value)})]}):"file"===x?(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(y,{name:"file",multiple:!1,onChange(e){var t;if(console.log(e),0===e.fileList.length){M(null),W("");return}M(e.file.originFileObj),W(null===(t=e.file.originFileObj)||void 0===t?void 0:t.name)},children:[(0,r.jsx)("p",{className:"ant-upload-drag-icon",children:(0,r.jsx)(i.Z,{})}),(0,r.jsx)("p",{style:{color:"rgb(22, 108, 255)",fontSize:"20px"},children:"Select or Drop file"}),(0,r.jsx)("p",{className:"ant-upload-hint",style:{color:"rgb(22, 108, 255)"},children:"PDF, PowerPoint, Excel, Word, Text, Markdown,"})]})}):(0,r.jsxs)(r.Fragment,{children:["Text Source(Optional):",(0,r.jsx)(f.ZP,{placeholder:"Please input the text source",onChange:e=>B(e.target.value),sx:{marginBottom:"20px"}}),"Text:",(0,r.jsx)(b.Z,{onChange:e=>L(e.target.value),minRows:4,sx:{marginBottom:"20px"}})]}),(0,r.jsx)(Z.ZP,{component:"label",sx:{marginTop:"20px"},endDecorator:(0,r.jsx)(w.Z,{checked:V,onChange:e=>H(e.target.checked)}),children:"Synch:"})]}),(0,r.jsxs)(g.Z,{direction:"row",justifyContent:"flex-start",alignItems:"center",sx:{marginBottom:"20px"},children:[(0,r.jsx)(j.Z,{variant:"outlined",sx:{marginRight:"20px"},onClick:()=>l(1),children:"< Back"}),(0,r.jsx)(j.Z,{variant:"outlined",onClick:async()=>{if(""===O){d.ZP.error("Please input the name");return}if("webPage"===x){if(""===E){d.ZP.error("Please input the Web Page URL");return}let e=await (0,P.PR)("/knowledge/".concat(N,"/document/add"),{doc_name:O,content:E,doc_type:"URL"});e.success?(d.ZP.success("success"),z(!1),V&&(0,P.PR)("/knowledge/".concat(N,"/document/sync"),{doc_ids:[e.data]})):d.ZP.error(e.err_msg||"failed")}else if("file"===x){if(!G){d.ZP.error("Please select a file");return}let e=new FormData;e.append("doc_name",O),e.append("doc_file",G),e.append("doc_type","DOCUMENT");let t=await (0,P.Ej)("/knowledge/".concat(N,"/document/upload"),e);t.success?(d.ZP.success("success"),z(!1),V&&(0,P.PR)("/knowledge/".concat(N,"/document/sync"),{doc_ids:[t.data]})):d.ZP.error(t.err_msg||"failed")}else{if(""===U){d.ZP.error("Please input the text");return}let e=await (0,P.PR)("/knowledge/".concat(N,"/document/add"),{doc_name:O,source:A,content:U,doc_type:"TEXT"});e.success?(d.ZP.success("success"),z(!1),V&&(0,P.PR)("/knowledge/".concat(N,"/document/sync"),{doc_ids:[e.data]})):d.ZP.error(e.err_msg||"failed")}},children:"Finish"})]})]})]})})]})}},78915:function(e,t,n){"use strict";n.d(t,{Tk:function(){return l},Kw:function(){return d},PR:function(){return x},Ej:function(){return p}});var r=n(21628),s=n(24214);let o=s.Z.create({baseURL:"http://127.0.0.1:5000"});o.defaults.timeout=1e4,o.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var i=n(84835);let a={"content-type":"application/json"},c=e=>{if(!(0,i.isPlainObject)(e))return JSON.stringify(e);let t={...e};for(let e in t){let n=t[e];"string"==typeof n&&(t[e]=n.trim())}return JSON.stringify(t)},l=(e,t)=>{if(t){let n=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");n&&(e+="?".concat(n))}return o.get("/api"+e,{headers:a}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},d=(e,t)=>{let n=c(t);return o.post("/api"+e,{body:n,headers:a}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},x=(e,t)=>{let n=c(t);return o.post(e,{body:n,headers:a}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},p=(e,t)=>o.post(e,{body:t}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})}},function(e){e.O(0,[180,430,577,214,86,693,118,672,642,253,769,744],function(){return e(e.s=20198)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/datastores/page-71018e8c7052cd88.js b/pilot/server/static/_next/static/chunks/app/datastores/page-71018e8c7052cd88.js new file mode 100644 index 000000000..155da50a2 --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/datastores/page-71018e8c7052cd88.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[43],{29382:function(e,t,n){"use strict";var r=n(78997);t.Z=void 0;var s=r(n(76906)),o=n(9268),a=(0,s.default)([(0,o.jsx)("path",{d:"M5 5h2v3h10V5h2v5h2V5c0-1.1-.9-2-2-2h-4.18C14.4 1.84 13.3 1 12 1s-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h5v-2H5V5zm7-2c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1z"},"0"),(0,o.jsx)("path",{d:"M20.3 18.9c.4-.7.7-1.5.7-2.4 0-2.5-2-4.5-4.5-4.5S12 14 12 16.5s2 4.5 4.5 4.5c.9 0 1.7-.3 2.4-.7l2.7 2.7 1.4-1.4-2.7-2.7zm-3.8.1c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5z"},"1")],"ContentPasteSearchOutlined");t.Z=a},20198:function(e,t,n){Promise.resolve().then(n.bind(n,44323))},44323:function(e,t,n){"use strict";n.r(t);var r=n(9268),s=n(56008),o=n(86006),a=n(72474),i=n(59534),c=n(29382),l=n(50157),d=n(21628),x=n(50645),p=n(5737),h=n(78635),u=n(90545),g=n(70900),m=n(11437),f=n(35086),j=n(53113),b=n(866),Z=n(22046),P=n(28086),w=n(78915);let{Dragger:y}=l.default,k=(0,x.Z)(p.Z)(e=>{let{theme:t}=e;return{width:"33%",backgroundColor:"dark"===t.palette.mode?t.palette.background.level1:"#fff",...t.typography.body2,padding:t.spacing(1),textAlign:"center",borderRadius:4,color:t.vars.palette.text.secondary}}),S=["Knowledge Space Config","Choose a Datasource type","Setup the Datasource"],F=[{type:"text",title:"Text",subTitle:"Fill your raw text"},{type:"webPage",title:"URL",subTitle:"Fetch the content of a URL"},{type:"file",title:"Document",subTitle:"Upload a document, document type can be PDF, CSV, Text, PowerPoint, Word, Markdown"}];t.default=()=>{let e=(0,s.useRouter)(),{mode:t}=(0,h.tv)(),[n,l]=(0,o.useState)(0),[x,v]=(0,o.useState)(""),[C,R]=(0,o.useState)([]),[_,A]=(0,o.useState)(!1),[z,N]=(0,o.useState)(""),[T,B]=(0,o.useState)(""),[E,O]=(0,o.useState)(""),[D,W]=(0,o.useState)(""),[U,L]=(0,o.useState)(""),[G,M]=(0,o.useState)(""),[V,I]=(0,o.useState)(""),[H,K]=(0,o.useState)(null),[J,X]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{(async function(){let e=await (0,w.PR)("/knowledge/space/list");e.success&&R(e.data)})()},[]),(0,r.jsxs)(u.Z,{sx:{width:"100%",height:"100%"},className:"bg-[#F1F2F5] dark:bg-[#212121]",children:[(0,r.jsx)(u.Z,{className:"page-body p-4",sx:{"&":{height:"90%",overflow:"auto"},"&::-webkit-scrollbar":{display:"none"}},children:(0,r.jsxs)(g.Z,{direction:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",sx:{"& i":{width:"430px",marginRight:"30px"}},children:[(0,r.jsxs)(u.Z,{sx:{display:"flex",alignContent:"start",boxSizing:"content-box",width:"390px",height:"79px",padding:"33px 20px 40px",marginRight:"30px",marginBottom:"30px",fontSize:"18px",fontWeight:"bold",color:"black",flexShrink:0,flexGrow:0,cursor:"pointer",borderRadius:"16px","&: hover":{boxShadow:"0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);"}},onClick:()=>A(!0),className:"bg-[#E9EBEE] dark:bg-[#484848]",children:[(0,r.jsx)(u.Z,{sx:{width:"32px",height:"32px",lineHeight:"28px",border:"1px solid #2AA3FF",textAlign:"center",borderRadius:"5px",marginRight:"5px",fontWeight:"300",color:"#2AA3FF"},children:"+"}),(0,r.jsx)(u.Z,{sx:{fontSize:"16px"},children:"space"})]}),C.map((t,n)=>(0,r.jsxs)(u.Z,{sx:{padding:"30px 20px 40px",marginRight:"30px",marginBottom:"30px",borderTop:"4px solid rgb(84, 164, 248)",flexShrink:0,flexGrow:0,cursor:"pointer",borderRadius:"10px","&: hover":{boxShadow:"0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);"}},onClick:()=>{e.push("/datastores/documents?name=".concat(t.name))},className:"bg-[#FFFFFF] dark:bg-[#484848]",children:[(0,r.jsxs)(u.Z,{sx:{fontSize:"18px",marginBottom:"10px",fontWeight:"bold",color:"black"},children:[(0,r.jsx)(c.Z,{sx:{marginRight:"5px",color:"#2AA3FF"}}),t.name]}),(0,r.jsxs)(u.Z,{sx:{display:"flex",justifyContent:"flex-start"},children:[(0,r.jsxs)(u.Z,{sx:{width:"130px",flexGrow:0,flexShrink:0},children:[(0,r.jsx)(u.Z,{sx:{color:"#2AA3FF"},children:t.vector_type}),(0,r.jsx)(u.Z,{sx:{fontSize:"12px",color:"black"},children:"Vector"})]}),(0,r.jsxs)(u.Z,{sx:{width:"130px",flexGrow:0,flexShrink:0},children:[(0,r.jsx)(u.Z,{sx:{color:"#2AA3FF"},children:t.owner}),(0,r.jsx)(u.Z,{sx:{fontSize:"12px",color:"black"},children:"Owner"})]}),(0,r.jsxs)(u.Z,{sx:{width:"130px",flexGrow:0,flexShrink:0},children:[(0,r.jsx)(u.Z,{sx:{color:"#2AA3FF"},children:t.docs||0}),(0,r.jsx)(u.Z,{sx:{fontSize:"12px",color:"black"},children:"Docs"})]})]})]},n)),(0,r.jsx)("i",{}),(0,r.jsx)("i",{}),(0,r.jsx)("i",{}),(0,r.jsx)("i",{}),(0,r.jsx)("i",{})]})}),(0,r.jsx)(m.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center","z-index":1e3},open:_,onClose:()=>A(!1),children:(0,r.jsxs)(p.Z,{variant:"outlined",sx:{width:800,borderRadius:"md",p:3,boxShadow:"lg"},children:[(0,r.jsx)(u.Z,{sx:{width:"100%"},children:(0,r.jsx)(g.Z,{spacing:2,direction:"row",children:S.map((e,t)=>(0,r.jsxs)(k,{sx:{fontWeight:n===t?"bold":"",color:n===t?"#2AA3FF":""},children:[tN(e.target.value),sx:{marginBottom:"20px"}}),"Owner:",(0,r.jsx)(f.ZP,{placeholder:"Please input the owner",onChange:e=>B(e.target.value),sx:{marginBottom:"20px"}}),"Description:",(0,r.jsx)(f.ZP,{placeholder:"Please input the description",onChange:e=>O(e.target.value),sx:{marginBottom:"20px"}})]}),(0,r.jsx)(j.Z,{variant:"outlined",onClick:async()=>{if(""===z){d.ZP.error("please input the name");return}if(""===T){d.ZP.error("please input the owner");return}if(""===E){d.ZP.error("please input the description");return}let e=await (0,w.PR)("/knowledge/space/add",{name:z,vector_type:"Chroma",owner:T,desc:E});if(e.success){d.ZP.success("success"),l(1);let e=await (0,w.PR)("/knowledge/space/list");e.success&&R(e.data)}else d.ZP.error(e.err_msg||"failed")},children:"Next"})]}):1===n?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(u.Z,{sx:{margin:"30px auto"},children:F.map(e=>(0,r.jsxs)(p.Z,{sx:{boxSizing:"border-box",height:"80px",padding:"12px",display:"flex",flexDirection:"column",justifyContent:"space-between",border:"1px solid gray",borderRadius:"6px",marginBottom:"20px",cursor:"pointer"},onClick:()=>{v(e.type),l(2)},children:[(0,r.jsx)(p.Z,{sx:{fontSize:"20px",fontWeight:"bold"},children:e.title}),(0,r.jsx)(p.Z,{children:e.subTitle})]},e.type))})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(u.Z,{sx:{margin:"30px auto"},children:["Name:",(0,r.jsx)(f.ZP,{placeholder:"Please input the name",onChange:e=>L(e.target.value),sx:{marginBottom:"20px"}}),"webPage"===x?(0,r.jsxs)(r.Fragment,{children:["Web Page URL:",(0,r.jsx)(f.ZP,{placeholder:"Please input the Web Page URL",onChange:e=>W(e.target.value)})]}):"file"===x?(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(y,{name:"file",multiple:!1,onChange(e){var t;if(console.log(e),0===e.fileList.length){K(null),L("");return}K(e.file.originFileObj),L(null===(t=e.file.originFileObj)||void 0===t?void 0:t.name)},children:[(0,r.jsx)("p",{className:"ant-upload-drag-icon",children:(0,r.jsx)(a.Z,{})}),(0,r.jsx)("p",{style:{color:"rgb(22, 108, 255)",fontSize:"20px"},children:"Select or Drop file"}),(0,r.jsx)("p",{className:"ant-upload-hint",style:{color:"rgb(22, 108, 255)"},children:"PDF, PowerPoint, Excel, Word, Text, Markdown,"})]})}):(0,r.jsxs)(r.Fragment,{children:["Text Source(Optional):",(0,r.jsx)(f.ZP,{placeholder:"Please input the text source",onChange:e=>M(e.target.value),sx:{marginBottom:"20px"}}),"Text:",(0,r.jsx)(b.Z,{onChange:e=>I(e.target.value),minRows:4,sx:{marginBottom:"20px"}})]}),(0,r.jsx)(Z.ZP,{component:"label",sx:{marginTop:"20px"},endDecorator:(0,r.jsx)(P.Z,{checked:J,onChange:e=>X(e.target.checked)}),children:"Synch:"})]}),(0,r.jsxs)(g.Z,{direction:"row",justifyContent:"flex-start",alignItems:"center",sx:{marginBottom:"20px"},children:[(0,r.jsx)(j.Z,{variant:"outlined",sx:{marginRight:"20px"},onClick:()=>l(1),children:"< Back"}),(0,r.jsx)(j.Z,{variant:"outlined",onClick:async()=>{if(""===U){d.ZP.error("Please input the name");return}if("webPage"===x){if(""===D){d.ZP.error("Please input the Web Page URL");return}let e=await (0,w.PR)("/knowledge/".concat(z,"/document/add"),{doc_name:U,content:D,doc_type:"URL"});e.success?(d.ZP.success("success"),A(!1),J&&(0,w.PR)("/knowledge/".concat(z,"/document/sync"),{doc_ids:[e.data]})):d.ZP.error(e.err_msg||"failed")}else if("file"===x){if(!H){d.ZP.error("Please select a file");return}let e=new FormData;e.append("doc_name",U),e.append("doc_file",H),e.append("doc_type","DOCUMENT");let t=await (0,w.Ej)("/knowledge/".concat(z,"/document/upload"),e);t.success?(d.ZP.success("success"),A(!1),J&&(0,w.PR)("/knowledge/".concat(z,"/document/sync"),{doc_ids:[t.data]})):d.ZP.error(t.err_msg||"failed")}else{if(""===V){d.ZP.error("Please input the text");return}let e=await (0,w.PR)("/knowledge/".concat(z,"/document/add"),{doc_name:U,source:G,content:V,doc_type:"TEXT"});e.success?(d.ZP.success("success"),A(!1),J&&(0,w.PR)("/knowledge/".concat(z,"/document/sync"),{doc_ids:[e.data]})):d.ZP.error(e.err_msg||"failed")}},children:"Finish"})]})]})]})})]})}},78915:function(e,t,n){"use strict";n.d(t,{Tk:function(){return d},Kw:function(){return x},PR:function(){return p},Ej:function(){return h}});var r=n(21628),s=n(24214),o=n(52040);let a=s.Z.create({baseURL:o.env.API_BASE_URL});a.defaults.timeout=1e4,a.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var i=n(84835);let c={"content-type":"application/json"},l=e=>{if(!(0,i.isPlainObject)(e))return JSON.stringify(e);let t={...e};for(let e in t){let n=t[e];"string"==typeof n&&(t[e]=n.trim())}return JSON.stringify(t)},d=(e,t)=>{if(t){let n=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");n&&(e+="?".concat(n))}return a.get("/api"+e,{headers:c}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},x=(e,t)=>{let n=l(t);return a.post("/api"+e,{body:n,headers:c}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})},p=(e,t)=>(l(t),a.post(e,t,{headers:c}).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})),h=(e,t)=>a.post(e,t).then(e=>e).catch(e=>{r.ZP.error(e),Promise.reject(e)})}},function(e){e.O(0,[180,106,685,86,693,118,672,642,253,769,744],function(){return e(e.s=20198)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/datastores/page-996f6590d12decbc.js b/pilot/server/static/_next/static/chunks/app/datastores/page-996f6590d12decbc.js new file mode 100644 index 000000000..6d68eee97 --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/datastores/page-996f6590d12decbc.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[43],{29382:function(e,t,n){"use strict";var o=n(78997);t.Z=void 0;var s=o(n(76906)),a=n(9268),i=(0,s.default)([(0,a.jsx)("path",{d:"M5 5h2v3h10V5h2v5h2V5c0-1.1-.9-2-2-2h-4.18C14.4 1.84 13.3 1 12 1s-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h5v-2H5V5zm7-2c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1z"},"0"),(0,a.jsx)("path",{d:"M20.3 18.9c.4-.7.7-1.5.7-2.4 0-2.5-2-4.5-4.5-4.5S12 14 12 16.5s2 4.5 4.5 4.5c.9 0 1.7-.3 2.4-.7l2.7 2.7 1.4-1.4-2.7-2.7zm-3.8.1c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5z"},"1")],"ContentPasteSearchOutlined");t.Z=i},20198:function(e,t,n){Promise.resolve().then(n.bind(n,44323))},44323:function(e,t,n){"use strict";n.r(t);var o=n(9268),s=n(56008),a=n(86006),i=n(72474),r=n(59534),c=n(29382),l=n(50157),d=n(21628),x=n(50645),p=n(5737),h=n(78635),g=n(90545),u=n(70900),f=n(11437),m=n(35086),j=n(53113),b=n(866),w=n(22046),y=n(28086);let{Dragger:Z}=l.default,S=(0,x.Z)(p.Z)(e=>{let{theme:t}=e;return{width:"33%",backgroundColor:"dark"===t.palette.mode?t.palette.background.level1:"#fff",...t.typography.body2,padding:t.spacing(1),textAlign:"center",borderRadius:4,color:t.vars.palette.text.secondary}}),P=["Knowledge Space Config","Choose a Datasource type","Setup the Datasource"],k=[{type:"text",title:"Text",subTitle:"Fill your raw text"},{type:"webPage",title:"URL",subTitle:"Fetch the content of a URL"},{type:"file",title:"Document",subTitle:"Upload a document, document type can be PDF, CSV, Text, PowerPoint, Word, Markdown"}];t.default=()=>{let e=(0,s.useRouter)(),{mode:t}=(0,h.tv)(),[n,l]=(0,a.useState)(0),[x,C]=(0,a.useState)(""),[F,T]=(0,a.useState)([]),[v,O]=(0,a.useState)(!1),[_,N]=(0,a.useState)(""),[R,z]=(0,a.useState)(""),[D,E]=(0,a.useState)(""),[W,A]=(0,a.useState)(""),[B,J]=(0,a.useState)(""),[U,L]=(0,a.useState)(null),[G,M]=(0,a.useState)(!0);return(0,a.useEffect)(()=>{(async function(){let e=await fetch("".concat("http://127.0.0.1:5000","/knowledge/space/list"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),t=await e.json();t.success&&T(t.data)})()},[]),(0,o.jsxs)(g.Z,{sx:{width:"100%",height:"100%"},className:"bg-[#F1F2F5] dark:bg-[#212121]",children:[(0,o.jsx)(g.Z,{className:"page-body p-4",sx:{"&":{height:"90%",overflow:"auto"},"&::-webkit-scrollbar":{display:"none"}},children:(0,o.jsxs)(u.Z,{direction:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",sx:{"& i":{width:"430px",marginRight:"30px"}},children:[(0,o.jsxs)(g.Z,{sx:{display:"flex",alignContent:"start",boxSizing:"content-box",width:"390px",height:"79px",padding:"33px 20px 40px",marginRight:"30px",marginBottom:"30px",fontSize:"18px",fontWeight:"bold",color:"black",flexShrink:0,flexGrow:0,cursor:"pointer",borderRadius:"16px","&: hover":{boxShadow:"0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);"}},onClick:()=>O(!0),className:"bg-[#E9EBEE] dark:bg-[#484848]",children:[(0,o.jsx)(g.Z,{sx:{width:"32px",height:"32px",lineHeight:"28px",border:"1px solid gray",textAlign:"center",borderRadius:"5px",marginRight:"5px",fontWeight:"300"},children:"+"}),(0,o.jsx)(g.Z,{sx:{fontSize:"16px"},children:"space"})]}),F.map((t,n)=>(0,o.jsxs)(g.Z,{sx:{padding:"30px 20px 40px",marginRight:"30px",marginBottom:"30px",borderTop:"4px solid rgb(84, 164, 248)",flexShrink:0,flexGrow:0,cursor:"pointer",borderRadius:"10px","&: hover":{boxShadow:"0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);"}},onClick:()=>{e.push("/datastores/documents?name=".concat(t.name))},className:"bg-[#FFFFFF] dark:bg-[#484848]",children:[(0,o.jsxs)(g.Z,{sx:{fontSize:"18px",marginBottom:"10px",fontWeight:"bold",color:"black"},children:[(0,o.jsx)(c.Z,{sx:{marginRight:"5px",color:"#2AA3FF"}}),t.name]}),(0,o.jsxs)(g.Z,{sx:{display:"flex",justifyContent:"flex-start"},children:[(0,o.jsxs)(g.Z,{sx:{width:"130px",flexGrow:0,flexShrink:0},children:[(0,o.jsx)(g.Z,{sx:{color:"#2AA3FF"},children:t.vector_type}),(0,o.jsx)(g.Z,{sx:{fontSize:"12px",color:"black"},children:"Vector"})]}),(0,o.jsxs)(g.Z,{sx:{width:"130px",flexGrow:0,flexShrink:0},children:[(0,o.jsx)(g.Z,{sx:{color:"#2AA3FF"},children:t.owner}),(0,o.jsx)(g.Z,{sx:{fontSize:"12px",color:"black"},children:"Owner"})]}),(0,o.jsxs)(g.Z,{sx:{width:"130px",flexGrow:0,flexShrink:0},children:[(0,o.jsx)(g.Z,{sx:{color:"#2AA3FF"},children:t.docs||0}),(0,o.jsx)(g.Z,{sx:{fontSize:"12px",color:"black"},children:"Docs"})]})]})]},n)),(0,o.jsx)("i",{}),(0,o.jsx)("i",{}),(0,o.jsx)("i",{}),(0,o.jsx)("i",{}),(0,o.jsx)("i",{})]})}),(0,o.jsx)(f.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center","z-index":1e3},open:v,onClose:()=>O(!1),children:(0,o.jsxs)(p.Z,{variant:"outlined",sx:{width:800,borderRadius:"md",p:3,boxShadow:"lg"},children:[(0,o.jsx)(g.Z,{sx:{width:"100%"},children:(0,o.jsx)(u.Z,{spacing:2,direction:"row",children:P.map((e,t)=>(0,o.jsxs)(S,{sx:{fontWeight:n===t?"bold":"",color:n===t?"#814DDE":""},children:[tN(e.target.value)})]}),(0,o.jsx)(j.Z,{variant:"outlined",onClick:async()=>{if(""===_){d.ZP.error("please input the name");return}let e=await fetch("".concat("http://127.0.0.1:5000","/knowledge/space/add"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:_,vector_type:"Chroma",owner:"keting",desc:"test1"})}),t=await e.json();if(t.success){d.ZP.success("success"),l(1);let e=await fetch("".concat("http://127.0.0.1:5000","/knowledge/space/list"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),t=await e.json();t.success&&T(t.data)}else d.ZP.error(t.err_msg||"failed")},children:"Next"})]}):1===n?(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(g.Z,{sx:{margin:"30px auto"},children:k.map(e=>(0,o.jsxs)(p.Z,{sx:{boxSizing:"border-box",height:"80px",padding:"12px",display:"flex",flexDirection:"column",justifyContent:"space-between",border:"1px solid gray",borderRadius:"6px",marginBottom:"20px",cursor:"pointer"},onClick:()=>{C(e.type),l(2)},children:[(0,o.jsx)(p.Z,{sx:{fontSize:"20px",fontWeight:"bold"},children:e.title}),(0,o.jsx)(p.Z,{children:e.subTitle})]},e.type))})}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(g.Z,{sx:{margin:"30px auto"},children:["Name:",(0,o.jsx)(m.ZP,{placeholder:"Please input the name",onChange:e=>E(e.target.value),sx:{marginBottom:"20px"}}),"webPage"===x?(0,o.jsxs)(o.Fragment,{children:["Web Page URL:",(0,o.jsx)(m.ZP,{placeholder:"Please input the Web Page URL",onChange:e=>z(e.target.value)})]}):"file"===x?(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(Z,{name:"file",multiple:!1,onChange(e){var t;if(console.log(e),0===e.fileList.length){L(null),E("");return}L(e.file.originFileObj),E(null===(t=e.file.originFileObj)||void 0===t?void 0:t.name)},children:[(0,o.jsx)("p",{className:"ant-upload-drag-icon",children:(0,o.jsx)(i.Z,{})}),(0,o.jsx)("p",{style:{color:"rgb(22, 108, 255)",fontSize:"20px"},children:"Select or Drop file"}),(0,o.jsx)("p",{className:"ant-upload-hint",style:{color:"rgb(22, 108, 255)"},children:"PDF, PowerPoint, Excel, Word, Text, Markdown,"})]})}):(0,o.jsxs)(o.Fragment,{children:["Text Source(Optional):",(0,o.jsx)(m.ZP,{placeholder:"Please input the text source",onChange:e=>A(e.target.value),sx:{marginBottom:"20px"}}),"Text:",(0,o.jsx)(b.Z,{onChange:e=>J(e.target.value),minRows:4,sx:{marginBottom:"20px"}})]}),(0,o.jsx)(w.ZP,{component:"label",sx:{marginTop:"20px"},endDecorator:(0,o.jsx)(y.Z,{checked:G,onChange:e=>M(e.target.checked)}),children:"Synch:"})]}),(0,o.jsxs)(u.Z,{direction:"row",justifyContent:"flex-start",alignItems:"center",sx:{marginBottom:"20px"},children:[(0,o.jsx)(j.Z,{variant:"outlined",sx:{marginRight:"20px"},onClick:()=>l(1),children:"< Back"}),(0,o.jsx)(j.Z,{variant:"outlined",onClick:async()=>{if(""===D){d.ZP.error("Please input the name");return}if("webPage"===x){if(""===R){d.ZP.error("Please input the Web Page URL");return}let e=await fetch("".concat("http://127.0.0.1:5000","/knowledge/").concat(_,"/document/add"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({doc_name:D,content:R,doc_type:"URL"})}),t=await e.json();t.success?(d.ZP.success("success"),O(!1),G&&fetch("".concat("http://127.0.0.1:5000","/knowledge/").concat(_,"/document/sync"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({doc_ids:[t.data]})})):d.ZP.error(t.err_msg||"failed")}else if("file"===x){if(!U){d.ZP.error("Please select a file");return}let e=new FormData;e.append("doc_name",D),e.append("doc_file",U),e.append("doc_type","DOCUMENT");let t=await fetch("".concat("http://127.0.0.1:5000","/knowledge/").concat(_,"/document/upload"),{method:"POST",body:e}),n=await t.json();n.success?(d.ZP.success("success"),O(!1),G&&fetch("".concat("http://127.0.0.1:5000","/knowledge/").concat(_,"/document/sync"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({doc_ids:[n.data]})})):d.ZP.error(n.err_msg||"failed")}else{if(""===B){d.ZP.error("Please input the text");return}let e=await fetch("".concat("http://127.0.0.1:5000","/knowledge/").concat(_,"/document/add"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({doc_name:D,source:W,content:B,doc_type:"TEXT"})}),t=await e.json();t.success?(d.ZP.success("success"),O(!1),G&&fetch("".concat("http://127.0.0.1:5000","/knowledge/").concat(_,"/document/sync"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({doc_ids:[t.data]})})):d.ZP.error(t.err_msg||"failed")}},children:"Finish"})]})]})]})})]})}}},function(e){e.O(0,[430,577,86,693,118,672,642,253,769,744],function(){return e(e.s=20198)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/layout-117315994f4b8aae.js b/pilot/server/static/_next/static/chunks/app/layout-117315994f4b8aae.js new file mode 100644 index 000000000..cb0eb79cd --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/layout-117315994f4b8aae.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{72431:function(){},49407:function(e,t,r){Promise.resolve().then(r.bind(r,50902))},57931:function(e,t,r){"use strict";r.d(t,{ZP:function(){return d},Cg:function(){return o}});var n=r(9268),i=r(89081),s=r(78915),l=r(86006);let[o,a]=function(){let e=l.createContext(void 0);return[function(){let t=l.useContext(e);if(void 0===t)throw Error("useCtx must be inside a Provider with a value");return t},e.Provider]}();var d=e=>{let{children:t}=e,{run:r,data:l,refresh:o}=(0,i.Z)(async()=>await (0,s.Tk)("/v1/chat/dialogue/list"),{manual:!0});return(0,n.jsx)(a,{value:{dialogueList:l,queryDialogueList:r,refreshDialogList:o},children:t})}},50902:function(e,t,r){"use strict";let n,i;r.r(t),r.d(t,{default:function(){return K}});var s=r(9268);r(97402),r(23517);var l=r(86006),o=r(56008),a=r(35846),d=r.n(a),c=r(20837),u=r(78635),h=r(90545),f=r(22046),x=r(53113),m=r(18818),p=r(4882),v=r(70092),j=r(64579),g=r(53047),b=r(62921),y=r(40020),Z=r(11515),w=r(84892),k=r(601),C=r(1301),B=r(98703),P=r(57931),N=r(66664),_=r(78915),D=()=>{var e;let t=(0,o.usePathname)(),r=(0,o.useSearchParams)(),n=r.get("id"),i=(0,o.useRouter)(),{dialogueList:a,queryDialogueList:D,refreshDialogList:E}=(0,P.Cg)(),{mode:S,setMode:z}=(0,u.tv)(),F=(0,l.useMemo)(()=>[{label:"Knowledge Space",route:"/datastores",icon:(0,s.jsx)(y.Z,{fontSize:"small"}),active:"/datastores"===t}],[t]);return(0,l.useEffect)(()=>{(async()=>{await D()})()},[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("nav",{className:"flex h-12 items-center justify-between border-b px-4 dark:border-gray-800 dark:bg-gray-800/70 md:hidden",children:[(0,s.jsx)("div",{children:(0,s.jsx)(k.Z,{})}),(0,s.jsx)("span",{className:"truncate px-4",children:"New Chat"}),(0,s.jsx)("a",{href:"",className:"-mr-3 flex h-9 w-9 shrink-0 items-center justify-center",children:(0,s.jsx)(C.Z,{})})]}),(0,s.jsx)("nav",{className:"grid max-h-screen h-full max-md:hidden",children:(0,s.jsxs)(h.Z,{sx:{display:"flex",flexDirection:"column",borderRight:"1px solid",borderColor:"divider",maxHeight:"100vh",position:"sticky",left:"0px",top:"0px",overflow:"hidden"},children:[(0,s.jsx)(h.Z,{sx:{p:2,gap:2,display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:(0,s.jsx)("div",{className:"flex items-center gap-3",children:(0,s.jsx)(f.ZP,{component:"h1",fontWeight:"xl",children:"DB-GPT"})})}),(0,s.jsx)(h.Z,{sx:{px:2},children:(0,s.jsx)(d(),{href:"/",children:(0,s.jsx)(x.Z,{color:"primary",className:"w-full bg-gradient-to-r from-[#31afff] to-[#1677ff] dark:bg-gradient-to-r dark:from-[#6a6a6a] dark:to-[#80868f]",style:{color:"#fff"},children:"+ New Chat"})})}),(0,s.jsx)(h.Z,{sx:{p:2,display:{xs:"none",sm:"initial"},maxHeight:"100%",overflow:"auto"},children:(0,s.jsx)(m.Z,{size:"sm",sx:{"--ListItem-radius":"8px"},children:(0,s.jsx)(p.Z,{nested:!0,children:(0,s.jsx)(m.Z,{size:"sm","aria-labelledby":"nav-list-browse",sx:{"& .JoyListItemButton-root":{p:"8px"},gap:"4px"},children:null==a?void 0:null===(e=a.data)||void 0===e?void 0:e.map(e=>{let l=("/chat"===t||"/chat/"===t)&&n===e.conv_uid;return(0,s.jsx)(p.Z,{children:(0,s.jsx)(v.Z,{selected:l,variant:l?"soft":"plain",sx:{"&:hover .del-btn":{visibility:"visible"}},children:(0,s.jsx)(j.Z,{children:(0,s.jsxs)(d(),{href:"/chat?id=".concat(e.conv_uid,"&scene=").concat(null==e?void 0:e.chat_mode),className:"flex items-center justify-between",children:[(0,s.jsxs)(f.ZP,{fontSize:14,noWrap:!0,children:[(0,s.jsx)(B.Z,{style:{marginRight:"0.5rem"}}),(null==e?void 0:e.user_name)||(null==e?void 0:e.user_input)||"undefined"]}),(0,s.jsx)(g.ZP,{color:"neutral",variant:"plain",size:"sm",onClick:n=>{n.preventDefault(),n.stopPropagation(),c.Z.confirm({title:"Delete Chat",content:"Are you sure delete this chat?",width:"276px",centered:!0,async onOk(){await (0,_.Kw)("/v1/chat/dialogue/delete?con_uid=".concat(e.conv_uid)),await E(),"/chat"===t&&r.get("id")===e.conv_uid&&i.push("/")}})},className:"del-btn invisible",children:(0,s.jsx)(N.Z,{})})]})})})},e.conv_uid)})})})})}),(0,s.jsxs)("div",{className:"flex flex-col justify-between flex-1",children:[(0,s.jsx)("div",{}),(0,s.jsx)(h.Z,{sx:{p:2,pt:3,pb:6,borderTop:"1px solid",borderColor:"divider",display:{xs:"none",sm:"initial"},position:"sticky",bottom:0,zIndex:100,background:"var(--joy-palette-background-body)"},children:(0,s.jsxs)(m.Z,{size:"sm",sx:{"--ListItem-radius":"8px"},children:[(0,s.jsx)(p.Z,{nested:!0,children:(0,s.jsx)(m.Z,{size:"sm","aria-labelledby":"nav-list-browse",sx:{"& .JoyListItemButton-root":{p:"8px"}},children:F.map(e=>(0,s.jsx)(d(),{href:e.route,children:(0,s.jsx)(p.Z,{children:(0,s.jsxs)(v.Z,{color:"neutral",sx:{marginBottom:1,height:"2.5rem"},selected:e.active,variant:e.active?"soft":"plain",children:[(0,s.jsx)(b.Z,{sx:{color:e.active?"inherit":"neutral.500"},children:e.icon}),(0,s.jsx)(j.Z,{children:e.label})]})})},e.route))})}),(0,s.jsx)(p.Z,{children:(0,s.jsxs)(v.Z,{sx:{height:"2.5rem"},onClick:()=>{"light"===S?z("dark"):z("light")},children:[(0,s.jsx)(b.Z,{children:"dark"===S?(0,s.jsx)(Z.Z,{fontSize:"small"}):(0,s.jsx)(w.Z,{fontSize:"small"})}),(0,s.jsx)(j.Z,{children:"Theme"})]})})]})})]})]})})]})},E=r(29720),S=r(41287),z=r(38230);let F=(0,S.Z)({colorSchemes:{light:{palette:{mode:"dark",primary:{...z.Z.grey,solidBg:"#e6f4ff",solidColor:"#1677ff",solidHoverBg:"#e6f4ff"},neutral:{plainColor:"#4d4d4d",plainHoverColor:"#131318",plainHoverBg:"#EBEBEF",plainActiveBg:"#D8D8DF",plainDisabledColor:"#B9B9C6"},background:{body:"#fff",surface:"#fff"},text:{primary:"#505050"}}},dark:{palette:{mode:"light",primary:{...z.Z.grey,softBg:"#353539",softHoverBg:"#35353978",softDisabledBg:"#353539",solidBg:"#51525beb",solidHoverBg:"#51525beb"},neutral:{plainColor:"#D8D8DF",plainHoverColor:"#F7F7F8",plainHoverBg:"#353539",plainActiveBg:"#434356",plainDisabledColor:"#434356",outlinedBorder:"#353539",outlinedHoverBorder:"#454651"},text:{primary:"#EBEBEF"},background:{body:"#212121",surface:"#51525beb"}}}},fontFamily:{body:"Josefin Sans, sans-serif",display:"Josefin Sans, sans-serif"},typography:{display1:{background:"linear-gradient(-30deg, var(--joy-palette-primary-900), var(--joy-palette-primary-400))",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}});var H=r(53794),L=r.n(H),T=r(54486),O=r.n(T);let I=0;function J(){"loading"!==i&&(i="loading",n=setTimeout(function(){O().start()},250))}function R(){I>0||(i="stop",clearTimeout(n),O().done())}if(L().events.on("routeChangeStart",J),L().events.on("routeChangeComplete",R),L().events.on("routeChangeError",R),"function"==typeof(null==window?void 0:window.fetch)){let e=window.fetch;window.fetch=async function(){for(var t=arguments.length,r=Array(t),n=0;n{if((null==n?void 0:n.current)&&r){var e,t,i,s,l,o;null==n||null===(e=n.current)||void 0===e||null===(t=e.classList)||void 0===t||t.add(r),"light"===r?null==n||null===(i=n.current)||void 0===i||null===(s=i.classList)||void 0===s||s.remove("dark"):null==n||null===(l=n.current)||void 0===l||null===(o=l.classList)||void 0===o||o.remove("light")}},[n,r]),(0,s.jsxs)("div",{ref:n,className:"h-full",children:[(0,s.jsx)(A,{}),(0,s.jsx)(P.ZP,{children:(0,s.jsx)("div",{className:"contents h-full",children:(0,s.jsxs)("div",{className:"grid h-full w-screen grid-cols-1 grid-rows-[auto,1fr] overflow-hidden text-smd dark:text-gray-300 md:grid-cols-[280px,1fr] md:grid-rows-[1fr]",children:[(0,s.jsx)(D,{}),(0,s.jsx)("div",{className:"relative min-h-0 min-w-0",children:t})]})})})]})}var K=function(e){let{children:t}=e;return(0,s.jsx)("html",{lang:"en",className:"h-full font-sans",children:(0,s.jsx)("body",{className:"h-full font-sans",children:(0,s.jsx)(E.Z,{theme:F,children:(0,s.jsx)(u.lL,{theme:F,defaultMode:"light",children:(0,s.jsx)(W,{children:t})})})})})}},78915:function(e,t,r){"use strict";r.d(t,{Tk:function(){return d},Kw:function(){return c},PR:function(){return u},Ej:function(){return h}});var n=r(21628),i=r(24214);let s=i.Z.create({baseURL:"http://127.0.0.1:5000"});s.defaults.timeout=1e4,s.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var l=r(84835);let o={"content-type":"application/json"},a=e=>{if(!(0,l.isPlainObject)(e))return JSON.stringify(e);let t={...e};for(let e in t){let r=t[e];"string"==typeof r&&(t[e]=r.trim())}return JSON.stringify(t)},d=(e,t)=>{if(t){let r=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");r&&(e+="?".concat(r))}return s.get("/api"+e,{headers:o}).then(e=>e).catch(e=>{n.ZP.error(e),Promise.reject(e)})},c=(e,t)=>{let r=a(t);return s.post("/api"+e,{body:r,headers:o}).then(e=>e).catch(e=>{n.ZP.error(e),Promise.reject(e)})},u=(e,t)=>{let r=a(t);return s.post(e,{body:r,headers:o}).then(e=>e).catch(e=>{n.ZP.error(e),Promise.reject(e)})},h=(e,t)=>s.post(e,{body:t}).then(e=>e).catch(e=>{n.ZP.error(e),Promise.reject(e)})},97402:function(){},23517:function(){}},function(e){e.O(0,[180,752,685,693,316,440,672,751,216,253,769,744],function(){return e(e.s=49407)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/layout-2c47115bc9505733.js b/pilot/server/static/_next/static/chunks/app/layout-2c47115bc9505733.js new file mode 100644 index 000000000..1f755e22f --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/layout-2c47115bc9505733.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{72431:function(){},49407:function(e,t,r){Promise.resolve().then(r.bind(r,50902))},57931:function(e,t,r){"use strict";r.d(t,{ZP:function(){return d},Cg:function(){return o}});var n=r(9268),i=r(89081),s=r(78915),l=r(86006);let[o,a]=function(){let e=l.createContext(void 0);return[function(){let t=l.useContext(e);if(void 0===t)throw Error("useCtx must be inside a Provider with a value");return t},e.Provider]}();var d=e=>{let{children:t}=e,{run:r,data:l,refresh:o}=(0,i.Z)(async()=>await (0,s.Tk)("/v1/chat/dialogue/list"),{manual:!0});return(0,n.jsx)(a,{value:{dialogueList:l,queryDialogueList:r,refreshDialogList:o},children:t})}},50902:function(e,t,r){"use strict";let n,i;r.r(t),r.d(t,{default:function(){return K}});var s=r(9268);r(97402),r(23517);var l=r(86006),o=r(56008),a=r(35846),d=r.n(a),c=r(20837),u=r(78635),h=r(90545),f=r(22046),x=r(53113),m=r(18818),p=r(4882),v=r(70092),j=r(64579),g=r(53047),b=r(62921),y=r(40020),Z=r(11515),w=r(84892),k=r(601),C=r(1301),B=r(98703),P=r(57931),N=r(66664),_=r(78915),D=()=>{var e;let t=(0,o.usePathname)(),r=(0,o.useSearchParams)(),n=r.get("id"),i=(0,o.useRouter)(),{dialogueList:a,queryDialogueList:D,refreshDialogList:E}=(0,P.Cg)(),{mode:S,setMode:z}=(0,u.tv)(),F=(0,l.useMemo)(()=>[{label:"Knowledge Space",route:"/datastores",icon:(0,s.jsx)(y.Z,{fontSize:"small"}),active:"/datastores"===t}],[t]);return(0,l.useEffect)(()=>{(async()=>{await D()})()},[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("nav",{className:"flex h-12 items-center justify-between border-b px-4 dark:border-gray-800 dark:bg-gray-800/70 md:hidden",children:[(0,s.jsx)("div",{children:(0,s.jsx)(k.Z,{})}),(0,s.jsx)("span",{className:"truncate px-4",children:"New Chat"}),(0,s.jsx)("a",{href:"",className:"-mr-3 flex h-9 w-9 shrink-0 items-center justify-center",children:(0,s.jsx)(C.Z,{})})]}),(0,s.jsx)("nav",{className:"grid max-h-screen h-full max-md:hidden",children:(0,s.jsxs)(h.Z,{sx:{display:"flex",flexDirection:"column",borderRight:"1px solid",borderColor:"divider",maxHeight:"100vh",position:"sticky",left:"0px",top:"0px",overflow:"hidden"},children:[(0,s.jsx)(h.Z,{sx:{p:2,gap:2,display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:(0,s.jsx)("div",{className:"flex items-center gap-3",children:(0,s.jsx)(f.ZP,{component:"h1",fontWeight:"xl",children:"DB-GPT"})})}),(0,s.jsx)(h.Z,{sx:{px:2},children:(0,s.jsx)(d(),{href:"/",children:(0,s.jsx)(x.Z,{color:"primary",className:"w-full bg-gradient-to-r from-[#31afff] to-[#1677ff] dark:bg-gradient-to-r dark:from-[#6a6a6a] dark:to-[#80868f]",style:{color:"#fff"},children:"+ New Chat"})})}),(0,s.jsx)(h.Z,{sx:{p:2,display:{xs:"none",sm:"initial"},maxHeight:"100%",overflow:"auto"},children:(0,s.jsx)(m.Z,{size:"sm",sx:{"--ListItem-radius":"8px"},children:(0,s.jsx)(p.Z,{nested:!0,children:(0,s.jsx)(m.Z,{size:"sm","aria-labelledby":"nav-list-browse",sx:{"& .JoyListItemButton-root":{p:"8px"},gap:"4px"},children:null==a?void 0:null===(e=a.data)||void 0===e?void 0:e.map(e=>{let l=("/chat"===t||"/chat/"===t)&&n===e.conv_uid;return(0,s.jsx)(p.Z,{children:(0,s.jsx)(v.Z,{selected:l,variant:l?"soft":"plain",sx:{"&:hover .del-btn":{visibility:"visible"}},children:(0,s.jsx)(j.Z,{children:(0,s.jsxs)(d(),{href:"/chat?id=".concat(e.conv_uid,"&scene=").concat(null==e?void 0:e.chat_mode),className:"flex items-center justify-between",children:[(0,s.jsxs)(f.ZP,{fontSize:14,noWrap:!0,children:[(0,s.jsx)(B.Z,{style:{marginRight:"0.5rem"}}),(null==e?void 0:e.user_name)||(null==e?void 0:e.user_input)||"undefined"]}),(0,s.jsx)(g.ZP,{color:"neutral",variant:"plain",size:"sm",onClick:n=>{n.preventDefault(),n.stopPropagation(),c.Z.confirm({title:"Delete Chat",content:"Are you sure delete this chat?",width:"276px",centered:!0,async onOk(){await (0,_.Kw)("/v1/chat/dialogue/delete?con_uid=".concat(e.conv_uid)),await E(),"/chat"===t&&r.get("id")===e.conv_uid&&i.push("/")}})},className:"del-btn invisible",children:(0,s.jsx)(N.Z,{})})]})})})},e.conv_uid)})})})})}),(0,s.jsxs)("div",{className:"flex flex-col justify-between flex-1",children:[(0,s.jsx)("div",{}),(0,s.jsx)(h.Z,{sx:{p:2,pt:3,pb:6,borderTop:"1px solid",borderColor:"divider",display:{xs:"none",sm:"initial"},position:"sticky",bottom:0,zIndex:100,background:"var(--joy-palette-background-body)"},children:(0,s.jsxs)(m.Z,{size:"sm",sx:{"--ListItem-radius":"8px"},children:[(0,s.jsx)(p.Z,{nested:!0,children:(0,s.jsx)(m.Z,{size:"sm","aria-labelledby":"nav-list-browse",sx:{"& .JoyListItemButton-root":{p:"8px"}},children:F.map(e=>(0,s.jsx)(d(),{href:e.route,children:(0,s.jsx)(p.Z,{children:(0,s.jsxs)(v.Z,{color:"neutral",sx:{marginBottom:1,height:"2.5rem"},selected:e.active,variant:e.active?"soft":"plain",children:[(0,s.jsx)(b.Z,{sx:{color:e.active?"inherit":"neutral.500"},children:e.icon}),(0,s.jsx)(j.Z,{children:e.label})]})})},e.route))})}),(0,s.jsx)(p.Z,{children:(0,s.jsxs)(v.Z,{sx:{height:"2.5rem"},onClick:()=>{"light"===S?z("dark"):z("light")},children:[(0,s.jsx)(b.Z,{children:"dark"===S?(0,s.jsx)(Z.Z,{fontSize:"small"}):(0,s.jsx)(w.Z,{fontSize:"small"})}),(0,s.jsx)(j.Z,{children:"Theme"})]})})]})})]})]})})]})},E=r(29720),S=r(41287),z=r(38230);let F=(0,S.Z)({colorSchemes:{light:{palette:{mode:"dark",primary:{...z.Z.grey,solidBg:"#e6f4ff",solidColor:"#1677ff",solidHoverBg:"#e6f4ff"},neutral:{plainColor:"#4d4d4d",plainHoverColor:"#131318",plainHoverBg:"#EBEBEF",plainActiveBg:"#D8D8DF",plainDisabledColor:"#B9B9C6"},background:{body:"#fff",surface:"#fff"},text:{primary:"#505050"}}},dark:{palette:{mode:"light",primary:{...z.Z.grey,softBg:"#353539",softHoverBg:"#35353978",softDisabledBg:"#353539",solidBg:"#51525beb",solidHoverBg:"#51525beb"},neutral:{plainColor:"#D8D8DF",plainHoverColor:"#F7F7F8",plainHoverBg:"#353539",plainActiveBg:"#434356",plainDisabledColor:"#434356",outlinedBorder:"#353539",outlinedHoverBorder:"#454651"},text:{primary:"#EBEBEF"},background:{body:"#212121",surface:"#51525beb"}}}},fontFamily:{body:"Josefin Sans, sans-serif",display:"Josefin Sans, sans-serif"},typography:{display1:{background:"linear-gradient(-30deg, var(--joy-palette-primary-900), var(--joy-palette-primary-400))",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}});var H=r(53794),L=r.n(H),T=r(54486),O=r.n(T);let I=0;function J(){"loading"!==i&&(i="loading",n=setTimeout(function(){O().start()},250))}function R(){I>0||(i="stop",clearTimeout(n),O().done())}if(L().events.on("routeChangeStart",J),L().events.on("routeChangeComplete",R),L().events.on("routeChangeError",R),"function"==typeof(null==window?void 0:window.fetch)){let e=window.fetch;window.fetch=async function(){for(var t=arguments.length,r=Array(t),n=0;n{if((null==n?void 0:n.current)&&r){var e,t,i,s,l,o;null==n||null===(e=n.current)||void 0===e||null===(t=e.classList)||void 0===t||t.add(r),"light"===r?null==n||null===(i=n.current)||void 0===i||null===(s=i.classList)||void 0===s||s.remove("dark"):null==n||null===(l=n.current)||void 0===l||null===(o=l.classList)||void 0===o||o.remove("light")}},[n,r]),(0,s.jsxs)("div",{ref:n,className:"h-full",children:[(0,s.jsx)(A,{}),(0,s.jsx)(P.ZP,{children:(0,s.jsx)("div",{className:"contents h-full",children:(0,s.jsxs)("div",{className:"grid h-full w-screen grid-cols-1 grid-rows-[auto,1fr] overflow-hidden text-smd dark:text-gray-300 md:grid-cols-[280px,1fr] md:grid-rows-[1fr]",children:[(0,s.jsx)(D,{}),(0,s.jsx)("div",{className:"relative min-h-0 min-w-0",children:t})]})})})]})}var K=function(e){let{children:t}=e;return(0,s.jsx)("html",{lang:"en",className:"h-full font-sans",children:(0,s.jsx)("body",{className:"h-full font-sans",children:(0,s.jsx)(E.Z,{theme:F,children:(0,s.jsx)(u.lL,{theme:F,defaultMode:"light",children:(0,s.jsx)(W,{children:t})})})})})}},78915:function(e,t,r){"use strict";r.d(t,{Tk:function(){return d},Kw:function(){return c},PR:function(){return u},Ej:function(){return h}});var n=r(21628),i=r(24214);let s=i.Z.create({baseURL:"http://127.0.0.1:5000"});s.defaults.timeout=1e4,s.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var l=r(84835);let o={"content-type":"application/json"},a=e=>{if(!(0,l.isPlainObject)(e))return JSON.stringify(e);let t={...e};for(let e in t){let r=t[e];"string"==typeof r&&(t[e]=r.trim())}return JSON.stringify(t)},d=(e,t)=>{if(t){let r=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");r&&(e+="?".concat(r))}return s.get("/api"+e,{headers:o}).then(e=>e).catch(e=>{n.ZP.error(e),Promise.reject(e)})},c=(e,t)=>{let r=a(t);return s.post("/api"+e,{body:r,headers:o}).then(e=>e).catch(e=>{n.ZP.error(e),Promise.reject(e)})},u=(e,t)=>{let r=a(t);return s.post(e,{body:r,headers:o}).then(e=>e).catch(e=>{n.ZP.error(e),Promise.reject(e)})},h=(e,t)=>s.post(e,{body:t}).then(e=>e).catch(e=>{n.ZP.error(e),Promise.reject(e)})},97402:function(){},23517:function(){}},function(e){e.O(0,[180,430,577,214,693,316,440,672,751,216,253,769,744],function(){return e(e.s=49407)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/layout-6452255d83d45c3e.js b/pilot/server/static/_next/static/chunks/app/layout-6452255d83d45c3e.js new file mode 100644 index 000000000..d2bde0ea6 --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/layout-6452255d83d45c3e.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{72431:function(){},49407:function(e,t,r){Promise.resolve().then(r.bind(r,50902))},57931:function(e,t,r){"use strict";r.d(t,{ZP:function(){return c},Cg:function(){return o}});var n=r(9268),i=r(89081),s=r(78915),l=r(86006);let[o,a]=function(){let e=l.createContext(void 0);return[function(){let t=l.useContext(e);if(void 0===t)throw Error("useCtx must be inside a Provider with a value");return t},e.Provider]}();var c=e=>{let{children:t}=e,{run:r,data:l,refresh:o}=(0,i.Z)(async()=>await (0,s.Tk)("/v1/chat/dialogue/list"),{manual:!0});return(0,n.jsx)(a,{value:{dialogueList:l,queryDialogueList:r,refreshDialogList:o},children:t})}},50902:function(e,t,r){"use strict";let n,i;r.r(t),r.d(t,{default:function(){return K}});var s=r(9268);r(97402),r(23517);var l=r(86006),o=r(56008),a=r(35846),c=r.n(a),d=r(20837),u=r(78635),f=r(90545),h=r(22046),x=r(53113),m=r(18818),p=r(4882),v=r(70092),j=r(64579),g=r(53047),b=r(62921),y=r(40020),Z=r(11515),w=r(84892),k=r(601),C=r(1301),B=r(98703),P=r(57931),N=r(66664),_=r(78915),E=()=>{var e;let t=(0,o.usePathname)(),r=(0,o.useSearchParams)(),n=r.get("id"),i=(0,o.useRouter)(),{dialogueList:a,queryDialogueList:E,refreshDialogList:D}=(0,P.Cg)(),{mode:S,setMode:z}=(0,u.tv)(),F=(0,l.useMemo)(()=>[{label:"Knowledge Space",route:"/datastores",icon:(0,s.jsx)(y.Z,{fontSize:"small"}),active:"/datastores"===t}],[t]);return(0,l.useEffect)(()=>{(async()=>{await E()})()},[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("nav",{className:"flex h-12 items-center justify-between border-b px-4 dark:border-gray-800 dark:bg-gray-800/70 md:hidden",children:[(0,s.jsx)("div",{children:(0,s.jsx)(k.Z,{})}),(0,s.jsx)("span",{className:"truncate px-4",children:"New Chat"}),(0,s.jsx)("a",{href:"",className:"-mr-3 flex h-9 w-9 shrink-0 items-center justify-center",children:(0,s.jsx)(C.Z,{})})]}),(0,s.jsx)("nav",{className:"grid max-h-screen h-full max-md:hidden",children:(0,s.jsxs)(f.Z,{sx:{display:"flex",flexDirection:"column",borderRight:"1px solid",borderColor:"divider",maxHeight:"100vh",position:"sticky",left:"0px",top:"0px",overflow:"hidden"},children:[(0,s.jsx)(f.Z,{sx:{p:2,gap:2,display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:(0,s.jsx)("div",{className:"flex items-center gap-3",children:(0,s.jsx)(h.ZP,{component:"h1",fontWeight:"xl",children:"DB-GPT"})})}),(0,s.jsx)(f.Z,{sx:{px:2},children:(0,s.jsx)(c(),{href:"/",children:(0,s.jsx)(x.Z,{color:"primary",className:"w-full bg-gradient-to-r from-[#31afff] to-[#1677ff] dark:bg-gradient-to-r dark:from-[#6a6a6a] dark:to-[#80868f]",style:{color:"#fff"},children:"+ New Chat"})})}),(0,s.jsx)(f.Z,{sx:{p:2,display:{xs:"none",sm:"initial"},maxHeight:"100%",overflow:"auto"},children:(0,s.jsx)(m.Z,{size:"sm",sx:{"--ListItem-radius":"8px"},children:(0,s.jsx)(p.Z,{nested:!0,children:(0,s.jsx)(m.Z,{size:"sm","aria-labelledby":"nav-list-browse",sx:{"& .JoyListItemButton-root":{p:"8px"},gap:"4px"},children:null==a?void 0:null===(e=a.data)||void 0===e?void 0:e.map(e=>{let l=("/chat"===t||"/chat/"===t)&&n===e.conv_uid;return(0,s.jsx)(p.Z,{children:(0,s.jsx)(v.Z,{selected:l,variant:l?"soft":"plain",sx:{"&:hover .del-btn":{visibility:"visible"}},children:(0,s.jsx)(j.Z,{children:(0,s.jsxs)(c(),{href:"/chat?id=".concat(e.conv_uid,"&scene=").concat(null==e?void 0:e.chat_mode),className:"flex items-center justify-between",children:[(0,s.jsxs)(h.ZP,{fontSize:14,noWrap:!0,children:[(0,s.jsx)(B.Z,{style:{marginRight:"0.5rem"}}),(null==e?void 0:e.user_name)||(null==e?void 0:e.user_input)||"undefined"]}),(0,s.jsx)(g.ZP,{color:"neutral",variant:"plain",size:"sm",onClick:n=>{n.preventDefault(),n.stopPropagation(),d.Z.confirm({title:"Delete Chat",content:"Are you sure delete this chat?",width:"276px",centered:!0,async onOk(){await (0,_.Kw)("/v1/chat/dialogue/delete?con_uid=".concat(e.conv_uid)),await D(),"/chat"===t&&r.get("id")===e.conv_uid&&i.push("/")}})},className:"del-btn invisible",children:(0,s.jsx)(N.Z,{})})]})})})},e.conv_uid)})})})})}),(0,s.jsxs)("div",{className:"flex flex-col justify-between flex-1",children:[(0,s.jsx)("div",{}),(0,s.jsx)(f.Z,{sx:{p:2,pt:3,pb:6,borderTop:"1px solid",borderColor:"divider",display:{xs:"none",sm:"initial"},position:"sticky",bottom:0,zIndex:100,background:"var(--joy-palette-background-body)"},children:(0,s.jsxs)(m.Z,{size:"sm",sx:{"--ListItem-radius":"8px"},children:[(0,s.jsx)(p.Z,{nested:!0,children:(0,s.jsx)(m.Z,{size:"sm","aria-labelledby":"nav-list-browse",sx:{"& .JoyListItemButton-root":{p:"8px"}},children:F.map(e=>(0,s.jsx)(c(),{href:e.route,children:(0,s.jsx)(p.Z,{children:(0,s.jsxs)(v.Z,{color:"neutral",sx:{marginBottom:1,height:"2.5rem"},selected:e.active,variant:e.active?"soft":"plain",children:[(0,s.jsx)(b.Z,{sx:{color:e.active?"inherit":"neutral.500"},children:e.icon}),(0,s.jsx)(j.Z,{children:e.label})]})})},e.route))})}),(0,s.jsx)(p.Z,{children:(0,s.jsxs)(v.Z,{sx:{height:"2.5rem"},onClick:()=>{"light"===S?z("dark"):z("light")},children:[(0,s.jsx)(b.Z,{children:"dark"===S?(0,s.jsx)(Z.Z,{fontSize:"small"}):(0,s.jsx)(w.Z,{fontSize:"small"})}),(0,s.jsx)(j.Z,{children:"Theme"})]})})]})})]})]})})]})},D=r(29720),S=r(41287),z=r(38230);let F=(0,S.Z)({colorSchemes:{light:{palette:{mode:"dark",primary:{...z.Z.grey,solidBg:"#e6f4ff",solidColor:"#1677ff",solidHoverBg:"#e6f4ff"},neutral:{plainColor:"#4d4d4d",plainHoverColor:"#131318",plainHoverBg:"#EBEBEF",plainActiveBg:"#D8D8DF",plainDisabledColor:"#B9B9C6"},background:{body:"#fff",surface:"#fff"},text:{primary:"#505050"}}},dark:{palette:{mode:"light",primary:{...z.Z.grey,softBg:"#353539",softHoverBg:"#35353978",softDisabledBg:"#353539",solidBg:"#51525beb",solidHoverBg:"#51525beb"},neutral:{plainColor:"#D8D8DF",plainHoverColor:"#F7F7F8",plainHoverBg:"#353539",plainActiveBg:"#434356",plainDisabledColor:"#434356",outlinedBorder:"#353539",outlinedHoverBorder:"#454651"},text:{primary:"#EBEBEF"},background:{body:"#212121",surface:"#51525beb"}}}},fontFamily:{body:"Josefin Sans, sans-serif",display:"Josefin Sans, sans-serif"},typography:{display1:{background:"linear-gradient(-30deg, var(--joy-palette-primary-900), var(--joy-palette-primary-400))",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}});var H=r(53794),L=r.n(H),T=r(54486),I=r.n(T);let O=0;function R(){"loading"!==i&&(i="loading",n=setTimeout(function(){I().start()},250))}function A(){O>0||(i="stop",clearTimeout(n),I().done())}if(L().events.on("routeChangeStart",R),L().events.on("routeChangeComplete",A),L().events.on("routeChangeError",A),"function"==typeof(null==window?void 0:window.fetch)){let e=window.fetch;window.fetch=async function(){for(var t=arguments.length,r=Array(t),n=0;n{if((null==n?void 0:n.current)&&r){var e,t,i,s,l,o;null==n||null===(e=n.current)||void 0===e||null===(t=e.classList)||void 0===t||t.add(r),"light"===r?null==n||null===(i=n.current)||void 0===i||null===(s=i.classList)||void 0===s||s.remove("dark"):null==n||null===(l=n.current)||void 0===l||null===(o=l.classList)||void 0===o||o.remove("light")}},[n,r]),(0,s.jsxs)("div",{ref:n,className:"h-full",children:[(0,s.jsx)(J,{}),(0,s.jsx)(P.ZP,{children:(0,s.jsx)("div",{className:"contents h-full",children:(0,s.jsxs)("div",{className:"grid h-full w-screen grid-cols-1 grid-rows-[auto,1fr] overflow-hidden text-smd dark:text-gray-300 md:grid-cols-[280px,1fr] md:grid-rows-[1fr]",children:[(0,s.jsx)(E,{}),(0,s.jsx)("div",{className:"relative min-h-0 min-w-0",children:t})]})})})]})}var K=function(e){let{children:t}=e;return(0,s.jsx)("html",{lang:"en",className:"h-full font-sans",children:(0,s.jsx)("body",{className:"h-full font-sans",children:(0,s.jsx)(D.Z,{theme:F,children:(0,s.jsx)(u.lL,{theme:F,defaultMode:"light",children:(0,s.jsx)(W,{children:t})})})})})}},78915:function(e,t,r){"use strict";r.d(t,{Tk:function(){return d},Kw:function(){return u},PR:function(){return f},Ej:function(){return h}});var n=r(21628),i=r(24214),s=r(52040);let l=i.Z.create({baseURL:s.env.API_BASE_URL});l.defaults.timeout=1e4,l.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var o=r(84835);let a={"content-type":"application/json"},c=e=>{if(!(0,o.isPlainObject)(e))return JSON.stringify(e);let t={...e};for(let e in t){let r=t[e];"string"==typeof r&&(t[e]=r.trim())}return JSON.stringify(t)},d=(e,t)=>{if(t){let r=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");r&&(e+="?".concat(r))}return l.get("/api"+e,{headers:a}).then(e=>e).catch(e=>{n.ZP.error(e),Promise.reject(e)})},u=(e,t)=>{let r=c(t);return l.post("/api"+e,{body:r,headers:a}).then(e=>e).catch(e=>{n.ZP.error(e),Promise.reject(e)})},f=(e,t)=>(c(t),l.post(e,t,{headers:a}).then(e=>e).catch(e=>{n.ZP.error(e),Promise.reject(e)})),h=(e,t)=>l.post(e,t).then(e=>e).catch(e=>{n.ZP.error(e),Promise.reject(e)})},97402:function(){},23517:function(){}},function(e){e.O(0,[180,106,685,693,316,440,672,751,216,253,769,744],function(){return e(e.s=49407)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/layout-79cc1cc379c49962.js b/pilot/server/static/_next/static/chunks/app/layout-79cc1cc379c49962.js new file mode 100644 index 000000000..8eadbe54a --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/layout-79cc1cc379c49962.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{72431:function(){},49407:function(e,t,r){Promise.resolve().then(r.bind(r,50902))},57931:function(e,t,r){"use strict";r.d(t,{ZP:function(){return d},Cg:function(){return a}});var n=r(9268),i=r(89081),l=r(78915),s=r(86006);let[a,o]=function(){let e=s.createContext(void 0);return[function(){let t=s.useContext(e);if(void 0===t)throw Error("useCtx must be inside a Provider with a value");return t},e.Provider]}();var d=e=>{let{children:t}=e,{run:r,data:s,refresh:a}=(0,i.Z)(async()=>await (0,l.T)("/v1/chat/dialogue/list"),{manual:!0});return(0,n.jsx)(o,{value:{dialogueList:s,queryDialogueList:r,refreshDialogList:a},children:t})}},50902:function(e,t,r){"use strict";let n,i;r.r(t),r.d(t,{default:function(){return K}});var l=r(9268);r(97402),r(23517);var s=r(86006),a=r(56008),o=r(35846),d=r.n(o),c=r(20837),u=r(78635),f=r(90545),h=r(22046),x=r(53113),m=r(18818),p=r(4882),v=r(70092),g=r(64579),j=r(53047),b=r(62921),y=r(40020),Z=r(11515),w=r(84892),k=r(601),C=r(1301),B=r(98703),N=r(57931),P=r(66664),_=r(78915),D=()=>{var e;let t=(0,a.usePathname)(),r=(0,a.useSearchParams)(),n=r.get("id"),i=(0,a.useRouter)(),{dialogueList:o,queryDialogueList:D,refreshDialogList:E}=(0,N.Cg)(),{mode:S,setMode:z}=(0,u.tv)(),F=(0,s.useMemo)(()=>[{label:"Knowledge Space",route:"/datastores",icon:(0,l.jsx)(y.Z,{fontSize:"small"}),active:"/datastores"===t}],[t]);return(0,s.useEffect)(()=>{(async()=>{await D()})()},[]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("nav",{className:"flex h-12 items-center justify-between border-b px-4 dark:border-gray-800 dark:bg-gray-800/70 md:hidden",children:[(0,l.jsx)("div",{children:(0,l.jsx)(k.Z,{})}),(0,l.jsx)("span",{className:"truncate px-4",children:"New Chat"}),(0,l.jsx)("a",{href:"",className:"-mr-3 flex h-9 w-9 shrink-0 items-center justify-center",children:(0,l.jsx)(C.Z,{})})]}),(0,l.jsx)("nav",{className:"grid max-h-screen h-full max-md:hidden",children:(0,l.jsxs)(f.Z,{sx:{display:"flex",flexDirection:"column",borderRight:"1px solid",borderColor:"divider",maxHeight:"100vh",position:"sticky",left:"0px",top:"0px",overflow:"hidden"},children:[(0,l.jsx)(f.Z,{sx:{p:2,gap:2,display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:(0,l.jsx)("div",{className:"flex items-center gap-3",children:(0,l.jsx)(h.ZP,{component:"h1",fontWeight:"xl",children:"DB-GPT"})})}),(0,l.jsx)(f.Z,{sx:{px:2},children:(0,l.jsx)(d(),{href:"/",children:(0,l.jsx)(x.Z,{color:"primary",className:"w-full bg-gradient-to-r from-[#31afff] to-[#1677ff] dark:bg-gradient-to-r dark:from-[#6a6a6a] dark:to-[#80868f]",style:{color:"#fff"},children:"+ New Chat"})})}),(0,l.jsx)(f.Z,{sx:{p:2,display:{xs:"none",sm:"initial"},maxHeight:"100%",overflow:"auto"},children:(0,l.jsx)(m.Z,{size:"sm",sx:{"--ListItem-radius":"8px"},children:(0,l.jsx)(p.Z,{nested:!0,children:(0,l.jsx)(m.Z,{size:"sm","aria-labelledby":"nav-list-browse",sx:{"& .JoyListItemButton-root":{p:"8px"},gap:"4px"},children:null==o?void 0:null===(e=o.data)||void 0===e?void 0:e.map(e=>{let s=("/chat"===t||"/chat/"===t)&&n===e.conv_uid;return(0,l.jsx)(p.Z,{children:(0,l.jsx)(v.Z,{selected:s,variant:s?"soft":"plain",sx:{"&:hover .del-btn":{visibility:"visible"}},children:(0,l.jsx)(g.Z,{children:(0,l.jsxs)(d(),{href:"/chat?id=".concat(e.conv_uid,"&scene=").concat(null==e?void 0:e.chat_mode),className:"flex items-center justify-between",children:[(0,l.jsxs)(h.ZP,{fontSize:14,noWrap:!0,children:[(0,l.jsx)(B.Z,{style:{marginRight:"0.5rem"}}),(null==e?void 0:e.user_name)||(null==e?void 0:e.user_input)||"undefined"]}),(0,l.jsx)(j.ZP,{color:"neutral",variant:"plain",size:"sm",onClick:n=>{n.preventDefault(),n.stopPropagation(),c.Z.confirm({title:"Delete Chat",content:"Are you sure delete this chat?",width:"276px",centered:!0,async onOk(){await (0,_.K)("/v1/chat/dialogue/delete?con_uid=".concat(e.conv_uid)),await E(),"/chat"===t&&r.get("id")===e.conv_uid&&i.push("/")}})},className:"del-btn invisible",children:(0,l.jsx)(P.Z,{})})]})})})},e.conv_uid)})})})})}),(0,l.jsxs)("div",{className:"flex flex-col justify-between flex-1",children:[(0,l.jsx)("div",{}),(0,l.jsx)(f.Z,{sx:{p:2,pt:3,pb:6,borderTop:"1px solid",borderColor:"divider",display:{xs:"none",sm:"initial"},position:"sticky",bottom:0,zIndex:100,background:"var(--joy-palette-background-body)"},children:(0,l.jsxs)(m.Z,{size:"sm",sx:{"--ListItem-radius":"8px"},children:[(0,l.jsx)(p.Z,{nested:!0,children:(0,l.jsx)(m.Z,{size:"sm","aria-labelledby":"nav-list-browse",sx:{"& .JoyListItemButton-root":{p:"8px"}},children:F.map(e=>(0,l.jsx)(d(),{href:e.route,children:(0,l.jsx)(p.Z,{children:(0,l.jsxs)(v.Z,{color:"neutral",sx:{marginBottom:1,height:"2.5rem"},selected:e.active,variant:e.active?"soft":"plain",children:[(0,l.jsx)(b.Z,{sx:{color:e.active?"inherit":"neutral.500"},children:e.icon}),(0,l.jsx)(g.Z,{children:e.label})]})})},e.route))})}),(0,l.jsx)(p.Z,{children:(0,l.jsxs)(v.Z,{sx:{height:"2.5rem"},onClick:()=>{"light"===S?z("dark"):z("light")},children:[(0,l.jsx)(b.Z,{children:"dark"===S?(0,l.jsx)(Z.Z,{fontSize:"small"}):(0,l.jsx)(w.Z,{fontSize:"small"})}),(0,l.jsx)(g.Z,{children:"Theme"})]})})]})})]})]})})]})},E=r(29720),S=r(41287),z=r(38230);let F=(0,S.Z)({colorSchemes:{light:{palette:{mode:"dark",primary:{...z.Z.grey,solidBg:"#e6f4ff",solidColor:"#1677ff",solidHoverBg:"#e6f4ff"},neutral:{plainColor:"#4d4d4d",plainHoverColor:"#131318",plainHoverBg:"#EBEBEF",plainActiveBg:"#D8D8DF",plainDisabledColor:"#B9B9C6"},background:{body:"#fff",surface:"#fff"},text:{primary:"#505050"}}},dark:{palette:{mode:"light",primary:{...z.Z.grey,softBg:"#353539",softHoverBg:"#35353978",softDisabledBg:"#353539",solidBg:"#51525beb",solidHoverBg:"#51525beb"},neutral:{plainColor:"#D8D8DF",plainHoverColor:"#F7F7F8",plainHoverBg:"#353539",plainActiveBg:"#434356",plainDisabledColor:"#434356",outlinedBorder:"#353539",outlinedHoverBorder:"#454651"},text:{primary:"#EBEBEF"},background:{body:"#212121",surface:"#51525beb"}}}},fontFamily:{body:"Josefin Sans, sans-serif",display:"Josefin Sans, sans-serif"},typography:{display1:{background:"linear-gradient(-30deg, var(--joy-palette-primary-900), var(--joy-palette-primary-400))",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}});var H=r(53794),L=r.n(H),T=r(54486),O=r.n(T);let I=0;function J(){"loading"!==i&&(i="loading",n=setTimeout(function(){O().start()},250))}function R(){I>0||(i="stop",clearTimeout(n),O().done())}if(L().events.on("routeChangeStart",J),L().events.on("routeChangeComplete",R),L().events.on("routeChangeError",R),"function"==typeof(null==window?void 0:window.fetch)){let e=window.fetch;window.fetch=async function(){for(var t=arguments.length,r=Array(t),n=0;n{if((null==n?void 0:n.current)&&r){var e,t,i,l,s,a;null==n||null===(e=n.current)||void 0===e||null===(t=e.classList)||void 0===t||t.add(r),"light"===r?null==n||null===(i=n.current)||void 0===i||null===(l=i.classList)||void 0===l||l.remove("dark"):null==n||null===(s=n.current)||void 0===s||null===(a=s.classList)||void 0===a||a.remove("light")}},[n,r]),(0,l.jsxs)("div",{ref:n,className:"h-full",children:[(0,l.jsx)(A,{}),(0,l.jsx)(N.ZP,{children:(0,l.jsx)("div",{className:"contents h-full",children:(0,l.jsxs)("div",{className:"grid h-full w-screen grid-cols-1 grid-rows-[auto,1fr] overflow-hidden text-smd dark:text-gray-300 md:grid-cols-[280px,1fr] md:grid-rows-[1fr]",children:[(0,l.jsx)(D,{}),(0,l.jsx)("div",{className:"relative min-h-0 min-w-0",children:t})]})})})]})}var K=function(e){let{children:t}=e;return(0,l.jsx)("html",{lang:"en",className:"h-full font-sans",children:(0,l.jsx)("body",{className:"h-full font-sans",children:(0,l.jsx)(E.Z,{theme:F,children:(0,l.jsx)(u.lL,{theme:F,defaultMode:"light",children:(0,l.jsx)(W,{children:t})})})})})}},78915:function(e,t,r){"use strict";r.d(t,{T:function(){return d},K:function(){return c}});var n=r(21628),i=r(24214);let l=i.Z.create({baseURL:"http://127.0.0.1:5000"});l.defaults.timeout=1e4,l.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var s=r(84835);let a={"content-type":"application/json"},o=e=>{if(!(0,s.isPlainObject)(e))return JSON.stringify(e);let t={...e};for(let e in t){let r=t[e];"string"==typeof r&&(t[e]=r.trim())}return JSON.stringify(t)},d=(e,t)=>{if(t){let r=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");r&&(e+="?".concat(r))}return l.get("/api"+e,{headers:a}).then(e=>e).catch(e=>{n.ZP.error(e),Promise.reject(e)})},c=(e,t)=>{let r=o(t);return l.post("/api"+e,{body:r,headers:a}).then(e=>e).catch(e=>{n.ZP.error(e),Promise.reject(e)})}},97402:function(){},23517:function(){}},function(e){e.O(0,[180,430,577,562,693,440,672,751,216,253,769,744],function(){return e(e.s=49407)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/layout-81a8574ac22b4a5b.js b/pilot/server/static/_next/static/chunks/app/layout-81a8574ac22b4a5b.js new file mode 100644 index 000000000..9acd7d472 --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/layout-81a8574ac22b4a5b.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{72431:function(){},49407:function(e,t,r){Promise.resolve().then(r.bind(r,50902))},57931:function(e,t,r){"use strict";r.d(t,{ZP:function(){return d},Cg:function(){return o}});var n=r(9268),i=r(89081),s=r(78915),l=r(86006);let[o,a]=function(){let e=l.createContext(void 0);return[function(){let t=l.useContext(e);if(void 0===t)throw Error("useCtx must be inside a Provider with a value");return t},e.Provider]}();var d=e=>{let{children:t}=e,{run:r,data:l,refresh:o}=(0,i.Z)(async()=>await (0,s.Tk)("/v1/chat/dialogue/list"),{manual:!0});return(0,n.jsx)(a,{value:{dialogueList:l,queryDialogueList:r,refreshDialogList:o},children:t})}},50902:function(e,t,r){"use strict";let n,i;r.r(t),r.d(t,{default:function(){return K}});var s=r(9268);r(97402),r(23517);var l=r(86006),o=r(56008),a=r(35846),d=r.n(a),c=r(20837),u=r(78635),f=r(90545),h=r(22046),x=r(53113),m=r(18818),p=r(4882),v=r(70092),j=r(64579),g=r(53047),b=r(62921),y=r(40020),Z=r(11515),w=r(84892),k=r(601),C=r(1301),B=r(98703),P=r(57931),N=r(66664),_=r(78915),E=()=>{var e;let t=(0,o.usePathname)(),r=(0,o.useSearchParams)(),n=r.get("id"),i=(0,o.useRouter)(),{dialogueList:a,queryDialogueList:E,refreshDialogList:D}=(0,P.Cg)(),{mode:S,setMode:z}=(0,u.tv)(),F=(0,l.useMemo)(()=>[{label:"Knowledge Space",route:"/datastores",icon:(0,s.jsx)(y.Z,{fontSize:"small"}),active:"/datastores"===t}],[t]);return(0,l.useEffect)(()=>{(async()=>{await E()})()},[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("nav",{className:"flex h-12 items-center justify-between border-b px-4 dark:border-gray-800 dark:bg-gray-800/70 md:hidden",children:[(0,s.jsx)("div",{children:(0,s.jsx)(k.Z,{})}),(0,s.jsx)("span",{className:"truncate px-4",children:"New Chat"}),(0,s.jsx)("a",{href:"",className:"-mr-3 flex h-9 w-9 shrink-0 items-center justify-center",children:(0,s.jsx)(C.Z,{})})]}),(0,s.jsx)("nav",{className:"grid max-h-screen h-full max-md:hidden",children:(0,s.jsxs)(f.Z,{sx:{display:"flex",flexDirection:"column",borderRight:"1px solid",borderColor:"divider",maxHeight:"100vh",position:"sticky",left:"0px",top:"0px",overflow:"hidden"},children:[(0,s.jsx)(f.Z,{sx:{p:2,gap:2,display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:(0,s.jsx)("div",{className:"flex items-center gap-3",children:(0,s.jsx)(h.ZP,{component:"h1",fontWeight:"xl",children:"DB-GPT"})})}),(0,s.jsx)(f.Z,{sx:{px:2},children:(0,s.jsx)(d(),{href:"/",children:(0,s.jsx)(x.Z,{color:"primary",className:"w-full bg-gradient-to-r from-[#31afff] to-[#1677ff] dark:bg-gradient-to-r dark:from-[#6a6a6a] dark:to-[#80868f]",style:{color:"#fff"},children:"+ New Chat"})})}),(0,s.jsx)(f.Z,{sx:{p:2,display:{xs:"none",sm:"initial"},maxHeight:"100%",overflow:"auto"},children:(0,s.jsx)(m.Z,{size:"sm",sx:{"--ListItem-radius":"8px"},children:(0,s.jsx)(p.Z,{nested:!0,children:(0,s.jsx)(m.Z,{size:"sm","aria-labelledby":"nav-list-browse",sx:{"& .JoyListItemButton-root":{p:"8px"},gap:"4px"},children:null==a?void 0:null===(e=a.data)||void 0===e?void 0:e.map(e=>{let l=("/chat"===t||"/chat/"===t)&&n===e.conv_uid;return(0,s.jsx)(p.Z,{children:(0,s.jsx)(v.Z,{selected:l,variant:l?"soft":"plain",sx:{"&:hover .del-btn":{visibility:"visible"}},children:(0,s.jsx)(j.Z,{children:(0,s.jsxs)(d(),{href:"/chat?id=".concat(e.conv_uid,"&scene=").concat(null==e?void 0:e.chat_mode),className:"flex items-center justify-between",children:[(0,s.jsxs)(h.ZP,{fontSize:14,noWrap:!0,children:[(0,s.jsx)(B.Z,{style:{marginRight:"0.5rem"}}),(null==e?void 0:e.user_name)||(null==e?void 0:e.user_input)||"undefined"]}),(0,s.jsx)(g.ZP,{color:"neutral",variant:"plain",size:"sm",onClick:n=>{n.preventDefault(),n.stopPropagation(),c.Z.confirm({title:"Delete Chat",content:"Are you sure delete this chat?",width:"276px",centered:!0,async onOk(){await (0,_.Kw)("/v1/chat/dialogue/delete?con_uid=".concat(e.conv_uid)),await D(),"/chat"===t&&r.get("id")===e.conv_uid&&i.push("/")}})},className:"del-btn invisible",children:(0,s.jsx)(N.Z,{})})]})})})},e.conv_uid)})})})})}),(0,s.jsxs)("div",{className:"flex flex-col justify-between flex-1",children:[(0,s.jsx)("div",{}),(0,s.jsx)(f.Z,{sx:{p:2,pt:3,pb:6,borderTop:"1px solid",borderColor:"divider",display:{xs:"none",sm:"initial"},position:"sticky",bottom:0,zIndex:100,background:"var(--joy-palette-background-body)"},children:(0,s.jsxs)(m.Z,{size:"sm",sx:{"--ListItem-radius":"8px"},children:[(0,s.jsx)(p.Z,{nested:!0,children:(0,s.jsx)(m.Z,{size:"sm","aria-labelledby":"nav-list-browse",sx:{"& .JoyListItemButton-root":{p:"8px"}},children:F.map(e=>(0,s.jsx)(d(),{href:e.route,children:(0,s.jsx)(p.Z,{children:(0,s.jsxs)(v.Z,{color:"neutral",sx:{marginBottom:1,height:"2.5rem"},selected:e.active,variant:e.active?"soft":"plain",children:[(0,s.jsx)(b.Z,{sx:{color:e.active?"inherit":"neutral.500"},children:e.icon}),(0,s.jsx)(j.Z,{children:e.label})]})})},e.route))})}),(0,s.jsx)(p.Z,{children:(0,s.jsxs)(v.Z,{sx:{height:"2.5rem"},onClick:()=>{"light"===S?z("dark"):z("light")},children:[(0,s.jsx)(b.Z,{children:"dark"===S?(0,s.jsx)(Z.Z,{fontSize:"small"}):(0,s.jsx)(w.Z,{fontSize:"small"})}),(0,s.jsx)(j.Z,{children:"Theme"})]})})]})})]})]})})]})},D=r(29720),S=r(41287),z=r(38230);let F=(0,S.Z)({colorSchemes:{light:{palette:{mode:"dark",primary:{...z.Z.grey,solidBg:"#e6f4ff",solidColor:"#1677ff",solidHoverBg:"#e6f4ff"},neutral:{plainColor:"#4d4d4d",plainHoverColor:"#131318",plainHoverBg:"#EBEBEF",plainActiveBg:"#D8D8DF",plainDisabledColor:"#B9B9C6"},background:{body:"#fff",surface:"#fff"},text:{primary:"#505050"}}},dark:{palette:{mode:"light",primary:{...z.Z.grey,softBg:"#353539",softHoverBg:"#35353978",softDisabledBg:"#353539",solidBg:"#51525beb",solidHoverBg:"#51525beb"},neutral:{plainColor:"#D8D8DF",plainHoverColor:"#F7F7F8",plainHoverBg:"#353539",plainActiveBg:"#434356",plainDisabledColor:"#434356",outlinedBorder:"#353539",outlinedHoverBorder:"#454651"},text:{primary:"#EBEBEF"},background:{body:"#212121",surface:"#51525beb"}}}},fontFamily:{body:"Josefin Sans, sans-serif",display:"Josefin Sans, sans-serif"},typography:{display1:{background:"linear-gradient(-30deg, var(--joy-palette-primary-900), var(--joy-palette-primary-400))",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}});var H=r(53794),L=r.n(H),T=r(54486),I=r.n(T);let O=0;function R(){"loading"!==i&&(i="loading",n=setTimeout(function(){I().start()},250))}function A(){O>0||(i="stop",clearTimeout(n),I().done())}if(L().events.on("routeChangeStart",R),L().events.on("routeChangeComplete",A),L().events.on("routeChangeError",A),"function"==typeof(null==window?void 0:window.fetch)){let e=window.fetch;window.fetch=async function(){for(var t=arguments.length,r=Array(t),n=0;n{if((null==n?void 0:n.current)&&r){var e,t,i,s,l,o;null==n||null===(e=n.current)||void 0===e||null===(t=e.classList)||void 0===t||t.add(r),"light"===r?null==n||null===(i=n.current)||void 0===i||null===(s=i.classList)||void 0===s||s.remove("dark"):null==n||null===(l=n.current)||void 0===l||null===(o=l.classList)||void 0===o||o.remove("light")}},[n,r]),(0,s.jsxs)("div",{ref:n,className:"h-full",children:[(0,s.jsx)(J,{}),(0,s.jsx)(P.ZP,{children:(0,s.jsx)("div",{className:"contents h-full",children:(0,s.jsxs)("div",{className:"grid h-full w-screen grid-cols-1 grid-rows-[auto,1fr] overflow-hidden text-smd dark:text-gray-300 md:grid-cols-[280px,1fr] md:grid-rows-[1fr]",children:[(0,s.jsx)(E,{}),(0,s.jsx)("div",{className:"relative min-h-0 min-w-0",children:t})]})})})]})}var K=function(e){let{children:t}=e;return(0,s.jsx)("html",{lang:"en",className:"h-full font-sans",children:(0,s.jsx)("body",{className:"h-full font-sans",children:(0,s.jsx)(D.Z,{theme:F,children:(0,s.jsx)(u.lL,{theme:F,defaultMode:"light",children:(0,s.jsx)(W,{children:t})})})})})}},78915:function(e,t,r){"use strict";r.d(t,{Tk:function(){return c},Kw:function(){return u},PR:function(){return f},Ej:function(){return h}});var n=r(21628),i=r(24214),s=r(52040);let l=i.Z.create({baseURL:s.env.API_BASE_URL});l.defaults.timeout=1e4,l.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var o=r(84835);let a={"content-type":"application/json"},d=e=>{if(!(0,o.isPlainObject)(e))return JSON.stringify(e);let t={...e};for(let e in t){let r=t[e];"string"==typeof r&&(t[e]=r.trim())}return JSON.stringify(t)},c=(e,t)=>{if(t){let r=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");r&&(e+="?".concat(r))}return l.get("/api"+e,{headers:a}).then(e=>e).catch(e=>{n.ZP.error(e),Promise.reject(e)})},u=(e,t)=>{let r=d(t);return l.post("/api"+e,{body:r,headers:a}).then(e=>e).catch(e=>{n.ZP.error(e),Promise.reject(e)})},f=(e,t)=>{let r=d(t);return l.post(e,{body:r,headers:a}).then(e=>e).catch(e=>{n.ZP.error(e),Promise.reject(e)})},h=(e,t)=>l.post(e,{body:t}).then(e=>e).catch(e=>{n.ZP.error(e),Promise.reject(e)})},97402:function(){},23517:function(){}},function(e){e.O(0,[180,106,685,693,316,440,672,751,216,253,769,744],function(){return e(e.s=49407)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/page-20e8f24fc2974573.js b/pilot/server/static/_next/static/chunks/app/page-20e8f24fc2974573.js new file mode 100644 index 000000000..de2b6f4c8 --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/page-20e8f24fc2974573.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{90545:function(e,r,t){"use strict";t.d(r,{Z:function(){return g}});var o=t(40431),i=t(46750),n=t(86006),a=t(89791),l=t(4323),s=t(51579),c=t(86601),d=t(95887),v=t(9268);let u=["className","component"];var p=t(47327),m=t(98918);let h=function(e={}){let{themeId:r,defaultTheme:t,defaultClassName:p="MuiBox-root",generateClassName:m}=e,h=(0,l.ZP)("div",{shouldForwardProp:e=>"theme"!==e&&"sx"!==e&&"as"!==e})(s.Z),g=n.forwardRef(function(e,n){let l=(0,d.Z)(t),s=(0,c.Z)(e),{className:g,component:f="div"}=s,y=(0,i.Z)(s,u);return(0,v.jsx)(h,(0,o.Z)({as:f,ref:n,className:(0,a.Z)(g,m?m(p):p),theme:r&&l[r]||l},y))});return g}({defaultTheme:m.Z,defaultClassName:"MuiBox-root",generateClassName:p.Z.generate});var g=h},53113:function(e,r,t){"use strict";var o=t(46750),i=t(40431),n=t(86006),a=t(46319),l=t(47562),s=t(53832),c=t(99179),d=t(50645),v=t(88930),u=t(47093),p=t(326),m=t(94244),h=t(77614),g=t(9268);let f=["children","action","color","variant","size","fullWidth","startDecorator","endDecorator","loading","loadingPosition","loadingIndicator","disabled"],y=e=>{let{color:r,disabled:t,focusVisible:o,focusVisibleClassName:i,fullWidth:n,size:a,variant:c,loading:d}=e,v={root:["root",t&&"disabled",o&&"focusVisible",n&&"fullWidth",c&&`variant${(0,s.Z)(c)}`,r&&`color${(0,s.Z)(r)}`,a&&`size${(0,s.Z)(a)}`,d&&"loading"],startDecorator:["startDecorator"],endDecorator:["endDecorator"],loadingIndicatorCenter:["loadingIndicatorCenter"]},u=(0,l.Z)(v,h.F,{});return o&&i&&(u.root+=` ${i}`),u},x=(0,d.Z)("span",{name:"JoyButton",slot:"StartDecorator",overridesResolver:(e,r)=>r.startDecorator})({"--Icon-margin":"0 0 0 calc(var(--Button-gap) / -2)","--CircularProgress-margin":"0 0 0 calc(var(--Button-gap) / -2)",display:"inherit",marginRight:"var(--Button-gap)"}),Z=(0,d.Z)("span",{name:"JoyButton",slot:"EndDecorator",overridesResolver:(e,r)=>r.endDecorator})({"--Icon-margin":"0 calc(var(--Button-gap) / -2) 0 0","--CircularProgress-margin":"0 calc(var(--Button-gap) / -2) 0 0",display:"inherit",marginLeft:"var(--Button-gap)"}),D=(0,d.Z)("span",{name:"JoyButton",slot:"LoadingCenter",overridesResolver:(e,r)=>r.loadingIndicatorCenter})(({theme:e,ownerState:r})=>{var t,o,n,a;return(0,i.Z)({display:"inherit",position:"absolute",left:"50%",transform:"translateX(-50%)",color:null==(t=e.variants[r.variant])?void 0:null==(o=t[r.color])?void 0:o.color},r.disabled&&{color:null==(n=e.variants[`${r.variant}Disabled`])?void 0:null==(a=n[r.color])?void 0:a.color})}),b=(0,d.Z)("button",{name:"JoyButton",slot:"Root",overridesResolver:(e,r)=>r.root})(({theme:e,ownerState:r})=>{var t,o,n,a;return[(0,i.Z)({"--Icon-margin":"initial"},"sm"===r.size&&{"--Icon-fontSize":"1.25rem","--CircularProgress-size":"20px","--Button-gap":"0.375rem",minHeight:"var(--Button-minHeight, 2rem)",fontSize:e.vars.fontSize.sm,paddingBlock:"2px",paddingInline:"0.75rem"},"md"===r.size&&{"--Icon-fontSize":"1.5rem","--CircularProgress-size":"24px","--Button-gap":"0.5rem",minHeight:"var(--Button-minHeight, 2.5rem)",fontSize:e.vars.fontSize.sm,paddingBlock:"0.25rem",paddingInline:"1rem"},"lg"===r.size&&{"--Icon-fontSize":"1.75rem","--CircularProgress-size":"28px","--Button-gap":"0.75rem",minHeight:"var(--Button-minHeight, 3rem)",fontSize:e.vars.fontSize.md,paddingBlock:"0.375rem",paddingInline:"1.5rem"},{WebkitTapHighlightColor:"transparent",borderRadius:`var(--Button-radius, ${e.vars.radius.sm})`,margin:"var(--Button-margin)",border:"none",backgroundColor:"transparent",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",textDecoration:"none",fontFamily:e.vars.fontFamily.body,fontWeight:e.vars.fontWeight.lg,lineHeight:1},r.fullWidth&&{width:"100%"},{[e.focus.selector]:e.focus.default}),null==(t=e.variants[r.variant])?void 0:t[r.color],{"&:hover":null==(o=e.variants[`${r.variant}Hover`])?void 0:o[r.color]},{"&:active":null==(n=e.variants[`${r.variant}Active`])?void 0:n[r.color]},(0,i.Z)({[`&.${h.Z.disabled}`]:null==(a=e.variants[`${r.variant}Disabled`])?void 0:a[r.color]},"center"===r.loadingPosition&&{[`&.${h.Z.loading}`]:{color:"transparent"}})]}),P=n.forwardRef(function(e,r){let t=(0,v.Z)({props:e,name:"JoyButton"}),{children:l,action:s,color:d="primary",variant:h="solid",size:P="md",fullWidth:S=!1,startDecorator:j,endDecorator:B,loading:I=!1,loadingPosition:w="center",loadingIndicator:C,disabled:z}=t,k=(0,o.Z)(t,f),{getColor:N}=(0,u.VT)(h),T=N(e.color,d),R=n.useRef(null),_=(0,c.Z)(R,r),{focusVisible:F,setFocusVisible:$,getRootProps:W}=(0,a.Z)((0,i.Z)({},t,{disabled:z||I,ref:_})),J=null!=C?C:(0,g.jsx)(m.Z,(0,i.Z)({},"context"!==T&&{color:T},{thickness:{sm:2,md:3,lg:4}[P]||3}));n.useImperativeHandle(s,()=>({focusVisible:()=>{var e;$(!0),null==(e=R.current)||e.focus()}}),[$]);let M=(0,i.Z)({},t,{color:T,fullWidth:S,variant:h,size:P,focusVisible:F,loading:I,loadingPosition:w,disabled:z||I}),H=y(M),[E,O]=(0,p.Z)("root",{ref:r,className:H.root,elementType:b,externalForwardedProps:k,getSlotProps:W,ownerState:M}),[L,A]=(0,p.Z)("startDecorator",{className:H.startDecorator,elementType:x,externalForwardedProps:k,ownerState:M}),[V,K]=(0,p.Z)("endDecorator",{className:H.endDecorator,elementType:Z,externalForwardedProps:k,ownerState:M}),[q,U]=(0,p.Z)("loadingIndicatorCenter",{className:H.loadingIndicatorCenter,elementType:D,externalForwardedProps:k,ownerState:M});return(0,g.jsxs)(E,(0,i.Z)({},O,{children:[(j||I&&"start"===w)&&(0,g.jsx)(L,(0,i.Z)({},A,{children:I&&"start"===w?J:j})),l,I&&"center"===w&&(0,g.jsx)(q,(0,i.Z)({},U,{children:J})),(B||I&&"end"===w)&&(0,g.jsx)(V,(0,i.Z)({},K,{children:I&&"end"===w?J:B}))]}))});r.Z=P},77614:function(e,r,t){"use strict";t.d(r,{F:function(){return i}});var o=t(18587);function i(e){return(0,o.d6)("MuiButton",e)}let n=(0,o.sI)("MuiButton",["root","colorPrimary","colorNeutral","colorDanger","colorInfo","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","focusVisible","disabled","sizeSm","sizeMd","sizeLg","fullWidth","startDecorator","endDecorator","loading","loadingIndicatorCenter"]);r.Z=n},22046:function(e,r,t){"use strict";t.d(r,{eu:function(){return x},FR:function(){return y},ZP:function(){return B}});var o=t(46750),i=t(40431),n=t(86006),a=t(53832),l=t(86601),s=t(47562),c=t(50645),d=t(88930),v=t(47093),u=t(326),p=t(18587);function m(e){return(0,p.d6)("MuiTypography",e)}(0,p.sI)("MuiTypography",["root","h1","h2","h3","h4","h5","h6","body1","body2","body3","noWrap","gutterBottom","startDecorator","endDecorator","colorPrimary","colorNeutral","colorDanger","colorInfo","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);var h=t(9268);let g=["color","textColor"],f=["component","gutterBottom","noWrap","level","levelMapping","children","endDecorator","startDecorator","variant"],y=n.createContext(!1),x=n.createContext(!1),Z=e=>{let{gutterBottom:r,noWrap:t,level:o,color:i,variant:n}=e,l={root:["root",o,r&&"gutterBottom",t&&"noWrap",i&&`color${(0,a.Z)(i)}`,n&&`variant${(0,a.Z)(n)}`],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return(0,s.Z)(l,m,{})},D=(0,c.Z)("span",{name:"JoyTypography",slot:"StartDecorator",overridesResolver:(e,r)=>r.startDecorator})(({ownerState:e})=>{var r;return(0,i.Z)({display:"inline-flex",marginInlineEnd:"clamp(4px, var(--Typography-gap, 0.375em), 0.75rem)"},"string"!=typeof e.startDecorator&&("flex-start"===e.alignItems||(null==(r=e.sx)?void 0:r.alignItems)==="flex-start")&&{marginTop:"2px"})}),b=(0,c.Z)("span",{name:"JoyTypography",slot:"endDecorator",overridesResolver:(e,r)=>r.endDecorator})(({ownerState:e})=>{var r;return(0,i.Z)({display:"inline-flex",marginInlineStart:"clamp(4px, var(--Typography-gap, 0.375em), 0.75rem)"},"string"!=typeof e.endDecorator&&("flex-start"===e.alignItems||(null==(r=e.sx)?void 0:r.alignItems)==="flex-start")&&{marginTop:"2px"})}),P=(0,c.Z)("span",{name:"JoyTypography",slot:"Root",overridesResolver:(e,r)=>r.root})(({theme:e,ownerState:r})=>{var t,o,n,a;return(0,i.Z)({"--Icon-fontSize":"1.25em",margin:"var(--Typography-margin, 0px)"},r.nesting?{display:"inline"}:{fontFamily:e.vars.fontFamily.body,display:"block"},(r.startDecorator||r.endDecorator)&&(0,i.Z)({display:"flex",alignItems:"center"},r.nesting&&(0,i.Z)({display:"inline-flex"},r.startDecorator&&{verticalAlign:"bottom"})),r.level&&"inherit"!==r.level&&e.typography[r.level],{fontSize:`var(--Typography-fontSize, ${r.level&&"inherit"!==r.level&&null!=(t=null==(o=e.typography[r.level])?void 0:o.fontSize)?t:"inherit"})`},r.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},r.gutterBottom&&{marginBottom:"0.35em"},r.color&&"context"!==r.color&&{color:`rgba(${null==(n=e.vars.palette[r.color])?void 0:n.mainChannel} / 1)`},r.variant&&(0,i.Z)({borderRadius:e.vars.radius.xs,paddingBlock:"min(0.15em, 4px)",paddingInline:"0.375em"},!r.nesting&&{marginInline:"-0.375em"},null==(a=e.variants[r.variant])?void 0:a[r.color]))}),S={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",display1:"h1",display2:"h2",body1:"p",body2:"p",body3:"span",body4:"span",body5:"span",inherit:"p"},j=n.forwardRef(function(e,r){let t=(0,d.Z)({props:e,name:"JoyTypography"}),{color:a,textColor:s}=t,c=(0,o.Z)(t,g),p=n.useContext(y),m=n.useContext(x),j=(0,l.Z)((0,i.Z)({},c,{color:s})),{component:B,gutterBottom:I=!1,noWrap:w=!1,level:C="body1",levelMapping:z={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",body1:"p",body2:"p",body3:"p",inherit:"p"},children:k,endDecorator:N,startDecorator:T,variant:R}=j,_=(0,o.Z)(j,f),{getColor:F}=(0,v.VT)(R),$=F(e.color,R?null!=a?a:"neutral":a),W=p||m?e.level||"inherit":C,J=B||(p?"span":z[W]||S[W]||"span"),M=(0,i.Z)({},j,{level:W,component:J,color:$,gutterBottom:I,noWrap:w,nesting:p,variant:R}),H=Z(M),E=(0,i.Z)({},_,{component:J}),[O,L]=(0,u.Z)("root",{ref:r,className:H.root,elementType:P,externalForwardedProps:E,ownerState:M}),[A,V]=(0,u.Z)("startDecorator",{className:H.startDecorator,elementType:D,externalForwardedProps:E,ownerState:M}),[K,q]=(0,u.Z)("endDecorator",{className:H.endDecorator,elementType:b,externalForwardedProps:E,ownerState:M});return(0,h.jsx)(y.Provider,{value:!0,children:(0,h.jsxs)(O,(0,i.Z)({},L,{children:[T&&(0,h.jsx)(A,(0,i.Z)({},V,{children:T})),k,N&&(0,h.jsx)(K,(0,i.Z)({},q,{children:N}))]}))})});var B=j},62499:function(e,r,t){Promise.resolve().then(t.bind(t,26925))},26925:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return k}});var o=t(9268),i=t(89081),n=t(86006),a=t(22046),l=t(46750),s=t(40431),c=t(89791),d=t(53832),v=t(47562),u=t(50645),p=t(88930),m=t(18587);function h(e){return(0,m.d6)("MuiDivider",e)}(0,m.sI)("MuiDivider",["root","horizontal","vertical","insetContext","insetNone"]);let g=["className","children","component","inset","orientation","role"],f=e=>{let{orientation:r,inset:t}=e,o={root:["root",r,t&&`inset${(0,d.Z)(t)}`]};return(0,v.Z)(o,h,{})},y=(0,u.Z)("hr",{name:"JoyDivider",slot:"Root",overridesResolver:(e,r)=>r.root})(({theme:e,ownerState:r})=>(0,s.Z)({"--Divider-thickness":"1px","--Divider-lineColor":e.vars.palette.divider},"none"===r.inset&&{"--_Divider-inset":"0px"},"context"===r.inset&&{"--_Divider-inset":"var(--Divider-inset, 0px)"},{margin:"initial",marginInline:"vertical"===r.orientation?"initial":"var(--_Divider-inset)",marginBlock:"vertical"===r.orientation?"var(--_Divider-inset)":"initial",position:"relative",alignSelf:"stretch",flexShrink:0},r.children?{"--Divider-gap":e.spacing(1),"--Divider-childPosition":"50%",display:"flex",flexDirection:"vertical"===r.orientation?"column":"row",alignItems:"center",whiteSpace:"nowrap",textAlign:"center",border:0,fontFamily:e.vars.fontFamily.body,fontSize:e.vars.fontSize.sm,"&::before, &::after":{position:"relative",inlineSize:"vertical"===r.orientation?"var(--Divider-thickness)":"initial",blockSize:"vertical"===r.orientation?"initial":"var(--Divider-thickness)",backgroundColor:"var(--Divider-lineColor)",content:'""'},"&::before":{marginInlineEnd:"vertical"===r.orientation?"initial":"min(var(--Divider-childPosition) * 999, var(--Divider-gap))",marginBlockEnd:"vertical"===r.orientation?"min(var(--Divider-childPosition) * 999, var(--Divider-gap))":"initial",flexBasis:"var(--Divider-childPosition)"},"&::after":{marginInlineStart:"vertical"===r.orientation?"initial":"min((100% - var(--Divider-childPosition)) * 999, var(--Divider-gap))",marginBlockStart:"vertical"===r.orientation?"min((100% - var(--Divider-childPosition)) * 999, var(--Divider-gap))":"initial",flexBasis:"calc(100% - var(--Divider-childPosition))"}}:{border:"none",listStyle:"none",backgroundColor:"var(--Divider-lineColor)",inlineSize:"vertical"===r.orientation?"var(--Divider-thickness)":"initial",blockSize:"vertical"===r.orientation?"initial":"var(--Divider-thickness)"})),x=n.forwardRef(function(e,r){let t=(0,p.Z)({props:e,name:"JoyDivider"}),{className:i,children:n,component:a=null!=n?"div":"hr",inset:d,orientation:v="horizontal",role:u="hr"!==a?"separator":void 0}=t,m=(0,l.Z)(t,g),h=(0,s.Z)({},t,{inset:d,role:u,orientation:v,component:a}),x=f(h);return(0,o.jsx)(y,(0,s.Z)({ref:r,as:a,className:(0,c.Z)(x.root,i),ownerState:h,role:u},"separator"===u&&"vertical"===v&&{"aria-orientation":"vertical"},m,{children:n}))});x.muiName="Divider";var Z=t(90545),D=t(77614),b=t(53113),P=t(35086),S=t(53047),j=t(54842),B=t(67830),I=t(19700),w=t(92391),C=t(78915),z=t(56008);function k(){var e;let r=w.z.object({query:w.z.string().min(1)}),t=(0,z.useRouter)(),[l,s]=(0,n.useState)(!1),c=(0,I.cI)({resolver:(0,B.F)(r),defaultValues:{}}),{data:d}=(0,i.Z)(async()=>await (0,C.Kw)("/v1/chat/dialogue/scenes")),v=async e=>{let{query:r}=e;try{var o,i;s(!0),c.reset();let e=await (0,C.Kw)("/v1/chat/dialogue/new",{chat_mode:"chat_normal"});(null==e?void 0:e.success)&&(null==e?void 0:null===(o=e.data)||void 0===o?void 0:o.conv_uid)&&t.push("/chat?id=".concat(null==e?void 0:null===(i=e.data)||void 0===i?void 0:i.conv_uid,"&initMessage=").concat(r))}catch(e){}finally{s(!1)}};return(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)("div",{className:"mx-auto h-full justify-center flex max-w-3xl flex-col gap-8 px-5 pt-6 xl:max-w-4xl",children:[(0,o.jsxs)("div",{className:"max-w-xs my-0 mx-auto",children:[(0,o.jsx)(a.ZP,{level:"h3",className:"text-center",children:"DB-GPT"}),(0,o.jsx)(a.ZP,{level:"body1",className:"text-center pt-4",children:"Revolutionizing Database Interactions with Private LLM Technology"})]}),(0,o.jsx)("div",{className:"grid gap-8 lg:grid-cols-3",children:(0,o.jsxs)("div",{className:"lg:col-span-3",children:[(0,o.jsx)(x,{className:"text-[#878c93]",children:"Quick Start"}),(0,o.jsx)(Z.Z,{className:"grid pt-7 rounded-xl gap-2 lg:grid-cols-3 lg:gap-6",sx:{["& .".concat(D.Z.root)]:{color:"var(--joy-palette-primary-solidColor)",backgroundColor:"var(--joy-palette-primary-solidBg)",height:"52px","&: hover":{backgroundColor:"var(--joy-palette-primary-solidHoverBg)"}}},children:null==d?void 0:null===(e=d.data)||void 0===e?void 0:e.map(e=>(0,o.jsx)(b.Z,{size:"md",variant:"solid",className:"text-base rounded-none",onClick:async()=>{var r,o;let i=await (0,C.Kw)("/v1/chat/dialogue/new",{chat_mode:e.chat_scene});(null==i?void 0:i.success)&&(null==i?void 0:null===(r=i.data)||void 0===r?void 0:r.conv_uid)&&t.push("/chat?id=".concat(null==i?void 0:null===(o=i.data)||void 0===o?void 0:o.conv_uid,"&scene=").concat(e.chat_scene))},children:e.scene_name},e.chat_scene))})]})}),(0,o.jsx)("div",{className:"mt-6 mb-[10%] pointer-events-none inset-x-0 bottom-0 z-0 mx-auto flex w-full max-w-3xl flex-col items-center justify-center max-md:border-t xl:max-w-4xl [&>*]:pointer-events-auto",children:(0,o.jsx)("form",{style:{maxWidth:"100%",width:"100%",position:"relative",display:"flex",marginTop:"auto",overflow:"visible",background:"none",justifyContent:"center",marginLeft:"auto",marginRight:"auto",height:"52px"},onSubmit:e=>{c.handleSubmit(v)(e)},children:(0,o.jsx)(P.ZP,{sx:{width:"100%"},variant:"outlined",placeholder:"Ask anything",endDecorator:(0,o.jsx)(S.ZP,{type:"submit",disabled:l,children:(0,o.jsx)(j.Z,{})}),...c.register("query")})})})]})})}},78915:function(e,r,t){"use strict";t.d(r,{Tk:function(){return d},Kw:function(){return v},PR:function(){return u},Ej:function(){return p}});var o=t(21628),i=t(24214),n=t(52040);let a=i.Z.create({baseURL:n.env.API_BASE_URL});a.defaults.timeout=1e4,a.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var l=t(84835);let s={"content-type":"application/json"},c=e=>{if(!(0,l.isPlainObject)(e))return JSON.stringify(e);let r={...e};for(let e in r){let t=r[e];"string"==typeof t&&(r[e]=t.trim())}return JSON.stringify(r)},d=(e,r)=>{if(r){let t=Object.keys(r).filter(e=>void 0!==r[e]&&""!==r[e]).map(e=>"".concat(e,"=").concat(r[e])).join("&");t&&(e+="?".concat(t))}return a.get("/api"+e,{headers:s}).then(e=>e).catch(e=>{o.ZP.error(e),Promise.reject(e)})},v=(e,r)=>{let t=c(r);return a.post("/api"+e,{body:t,headers:s}).then(e=>e).catch(e=>{o.ZP.error(e),Promise.reject(e)})},u=(e,r)=>{let t=c(r);return a.post(e,{body:t,headers:s}).then(e=>e).catch(e=>{o.ZP.error(e),Promise.reject(e)})},p=(e,r)=>a.post(e,{body:r}).then(e=>e).catch(e=>{o.ZP.error(e),Promise.reject(e)})},56008:function(e,r,t){e.exports=t(30794)}},function(e){e.O(0,[180,106,685,86,316,259,253,769,744],function(){return e(e.s=62499)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/page-434a95cceffaef05.js b/pilot/server/static/_next/static/chunks/app/page-434a95cceffaef05.js new file mode 100644 index 000000000..22fb995ff --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/page-434a95cceffaef05.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{90545:function(e,r,t){"use strict";t.d(r,{Z:function(){return g}});var o=t(40431),i=t(46750),n=t(86006),a=t(89791),l=t(4323),s=t(51579),c=t(86601),d=t(95887),v=t(9268);let u=["className","component"];var p=t(47327),m=t(98918);let h=function(e={}){let{themeId:r,defaultTheme:t,defaultClassName:p="MuiBox-root",generateClassName:m}=e,h=(0,l.ZP)("div",{shouldForwardProp:e=>"theme"!==e&&"sx"!==e&&"as"!==e})(s.Z),g=n.forwardRef(function(e,n){let l=(0,d.Z)(t),s=(0,c.Z)(e),{className:g,component:f="div"}=s,y=(0,i.Z)(s,u);return(0,v.jsx)(h,(0,o.Z)({as:f,ref:n,className:(0,a.Z)(g,m?m(p):p),theme:r&&l[r]||l},y))});return g}({defaultTheme:m.Z,defaultClassName:"MuiBox-root",generateClassName:p.Z.generate});var g=h},53113:function(e,r,t){"use strict";var o=t(46750),i=t(40431),n=t(86006),a=t(46319),l=t(47562),s=t(53832),c=t(99179),d=t(50645),v=t(88930),u=t(47093),p=t(326),m=t(94244),h=t(77614),g=t(9268);let f=["children","action","color","variant","size","fullWidth","startDecorator","endDecorator","loading","loadingPosition","loadingIndicator","disabled"],y=e=>{let{color:r,disabled:t,focusVisible:o,focusVisibleClassName:i,fullWidth:n,size:a,variant:c,loading:d}=e,v={root:["root",t&&"disabled",o&&"focusVisible",n&&"fullWidth",c&&`variant${(0,s.Z)(c)}`,r&&`color${(0,s.Z)(r)}`,a&&`size${(0,s.Z)(a)}`,d&&"loading"],startDecorator:["startDecorator"],endDecorator:["endDecorator"],loadingIndicatorCenter:["loadingIndicatorCenter"]},u=(0,l.Z)(v,h.F,{});return o&&i&&(u.root+=` ${i}`),u},x=(0,d.Z)("span",{name:"JoyButton",slot:"StartDecorator",overridesResolver:(e,r)=>r.startDecorator})({"--Icon-margin":"0 0 0 calc(var(--Button-gap) / -2)","--CircularProgress-margin":"0 0 0 calc(var(--Button-gap) / -2)",display:"inherit",marginRight:"var(--Button-gap)"}),Z=(0,d.Z)("span",{name:"JoyButton",slot:"EndDecorator",overridesResolver:(e,r)=>r.endDecorator})({"--Icon-margin":"0 calc(var(--Button-gap) / -2) 0 0","--CircularProgress-margin":"0 calc(var(--Button-gap) / -2) 0 0",display:"inherit",marginLeft:"var(--Button-gap)"}),D=(0,d.Z)("span",{name:"JoyButton",slot:"LoadingCenter",overridesResolver:(e,r)=>r.loadingIndicatorCenter})(({theme:e,ownerState:r})=>{var t,o,n,a;return(0,i.Z)({display:"inherit",position:"absolute",left:"50%",transform:"translateX(-50%)",color:null==(t=e.variants[r.variant])?void 0:null==(o=t[r.color])?void 0:o.color},r.disabled&&{color:null==(n=e.variants[`${r.variant}Disabled`])?void 0:null==(a=n[r.color])?void 0:a.color})}),b=(0,d.Z)("button",{name:"JoyButton",slot:"Root",overridesResolver:(e,r)=>r.root})(({theme:e,ownerState:r})=>{var t,o,n,a;return[(0,i.Z)({"--Icon-margin":"initial"},"sm"===r.size&&{"--Icon-fontSize":"1.25rem","--CircularProgress-size":"20px","--Button-gap":"0.375rem",minHeight:"var(--Button-minHeight, 2rem)",fontSize:e.vars.fontSize.sm,paddingBlock:"2px",paddingInline:"0.75rem"},"md"===r.size&&{"--Icon-fontSize":"1.5rem","--CircularProgress-size":"24px","--Button-gap":"0.5rem",minHeight:"var(--Button-minHeight, 2.5rem)",fontSize:e.vars.fontSize.sm,paddingBlock:"0.25rem",paddingInline:"1rem"},"lg"===r.size&&{"--Icon-fontSize":"1.75rem","--CircularProgress-size":"28px","--Button-gap":"0.75rem",minHeight:"var(--Button-minHeight, 3rem)",fontSize:e.vars.fontSize.md,paddingBlock:"0.375rem",paddingInline:"1.5rem"},{WebkitTapHighlightColor:"transparent",borderRadius:`var(--Button-radius, ${e.vars.radius.sm})`,margin:"var(--Button-margin)",border:"none",backgroundColor:"transparent",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",textDecoration:"none",fontFamily:e.vars.fontFamily.body,fontWeight:e.vars.fontWeight.lg,lineHeight:1},r.fullWidth&&{width:"100%"},{[e.focus.selector]:e.focus.default}),null==(t=e.variants[r.variant])?void 0:t[r.color],{"&:hover":null==(o=e.variants[`${r.variant}Hover`])?void 0:o[r.color]},{"&:active":null==(n=e.variants[`${r.variant}Active`])?void 0:n[r.color]},(0,i.Z)({[`&.${h.Z.disabled}`]:null==(a=e.variants[`${r.variant}Disabled`])?void 0:a[r.color]},"center"===r.loadingPosition&&{[`&.${h.Z.loading}`]:{color:"transparent"}})]}),P=n.forwardRef(function(e,r){let t=(0,v.Z)({props:e,name:"JoyButton"}),{children:l,action:s,color:d="primary",variant:h="solid",size:P="md",fullWidth:j=!1,startDecorator:S,endDecorator:B,loading:I=!1,loadingPosition:w="center",loadingIndicator:C,disabled:z}=t,k=(0,o.Z)(t,f),{getColor:N}=(0,u.VT)(h),T=N(e.color,d),R=n.useRef(null),_=(0,c.Z)(R,r),{focusVisible:F,setFocusVisible:$,getRootProps:W}=(0,a.Z)((0,i.Z)({},t,{disabled:z||I,ref:_})),J=null!=C?C:(0,g.jsx)(m.Z,(0,i.Z)({},"context"!==T&&{color:T},{thickness:{sm:2,md:3,lg:4}[P]||3}));n.useImperativeHandle(s,()=>({focusVisible:()=>{var e;$(!0),null==(e=R.current)||e.focus()}}),[$]);let M=(0,i.Z)({},t,{color:T,fullWidth:j,variant:h,size:P,focusVisible:F,loading:I,loadingPosition:w,disabled:z||I}),H=y(M),[O,E]=(0,p.Z)("root",{ref:r,className:H.root,elementType:b,externalForwardedProps:k,getSlotProps:W,ownerState:M}),[L,V]=(0,p.Z)("startDecorator",{className:H.startDecorator,elementType:x,externalForwardedProps:k,ownerState:M}),[A,K]=(0,p.Z)("endDecorator",{className:H.endDecorator,elementType:Z,externalForwardedProps:k,ownerState:M}),[q,G]=(0,p.Z)("loadingIndicatorCenter",{className:H.loadingIndicatorCenter,elementType:D,externalForwardedProps:k,ownerState:M});return(0,g.jsxs)(O,(0,i.Z)({},E,{children:[(S||I&&"start"===w)&&(0,g.jsx)(L,(0,i.Z)({},V,{children:I&&"start"===w?J:S})),l,I&&"center"===w&&(0,g.jsx)(q,(0,i.Z)({},G,{children:J})),(B||I&&"end"===w)&&(0,g.jsx)(A,(0,i.Z)({},K,{children:I&&"end"===w?J:B}))]}))});r.Z=P},77614:function(e,r,t){"use strict";t.d(r,{F:function(){return i}});var o=t(18587);function i(e){return(0,o.d6)("MuiButton",e)}let n=(0,o.sI)("MuiButton",["root","colorPrimary","colorNeutral","colorDanger","colorInfo","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","focusVisible","disabled","sizeSm","sizeMd","sizeLg","fullWidth","startDecorator","endDecorator","loading","loadingIndicatorCenter"]);r.Z=n},22046:function(e,r,t){"use strict";t.d(r,{eu:function(){return x},FR:function(){return y},ZP:function(){return B}});var o=t(46750),i=t(40431),n=t(86006),a=t(53832),l=t(86601),s=t(47562),c=t(50645),d=t(88930),v=t(47093),u=t(326),p=t(18587);function m(e){return(0,p.d6)("MuiTypography",e)}(0,p.sI)("MuiTypography",["root","h1","h2","h3","h4","h5","h6","body1","body2","body3","noWrap","gutterBottom","startDecorator","endDecorator","colorPrimary","colorNeutral","colorDanger","colorInfo","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);var h=t(9268);let g=["color","textColor"],f=["component","gutterBottom","noWrap","level","levelMapping","children","endDecorator","startDecorator","variant"],y=n.createContext(!1),x=n.createContext(!1),Z=e=>{let{gutterBottom:r,noWrap:t,level:o,color:i,variant:n}=e,l={root:["root",o,r&&"gutterBottom",t&&"noWrap",i&&`color${(0,a.Z)(i)}`,n&&`variant${(0,a.Z)(n)}`],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return(0,s.Z)(l,m,{})},D=(0,c.Z)("span",{name:"JoyTypography",slot:"StartDecorator",overridesResolver:(e,r)=>r.startDecorator})(({ownerState:e})=>{var r;return(0,i.Z)({display:"inline-flex",marginInlineEnd:"clamp(4px, var(--Typography-gap, 0.375em), 0.75rem)"},"string"!=typeof e.startDecorator&&("flex-start"===e.alignItems||(null==(r=e.sx)?void 0:r.alignItems)==="flex-start")&&{marginTop:"2px"})}),b=(0,c.Z)("span",{name:"JoyTypography",slot:"endDecorator",overridesResolver:(e,r)=>r.endDecorator})(({ownerState:e})=>{var r;return(0,i.Z)({display:"inline-flex",marginInlineStart:"clamp(4px, var(--Typography-gap, 0.375em), 0.75rem)"},"string"!=typeof e.endDecorator&&("flex-start"===e.alignItems||(null==(r=e.sx)?void 0:r.alignItems)==="flex-start")&&{marginTop:"2px"})}),P=(0,c.Z)("span",{name:"JoyTypography",slot:"Root",overridesResolver:(e,r)=>r.root})(({theme:e,ownerState:r})=>{var t,o,n,a;return(0,i.Z)({"--Icon-fontSize":"1.25em",margin:"var(--Typography-margin, 0px)"},r.nesting?{display:"inline"}:{fontFamily:e.vars.fontFamily.body,display:"block"},(r.startDecorator||r.endDecorator)&&(0,i.Z)({display:"flex",alignItems:"center"},r.nesting&&(0,i.Z)({display:"inline-flex"},r.startDecorator&&{verticalAlign:"bottom"})),r.level&&"inherit"!==r.level&&e.typography[r.level],{fontSize:`var(--Typography-fontSize, ${r.level&&"inherit"!==r.level&&null!=(t=null==(o=e.typography[r.level])?void 0:o.fontSize)?t:"inherit"})`},r.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},r.gutterBottom&&{marginBottom:"0.35em"},r.color&&"context"!==r.color&&{color:`rgba(${null==(n=e.vars.palette[r.color])?void 0:n.mainChannel} / 1)`},r.variant&&(0,i.Z)({borderRadius:e.vars.radius.xs,paddingBlock:"min(0.15em, 4px)",paddingInline:"0.375em"},!r.nesting&&{marginInline:"-0.375em"},null==(a=e.variants[r.variant])?void 0:a[r.color]))}),j={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",display1:"h1",display2:"h2",body1:"p",body2:"p",body3:"span",body4:"span",body5:"span",inherit:"p"},S=n.forwardRef(function(e,r){let t=(0,d.Z)({props:e,name:"JoyTypography"}),{color:a,textColor:s}=t,c=(0,o.Z)(t,g),p=n.useContext(y),m=n.useContext(x),S=(0,l.Z)((0,i.Z)({},c,{color:s})),{component:B,gutterBottom:I=!1,noWrap:w=!1,level:C="body1",levelMapping:z={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",body1:"p",body2:"p",body3:"p",inherit:"p"},children:k,endDecorator:N,startDecorator:T,variant:R}=S,_=(0,o.Z)(S,f),{getColor:F}=(0,v.VT)(R),$=F(e.color,R?null!=a?a:"neutral":a),W=p||m?e.level||"inherit":C,J=B||(p?"span":z[W]||j[W]||"span"),M=(0,i.Z)({},S,{level:W,component:J,color:$,gutterBottom:I,noWrap:w,nesting:p,variant:R}),H=Z(M),O=(0,i.Z)({},_,{component:J}),[E,L]=(0,u.Z)("root",{ref:r,className:H.root,elementType:P,externalForwardedProps:O,ownerState:M}),[V,A]=(0,u.Z)("startDecorator",{className:H.startDecorator,elementType:D,externalForwardedProps:O,ownerState:M}),[K,q]=(0,u.Z)("endDecorator",{className:H.endDecorator,elementType:b,externalForwardedProps:O,ownerState:M});return(0,h.jsx)(y.Provider,{value:!0,children:(0,h.jsxs)(E,(0,i.Z)({},L,{children:[T&&(0,h.jsx)(V,(0,i.Z)({},A,{children:T})),k,N&&(0,h.jsx)(K,(0,i.Z)({},q,{children:N}))]}))})});var B=S},62499:function(e,r,t){Promise.resolve().then(t.bind(t,26925))},26925:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return k}});var o=t(9268),i=t(89081),n=t(86006),a=t(22046),l=t(46750),s=t(40431),c=t(89791),d=t(53832),v=t(47562),u=t(50645),p=t(88930),m=t(18587);function h(e){return(0,m.d6)("MuiDivider",e)}(0,m.sI)("MuiDivider",["root","horizontal","vertical","insetContext","insetNone"]);let g=["className","children","component","inset","orientation","role"],f=e=>{let{orientation:r,inset:t}=e,o={root:["root",r,t&&`inset${(0,d.Z)(t)}`]};return(0,v.Z)(o,h,{})},y=(0,u.Z)("hr",{name:"JoyDivider",slot:"Root",overridesResolver:(e,r)=>r.root})(({theme:e,ownerState:r})=>(0,s.Z)({"--Divider-thickness":"1px","--Divider-lineColor":e.vars.palette.divider},"none"===r.inset&&{"--_Divider-inset":"0px"},"context"===r.inset&&{"--_Divider-inset":"var(--Divider-inset, 0px)"},{margin:"initial",marginInline:"vertical"===r.orientation?"initial":"var(--_Divider-inset)",marginBlock:"vertical"===r.orientation?"var(--_Divider-inset)":"initial",position:"relative",alignSelf:"stretch",flexShrink:0},r.children?{"--Divider-gap":e.spacing(1),"--Divider-childPosition":"50%",display:"flex",flexDirection:"vertical"===r.orientation?"column":"row",alignItems:"center",whiteSpace:"nowrap",textAlign:"center",border:0,fontFamily:e.vars.fontFamily.body,fontSize:e.vars.fontSize.sm,"&::before, &::after":{position:"relative",inlineSize:"vertical"===r.orientation?"var(--Divider-thickness)":"initial",blockSize:"vertical"===r.orientation?"initial":"var(--Divider-thickness)",backgroundColor:"var(--Divider-lineColor)",content:'""'},"&::before":{marginInlineEnd:"vertical"===r.orientation?"initial":"min(var(--Divider-childPosition) * 999, var(--Divider-gap))",marginBlockEnd:"vertical"===r.orientation?"min(var(--Divider-childPosition) * 999, var(--Divider-gap))":"initial",flexBasis:"var(--Divider-childPosition)"},"&::after":{marginInlineStart:"vertical"===r.orientation?"initial":"min((100% - var(--Divider-childPosition)) * 999, var(--Divider-gap))",marginBlockStart:"vertical"===r.orientation?"min((100% - var(--Divider-childPosition)) * 999, var(--Divider-gap))":"initial",flexBasis:"calc(100% - var(--Divider-childPosition))"}}:{border:"none",listStyle:"none",backgroundColor:"var(--Divider-lineColor)",inlineSize:"vertical"===r.orientation?"var(--Divider-thickness)":"initial",blockSize:"vertical"===r.orientation?"initial":"var(--Divider-thickness)"})),x=n.forwardRef(function(e,r){let t=(0,p.Z)({props:e,name:"JoyDivider"}),{className:i,children:n,component:a=null!=n?"div":"hr",inset:d,orientation:v="horizontal",role:u="hr"!==a?"separator":void 0}=t,m=(0,l.Z)(t,g),h=(0,s.Z)({},t,{inset:d,role:u,orientation:v,component:a}),x=f(h);return(0,o.jsx)(y,(0,s.Z)({ref:r,as:a,className:(0,c.Z)(x.root,i),ownerState:h,role:u},"separator"===u&&"vertical"===v&&{"aria-orientation":"vertical"},m,{children:n}))});x.muiName="Divider";var Z=t(90545),D=t(77614),b=t(53113),P=t(35086),j=t(53047),S=t(54842),B=t(67830),I=t(19700),w=t(92391),C=t(78915),z=t(56008);function k(){var e;let r=w.z.object({query:w.z.string().min(1)}),t=(0,z.useRouter)(),[l,s]=(0,n.useState)(!1),c=(0,I.cI)({resolver:(0,B.F)(r),defaultValues:{}}),{data:d}=(0,i.Z)(async()=>await (0,C.Kw)("/v1/chat/dialogue/scenes")),v=async e=>{let{query:r}=e;try{var o,i;s(!0),c.reset();let e=await (0,C.Kw)("/v1/chat/dialogue/new",{chat_mode:"chat_normal"});(null==e?void 0:e.success)&&(null==e?void 0:null===(o=e.data)||void 0===o?void 0:o.conv_uid)&&t.push("/chat?id=".concat(null==e?void 0:null===(i=e.data)||void 0===i?void 0:i.conv_uid,"&initMessage=").concat(r))}catch(e){}finally{s(!1)}};return(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)("div",{className:"mx-auto h-full justify-center flex max-w-3xl flex-col gap-8 px-5 pt-6 xl:max-w-4xl",children:[(0,o.jsxs)("div",{className:"max-w-xs my-0 mx-auto",children:[(0,o.jsx)(a.ZP,{level:"h3",className:"text-center",children:"DB-GPT"}),(0,o.jsx)(a.ZP,{level:"body1",className:"text-center pt-4",children:"Revolutionizing Database Interactions with Private LLM Technology"})]}),(0,o.jsx)("div",{className:"grid gap-8 lg:grid-cols-3",children:(0,o.jsxs)("div",{className:"lg:col-span-3",children:[(0,o.jsx)(x,{className:"text-[#878c93]",children:"Quick Start"}),(0,o.jsx)(Z.Z,{className:"grid pt-7 rounded-xl gap-2 lg:grid-cols-3 lg:gap-6",sx:{["& .".concat(D.Z.root)]:{color:"var(--joy-palette-primary-solidColor)",backgroundColor:"var(--joy-palette-primary-solidBg)",height:"52px","&: hover":{backgroundColor:"var(--joy-palette-primary-solidHoverBg)"}}},children:null==d?void 0:null===(e=d.data)||void 0===e?void 0:e.map(e=>(0,o.jsx)(b.Z,{size:"md",variant:"solid",className:"text-base rounded-none",onClick:async()=>{var r,o;let i=await (0,C.Kw)("/v1/chat/dialogue/new",{chat_mode:e.chat_scene});(null==i?void 0:i.success)&&(null==i?void 0:null===(r=i.data)||void 0===r?void 0:r.conv_uid)&&t.push("/chat?id=".concat(null==i?void 0:null===(o=i.data)||void 0===o?void 0:o.conv_uid,"&scene=").concat(e.chat_scene))},children:e.scene_name},e.chat_scene))})]})}),(0,o.jsx)("div",{className:"mt-6 mb-[10%] pointer-events-none inset-x-0 bottom-0 z-0 mx-auto flex w-full max-w-3xl flex-col items-center justify-center max-md:border-t xl:max-w-4xl [&>*]:pointer-events-auto",children:(0,o.jsx)("form",{style:{maxWidth:"100%",width:"100%",position:"relative",display:"flex",marginTop:"auto",overflow:"visible",background:"none",justifyContent:"center",marginLeft:"auto",marginRight:"auto",height:"52px"},onSubmit:e=>{c.handleSubmit(v)(e)},children:(0,o.jsx)(P.ZP,{sx:{width:"100%"},variant:"outlined",placeholder:"Ask anything",endDecorator:(0,o.jsx)(j.ZP,{type:"submit",disabled:l,children:(0,o.jsx)(S.Z,{})}),...c.register("query")})})})]})})}},78915:function(e,r,t){"use strict";t.d(r,{Tk:function(){return c},Kw:function(){return d},PR:function(){return v},Ej:function(){return u}});var o=t(21628),i=t(24214);let n=i.Z.create({baseURL:"http://127.0.0.1:5000"});n.defaults.timeout=1e4,n.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var a=t(84835);let l={"content-type":"application/json"},s=e=>{if(!(0,a.isPlainObject)(e))return JSON.stringify(e);let r={...e};for(let e in r){let t=r[e];"string"==typeof t&&(r[e]=t.trim())}return JSON.stringify(r)},c=(e,r)=>{if(r){let t=Object.keys(r).filter(e=>void 0!==r[e]&&""!==r[e]).map(e=>"".concat(e,"=").concat(r[e])).join("&");t&&(e+="?".concat(t))}return n.get("/api"+e,{headers:l}).then(e=>e).catch(e=>{o.ZP.error(e),Promise.reject(e)})},d=(e,r)=>{let t=s(r);return n.post("/api"+e,{body:t,headers:l}).then(e=>e).catch(e=>{o.ZP.error(e),Promise.reject(e)})},v=(e,r)=>{let t=s(r);return n.post(e,{body:t,headers:l}).then(e=>e).catch(e=>{o.ZP.error(e),Promise.reject(e)})},u=(e,r)=>n.post(e,{body:r}).then(e=>e).catch(e=>{o.ZP.error(e),Promise.reject(e)})},56008:function(e,r,t){e.exports=t(30794)}},function(e){e.O(0,[180,430,577,214,86,316,259,253,769,744],function(){return e(e.s=62499)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/page-845483ccc3f5c179.js b/pilot/server/static/_next/static/chunks/app/page-845483ccc3f5c179.js new file mode 100644 index 000000000..8e020b3b7 --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/page-845483ccc3f5c179.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{90545:function(e,r,t){"use strict";t.d(r,{Z:function(){return g}});var o=t(40431),i=t(46750),n=t(86006),a=t(89791),l=t(4323),s=t(51579),c=t(86601),d=t(95887),v=t(9268);let u=["className","component"];var p=t(47327),m=t(98918);let h=function(e={}){let{themeId:r,defaultTheme:t,defaultClassName:p="MuiBox-root",generateClassName:m}=e,h=(0,l.ZP)("div",{shouldForwardProp:e=>"theme"!==e&&"sx"!==e&&"as"!==e})(s.Z),g=n.forwardRef(function(e,n){let l=(0,d.Z)(t),s=(0,c.Z)(e),{className:g,component:f="div"}=s,y=(0,i.Z)(s,u);return(0,v.jsx)(h,(0,o.Z)({as:f,ref:n,className:(0,a.Z)(g,m?m(p):p),theme:r&&l[r]||l},y))});return g}({defaultTheme:m.Z,defaultClassName:"MuiBox-root",generateClassName:p.Z.generate});var g=h},53113:function(e,r,t){"use strict";var o=t(46750),i=t(40431),n=t(86006),a=t(46319),l=t(47562),s=t(53832),c=t(99179),d=t(50645),v=t(88930),u=t(47093),p=t(326),m=t(94244),h=t(77614),g=t(9268);let f=["children","action","color","variant","size","fullWidth","startDecorator","endDecorator","loading","loadingPosition","loadingIndicator","disabled"],y=e=>{let{color:r,disabled:t,focusVisible:o,focusVisibleClassName:i,fullWidth:n,size:a,variant:c,loading:d}=e,v={root:["root",t&&"disabled",o&&"focusVisible",n&&"fullWidth",c&&`variant${(0,s.Z)(c)}`,r&&`color${(0,s.Z)(r)}`,a&&`size${(0,s.Z)(a)}`,d&&"loading"],startDecorator:["startDecorator"],endDecorator:["endDecorator"],loadingIndicatorCenter:["loadingIndicatorCenter"]},u=(0,l.Z)(v,h.F,{});return o&&i&&(u.root+=` ${i}`),u},x=(0,d.Z)("span",{name:"JoyButton",slot:"StartDecorator",overridesResolver:(e,r)=>r.startDecorator})({"--Icon-margin":"0 0 0 calc(var(--Button-gap) / -2)","--CircularProgress-margin":"0 0 0 calc(var(--Button-gap) / -2)",display:"inherit",marginRight:"var(--Button-gap)"}),Z=(0,d.Z)("span",{name:"JoyButton",slot:"EndDecorator",overridesResolver:(e,r)=>r.endDecorator})({"--Icon-margin":"0 calc(var(--Button-gap) / -2) 0 0","--CircularProgress-margin":"0 calc(var(--Button-gap) / -2) 0 0",display:"inherit",marginLeft:"var(--Button-gap)"}),D=(0,d.Z)("span",{name:"JoyButton",slot:"LoadingCenter",overridesResolver:(e,r)=>r.loadingIndicatorCenter})(({theme:e,ownerState:r})=>{var t,o,n,a;return(0,i.Z)({display:"inherit",position:"absolute",left:"50%",transform:"translateX(-50%)",color:null==(t=e.variants[r.variant])?void 0:null==(o=t[r.color])?void 0:o.color},r.disabled&&{color:null==(n=e.variants[`${r.variant}Disabled`])?void 0:null==(a=n[r.color])?void 0:a.color})}),b=(0,d.Z)("button",{name:"JoyButton",slot:"Root",overridesResolver:(e,r)=>r.root})(({theme:e,ownerState:r})=>{var t,o,n,a;return[(0,i.Z)({"--Icon-margin":"initial"},"sm"===r.size&&{"--Icon-fontSize":"1.25rem","--CircularProgress-size":"20px","--Button-gap":"0.375rem",minHeight:"var(--Button-minHeight, 2rem)",fontSize:e.vars.fontSize.sm,paddingBlock:"2px",paddingInline:"0.75rem"},"md"===r.size&&{"--Icon-fontSize":"1.5rem","--CircularProgress-size":"24px","--Button-gap":"0.5rem",minHeight:"var(--Button-minHeight, 2.5rem)",fontSize:e.vars.fontSize.sm,paddingBlock:"0.25rem",paddingInline:"1rem"},"lg"===r.size&&{"--Icon-fontSize":"1.75rem","--CircularProgress-size":"28px","--Button-gap":"0.75rem",minHeight:"var(--Button-minHeight, 3rem)",fontSize:e.vars.fontSize.md,paddingBlock:"0.375rem",paddingInline:"1.5rem"},{WebkitTapHighlightColor:"transparent",borderRadius:`var(--Button-radius, ${e.vars.radius.sm})`,margin:"var(--Button-margin)",border:"none",backgroundColor:"transparent",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",textDecoration:"none",fontFamily:e.vars.fontFamily.body,fontWeight:e.vars.fontWeight.lg,lineHeight:1},r.fullWidth&&{width:"100%"},{[e.focus.selector]:e.focus.default}),null==(t=e.variants[r.variant])?void 0:t[r.color],{"&:hover":null==(o=e.variants[`${r.variant}Hover`])?void 0:o[r.color]},{"&:active":null==(n=e.variants[`${r.variant}Active`])?void 0:n[r.color]},(0,i.Z)({[`&.${h.Z.disabled}`]:null==(a=e.variants[`${r.variant}Disabled`])?void 0:a[r.color]},"center"===r.loadingPosition&&{[`&.${h.Z.loading}`]:{color:"transparent"}})]}),S=n.forwardRef(function(e,r){let t=(0,v.Z)({props:e,name:"JoyButton"}),{children:l,action:s,color:d="primary",variant:h="solid",size:S="md",fullWidth:j=!1,startDecorator:B,endDecorator:I,loading:P=!1,loadingPosition:C="center",loadingIndicator:z,disabled:w}=t,k=(0,o.Z)(t,f),{getColor:N}=(0,u.VT)(h),T=N(e.color,d),R=n.useRef(null),_=(0,c.Z)(R,r),{focusVisible:F,setFocusVisible:$,getRootProps:W}=(0,a.Z)((0,i.Z)({},t,{disabled:w||P,ref:_})),J=null!=z?z:(0,g.jsx)(m.Z,(0,i.Z)({},"context"!==T&&{color:T},{thickness:{sm:2,md:3,lg:4}[S]||3}));n.useImperativeHandle(s,()=>({focusVisible:()=>{var e;$(!0),null==(e=R.current)||e.focus()}}),[$]);let M=(0,i.Z)({},t,{color:T,fullWidth:j,variant:h,size:S,focusVisible:F,loading:P,loadingPosition:C,disabled:w||P}),H=y(M),[O,E]=(0,p.Z)("root",{ref:r,className:H.root,elementType:b,externalForwardedProps:k,getSlotProps:W,ownerState:M}),[L,V]=(0,p.Z)("startDecorator",{className:H.startDecorator,elementType:x,externalForwardedProps:k,ownerState:M}),[A,K]=(0,p.Z)("endDecorator",{className:H.endDecorator,elementType:Z,externalForwardedProps:k,ownerState:M}),[q,G]=(0,p.Z)("loadingIndicatorCenter",{className:H.loadingIndicatorCenter,elementType:D,externalForwardedProps:k,ownerState:M});return(0,g.jsxs)(O,(0,i.Z)({},E,{children:[(B||P&&"start"===C)&&(0,g.jsx)(L,(0,i.Z)({},V,{children:P&&"start"===C?J:B})),l,P&&"center"===C&&(0,g.jsx)(q,(0,i.Z)({},G,{children:J})),(I||P&&"end"===C)&&(0,g.jsx)(A,(0,i.Z)({},K,{children:P&&"end"===C?J:I}))]}))});r.Z=S},77614:function(e,r,t){"use strict";t.d(r,{F:function(){return i}});var o=t(18587);function i(e){return(0,o.d6)("MuiButton",e)}let n=(0,o.sI)("MuiButton",["root","colorPrimary","colorNeutral","colorDanger","colorInfo","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","focusVisible","disabled","sizeSm","sizeMd","sizeLg","fullWidth","startDecorator","endDecorator","loading","loadingIndicatorCenter"]);r.Z=n},22046:function(e,r,t){"use strict";t.d(r,{eu:function(){return x},FR:function(){return y},ZP:function(){return I}});var o=t(46750),i=t(40431),n=t(86006),a=t(53832),l=t(86601),s=t(47562),c=t(50645),d=t(88930),v=t(47093),u=t(326),p=t(18587);function m(e){return(0,p.d6)("MuiTypography",e)}(0,p.sI)("MuiTypography",["root","h1","h2","h3","h4","h5","h6","body1","body2","body3","noWrap","gutterBottom","startDecorator","endDecorator","colorPrimary","colorNeutral","colorDanger","colorInfo","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);var h=t(9268);let g=["color","textColor"],f=["component","gutterBottom","noWrap","level","levelMapping","children","endDecorator","startDecorator","variant"],y=n.createContext(!1),x=n.createContext(!1),Z=e=>{let{gutterBottom:r,noWrap:t,level:o,color:i,variant:n}=e,l={root:["root",o,r&&"gutterBottom",t&&"noWrap",i&&`color${(0,a.Z)(i)}`,n&&`variant${(0,a.Z)(n)}`],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return(0,s.Z)(l,m,{})},D=(0,c.Z)("span",{name:"JoyTypography",slot:"StartDecorator",overridesResolver:(e,r)=>r.startDecorator})(({ownerState:e})=>{var r;return(0,i.Z)({display:"inline-flex",marginInlineEnd:"clamp(4px, var(--Typography-gap, 0.375em), 0.75rem)"},"string"!=typeof e.startDecorator&&("flex-start"===e.alignItems||(null==(r=e.sx)?void 0:r.alignItems)==="flex-start")&&{marginTop:"2px"})}),b=(0,c.Z)("span",{name:"JoyTypography",slot:"endDecorator",overridesResolver:(e,r)=>r.endDecorator})(({ownerState:e})=>{var r;return(0,i.Z)({display:"inline-flex",marginInlineStart:"clamp(4px, var(--Typography-gap, 0.375em), 0.75rem)"},"string"!=typeof e.endDecorator&&("flex-start"===e.alignItems||(null==(r=e.sx)?void 0:r.alignItems)==="flex-start")&&{marginTop:"2px"})}),S=(0,c.Z)("span",{name:"JoyTypography",slot:"Root",overridesResolver:(e,r)=>r.root})(({theme:e,ownerState:r})=>{var t,o,n,a;return(0,i.Z)({"--Icon-fontSize":"1.25em",margin:"var(--Typography-margin, 0px)"},r.nesting?{display:"inline"}:{fontFamily:e.vars.fontFamily.body,display:"block"},(r.startDecorator||r.endDecorator)&&(0,i.Z)({display:"flex",alignItems:"center"},r.nesting&&(0,i.Z)({display:"inline-flex"},r.startDecorator&&{verticalAlign:"bottom"})),r.level&&"inherit"!==r.level&&e.typography[r.level],{fontSize:`var(--Typography-fontSize, ${r.level&&"inherit"!==r.level&&null!=(t=null==(o=e.typography[r.level])?void 0:o.fontSize)?t:"inherit"})`},r.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},r.gutterBottom&&{marginBottom:"0.35em"},r.color&&"context"!==r.color&&{color:`rgba(${null==(n=e.vars.palette[r.color])?void 0:n.mainChannel} / 1)`},r.variant&&(0,i.Z)({borderRadius:e.vars.radius.xs,paddingBlock:"min(0.15em, 4px)",paddingInline:"0.375em"},!r.nesting&&{marginInline:"-0.375em"},null==(a=e.variants[r.variant])?void 0:a[r.color]))}),j={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",display1:"h1",display2:"h2",body1:"p",body2:"p",body3:"span",body4:"span",body5:"span",inherit:"p"},B=n.forwardRef(function(e,r){let t=(0,d.Z)({props:e,name:"JoyTypography"}),{color:a,textColor:s}=t,c=(0,o.Z)(t,g),p=n.useContext(y),m=n.useContext(x),B=(0,l.Z)((0,i.Z)({},c,{color:s})),{component:I,gutterBottom:P=!1,noWrap:C=!1,level:z="body1",levelMapping:w={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",body1:"p",body2:"p",body3:"p",inherit:"p"},children:k,endDecorator:N,startDecorator:T,variant:R}=B,_=(0,o.Z)(B,f),{getColor:F}=(0,v.VT)(R),$=F(e.color,R?null!=a?a:"neutral":a),W=p||m?e.level||"inherit":z,J=I||(p?"span":w[W]||j[W]||"span"),M=(0,i.Z)({},B,{level:W,component:J,color:$,gutterBottom:P,noWrap:C,nesting:p,variant:R}),H=Z(M),O=(0,i.Z)({},_,{component:J}),[E,L]=(0,u.Z)("root",{ref:r,className:H.root,elementType:S,externalForwardedProps:O,ownerState:M}),[V,A]=(0,u.Z)("startDecorator",{className:H.startDecorator,elementType:D,externalForwardedProps:O,ownerState:M}),[K,q]=(0,u.Z)("endDecorator",{className:H.endDecorator,elementType:b,externalForwardedProps:O,ownerState:M});return(0,h.jsx)(y.Provider,{value:!0,children:(0,h.jsxs)(E,(0,i.Z)({},L,{children:[T&&(0,h.jsx)(V,(0,i.Z)({},A,{children:T})),k,N&&(0,h.jsx)(K,(0,i.Z)({},q,{children:N}))]}))})});var I=B},62499:function(e,r,t){Promise.resolve().then(t.bind(t,26925))},26925:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return k}});var o=t(9268),i=t(89081),n=t(86006),a=t(22046),l=t(46750),s=t(40431),c=t(89791),d=t(53832),v=t(47562),u=t(50645),p=t(88930),m=t(18587);function h(e){return(0,m.d6)("MuiDivider",e)}(0,m.sI)("MuiDivider",["root","horizontal","vertical","insetContext","insetNone"]);let g=["className","children","component","inset","orientation","role"],f=e=>{let{orientation:r,inset:t}=e,o={root:["root",r,t&&`inset${(0,d.Z)(t)}`]};return(0,v.Z)(o,h,{})},y=(0,u.Z)("hr",{name:"JoyDivider",slot:"Root",overridesResolver:(e,r)=>r.root})(({theme:e,ownerState:r})=>(0,s.Z)({"--Divider-thickness":"1px","--Divider-lineColor":e.vars.palette.divider},"none"===r.inset&&{"--_Divider-inset":"0px"},"context"===r.inset&&{"--_Divider-inset":"var(--Divider-inset, 0px)"},{margin:"initial",marginInline:"vertical"===r.orientation?"initial":"var(--_Divider-inset)",marginBlock:"vertical"===r.orientation?"var(--_Divider-inset)":"initial",position:"relative",alignSelf:"stretch",flexShrink:0},r.children?{"--Divider-gap":e.spacing(1),"--Divider-childPosition":"50%",display:"flex",flexDirection:"vertical"===r.orientation?"column":"row",alignItems:"center",whiteSpace:"nowrap",textAlign:"center",border:0,fontFamily:e.vars.fontFamily.body,fontSize:e.vars.fontSize.sm,"&::before, &::after":{position:"relative",inlineSize:"vertical"===r.orientation?"var(--Divider-thickness)":"initial",blockSize:"vertical"===r.orientation?"initial":"var(--Divider-thickness)",backgroundColor:"var(--Divider-lineColor)",content:'""'},"&::before":{marginInlineEnd:"vertical"===r.orientation?"initial":"min(var(--Divider-childPosition) * 999, var(--Divider-gap))",marginBlockEnd:"vertical"===r.orientation?"min(var(--Divider-childPosition) * 999, var(--Divider-gap))":"initial",flexBasis:"var(--Divider-childPosition)"},"&::after":{marginInlineStart:"vertical"===r.orientation?"initial":"min((100% - var(--Divider-childPosition)) * 999, var(--Divider-gap))",marginBlockStart:"vertical"===r.orientation?"min((100% - var(--Divider-childPosition)) * 999, var(--Divider-gap))":"initial",flexBasis:"calc(100% - var(--Divider-childPosition))"}}:{border:"none",listStyle:"none",backgroundColor:"var(--Divider-lineColor)",inlineSize:"vertical"===r.orientation?"var(--Divider-thickness)":"initial",blockSize:"vertical"===r.orientation?"initial":"var(--Divider-thickness)"})),x=n.forwardRef(function(e,r){let t=(0,p.Z)({props:e,name:"JoyDivider"}),{className:i,children:n,component:a=null!=n?"div":"hr",inset:d,orientation:v="horizontal",role:u="hr"!==a?"separator":void 0}=t,m=(0,l.Z)(t,g),h=(0,s.Z)({},t,{inset:d,role:u,orientation:v,component:a}),x=f(h);return(0,o.jsx)(y,(0,s.Z)({ref:r,as:a,className:(0,c.Z)(x.root,i),ownerState:h,role:u},"separator"===u&&"vertical"===v&&{"aria-orientation":"vertical"},m,{children:n}))});x.muiName="Divider";var Z=t(90545),D=t(77614),b=t(53113),S=t(35086),j=t(53047),B=t(54842),I=t(67830),P=t(19700),C=t(92391),z=t(78915),w=t(56008);function k(){var e;let r=C.z.object({query:C.z.string().min(1)}),t=(0,w.useRouter)(),[l,s]=(0,n.useState)(!1),c=(0,P.cI)({resolver:(0,I.F)(r),defaultValues:{}}),{data:d}=(0,i.Z)(async()=>await (0,z.K)("/v1/chat/dialogue/scenes")),v=async e=>{let{query:r}=e;try{var o,i;s(!0),c.reset();let e=await (0,z.K)("/v1/chat/dialogue/new",{chat_mode:"chat_normal"});(null==e?void 0:e.success)&&(null==e?void 0:null===(o=e.data)||void 0===o?void 0:o.conv_uid)&&t.push("/chat?id=".concat(null==e?void 0:null===(i=e.data)||void 0===i?void 0:i.conv_uid,"&initMessage=").concat(r))}catch(e){}finally{s(!1)}};return(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)("div",{className:"mx-auto h-full justify-center flex max-w-3xl flex-col gap-8 px-5 pt-6 xl:max-w-4xl",children:[(0,o.jsxs)("div",{className:"max-w-xs my-0 mx-auto",children:[(0,o.jsx)(a.ZP,{level:"h3",className:"text-center",children:"DB-GPT"}),(0,o.jsx)(a.ZP,{level:"body1",className:"text-center pt-4",children:"Revolutionizing Database Interactions with Private LLM Technology"})]}),(0,o.jsx)("div",{className:"grid gap-8 lg:grid-cols-3",children:(0,o.jsxs)("div",{className:"lg:col-span-3",children:[(0,o.jsx)(x,{className:"text-[#878c93]",children:"Quick Start"}),(0,o.jsx)(Z.Z,{className:"grid pt-7 rounded-xl gap-2 lg:grid-cols-3 lg:gap-6",sx:{["& .".concat(D.Z.root)]:{color:"var(--joy-palette-primary-solidColor)",backgroundColor:"var(--joy-palette-primary-solidBg)",height:"52px","&: hover":{backgroundColor:"var(--joy-palette-primary-solidHoverBg)"}}},children:null==d?void 0:null===(e=d.data)||void 0===e?void 0:e.map(e=>(0,o.jsx)(b.Z,{size:"md",variant:"solid",className:"text-base rounded-none",onClick:async()=>{var r,o;let i=await (0,z.K)("/v1/chat/dialogue/new",{chat_mode:e.chat_scene});(null==i?void 0:i.success)&&(null==i?void 0:null===(r=i.data)||void 0===r?void 0:r.conv_uid)&&t.push("/chat?id=".concat(null==i?void 0:null===(o=i.data)||void 0===o?void 0:o.conv_uid,"&scene=").concat(e.chat_scene))},children:e.scene_name},e.chat_scene))})]})}),(0,o.jsx)("div",{className:"mt-6 mb-[10%] pointer-events-none inset-x-0 bottom-0 z-0 mx-auto flex w-full max-w-3xl flex-col items-center justify-center max-md:border-t xl:max-w-4xl [&>*]:pointer-events-auto",children:(0,o.jsx)("form",{style:{maxWidth:"100%",width:"100%",position:"relative",display:"flex",marginTop:"auto",overflow:"visible",background:"none",justifyContent:"center",marginLeft:"auto",marginRight:"auto",height:"52px"},onSubmit:e=>{c.handleSubmit(v)(e)},children:(0,o.jsx)(S.ZP,{sx:{width:"100%"},variant:"outlined",placeholder:"Ask anything",endDecorator:(0,o.jsx)(j.ZP,{type:"submit",disabled:l,children:(0,o.jsx)(B.Z,{})}),...c.register("query")})})})]})})}},78915:function(e,r,t){"use strict";t.d(r,{T:function(){return c},K:function(){return d}});var o=t(21628),i=t(24214);let n=i.Z.create({baseURL:"http://127.0.0.1:5000"});n.defaults.timeout=1e4,n.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var a=t(84835);let l={"content-type":"application/json"},s=e=>{if(!(0,a.isPlainObject)(e))return JSON.stringify(e);let r={...e};for(let e in r){let t=r[e];"string"==typeof t&&(r[e]=t.trim())}return JSON.stringify(r)},c=(e,r)=>{if(r){let t=Object.keys(r).filter(e=>void 0!==r[e]&&""!==r[e]).map(e=>"".concat(e,"=").concat(r[e])).join("&");t&&(e+="?".concat(t))}return n.get("/api"+e,{headers:l}).then(e=>e).catch(e=>{o.ZP.error(e),Promise.reject(e)})},d=(e,r)=>{let t=s(r);return n.post("/api"+e,{body:t,headers:l}).then(e=>e).catch(e=>{o.ZP.error(e),Promise.reject(e)})}},56008:function(e,r,t){e.exports=t(30794)}},function(e){e.O(0,[180,430,577,86,562,259,253,769,744],function(){return e(e.s=62499)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/page-d0a57ae1438a1222.js b/pilot/server/static/_next/static/chunks/app/page-d0a57ae1438a1222.js new file mode 100644 index 000000000..82f0ce7cd --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/page-d0a57ae1438a1222.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{90545:function(e,r,t){"use strict";t.d(r,{Z:function(){return g}});var o=t(40431),i=t(46750),n=t(86006),a=t(89791),l=t(4323),s=t(51579),c=t(86601),d=t(95887),v=t(9268);let u=["className","component"];var p=t(47327),m=t(98918);let h=function(e={}){let{themeId:r,defaultTheme:t,defaultClassName:p="MuiBox-root",generateClassName:m}=e,h=(0,l.ZP)("div",{shouldForwardProp:e=>"theme"!==e&&"sx"!==e&&"as"!==e})(s.Z),g=n.forwardRef(function(e,n){let l=(0,d.Z)(t),s=(0,c.Z)(e),{className:g,component:f="div"}=s,y=(0,i.Z)(s,u);return(0,v.jsx)(h,(0,o.Z)({as:f,ref:n,className:(0,a.Z)(g,m?m(p):p),theme:r&&l[r]||l},y))});return g}({defaultTheme:m.Z,defaultClassName:"MuiBox-root",generateClassName:p.Z.generate});var g=h},53113:function(e,r,t){"use strict";var o=t(46750),i=t(40431),n=t(86006),a=t(46319),l=t(47562),s=t(53832),c=t(99179),d=t(50645),v=t(88930),u=t(47093),p=t(326),m=t(94244),h=t(77614),g=t(9268);let f=["children","action","color","variant","size","fullWidth","startDecorator","endDecorator","loading","loadingPosition","loadingIndicator","disabled"],y=e=>{let{color:r,disabled:t,focusVisible:o,focusVisibleClassName:i,fullWidth:n,size:a,variant:c,loading:d}=e,v={root:["root",t&&"disabled",o&&"focusVisible",n&&"fullWidth",c&&`variant${(0,s.Z)(c)}`,r&&`color${(0,s.Z)(r)}`,a&&`size${(0,s.Z)(a)}`,d&&"loading"],startDecorator:["startDecorator"],endDecorator:["endDecorator"],loadingIndicatorCenter:["loadingIndicatorCenter"]},u=(0,l.Z)(v,h.F,{});return o&&i&&(u.root+=` ${i}`),u},x=(0,d.Z)("span",{name:"JoyButton",slot:"StartDecorator",overridesResolver:(e,r)=>r.startDecorator})({"--Icon-margin":"0 0 0 calc(var(--Button-gap) / -2)","--CircularProgress-margin":"0 0 0 calc(var(--Button-gap) / -2)",display:"inherit",marginRight:"var(--Button-gap)"}),Z=(0,d.Z)("span",{name:"JoyButton",slot:"EndDecorator",overridesResolver:(e,r)=>r.endDecorator})({"--Icon-margin":"0 calc(var(--Button-gap) / -2) 0 0","--CircularProgress-margin":"0 calc(var(--Button-gap) / -2) 0 0",display:"inherit",marginLeft:"var(--Button-gap)"}),D=(0,d.Z)("span",{name:"JoyButton",slot:"LoadingCenter",overridesResolver:(e,r)=>r.loadingIndicatorCenter})(({theme:e,ownerState:r})=>{var t,o,n,a;return(0,i.Z)({display:"inherit",position:"absolute",left:"50%",transform:"translateX(-50%)",color:null==(t=e.variants[r.variant])?void 0:null==(o=t[r.color])?void 0:o.color},r.disabled&&{color:null==(n=e.variants[`${r.variant}Disabled`])?void 0:null==(a=n[r.color])?void 0:a.color})}),b=(0,d.Z)("button",{name:"JoyButton",slot:"Root",overridesResolver:(e,r)=>r.root})(({theme:e,ownerState:r})=>{var t,o,n,a;return[(0,i.Z)({"--Icon-margin":"initial"},"sm"===r.size&&{"--Icon-fontSize":"1.25rem","--CircularProgress-size":"20px","--Button-gap":"0.375rem",minHeight:"var(--Button-minHeight, 2rem)",fontSize:e.vars.fontSize.sm,paddingBlock:"2px",paddingInline:"0.75rem"},"md"===r.size&&{"--Icon-fontSize":"1.5rem","--CircularProgress-size":"24px","--Button-gap":"0.5rem",minHeight:"var(--Button-minHeight, 2.5rem)",fontSize:e.vars.fontSize.sm,paddingBlock:"0.25rem",paddingInline:"1rem"},"lg"===r.size&&{"--Icon-fontSize":"1.75rem","--CircularProgress-size":"28px","--Button-gap":"0.75rem",minHeight:"var(--Button-minHeight, 3rem)",fontSize:e.vars.fontSize.md,paddingBlock:"0.375rem",paddingInline:"1.5rem"},{WebkitTapHighlightColor:"transparent",borderRadius:`var(--Button-radius, ${e.vars.radius.sm})`,margin:"var(--Button-margin)",border:"none",backgroundColor:"transparent",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",textDecoration:"none",fontFamily:e.vars.fontFamily.body,fontWeight:e.vars.fontWeight.lg,lineHeight:1},r.fullWidth&&{width:"100%"},{[e.focus.selector]:e.focus.default}),null==(t=e.variants[r.variant])?void 0:t[r.color],{"&:hover":null==(o=e.variants[`${r.variant}Hover`])?void 0:o[r.color]},{"&:active":null==(n=e.variants[`${r.variant}Active`])?void 0:n[r.color]},(0,i.Z)({[`&.${h.Z.disabled}`]:null==(a=e.variants[`${r.variant}Disabled`])?void 0:a[r.color]},"center"===r.loadingPosition&&{[`&.${h.Z.loading}`]:{color:"transparent"}})]}),P=n.forwardRef(function(e,r){let t=(0,v.Z)({props:e,name:"JoyButton"}),{children:l,action:s,color:d="primary",variant:h="solid",size:P="md",fullWidth:j=!1,startDecorator:S,endDecorator:B,loading:I=!1,loadingPosition:w="center",loadingIndicator:C,disabled:z}=t,k=(0,o.Z)(t,f),{getColor:N}=(0,u.VT)(h),T=N(e.color,d),R=n.useRef(null),_=(0,c.Z)(R,r),{focusVisible:F,setFocusVisible:$,getRootProps:W}=(0,a.Z)((0,i.Z)({},t,{disabled:z||I,ref:_})),J=null!=C?C:(0,g.jsx)(m.Z,(0,i.Z)({},"context"!==T&&{color:T},{thickness:{sm:2,md:3,lg:4}[P]||3}));n.useImperativeHandle(s,()=>({focusVisible:()=>{var e;$(!0),null==(e=R.current)||e.focus()}}),[$]);let M=(0,i.Z)({},t,{color:T,fullWidth:j,variant:h,size:P,focusVisible:F,loading:I,loadingPosition:w,disabled:z||I}),H=y(M),[O,E]=(0,p.Z)("root",{ref:r,className:H.root,elementType:b,externalForwardedProps:k,getSlotProps:W,ownerState:M}),[L,V]=(0,p.Z)("startDecorator",{className:H.startDecorator,elementType:x,externalForwardedProps:k,ownerState:M}),[A,K]=(0,p.Z)("endDecorator",{className:H.endDecorator,elementType:Z,externalForwardedProps:k,ownerState:M}),[q,G]=(0,p.Z)("loadingIndicatorCenter",{className:H.loadingIndicatorCenter,elementType:D,externalForwardedProps:k,ownerState:M});return(0,g.jsxs)(O,(0,i.Z)({},E,{children:[(S||I&&"start"===w)&&(0,g.jsx)(L,(0,i.Z)({},V,{children:I&&"start"===w?J:S})),l,I&&"center"===w&&(0,g.jsx)(q,(0,i.Z)({},G,{children:J})),(B||I&&"end"===w)&&(0,g.jsx)(A,(0,i.Z)({},K,{children:I&&"end"===w?J:B}))]}))});r.Z=P},77614:function(e,r,t){"use strict";t.d(r,{F:function(){return i}});var o=t(18587);function i(e){return(0,o.d6)("MuiButton",e)}let n=(0,o.sI)("MuiButton",["root","colorPrimary","colorNeutral","colorDanger","colorInfo","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","focusVisible","disabled","sizeSm","sizeMd","sizeLg","fullWidth","startDecorator","endDecorator","loading","loadingIndicatorCenter"]);r.Z=n},22046:function(e,r,t){"use strict";t.d(r,{eu:function(){return x},FR:function(){return y},ZP:function(){return B}});var o=t(46750),i=t(40431),n=t(86006),a=t(53832),l=t(86601),s=t(47562),c=t(50645),d=t(88930),v=t(47093),u=t(326),p=t(18587);function m(e){return(0,p.d6)("MuiTypography",e)}(0,p.sI)("MuiTypography",["root","h1","h2","h3","h4","h5","h6","body1","body2","body3","noWrap","gutterBottom","startDecorator","endDecorator","colorPrimary","colorNeutral","colorDanger","colorInfo","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);var h=t(9268);let g=["color","textColor"],f=["component","gutterBottom","noWrap","level","levelMapping","children","endDecorator","startDecorator","variant"],y=n.createContext(!1),x=n.createContext(!1),Z=e=>{let{gutterBottom:r,noWrap:t,level:o,color:i,variant:n}=e,l={root:["root",o,r&&"gutterBottom",t&&"noWrap",i&&`color${(0,a.Z)(i)}`,n&&`variant${(0,a.Z)(n)}`],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return(0,s.Z)(l,m,{})},D=(0,c.Z)("span",{name:"JoyTypography",slot:"StartDecorator",overridesResolver:(e,r)=>r.startDecorator})(({ownerState:e})=>{var r;return(0,i.Z)({display:"inline-flex",marginInlineEnd:"clamp(4px, var(--Typography-gap, 0.375em), 0.75rem)"},"string"!=typeof e.startDecorator&&("flex-start"===e.alignItems||(null==(r=e.sx)?void 0:r.alignItems)==="flex-start")&&{marginTop:"2px"})}),b=(0,c.Z)("span",{name:"JoyTypography",slot:"endDecorator",overridesResolver:(e,r)=>r.endDecorator})(({ownerState:e})=>{var r;return(0,i.Z)({display:"inline-flex",marginInlineStart:"clamp(4px, var(--Typography-gap, 0.375em), 0.75rem)"},"string"!=typeof e.endDecorator&&("flex-start"===e.alignItems||(null==(r=e.sx)?void 0:r.alignItems)==="flex-start")&&{marginTop:"2px"})}),P=(0,c.Z)("span",{name:"JoyTypography",slot:"Root",overridesResolver:(e,r)=>r.root})(({theme:e,ownerState:r})=>{var t,o,n,a;return(0,i.Z)({"--Icon-fontSize":"1.25em",margin:"var(--Typography-margin, 0px)"},r.nesting?{display:"inline"}:{fontFamily:e.vars.fontFamily.body,display:"block"},(r.startDecorator||r.endDecorator)&&(0,i.Z)({display:"flex",alignItems:"center"},r.nesting&&(0,i.Z)({display:"inline-flex"},r.startDecorator&&{verticalAlign:"bottom"})),r.level&&"inherit"!==r.level&&e.typography[r.level],{fontSize:`var(--Typography-fontSize, ${r.level&&"inherit"!==r.level&&null!=(t=null==(o=e.typography[r.level])?void 0:o.fontSize)?t:"inherit"})`},r.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},r.gutterBottom&&{marginBottom:"0.35em"},r.color&&"context"!==r.color&&{color:`rgba(${null==(n=e.vars.palette[r.color])?void 0:n.mainChannel} / 1)`},r.variant&&(0,i.Z)({borderRadius:e.vars.radius.xs,paddingBlock:"min(0.15em, 4px)",paddingInline:"0.375em"},!r.nesting&&{marginInline:"-0.375em"},null==(a=e.variants[r.variant])?void 0:a[r.color]))}),j={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",display1:"h1",display2:"h2",body1:"p",body2:"p",body3:"span",body4:"span",body5:"span",inherit:"p"},S=n.forwardRef(function(e,r){let t=(0,d.Z)({props:e,name:"JoyTypography"}),{color:a,textColor:s}=t,c=(0,o.Z)(t,g),p=n.useContext(y),m=n.useContext(x),S=(0,l.Z)((0,i.Z)({},c,{color:s})),{component:B,gutterBottom:I=!1,noWrap:w=!1,level:C="body1",levelMapping:z={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",body1:"p",body2:"p",body3:"p",inherit:"p"},children:k,endDecorator:N,startDecorator:T,variant:R}=S,_=(0,o.Z)(S,f),{getColor:F}=(0,v.VT)(R),$=F(e.color,R?null!=a?a:"neutral":a),W=p||m?e.level||"inherit":C,J=B||(p?"span":z[W]||j[W]||"span"),M=(0,i.Z)({},S,{level:W,component:J,color:$,gutterBottom:I,noWrap:w,nesting:p,variant:R}),H=Z(M),O=(0,i.Z)({},_,{component:J}),[E,L]=(0,u.Z)("root",{ref:r,className:H.root,elementType:P,externalForwardedProps:O,ownerState:M}),[V,A]=(0,u.Z)("startDecorator",{className:H.startDecorator,elementType:D,externalForwardedProps:O,ownerState:M}),[K,q]=(0,u.Z)("endDecorator",{className:H.endDecorator,elementType:b,externalForwardedProps:O,ownerState:M});return(0,h.jsx)(y.Provider,{value:!0,children:(0,h.jsxs)(E,(0,i.Z)({},L,{children:[T&&(0,h.jsx)(V,(0,i.Z)({},A,{children:T})),k,N&&(0,h.jsx)(K,(0,i.Z)({},q,{children:N}))]}))})});var B=S},62499:function(e,r,t){Promise.resolve().then(t.bind(t,26925))},26925:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return k}});var o=t(9268),i=t(89081),n=t(86006),a=t(22046),l=t(46750),s=t(40431),c=t(89791),d=t(53832),v=t(47562),u=t(50645),p=t(88930),m=t(18587);function h(e){return(0,m.d6)("MuiDivider",e)}(0,m.sI)("MuiDivider",["root","horizontal","vertical","insetContext","insetNone"]);let g=["className","children","component","inset","orientation","role"],f=e=>{let{orientation:r,inset:t}=e,o={root:["root",r,t&&`inset${(0,d.Z)(t)}`]};return(0,v.Z)(o,h,{})},y=(0,u.Z)("hr",{name:"JoyDivider",slot:"Root",overridesResolver:(e,r)=>r.root})(({theme:e,ownerState:r})=>(0,s.Z)({"--Divider-thickness":"1px","--Divider-lineColor":e.vars.palette.divider},"none"===r.inset&&{"--_Divider-inset":"0px"},"context"===r.inset&&{"--_Divider-inset":"var(--Divider-inset, 0px)"},{margin:"initial",marginInline:"vertical"===r.orientation?"initial":"var(--_Divider-inset)",marginBlock:"vertical"===r.orientation?"var(--_Divider-inset)":"initial",position:"relative",alignSelf:"stretch",flexShrink:0},r.children?{"--Divider-gap":e.spacing(1),"--Divider-childPosition":"50%",display:"flex",flexDirection:"vertical"===r.orientation?"column":"row",alignItems:"center",whiteSpace:"nowrap",textAlign:"center",border:0,fontFamily:e.vars.fontFamily.body,fontSize:e.vars.fontSize.sm,"&::before, &::after":{position:"relative",inlineSize:"vertical"===r.orientation?"var(--Divider-thickness)":"initial",blockSize:"vertical"===r.orientation?"initial":"var(--Divider-thickness)",backgroundColor:"var(--Divider-lineColor)",content:'""'},"&::before":{marginInlineEnd:"vertical"===r.orientation?"initial":"min(var(--Divider-childPosition) * 999, var(--Divider-gap))",marginBlockEnd:"vertical"===r.orientation?"min(var(--Divider-childPosition) * 999, var(--Divider-gap))":"initial",flexBasis:"var(--Divider-childPosition)"},"&::after":{marginInlineStart:"vertical"===r.orientation?"initial":"min((100% - var(--Divider-childPosition)) * 999, var(--Divider-gap))",marginBlockStart:"vertical"===r.orientation?"min((100% - var(--Divider-childPosition)) * 999, var(--Divider-gap))":"initial",flexBasis:"calc(100% - var(--Divider-childPosition))"}}:{border:"none",listStyle:"none",backgroundColor:"var(--Divider-lineColor)",inlineSize:"vertical"===r.orientation?"var(--Divider-thickness)":"initial",blockSize:"vertical"===r.orientation?"initial":"var(--Divider-thickness)"})),x=n.forwardRef(function(e,r){let t=(0,p.Z)({props:e,name:"JoyDivider"}),{className:i,children:n,component:a=null!=n?"div":"hr",inset:d,orientation:v="horizontal",role:u="hr"!==a?"separator":void 0}=t,m=(0,l.Z)(t,g),h=(0,s.Z)({},t,{inset:d,role:u,orientation:v,component:a}),x=f(h);return(0,o.jsx)(y,(0,s.Z)({ref:r,as:a,className:(0,c.Z)(x.root,i),ownerState:h,role:u},"separator"===u&&"vertical"===v&&{"aria-orientation":"vertical"},m,{children:n}))});x.muiName="Divider";var Z=t(90545),D=t(77614),b=t(53113),P=t(35086),j=t(53047),S=t(54842),B=t(67830),I=t(19700),w=t(92391),C=t(78915),z=t(56008);function k(){var e;let r=w.z.object({query:w.z.string().min(1)}),t=(0,z.useRouter)(),[l,s]=(0,n.useState)(!1),c=(0,I.cI)({resolver:(0,B.F)(r),defaultValues:{}}),{data:d}=(0,i.Z)(async()=>await (0,C.Kw)("/v1/chat/dialogue/scenes")),v=async e=>{let{query:r}=e;try{var o,i;s(!0),c.reset();let e=await (0,C.Kw)("/v1/chat/dialogue/new",{chat_mode:"chat_normal"});(null==e?void 0:e.success)&&(null==e?void 0:null===(o=e.data)||void 0===o?void 0:o.conv_uid)&&t.push("/chat?id=".concat(null==e?void 0:null===(i=e.data)||void 0===i?void 0:i.conv_uid,"&initMessage=").concat(r))}catch(e){}finally{s(!1)}};return(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)("div",{className:"mx-auto h-full justify-center flex max-w-3xl flex-col gap-8 px-5 pt-6 xl:max-w-4xl",children:[(0,o.jsxs)("div",{className:"max-w-xs my-0 mx-auto",children:[(0,o.jsx)(a.ZP,{level:"h3",className:"text-center",children:"DB-GPT"}),(0,o.jsx)(a.ZP,{level:"body1",className:"text-center pt-4",children:"Revolutionizing Database Interactions with Private LLM Technology"})]}),(0,o.jsx)("div",{className:"grid gap-8 lg:grid-cols-3",children:(0,o.jsxs)("div",{className:"lg:col-span-3",children:[(0,o.jsx)(x,{className:"text-[#878c93]",children:"Quick Start"}),(0,o.jsx)(Z.Z,{className:"grid pt-7 rounded-xl gap-2 lg:grid-cols-3 lg:gap-6",sx:{["& .".concat(D.Z.root)]:{color:"var(--joy-palette-primary-solidColor)",backgroundColor:"var(--joy-palette-primary-solidBg)",height:"52px","&: hover":{backgroundColor:"var(--joy-palette-primary-solidHoverBg)"}}},children:null==d?void 0:null===(e=d.data)||void 0===e?void 0:e.map(e=>(0,o.jsx)(b.Z,{size:"md",variant:"solid",className:"text-base rounded-none",onClick:async()=>{var r,o;let i=await (0,C.Kw)("/v1/chat/dialogue/new",{chat_mode:e.chat_scene});(null==i?void 0:i.success)&&(null==i?void 0:null===(r=i.data)||void 0===r?void 0:r.conv_uid)&&t.push("/chat?id=".concat(null==i?void 0:null===(o=i.data)||void 0===o?void 0:o.conv_uid,"&scene=").concat(e.chat_scene))},children:e.scene_name},e.chat_scene))})]})}),(0,o.jsx)("div",{className:"mt-6 mb-[10%] pointer-events-none inset-x-0 bottom-0 z-0 mx-auto flex w-full max-w-3xl flex-col items-center justify-center max-md:border-t xl:max-w-4xl [&>*]:pointer-events-auto",children:(0,o.jsx)("form",{style:{maxWidth:"100%",width:"100%",position:"relative",display:"flex",marginTop:"auto",overflow:"visible",background:"none",justifyContent:"center",marginLeft:"auto",marginRight:"auto",height:"52px"},onSubmit:e=>{c.handleSubmit(v)(e)},children:(0,o.jsx)(P.ZP,{sx:{width:"100%"},variant:"outlined",placeholder:"Ask anything",endDecorator:(0,o.jsx)(j.ZP,{type:"submit",disabled:l,children:(0,o.jsx)(S.Z,{})}),...c.register("query")})})})]})})}},78915:function(e,r,t){"use strict";t.d(r,{Tk:function(){return c},Kw:function(){return d},PR:function(){return v},Ej:function(){return u}});var o=t(21628),i=t(24214);let n=i.Z.create({baseURL:"http://127.0.0.1:5000"});n.defaults.timeout=1e4,n.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var a=t(84835);let l={"content-type":"application/json"},s=e=>{if(!(0,a.isPlainObject)(e))return JSON.stringify(e);let r={...e};for(let e in r){let t=r[e];"string"==typeof t&&(r[e]=t.trim())}return JSON.stringify(r)},c=(e,r)=>{if(r){let t=Object.keys(r).filter(e=>void 0!==r[e]&&""!==r[e]).map(e=>"".concat(e,"=").concat(r[e])).join("&");t&&(e+="?".concat(t))}return n.get("/api"+e,{headers:l}).then(e=>e).catch(e=>{o.ZP.error(e),Promise.reject(e)})},d=(e,r)=>{let t=s(r);return n.post("/api"+e,{body:t,headers:l}).then(e=>e).catch(e=>{o.ZP.error(e),Promise.reject(e)})},v=(e,r)=>{let t=s(r);return n.post(e,{body:t,headers:l}).then(e=>e).catch(e=>{o.ZP.error(e),Promise.reject(e)})},u=(e,r)=>n.post(e,{body:r}).then(e=>e).catch(e=>{o.ZP.error(e),Promise.reject(e)})},56008:function(e,r,t){e.exports=t(30794)}},function(e){e.O(0,[180,752,685,86,316,259,253,769,744],function(){return e(e.s=62499)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/app/page-f82d4b8e68b1c0b2.js b/pilot/server/static/_next/static/chunks/app/page-f82d4b8e68b1c0b2.js new file mode 100644 index 000000000..1a48ca17e --- /dev/null +++ b/pilot/server/static/_next/static/chunks/app/page-f82d4b8e68b1c0b2.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{90545:function(e,r,t){"use strict";t.d(r,{Z:function(){return g}});var o=t(40431),i=t(46750),n=t(86006),a=t(89791),l=t(4323),s=t(51579),c=t(86601),d=t(95887),v=t(9268);let u=["className","component"];var p=t(47327),m=t(98918);let h=function(e={}){let{themeId:r,defaultTheme:t,defaultClassName:p="MuiBox-root",generateClassName:m}=e,h=(0,l.ZP)("div",{shouldForwardProp:e=>"theme"!==e&&"sx"!==e&&"as"!==e})(s.Z),g=n.forwardRef(function(e,n){let l=(0,d.Z)(t),s=(0,c.Z)(e),{className:g,component:f="div"}=s,y=(0,i.Z)(s,u);return(0,v.jsx)(h,(0,o.Z)({as:f,ref:n,className:(0,a.Z)(g,m?m(p):p),theme:r&&l[r]||l},y))});return g}({defaultTheme:m.Z,defaultClassName:"MuiBox-root",generateClassName:p.Z.generate});var g=h},53113:function(e,r,t){"use strict";var o=t(46750),i=t(40431),n=t(86006),a=t(46319),l=t(47562),s=t(53832),c=t(99179),d=t(50645),v=t(88930),u=t(47093),p=t(326),m=t(94244),h=t(77614),g=t(9268);let f=["children","action","color","variant","size","fullWidth","startDecorator","endDecorator","loading","loadingPosition","loadingIndicator","disabled"],y=e=>{let{color:r,disabled:t,focusVisible:o,focusVisibleClassName:i,fullWidth:n,size:a,variant:c,loading:d}=e,v={root:["root",t&&"disabled",o&&"focusVisible",n&&"fullWidth",c&&`variant${(0,s.Z)(c)}`,r&&`color${(0,s.Z)(r)}`,a&&`size${(0,s.Z)(a)}`,d&&"loading"],startDecorator:["startDecorator"],endDecorator:["endDecorator"],loadingIndicatorCenter:["loadingIndicatorCenter"]},u=(0,l.Z)(v,h.F,{});return o&&i&&(u.root+=` ${i}`),u},x=(0,d.Z)("span",{name:"JoyButton",slot:"StartDecorator",overridesResolver:(e,r)=>r.startDecorator})({"--Icon-margin":"0 0 0 calc(var(--Button-gap) / -2)","--CircularProgress-margin":"0 0 0 calc(var(--Button-gap) / -2)",display:"inherit",marginRight:"var(--Button-gap)"}),Z=(0,d.Z)("span",{name:"JoyButton",slot:"EndDecorator",overridesResolver:(e,r)=>r.endDecorator})({"--Icon-margin":"0 calc(var(--Button-gap) / -2) 0 0","--CircularProgress-margin":"0 calc(var(--Button-gap) / -2) 0 0",display:"inherit",marginLeft:"var(--Button-gap)"}),D=(0,d.Z)("span",{name:"JoyButton",slot:"LoadingCenter",overridesResolver:(e,r)=>r.loadingIndicatorCenter})(({theme:e,ownerState:r})=>{var t,o,n,a;return(0,i.Z)({display:"inherit",position:"absolute",left:"50%",transform:"translateX(-50%)",color:null==(t=e.variants[r.variant])?void 0:null==(o=t[r.color])?void 0:o.color},r.disabled&&{color:null==(n=e.variants[`${r.variant}Disabled`])?void 0:null==(a=n[r.color])?void 0:a.color})}),b=(0,d.Z)("button",{name:"JoyButton",slot:"Root",overridesResolver:(e,r)=>r.root})(({theme:e,ownerState:r})=>{var t,o,n,a;return[(0,i.Z)({"--Icon-margin":"initial"},"sm"===r.size&&{"--Icon-fontSize":"1.25rem","--CircularProgress-size":"20px","--Button-gap":"0.375rem",minHeight:"var(--Button-minHeight, 2rem)",fontSize:e.vars.fontSize.sm,paddingBlock:"2px",paddingInline:"0.75rem"},"md"===r.size&&{"--Icon-fontSize":"1.5rem","--CircularProgress-size":"24px","--Button-gap":"0.5rem",minHeight:"var(--Button-minHeight, 2.5rem)",fontSize:e.vars.fontSize.sm,paddingBlock:"0.25rem",paddingInline:"1rem"},"lg"===r.size&&{"--Icon-fontSize":"1.75rem","--CircularProgress-size":"28px","--Button-gap":"0.75rem",minHeight:"var(--Button-minHeight, 3rem)",fontSize:e.vars.fontSize.md,paddingBlock:"0.375rem",paddingInline:"1.5rem"},{WebkitTapHighlightColor:"transparent",borderRadius:`var(--Button-radius, ${e.vars.radius.sm})`,margin:"var(--Button-margin)",border:"none",backgroundColor:"transparent",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",textDecoration:"none",fontFamily:e.vars.fontFamily.body,fontWeight:e.vars.fontWeight.lg,lineHeight:1},r.fullWidth&&{width:"100%"},{[e.focus.selector]:e.focus.default}),null==(t=e.variants[r.variant])?void 0:t[r.color],{"&:hover":null==(o=e.variants[`${r.variant}Hover`])?void 0:o[r.color]},{"&:active":null==(n=e.variants[`${r.variant}Active`])?void 0:n[r.color]},(0,i.Z)({[`&.${h.Z.disabled}`]:null==(a=e.variants[`${r.variant}Disabled`])?void 0:a[r.color]},"center"===r.loadingPosition&&{[`&.${h.Z.loading}`]:{color:"transparent"}})]}),P=n.forwardRef(function(e,r){let t=(0,v.Z)({props:e,name:"JoyButton"}),{children:l,action:s,color:d="primary",variant:h="solid",size:P="md",fullWidth:S=!1,startDecorator:j,endDecorator:B,loading:I=!1,loadingPosition:w="center",loadingIndicator:C,disabled:z}=t,k=(0,o.Z)(t,f),{getColor:N}=(0,u.VT)(h),T=N(e.color,d),R=n.useRef(null),_=(0,c.Z)(R,r),{focusVisible:F,setFocusVisible:$,getRootProps:W}=(0,a.Z)((0,i.Z)({},t,{disabled:z||I,ref:_})),J=null!=C?C:(0,g.jsx)(m.Z,(0,i.Z)({},"context"!==T&&{color:T},{thickness:{sm:2,md:3,lg:4}[P]||3}));n.useImperativeHandle(s,()=>({focusVisible:()=>{var e;$(!0),null==(e=R.current)||e.focus()}}),[$]);let M=(0,i.Z)({},t,{color:T,fullWidth:S,variant:h,size:P,focusVisible:F,loading:I,loadingPosition:w,disabled:z||I}),H=y(M),[E,O]=(0,p.Z)("root",{ref:r,className:H.root,elementType:b,externalForwardedProps:k,getSlotProps:W,ownerState:M}),[L,A]=(0,p.Z)("startDecorator",{className:H.startDecorator,elementType:x,externalForwardedProps:k,ownerState:M}),[V,K]=(0,p.Z)("endDecorator",{className:H.endDecorator,elementType:Z,externalForwardedProps:k,ownerState:M}),[q,U]=(0,p.Z)("loadingIndicatorCenter",{className:H.loadingIndicatorCenter,elementType:D,externalForwardedProps:k,ownerState:M});return(0,g.jsxs)(E,(0,i.Z)({},O,{children:[(j||I&&"start"===w)&&(0,g.jsx)(L,(0,i.Z)({},A,{children:I&&"start"===w?J:j})),l,I&&"center"===w&&(0,g.jsx)(q,(0,i.Z)({},U,{children:J})),(B||I&&"end"===w)&&(0,g.jsx)(V,(0,i.Z)({},K,{children:I&&"end"===w?J:B}))]}))});r.Z=P},77614:function(e,r,t){"use strict";t.d(r,{F:function(){return i}});var o=t(18587);function i(e){return(0,o.d6)("MuiButton",e)}let n=(0,o.sI)("MuiButton",["root","colorPrimary","colorNeutral","colorDanger","colorInfo","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","focusVisible","disabled","sizeSm","sizeMd","sizeLg","fullWidth","startDecorator","endDecorator","loading","loadingIndicatorCenter"]);r.Z=n},22046:function(e,r,t){"use strict";t.d(r,{eu:function(){return x},FR:function(){return y},ZP:function(){return B}});var o=t(46750),i=t(40431),n=t(86006),a=t(53832),l=t(86601),s=t(47562),c=t(50645),d=t(88930),v=t(47093),u=t(326),p=t(18587);function m(e){return(0,p.d6)("MuiTypography",e)}(0,p.sI)("MuiTypography",["root","h1","h2","h3","h4","h5","h6","body1","body2","body3","noWrap","gutterBottom","startDecorator","endDecorator","colorPrimary","colorNeutral","colorDanger","colorInfo","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);var h=t(9268);let g=["color","textColor"],f=["component","gutterBottom","noWrap","level","levelMapping","children","endDecorator","startDecorator","variant"],y=n.createContext(!1),x=n.createContext(!1),Z=e=>{let{gutterBottom:r,noWrap:t,level:o,color:i,variant:n}=e,l={root:["root",o,r&&"gutterBottom",t&&"noWrap",i&&`color${(0,a.Z)(i)}`,n&&`variant${(0,a.Z)(n)}`],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return(0,s.Z)(l,m,{})},D=(0,c.Z)("span",{name:"JoyTypography",slot:"StartDecorator",overridesResolver:(e,r)=>r.startDecorator})(({ownerState:e})=>{var r;return(0,i.Z)({display:"inline-flex",marginInlineEnd:"clamp(4px, var(--Typography-gap, 0.375em), 0.75rem)"},"string"!=typeof e.startDecorator&&("flex-start"===e.alignItems||(null==(r=e.sx)?void 0:r.alignItems)==="flex-start")&&{marginTop:"2px"})}),b=(0,c.Z)("span",{name:"JoyTypography",slot:"endDecorator",overridesResolver:(e,r)=>r.endDecorator})(({ownerState:e})=>{var r;return(0,i.Z)({display:"inline-flex",marginInlineStart:"clamp(4px, var(--Typography-gap, 0.375em), 0.75rem)"},"string"!=typeof e.endDecorator&&("flex-start"===e.alignItems||(null==(r=e.sx)?void 0:r.alignItems)==="flex-start")&&{marginTop:"2px"})}),P=(0,c.Z)("span",{name:"JoyTypography",slot:"Root",overridesResolver:(e,r)=>r.root})(({theme:e,ownerState:r})=>{var t,o,n,a;return(0,i.Z)({"--Icon-fontSize":"1.25em",margin:"var(--Typography-margin, 0px)"},r.nesting?{display:"inline"}:{fontFamily:e.vars.fontFamily.body,display:"block"},(r.startDecorator||r.endDecorator)&&(0,i.Z)({display:"flex",alignItems:"center"},r.nesting&&(0,i.Z)({display:"inline-flex"},r.startDecorator&&{verticalAlign:"bottom"})),r.level&&"inherit"!==r.level&&e.typography[r.level],{fontSize:`var(--Typography-fontSize, ${r.level&&"inherit"!==r.level&&null!=(t=null==(o=e.typography[r.level])?void 0:o.fontSize)?t:"inherit"})`},r.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},r.gutterBottom&&{marginBottom:"0.35em"},r.color&&"context"!==r.color&&{color:`rgba(${null==(n=e.vars.palette[r.color])?void 0:n.mainChannel} / 1)`},r.variant&&(0,i.Z)({borderRadius:e.vars.radius.xs,paddingBlock:"min(0.15em, 4px)",paddingInline:"0.375em"},!r.nesting&&{marginInline:"-0.375em"},null==(a=e.variants[r.variant])?void 0:a[r.color]))}),S={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",display1:"h1",display2:"h2",body1:"p",body2:"p",body3:"span",body4:"span",body5:"span",inherit:"p"},j=n.forwardRef(function(e,r){let t=(0,d.Z)({props:e,name:"JoyTypography"}),{color:a,textColor:s}=t,c=(0,o.Z)(t,g),p=n.useContext(y),m=n.useContext(x),j=(0,l.Z)((0,i.Z)({},c,{color:s})),{component:B,gutterBottom:I=!1,noWrap:w=!1,level:C="body1",levelMapping:z={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",body1:"p",body2:"p",body3:"p",inherit:"p"},children:k,endDecorator:N,startDecorator:T,variant:R}=j,_=(0,o.Z)(j,f),{getColor:F}=(0,v.VT)(R),$=F(e.color,R?null!=a?a:"neutral":a),W=p||m?e.level||"inherit":C,J=B||(p?"span":z[W]||S[W]||"span"),M=(0,i.Z)({},j,{level:W,component:J,color:$,gutterBottom:I,noWrap:w,nesting:p,variant:R}),H=Z(M),E=(0,i.Z)({},_,{component:J}),[O,L]=(0,u.Z)("root",{ref:r,className:H.root,elementType:P,externalForwardedProps:E,ownerState:M}),[A,V]=(0,u.Z)("startDecorator",{className:H.startDecorator,elementType:D,externalForwardedProps:E,ownerState:M}),[K,q]=(0,u.Z)("endDecorator",{className:H.endDecorator,elementType:b,externalForwardedProps:E,ownerState:M});return(0,h.jsx)(y.Provider,{value:!0,children:(0,h.jsxs)(O,(0,i.Z)({},L,{children:[T&&(0,h.jsx)(A,(0,i.Z)({},V,{children:T})),k,N&&(0,h.jsx)(K,(0,i.Z)({},q,{children:N}))]}))})});var B=j},62499:function(e,r,t){Promise.resolve().then(t.bind(t,26925))},26925:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return k}});var o=t(9268),i=t(89081),n=t(86006),a=t(22046),l=t(46750),s=t(40431),c=t(89791),d=t(53832),v=t(47562),u=t(50645),p=t(88930),m=t(18587);function h(e){return(0,m.d6)("MuiDivider",e)}(0,m.sI)("MuiDivider",["root","horizontal","vertical","insetContext","insetNone"]);let g=["className","children","component","inset","orientation","role"],f=e=>{let{orientation:r,inset:t}=e,o={root:["root",r,t&&`inset${(0,d.Z)(t)}`]};return(0,v.Z)(o,h,{})},y=(0,u.Z)("hr",{name:"JoyDivider",slot:"Root",overridesResolver:(e,r)=>r.root})(({theme:e,ownerState:r})=>(0,s.Z)({"--Divider-thickness":"1px","--Divider-lineColor":e.vars.palette.divider},"none"===r.inset&&{"--_Divider-inset":"0px"},"context"===r.inset&&{"--_Divider-inset":"var(--Divider-inset, 0px)"},{margin:"initial",marginInline:"vertical"===r.orientation?"initial":"var(--_Divider-inset)",marginBlock:"vertical"===r.orientation?"var(--_Divider-inset)":"initial",position:"relative",alignSelf:"stretch",flexShrink:0},r.children?{"--Divider-gap":e.spacing(1),"--Divider-childPosition":"50%",display:"flex",flexDirection:"vertical"===r.orientation?"column":"row",alignItems:"center",whiteSpace:"nowrap",textAlign:"center",border:0,fontFamily:e.vars.fontFamily.body,fontSize:e.vars.fontSize.sm,"&::before, &::after":{position:"relative",inlineSize:"vertical"===r.orientation?"var(--Divider-thickness)":"initial",blockSize:"vertical"===r.orientation?"initial":"var(--Divider-thickness)",backgroundColor:"var(--Divider-lineColor)",content:'""'},"&::before":{marginInlineEnd:"vertical"===r.orientation?"initial":"min(var(--Divider-childPosition) * 999, var(--Divider-gap))",marginBlockEnd:"vertical"===r.orientation?"min(var(--Divider-childPosition) * 999, var(--Divider-gap))":"initial",flexBasis:"var(--Divider-childPosition)"},"&::after":{marginInlineStart:"vertical"===r.orientation?"initial":"min((100% - var(--Divider-childPosition)) * 999, var(--Divider-gap))",marginBlockStart:"vertical"===r.orientation?"min((100% - var(--Divider-childPosition)) * 999, var(--Divider-gap))":"initial",flexBasis:"calc(100% - var(--Divider-childPosition))"}}:{border:"none",listStyle:"none",backgroundColor:"var(--Divider-lineColor)",inlineSize:"vertical"===r.orientation?"var(--Divider-thickness)":"initial",blockSize:"vertical"===r.orientation?"initial":"var(--Divider-thickness)"})),x=n.forwardRef(function(e,r){let t=(0,p.Z)({props:e,name:"JoyDivider"}),{className:i,children:n,component:a=null!=n?"div":"hr",inset:d,orientation:v="horizontal",role:u="hr"!==a?"separator":void 0}=t,m=(0,l.Z)(t,g),h=(0,s.Z)({},t,{inset:d,role:u,orientation:v,component:a}),x=f(h);return(0,o.jsx)(y,(0,s.Z)({ref:r,as:a,className:(0,c.Z)(x.root,i),ownerState:h,role:u},"separator"===u&&"vertical"===v&&{"aria-orientation":"vertical"},m,{children:n}))});x.muiName="Divider";var Z=t(90545),D=t(77614),b=t(53113),P=t(35086),S=t(53047),j=t(54842),B=t(67830),I=t(19700),w=t(92391),C=t(78915),z=t(56008);function k(){var e;let r=w.z.object({query:w.z.string().min(1)}),t=(0,z.useRouter)(),[l,s]=(0,n.useState)(!1),c=(0,I.cI)({resolver:(0,B.F)(r),defaultValues:{}}),{data:d}=(0,i.Z)(async()=>await (0,C.Kw)("/v1/chat/dialogue/scenes")),v=async e=>{let{query:r}=e;try{var o,i;s(!0),c.reset();let e=await (0,C.Kw)("/v1/chat/dialogue/new",{chat_mode:"chat_normal"});(null==e?void 0:e.success)&&(null==e?void 0:null===(o=e.data)||void 0===o?void 0:o.conv_uid)&&t.push("/chat?id=".concat(null==e?void 0:null===(i=e.data)||void 0===i?void 0:i.conv_uid,"&initMessage=").concat(r))}catch(e){}finally{s(!1)}};return(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)("div",{className:"mx-auto h-full justify-center flex max-w-3xl flex-col gap-8 px-5 pt-6 xl:max-w-4xl",children:[(0,o.jsxs)("div",{className:"max-w-xs my-0 mx-auto",children:[(0,o.jsx)(a.ZP,{level:"h3",className:"text-center",children:"DB-GPT"}),(0,o.jsx)(a.ZP,{level:"body1",className:"text-center pt-4",children:"Revolutionizing Database Interactions with Private LLM Technology"})]}),(0,o.jsx)("div",{className:"grid gap-8 lg:grid-cols-3",children:(0,o.jsxs)("div",{className:"lg:col-span-3",children:[(0,o.jsx)(x,{className:"text-[#878c93]",children:"Quick Start"}),(0,o.jsx)(Z.Z,{className:"grid pt-7 rounded-xl gap-2 lg:grid-cols-3 lg:gap-6",sx:{["& .".concat(D.Z.root)]:{color:"var(--joy-palette-primary-solidColor)",backgroundColor:"var(--joy-palette-primary-solidBg)",height:"52px","&: hover":{backgroundColor:"var(--joy-palette-primary-solidHoverBg)"}}},children:null==d?void 0:null===(e=d.data)||void 0===e?void 0:e.map(e=>(0,o.jsx)(b.Z,{size:"md",variant:"solid",className:"text-base rounded-none",onClick:async()=>{var r,o;let i=await (0,C.Kw)("/v1/chat/dialogue/new",{chat_mode:e.chat_scene});(null==i?void 0:i.success)&&(null==i?void 0:null===(r=i.data)||void 0===r?void 0:r.conv_uid)&&t.push("/chat?id=".concat(null==i?void 0:null===(o=i.data)||void 0===o?void 0:o.conv_uid,"&scene=").concat(e.chat_scene))},children:e.scene_name},e.chat_scene))})]})}),(0,o.jsx)("div",{className:"mt-6 mb-[10%] pointer-events-none inset-x-0 bottom-0 z-0 mx-auto flex w-full max-w-3xl flex-col items-center justify-center max-md:border-t xl:max-w-4xl [&>*]:pointer-events-auto",children:(0,o.jsx)("form",{style:{maxWidth:"100%",width:"100%",position:"relative",display:"flex",marginTop:"auto",overflow:"visible",background:"none",justifyContent:"center",marginLeft:"auto",marginRight:"auto",height:"52px"},onSubmit:e=>{c.handleSubmit(v)(e)},children:(0,o.jsx)(P.ZP,{sx:{width:"100%"},variant:"outlined",placeholder:"Ask anything",endDecorator:(0,o.jsx)(S.ZP,{type:"submit",disabled:l,children:(0,o.jsx)(j.Z,{})}),...c.register("query")})})})]})})}},78915:function(e,r,t){"use strict";t.d(r,{Tk:function(){return d},Kw:function(){return v},PR:function(){return u},Ej:function(){return p}});var o=t(21628),i=t(24214),n=t(52040);let a=i.Z.create({baseURL:n.env.API_BASE_URL});a.defaults.timeout=1e4,a.interceptors.response.use(e=>e.data,e=>Promise.reject(e));var l=t(84835);let s={"content-type":"application/json"},c=e=>{if(!(0,l.isPlainObject)(e))return JSON.stringify(e);let r={...e};for(let e in r){let t=r[e];"string"==typeof t&&(r[e]=t.trim())}return JSON.stringify(r)},d=(e,r)=>{if(r){let t=Object.keys(r).filter(e=>void 0!==r[e]&&""!==r[e]).map(e=>"".concat(e,"=").concat(r[e])).join("&");t&&(e+="?".concat(t))}return a.get("/api"+e,{headers:s}).then(e=>e).catch(e=>{o.ZP.error(e),Promise.reject(e)})},v=(e,r)=>{let t=c(r);return a.post("/api"+e,{body:t,headers:s}).then(e=>e).catch(e=>{o.ZP.error(e),Promise.reject(e)})},u=(e,r)=>(c(r),a.post(e,r,{headers:s}).then(e=>e).catch(e=>{o.ZP.error(e),Promise.reject(e)})),p=(e,r)=>a.post(e,r).then(e=>e).catch(e=>{o.ZP.error(e),Promise.reject(e)})},56008:function(e,r,t){e.exports=t(30794)}},function(e){e.O(0,[180,106,685,86,316,259,253,769,744],function(){return e(e.s=62499)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/main-app-91ea9f8e0d720f97.js b/pilot/server/static/_next/static/chunks/main-app-91ea9f8e0d720f97.js new file mode 100644 index 000000000..e55ce07a0 --- /dev/null +++ b/pilot/server/static/_next/static/chunks/main-app-91ea9f8e0d720f97.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[744],{51029:function(e,n,t){Promise.resolve().then(t.t.bind(t,68802,23)),Promise.resolve().then(t.t.bind(t,13211,23)),Promise.resolve().then(t.t.bind(t,5767,23)),Promise.resolve().then(t.t.bind(t,14299,23)),Promise.resolve().then(t.t.bind(t,37396,23))}},function(e){var n=function(n){return e(e.s=n)};e.O(0,[253,769],function(){return n(29070),n(51029)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/dgtRJhFzjUcu_jKPpUKQu/_buildManifest.js b/pilot/server/static/_next/static/dgtRJhFzjUcu_jKPpUKQu/_buildManifest.js new file mode 100644 index 000000000..cb10d35e8 --- /dev/null +++ b/pilot/server/static/_next/static/dgtRJhFzjUcu_jKPpUKQu/_buildManifest.js @@ -0,0 +1 @@ +self.__BUILD_MANIFEST={__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/_error":["static/chunks/pages/_error-f5357f382422dd96.js"],sortedPages:["/_app","/_error"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/pilot/server/static/_next/static/dgtRJhFzjUcu_jKPpUKQu/_ssgManifest.js b/pilot/server/static/_next/static/dgtRJhFzjUcu_jKPpUKQu/_ssgManifest.js new file mode 100644 index 000000000..5b3ff592f --- /dev/null +++ b/pilot/server/static/_next/static/dgtRJhFzjUcu_jKPpUKQu/_ssgManifest.js @@ -0,0 +1 @@ +self.__SSG_MANIFEST=new Set([]);self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB() \ No newline at end of file diff --git a/pilot/server/static/agents/index.html b/pilot/server/static/agents/index.html index cda49dc8e..91e94a7df 100644 --- a/pilot/server/static/agents/index.html +++ b/pilot/server/static/agents/index.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/pilot/server/static/agents/index.txt b/pilot/server/static/agents/index.txt index ecde25461..0440f4a62 100644 --- a/pilot/server/static/agents/index.txt +++ b/pilot/server/static/agents/index.txt @@ -1,9 +1,9 @@ 1:HL["/_next/static/css/500e50384396563b.css",{"as":"style"}] -0:["4ef3Zj0tsK1FEAj-0Rw_K",[[["",{"children":["agents",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L2",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/500e50384396563b.css","precedence":"next"}]],["$L3",null]]]]] -4:I{"id":"50902","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","106:static/chunks/106-a778485a4c5bcb5b.js","685:static/chunks/685-9a51e8e6726368d3.js","693:static/chunks/693-ed79550f78fd681b.js","316:static/chunks/316-cdd7af28971b8ca4.js","440:static/chunks/440-8431a38ed9f2e11b.js","672:static/chunks/672-860e1c1d53658862.js","751:static/chunks/751-9808572c67f2351c.js","216:static/chunks/216-7cd3d510ec0e1384.js","185:static/chunks/app/layout-f0f8e514282ceb6a.js"],"name":"","async":false} +0:["LsJAw9wmT3q63aQDzaYhO",[[["",{"children":["agents",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L2",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/500e50384396563b.css","precedence":"next"}]],["$L3",null]]]]] +4:I{"id":"50902","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","106:static/chunks/106-a778485a4c5bcb5b.js","685:static/chunks/685-9a51e8e6726368d3.js","693:static/chunks/693-ed79550f78fd681b.js","316:static/chunks/316-cdd7af28971b8ca4.js","440:static/chunks/440-8431a38ed9f2e11b.js","672:static/chunks/672-860e1c1d53658862.js","751:static/chunks/751-9808572c67f2351c.js","216:static/chunks/216-7cd3d510ec0e1384.js","185:static/chunks/app/layout-6452255d83d45c3e.js"],"name":"","async":false} 5:I{"id":"13211","chunks":["272:static/chunks/webpack-053a725dccea4b75.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-76f7aafd375fdd6b.js"],"name":"","async":false} 6:I{"id":"5767","chunks":["272:static/chunks/webpack-053a725dccea4b75.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-76f7aafd375fdd6b.js"],"name":"","async":false} 7:I{"id":"37396","chunks":["272:static/chunks/webpack-053a725dccea4b75.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-76f7aafd375fdd6b.js"],"name":"","async":false} -8:I{"id":"4191","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","757:static/chunks/f60284a2-6891068c9ea7ce77.js","106:static/chunks/106-a778485a4c5bcb5b.js","685:static/chunks/685-9a51e8e6726368d3.js","86:static/chunks/86-3a20bc6b78835c59.js","316:static/chunks/316-cdd7af28971b8ca4.js","259:static/chunks/259-2c3490a9eca2f411.js","751:static/chunks/751-9808572c67f2351c.js","662:static/chunks/662-6f651dffca342bc9.js","481:static/chunks/481-55e7d47dd2c74b66.js","718:static/chunks/app/agents/page-d0e9747fec52ce80.js"],"name":"","async":false} +8:I{"id":"4191","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","757:static/chunks/f60284a2-6891068c9ea7ce77.js","106:static/chunks/106-a778485a4c5bcb5b.js","685:static/chunks/685-9a51e8e6726368d3.js","86:static/chunks/86-3a20bc6b78835c59.js","316:static/chunks/316-cdd7af28971b8ca4.js","259:static/chunks/259-2c3490a9eca2f411.js","751:static/chunks/751-9808572c67f2351c.js","662:static/chunks/662-6f651dffca342bc9.js","481:static/chunks/481-55e7d47dd2c74b66.js","718:static/chunks/app/agents/page-4681b3d10d858b08.js"],"name":"","async":false} 2:[["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":[["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children","agents","children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":[["$","$L7",null,{"propsForComponent":{"params":{}},"Component":"$8"}],null],"segment":"__PAGE__"},"styles":[]}],null],"segment":"agents"},"styles":[]}],"params":{}}],null] 3:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","link","2",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"any"}]] diff --git a/pilot/server/static/chat/index.html b/pilot/server/static/chat/index.html index b55c1493e..638a0d0e7 100644 --- a/pilot/server/static/chat/index.html +++ b/pilot/server/static/chat/index.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/pilot/server/static/chat/index.txt b/pilot/server/static/chat/index.txt index 2056a9340..49325ddce 100644 --- a/pilot/server/static/chat/index.txt +++ b/pilot/server/static/chat/index.txt @@ -1,9 +1,9 @@ 1:HL["/_next/static/css/500e50384396563b.css",{"as":"style"}] -0:["4ef3Zj0tsK1FEAj-0Rw_K",[[["",{"children":["chat",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L2",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/500e50384396563b.css","precedence":"next"}]],["$L3",null]]]]] -4:I{"id":"50902","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","106:static/chunks/106-a778485a4c5bcb5b.js","685:static/chunks/685-9a51e8e6726368d3.js","693:static/chunks/693-ed79550f78fd681b.js","316:static/chunks/316-cdd7af28971b8ca4.js","440:static/chunks/440-8431a38ed9f2e11b.js","672:static/chunks/672-860e1c1d53658862.js","751:static/chunks/751-9808572c67f2351c.js","216:static/chunks/216-7cd3d510ec0e1384.js","185:static/chunks/app/layout-f0f8e514282ceb6a.js"],"name":"","async":false} +0:["LsJAw9wmT3q63aQDzaYhO",[[["",{"children":["chat",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L2",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/500e50384396563b.css","precedence":"next"}]],["$L3",null]]]]] +4:I{"id":"50902","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","106:static/chunks/106-a778485a4c5bcb5b.js","685:static/chunks/685-9a51e8e6726368d3.js","693:static/chunks/693-ed79550f78fd681b.js","316:static/chunks/316-cdd7af28971b8ca4.js","440:static/chunks/440-8431a38ed9f2e11b.js","672:static/chunks/672-860e1c1d53658862.js","751:static/chunks/751-9808572c67f2351c.js","216:static/chunks/216-7cd3d510ec0e1384.js","185:static/chunks/app/layout-6452255d83d45c3e.js"],"name":"","async":false} 5:I{"id":"13211","chunks":["272:static/chunks/webpack-053a725dccea4b75.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-76f7aafd375fdd6b.js"],"name":"","async":false} 6:I{"id":"5767","chunks":["272:static/chunks/webpack-053a725dccea4b75.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-76f7aafd375fdd6b.js"],"name":"","async":false} 7:I{"id":"37396","chunks":["272:static/chunks/webpack-053a725dccea4b75.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-76f7aafd375fdd6b.js"],"name":"","async":false} -8:I{"id":"59498","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","106:static/chunks/106-a778485a4c5bcb5b.js","685:static/chunks/685-9a51e8e6726368d3.js","86:static/chunks/86-3a20bc6b78835c59.js","316:static/chunks/316-cdd7af28971b8ca4.js","259:static/chunks/259-2c3490a9eca2f411.js","751:static/chunks/751-9808572c67f2351c.js","662:static/chunks/662-6f651dffca342bc9.js","929:static/chunks/app/chat/page-9b84c22e2aa86b93.js"],"name":"","async":false} +8:I{"id":"59498","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","106:static/chunks/106-a778485a4c5bcb5b.js","685:static/chunks/685-9a51e8e6726368d3.js","86:static/chunks/86-3a20bc6b78835c59.js","316:static/chunks/316-cdd7af28971b8ca4.js","259:static/chunks/259-2c3490a9eca2f411.js","751:static/chunks/751-9808572c67f2351c.js","662:static/chunks/662-6f651dffca342bc9.js","929:static/chunks/app/chat/page-dbd994bed3394f35.js"],"name":"","async":false} 2:[["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children","chat","children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":[["$","$L7",null,{"propsForComponent":{"params":{}},"Component":"$8"}],null],"segment":"__PAGE__"},"styles":[]}],"segment":"chat"},"styles":[]}],"params":{}}],null] 3:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","link","2",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"any"}]] diff --git a/pilot/server/static/datastores/documents/chunklist/index.html b/pilot/server/static/datastores/documents/chunklist/index.html index b7d83dae1..e059f94b3 100644 --- a/pilot/server/static/datastores/documents/chunklist/index.html +++ b/pilot/server/static/datastores/documents/chunklist/index.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/pilot/server/static/datastores/documents/chunklist/index.txt b/pilot/server/static/datastores/documents/chunklist/index.txt index 0a26e581e..dbaca4d8e 100644 --- a/pilot/server/static/datastores/documents/chunklist/index.txt +++ b/pilot/server/static/datastores/documents/chunklist/index.txt @@ -1,9 +1,9 @@ 1:HL["/_next/static/css/500e50384396563b.css",{"as":"style"}] -0:["4ef3Zj0tsK1FEAj-0Rw_K",[[["",{"children":["datastores",{"children":["documents",{"children":["chunklist",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],"$L2",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/500e50384396563b.css","precedence":"next"}]],["$L3",null]]]]] -4:I{"id":"50902","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","106:static/chunks/106-a778485a4c5bcb5b.js","685:static/chunks/685-9a51e8e6726368d3.js","693:static/chunks/693-ed79550f78fd681b.js","316:static/chunks/316-cdd7af28971b8ca4.js","440:static/chunks/440-8431a38ed9f2e11b.js","672:static/chunks/672-860e1c1d53658862.js","751:static/chunks/751-9808572c67f2351c.js","216:static/chunks/216-7cd3d510ec0e1384.js","185:static/chunks/app/layout-f0f8e514282ceb6a.js"],"name":"","async":false} +0:["LsJAw9wmT3q63aQDzaYhO",[[["",{"children":["datastores",{"children":["documents",{"children":["chunklist",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],"$L2",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/500e50384396563b.css","precedence":"next"}]],["$L3",null]]]]] +4:I{"id":"50902","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","106:static/chunks/106-a778485a4c5bcb5b.js","685:static/chunks/685-9a51e8e6726368d3.js","693:static/chunks/693-ed79550f78fd681b.js","316:static/chunks/316-cdd7af28971b8ca4.js","440:static/chunks/440-8431a38ed9f2e11b.js","672:static/chunks/672-860e1c1d53658862.js","751:static/chunks/751-9808572c67f2351c.js","216:static/chunks/216-7cd3d510ec0e1384.js","185:static/chunks/app/layout-6452255d83d45c3e.js"],"name":"","async":false} 5:I{"id":"13211","chunks":["272:static/chunks/webpack-053a725dccea4b75.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-76f7aafd375fdd6b.js"],"name":"","async":false} 6:I{"id":"5767","chunks":["272:static/chunks/webpack-053a725dccea4b75.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-76f7aafd375fdd6b.js"],"name":"","async":false} 7:I{"id":"37396","chunks":["272:static/chunks/webpack-053a725dccea4b75.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-76f7aafd375fdd6b.js"],"name":"","async":false} -8:I{"id":"26257","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","106:static/chunks/106-a778485a4c5bcb5b.js","693:static/chunks/693-ed79550f78fd681b.js","118:static/chunks/118-46b95fe35f46f1b9.js","440:static/chunks/440-8431a38ed9f2e11b.js","55:static/chunks/55-41778c7520ea1334.js","538:static/chunks/app/datastores/documents/chunklist/page-eff0493e5a094c84.js"],"name":"","async":false} +8:I{"id":"26257","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","106:static/chunks/106-a778485a4c5bcb5b.js","693:static/chunks/693-ed79550f78fd681b.js","118:static/chunks/118-46b95fe35f46f1b9.js","440:static/chunks/440-8431a38ed9f2e11b.js","55:static/chunks/55-41778c7520ea1334.js","538:static/chunks/app/datastores/documents/chunklist/page-24d5ddd85fb15398.js"],"name":"","async":false} 2:[["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children","datastores","children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children","datastores","children","documents","children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children","datastores","children","documents","children","chunklist","children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":[["$","$L7",null,{"propsForComponent":{"params":{}},"Component":"$8"}],null],"segment":"__PAGE__"},"styles":[]}],"segment":"chunklist"},"styles":[]}],"segment":"documents"},"styles":[]}],"segment":"datastores"},"styles":[]}],"params":{}}],null] 3:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","link","2",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"any"}]] diff --git a/pilot/server/static/datastores/documents/index.html b/pilot/server/static/datastores/documents/index.html index e7f0c1b93..4f4bdb000 100644 --- a/pilot/server/static/datastores/documents/index.html +++ b/pilot/server/static/datastores/documents/index.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/pilot/server/static/datastores/documents/index.txt b/pilot/server/static/datastores/documents/index.txt index 5ac783c6f..f4109beab 100644 --- a/pilot/server/static/datastores/documents/index.txt +++ b/pilot/server/static/datastores/documents/index.txt @@ -1,9 +1,9 @@ 1:HL["/_next/static/css/500e50384396563b.css",{"as":"style"}] -0:["4ef3Zj0tsK1FEAj-0Rw_K",[[["",{"children":["datastores",{"children":["documents",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],"$L2",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/500e50384396563b.css","precedence":"next"}]],["$L3",null]]]]] -4:I{"id":"50902","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","106:static/chunks/106-a778485a4c5bcb5b.js","685:static/chunks/685-9a51e8e6726368d3.js","693:static/chunks/693-ed79550f78fd681b.js","316:static/chunks/316-cdd7af28971b8ca4.js","440:static/chunks/440-8431a38ed9f2e11b.js","672:static/chunks/672-860e1c1d53658862.js","751:static/chunks/751-9808572c67f2351c.js","216:static/chunks/216-7cd3d510ec0e1384.js","185:static/chunks/app/layout-f0f8e514282ceb6a.js"],"name":"","async":false} +0:["LsJAw9wmT3q63aQDzaYhO",[[["",{"children":["datastores",{"children":["documents",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],"$L2",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/500e50384396563b.css","precedence":"next"}]],["$L3",null]]]]] +4:I{"id":"50902","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","106:static/chunks/106-a778485a4c5bcb5b.js","685:static/chunks/685-9a51e8e6726368d3.js","693:static/chunks/693-ed79550f78fd681b.js","316:static/chunks/316-cdd7af28971b8ca4.js","440:static/chunks/440-8431a38ed9f2e11b.js","672:static/chunks/672-860e1c1d53658862.js","751:static/chunks/751-9808572c67f2351c.js","216:static/chunks/216-7cd3d510ec0e1384.js","185:static/chunks/app/layout-6452255d83d45c3e.js"],"name":"","async":false} 5:I{"id":"13211","chunks":["272:static/chunks/webpack-053a725dccea4b75.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-76f7aafd375fdd6b.js"],"name":"","async":false} 6:I{"id":"5767","chunks":["272:static/chunks/webpack-053a725dccea4b75.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-76f7aafd375fdd6b.js"],"name":"","async":false} 7:I{"id":"37396","chunks":["272:static/chunks/webpack-053a725dccea4b75.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-76f7aafd375fdd6b.js"],"name":"","async":false} -8:I{"id":"16692","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","550:static/chunks/925f3d25-1af7259455ef26bd.js","106:static/chunks/106-a778485a4c5bcb5b.js","685:static/chunks/685-9a51e8e6726368d3.js","86:static/chunks/86-3a20bc6b78835c59.js","693:static/chunks/693-ed79550f78fd681b.js","118:static/chunks/118-46b95fe35f46f1b9.js","440:static/chunks/440-8431a38ed9f2e11b.js","672:static/chunks/672-860e1c1d53658862.js","55:static/chunks/55-41778c7520ea1334.js","642:static/chunks/642-df31c252aa27b391.js","470:static/chunks/app/datastores/documents/page-aade80c3f0e3294d.js"],"name":"","async":false} +8:I{"id":"16692","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","550:static/chunks/925f3d25-1af7259455ef26bd.js","106:static/chunks/106-a778485a4c5bcb5b.js","685:static/chunks/685-9a51e8e6726368d3.js","86:static/chunks/86-3a20bc6b78835c59.js","693:static/chunks/693-ed79550f78fd681b.js","118:static/chunks/118-46b95fe35f46f1b9.js","440:static/chunks/440-8431a38ed9f2e11b.js","672:static/chunks/672-860e1c1d53658862.js","55:static/chunks/55-41778c7520ea1334.js","642:static/chunks/642-df31c252aa27b391.js","470:static/chunks/app/datastores/documents/page-8115d00a8bdfbea1.js"],"name":"","async":false} 2:[["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children","datastores","children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children","datastores","children","documents","children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":[["$","$L7",null,{"propsForComponent":{"params":{}},"Component":"$8"}],null],"segment":"__PAGE__"},"styles":[]}],"segment":"documents"},"styles":[]}],"segment":"datastores"},"styles":[]}],"params":{}}],null] 3:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","link","2",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"any"}]] diff --git a/pilot/server/static/datastores/index.html b/pilot/server/static/datastores/index.html index e583a8273..78be6f7d9 100644 --- a/pilot/server/static/datastores/index.html +++ b/pilot/server/static/datastores/index.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/pilot/server/static/datastores/index.txt b/pilot/server/static/datastores/index.txt index c9f294b8a..020e67a5a 100644 --- a/pilot/server/static/datastores/index.txt +++ b/pilot/server/static/datastores/index.txt @@ -1,9 +1,9 @@ 1:HL["/_next/static/css/500e50384396563b.css",{"as":"style"}] -0:["4ef3Zj0tsK1FEAj-0Rw_K",[[["",{"children":["datastores",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L2",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/500e50384396563b.css","precedence":"next"}]],["$L3",null]]]]] -4:I{"id":"50902","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","106:static/chunks/106-a778485a4c5bcb5b.js","685:static/chunks/685-9a51e8e6726368d3.js","693:static/chunks/693-ed79550f78fd681b.js","316:static/chunks/316-cdd7af28971b8ca4.js","440:static/chunks/440-8431a38ed9f2e11b.js","672:static/chunks/672-860e1c1d53658862.js","751:static/chunks/751-9808572c67f2351c.js","216:static/chunks/216-7cd3d510ec0e1384.js","185:static/chunks/app/layout-f0f8e514282ceb6a.js"],"name":"","async":false} +0:["LsJAw9wmT3q63aQDzaYhO",[[["",{"children":["datastores",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L2",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/500e50384396563b.css","precedence":"next"}]],["$L3",null]]]]] +4:I{"id":"50902","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","106:static/chunks/106-a778485a4c5bcb5b.js","685:static/chunks/685-9a51e8e6726368d3.js","693:static/chunks/693-ed79550f78fd681b.js","316:static/chunks/316-cdd7af28971b8ca4.js","440:static/chunks/440-8431a38ed9f2e11b.js","672:static/chunks/672-860e1c1d53658862.js","751:static/chunks/751-9808572c67f2351c.js","216:static/chunks/216-7cd3d510ec0e1384.js","185:static/chunks/app/layout-6452255d83d45c3e.js"],"name":"","async":false} 5:I{"id":"13211","chunks":["272:static/chunks/webpack-053a725dccea4b75.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-76f7aafd375fdd6b.js"],"name":"","async":false} 6:I{"id":"5767","chunks":["272:static/chunks/webpack-053a725dccea4b75.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-76f7aafd375fdd6b.js"],"name":"","async":false} 7:I{"id":"37396","chunks":["272:static/chunks/webpack-053a725dccea4b75.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-76f7aafd375fdd6b.js"],"name":"","async":false} -8:I{"id":"44323","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","106:static/chunks/106-a778485a4c5bcb5b.js","685:static/chunks/685-9a51e8e6726368d3.js","86:static/chunks/86-3a20bc6b78835c59.js","693:static/chunks/693-ed79550f78fd681b.js","118:static/chunks/118-46b95fe35f46f1b9.js","672:static/chunks/672-860e1c1d53658862.js","642:static/chunks/642-df31c252aa27b391.js","43:static/chunks/app/datastores/page-b20f7e6815096335.js"],"name":"","async":false} +8:I{"id":"44323","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","106:static/chunks/106-a778485a4c5bcb5b.js","685:static/chunks/685-9a51e8e6726368d3.js","86:static/chunks/86-3a20bc6b78835c59.js","693:static/chunks/693-ed79550f78fd681b.js","118:static/chunks/118-46b95fe35f46f1b9.js","672:static/chunks/672-860e1c1d53658862.js","642:static/chunks/642-df31c252aa27b391.js","43:static/chunks/app/datastores/page-0ad92a94a235eabf.js"],"name":"","async":false} 2:[["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children","datastores","children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":[["$","$L7",null,{"propsForComponent":{"params":{}},"Component":"$8"}],null],"segment":"__PAGE__"},"styles":[]}],"segment":"datastores"},"styles":[]}],"params":{}}],null] 3:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","link","2",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"any"}]] diff --git a/pilot/server/static/index.html b/pilot/server/static/index.html index a012d9dcc..91f5ca263 100644 --- a/pilot/server/static/index.html +++ b/pilot/server/static/index.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/pilot/server/static/index.txt b/pilot/server/static/index.txt index 32d935d92..9d701b306 100644 --- a/pilot/server/static/index.txt +++ b/pilot/server/static/index.txt @@ -1,9 +1,9 @@ 1:HL["/_next/static/css/500e50384396563b.css",{"as":"style"}] -0:["4ef3Zj0tsK1FEAj-0Rw_K",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],"$L2",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/500e50384396563b.css","precedence":"next"}]],["$L3",null]]]]] -4:I{"id":"50902","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","106:static/chunks/106-a778485a4c5bcb5b.js","685:static/chunks/685-9a51e8e6726368d3.js","693:static/chunks/693-ed79550f78fd681b.js","316:static/chunks/316-cdd7af28971b8ca4.js","440:static/chunks/440-8431a38ed9f2e11b.js","672:static/chunks/672-860e1c1d53658862.js","751:static/chunks/751-9808572c67f2351c.js","216:static/chunks/216-7cd3d510ec0e1384.js","185:static/chunks/app/layout-f0f8e514282ceb6a.js"],"name":"","async":false} +0:["LsJAw9wmT3q63aQDzaYhO",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],"$L2",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/500e50384396563b.css","precedence":"next"}]],["$L3",null]]]]] +4:I{"id":"50902","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","106:static/chunks/106-a778485a4c5bcb5b.js","685:static/chunks/685-9a51e8e6726368d3.js","693:static/chunks/693-ed79550f78fd681b.js","316:static/chunks/316-cdd7af28971b8ca4.js","440:static/chunks/440-8431a38ed9f2e11b.js","672:static/chunks/672-860e1c1d53658862.js","751:static/chunks/751-9808572c67f2351c.js","216:static/chunks/216-7cd3d510ec0e1384.js","185:static/chunks/app/layout-6452255d83d45c3e.js"],"name":"","async":false} 5:I{"id":"13211","chunks":["272:static/chunks/webpack-053a725dccea4b75.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-76f7aafd375fdd6b.js"],"name":"","async":false} 6:I{"id":"5767","chunks":["272:static/chunks/webpack-053a725dccea4b75.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-76f7aafd375fdd6b.js"],"name":"","async":false} 7:I{"id":"37396","chunks":["272:static/chunks/webpack-053a725dccea4b75.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-76f7aafd375fdd6b.js"],"name":"","async":false} -8:I{"id":"26925","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","106:static/chunks/106-a778485a4c5bcb5b.js","685:static/chunks/685-9a51e8e6726368d3.js","86:static/chunks/86-3a20bc6b78835c59.js","316:static/chunks/316-cdd7af28971b8ca4.js","259:static/chunks/259-2c3490a9eca2f411.js","931:static/chunks/app/page-82f81a52b1831f3f.js"],"name":"","async":false} +8:I{"id":"26925","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","106:static/chunks/106-a778485a4c5bcb5b.js","685:static/chunks/685-9a51e8e6726368d3.js","86:static/chunks/86-3a20bc6b78835c59.js","316:static/chunks/316-cdd7af28971b8ca4.js","259:static/chunks/259-2c3490a9eca2f411.js","931:static/chunks/app/page-f82d4b8e68b1c0b2.js"],"name":"","async":false} 2:[["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":[["$","$L7",null,{"propsForComponent":{"params":{}},"Component":"$8"}],null],"segment":"__PAGE__"},"styles":[]}],"params":{}}],null] 3:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","link","2",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"any"}]]