From f77e01e28864748de2e9469dc4d4f573a6a515f9 Mon Sep 17 00:00:00 2001 From: yangdx Date: Tue, 22 Apr 2025 21:26:11 +0800 Subject: [PATCH] Update webui assets --- ...re-retrieval-CM1cm2DW.js => feature-retrieval-DDX5drAN.js} | 2 +- .../api/webui/assets/{index-CMvAQg9O.js => index-Cl5M_-Dt.js} | 2 +- lightrag/api/webui/index.html | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename lightrag/api/webui/assets/{feature-retrieval-CM1cm2DW.js => feature-retrieval-DDX5drAN.js} (99%) rename lightrag/api/webui/assets/{index-CMvAQg9O.js => index-Cl5M_-Dt.js} (99%) diff --git a/lightrag/api/webui/assets/feature-retrieval-CM1cm2DW.js b/lightrag/api/webui/assets/feature-retrieval-DDX5drAN.js similarity index 99% rename from lightrag/api/webui/assets/feature-retrieval-CM1cm2DW.js rename to lightrag/api/webui/assets/feature-retrieval-DDX5drAN.js index 453382da..2a3c86ff 100644 --- a/lightrag/api/webui/assets/feature-retrieval-CM1cm2DW.js +++ b/lightrag/api/webui/assets/feature-retrieval-DDX5drAN.js @@ -12,6 +12,6 @@ import{j as r,E as vr,I as Ir,F as xr,G as zr,H as Ur,J as Ar,V as Kr,L as Mr,K `),s=`mermaid-${Date.now()}`;So.render(s,w).then(({svg:g,bindFunctions:p})=>{if(S.current===b){if(b.innerHTML=g,p)try{p(b)}catch(f){console.error("Mermaid bindFunctions error:",f),b.innerHTML+='

Diagram interactions might be limited.

'}}else console.log("Mermaid container changed before rendering completed.")}).catch(g=>{if(console.error("Mermaid rendering promise error (debounced):",g),console.error("Failed content (debounced):",w),S.current===b){const p=g instanceof Error?g.message:String(g),f=document.createElement("pre");f.className="text-red-500 text-xs whitespace-pre-wrap break-words",f.textContent=`Mermaid diagram error: ${p} Content: -${w}`,b.innerHTML="",b.appendChild(f)}})}catch(u){if(console.error("Mermaid synchronous error (debounced):",u),console.error("Failed content (debounced):",String(o)),S.current===b){const v=u instanceof Error?u.message:String(u),w=document.createElement("pre");w.className="text-red-500 text-xs whitespace-pre-wrap break-words",w.textContent=`Mermaid diagram setup error: ${v}`,b.innerHTML="",b.appendChild(w)}}},300)}return()=>{z.current&&clearTimeout(z.current)}},[c,o,t]),c==="mermaid"?r.jsx("div",{className:"mermaid-diagram-container my-4 overflow-x-auto",ref:S}):h?r.jsx("code",{className:J(e,"mx-1 rounded-sm bg-muted px-1 py-0.5 font-mono text-sm"),...a,children:o}):r.jsx(kn,{style:t==="dark"?Sr.oneDark:Sr.oneLight,PreTag:"div",language:c,...a,children:String(o).replace(/\n$/,"")})};function Ka(){const{t:e}=ko(),[o,n]=x.useState(()=>ie.getState().retrievalHistory||[]),[a,t]=x.useState(""),[l,c]=x.useState(!1),h=x.useRef(null),S=x.useRef(null),z=x.useCallback(()=>{const s=S.current;if(!s)return!0;const{scrollTop:g,scrollHeight:p,clientHeight:f}=s;return p-g-f<100},[]),b=x.useCallback((s=!1)=>{var g;(s||z())&&((g=h.current)==null||g.scrollIntoView({behavior:"smooth"}))},[z]),u=x.useCallback(async s=>{if(s.preventDefault(),!a.trim()||l)return;const g={content:a,role:"user"},p={content:"",role:"assistant"},f=[...o];n([...f,g,p]),t(""),c(!0);const T=(k,q)=>{p.content+=k,n(L=>{const C=[...L],N=C[C.length-1];return N.role==="assistant"&&(N.content=p.content,N.isError=q),C}),b(!1)},W=ie.getState(),P={...W.querySettings,query:g.content,conversation_history:f.filter(k=>k.isError!==!0).slice(-(W.querySettings.history_turns||0)*2).map(k=>({role:k.role,content:k.content}))};try{if(W.querySettings.stream){let k="";await cn(P,T,q=>{k+=q}),k&&(p.content&&(k=p.content+` +${w}`,b.innerHTML="",b.appendChild(f)}})}catch(u){if(console.error("Mermaid synchronous error (debounced):",u),console.error("Failed content (debounced):",String(o)),S.current===b){const v=u instanceof Error?u.message:String(u),w=document.createElement("pre");w.className="text-red-500 text-xs whitespace-pre-wrap break-words",w.textContent=`Mermaid diagram setup error: ${v}`,b.innerHTML="",b.appendChild(w)}}},300)}return()=>{z.current&&clearTimeout(z.current)}},[c,o,t]),c==="mermaid"?r.jsx("div",{className:"mermaid-diagram-container my-4 overflow-x-auto",ref:S}):h?r.jsx("code",{className:J(e,"mx-1 rounded-sm bg-muted px-1 py-0.5 font-mono text-sm"),...a,children:o}):r.jsx(kn,{style:t==="dark"?Sr.oneDark:Sr.oneLight,PreTag:"div",language:c,...a,children:String(o).replace(/\n$/,"")})};function Ka(){const{t:e}=ko(),[o,n]=x.useState(()=>ie.getState().retrievalHistory||[]),[a,t]=x.useState(""),[l,c]=x.useState(!1),h=x.useRef(null),S=x.useRef(null),z=x.useCallback(()=>{const s=S.current;if(!s)return!0;const{scrollTop:g,scrollHeight:p,clientHeight:f}=s;return p-g-f<100},[]),b=x.useCallback((s=!1)=>{var g;(s||z())&&((g=h.current)==null||g.scrollIntoView({behavior:"smooth"}))},[z]),u=x.useCallback(async s=>{if(s.preventDefault(),!a.trim()||l)return;const g={content:a,role:"user"},p={content:"",role:"assistant"},f=[...o];n([...f,g,p]),setTimeout(()=>{b(!0)},0),t(""),c(!0);const T=(k,q)=>{p.content+=k,n(L=>{const C=[...L],N=C[C.length-1];return N.role==="assistant"&&(N.content=p.content,N.isError=q),C}),b(!1)},W=ie.getState(),P={...W.querySettings,query:g.content,conversation_history:f.filter(k=>k.isError!==!0).slice(-(W.querySettings.history_turns||0)*2).map(k=>({role:k.role,content:k.content}))};try{if(W.querySettings.stream){let k="";await cn(P,T,q=>{k+=q}),k&&(p.content&&(k=p.content+` `+k),T(k,!0))}else{const k=await sn(P);T(k.response)}}catch(k){T(`${e("retrievePanel.retrieval.error")} ${dn(k)}`,!0)}finally{c(!1),ie.getState().setRetrievalHistory([...f,g,p])}},[a,l,o,n,e,b]),v=un(o,100);x.useEffect(()=>b(!1),[v,b]);const w=x.useCallback(()=>{n([]),ie.getState().setRetrievalHistory([])},[n]);return r.jsxs("div",{className:"flex size-full gap-2 px-2 pb-12 overflow-hidden",children:[r.jsxs("div",{className:"flex grow flex-col gap-4",children:[r.jsx("div",{className:"relative grow",children:r.jsx("div",{ref:S,className:"bg-primary-foreground/60 absolute inset-0 flex flex-col overflow-auto rounded-lg border p-2",children:r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2",children:[o.length===0?r.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center text-lg",children:e("retrievePanel.retrieval.startPrompt")}):o.map((s,g)=>r.jsx("div",{className:`flex ${s.role==="user"?"justify-end":"justify-start"}`,children:r.jsx(Na,{message:s})},g)),r.jsx("div",{ref:h,className:"pb-1"})]})})}),r.jsxs("form",{onSubmit:u,className:"flex shrink-0 items-center gap-2",children:[r.jsxs(fe,{type:"button",variant:"outline",onClick:w,disabled:l,size:"sm",children:[r.jsx(gn,{}),e("retrievePanel.retrieval.clear")]}),r.jsxs("div",{className:"flex-1 relative",children:[r.jsx("label",{htmlFor:"query-input",className:"sr-only",children:e("retrievePanel.retrieval.placeholder")}),r.jsx(he,{id:"query-input",className:"w-full",value:a,onChange:s=>t(s.target.value),placeholder:e("retrievePanel.retrieval.placeholder"),disabled:l})]}),r.jsxs(fe,{type:"submit",variant:"default",disabled:l,size:"sm",children:[r.jsx(fn,{}),e("retrievePanel.retrieval.send")]})]})]}),r.jsx(Un,{})]})}export{Ka as R,vo as S,po as a,zo as b,ho as c,Q as d}; diff --git a/lightrag/api/webui/assets/index-CMvAQg9O.js b/lightrag/api/webui/assets/index-Cl5M_-Dt.js similarity index 99% rename from lightrag/api/webui/assets/index-CMvAQg9O.js rename to lightrag/api/webui/assets/index-Cl5M_-Dt.js index 73f9e1d7..ad55b4dd 100644 --- a/lightrag/api/webui/assets/index-CMvAQg9O.js +++ b/lightrag/api/webui/assets/index-Cl5M_-Dt.js @@ -1,4 +1,4 @@ -import{j as o,Y as td,O as rg,k as dg,u as ad,Z as mg,c as hg,l as gg,g as pg,S as yg,T as vg,n as bg,m as nd,o as Sg,p as Tg,$ as ud,a0 as id,a1 as cd,a2 as xg}from"./ui-vendor-CeCm8EER.js";import{d as Ag,h as Dg,r as E,u as sd,H as Ng,i as Eg,j as kr}from"./react-vendor-DEwriMA6.js";import{w as ll,c as we,a1 as od,u as Bl,v as qt,a2 as fd,a3 as rd,I as us,B as Cn,D as zg,i as Mg,j as Cg,k as Og,l as jg,a4 as Rg,a5 as Ug,a6 as _g,a7 as Hg,a8 as Ll,a9 as dd,aa as ss,ab as is,ac as Lg,ad as Bg,ae as qg,af as Gg,ag as Yg,ah as wg,ai as md,aj as Xg,ak as Vg,al as hd,am as Qg,an as gd,C as Kg,z as Zg,G as kg,d as En,ao as Jg,ap as Fg,aq as $g}from"./feature-graph-CZjdqJyF.js";import{S as Jr,a as Fr,b as $r,c as Wr,d as ot,R as Wg}from"./feature-retrieval-CM1cm2DW.js";import{D as Pg}from"./feature-documents-DuQJNKmF.js";import{i as cs}from"./utils-vendor-BysuhMZA.js";import"./graph-vendor-B-X5JegA.js";import"./mermaid-vendor-b0c9-Qp8.js";import"./markdown-vendor-BBaHfVvE.js";(function(){const b=document.createElement("link").relList;if(b&&b.supports&&b.supports("modulepreload"))return;for(const N of document.querySelectorAll('link[rel="modulepreload"]'))d(N);new MutationObserver(N=>{for(const j of N)if(j.type==="childList")for(const H of j.addedNodes)H.tagName==="LINK"&&H.rel==="modulepreload"&&d(H)}).observe(document,{childList:!0,subtree:!0});function x(N){const j={};return N.integrity&&(j.integrity=N.integrity),N.referrerPolicy&&(j.referrerPolicy=N.referrerPolicy),N.crossOrigin==="use-credentials"?j.credentials="include":N.crossOrigin==="anonymous"?j.credentials="omit":j.credentials="same-origin",j}function d(N){if(N.ep)return;N.ep=!0;const j=x(N);fetch(N.href,j)}})();var ts={exports:{}},zn={},as={exports:{}},ns={};/** +import{j as o,Y as td,O as rg,k as dg,u as ad,Z as mg,c as hg,l as gg,g as pg,S as yg,T as vg,n as bg,m as nd,o as Sg,p as Tg,$ as ud,a0 as id,a1 as cd,a2 as xg}from"./ui-vendor-CeCm8EER.js";import{d as Ag,h as Dg,r as E,u as sd,H as Ng,i as Eg,j as kr}from"./react-vendor-DEwriMA6.js";import{w as ll,c as we,a1 as od,u as Bl,v as qt,a2 as fd,a3 as rd,I as us,B as Cn,D as zg,i as Mg,j as Cg,k as Og,l as jg,a4 as Rg,a5 as Ug,a6 as _g,a7 as Hg,a8 as Ll,a9 as dd,aa as ss,ab as is,ac as Lg,ad as Bg,ae as qg,af as Gg,ag as Yg,ah as wg,ai as md,aj as Xg,ak as Vg,al as hd,am as Qg,an as gd,C as Kg,z as Zg,G as kg,d as En,ao as Jg,ap as Fg,aq as $g}from"./feature-graph-CZjdqJyF.js";import{S as Jr,a as Fr,b as $r,c as Wr,d as ot,R as Wg}from"./feature-retrieval-DDX5drAN.js";import{D as Pg}from"./feature-documents-DuQJNKmF.js";import{i as cs}from"./utils-vendor-BysuhMZA.js";import"./graph-vendor-B-X5JegA.js";import"./mermaid-vendor-b0c9-Qp8.js";import"./markdown-vendor-BBaHfVvE.js";(function(){const b=document.createElement("link").relList;if(b&&b.supports&&b.supports("modulepreload"))return;for(const N of document.querySelectorAll('link[rel="modulepreload"]'))d(N);new MutationObserver(N=>{for(const j of N)if(j.type==="childList")for(const H of j.addedNodes)H.tagName==="LINK"&&H.rel==="modulepreload"&&d(H)}).observe(document,{childList:!0,subtree:!0});function x(N){const j={};return N.integrity&&(j.integrity=N.integrity),N.referrerPolicy&&(j.referrerPolicy=N.referrerPolicy),N.crossOrigin==="use-credentials"?j.credentials="include":N.crossOrigin==="anonymous"?j.credentials="omit":j.credentials="same-origin",j}function d(N){if(N.ep)return;N.ep=!0;const j=x(N);fetch(N.href,j)}})();var ts={exports:{}},zn={},as={exports:{}},ns={};/** * @license React * scheduler.production.js * diff --git a/lightrag/api/webui/index.html b/lightrag/api/webui/index.html index eabebaaa..5859acd5 100644 --- a/lightrag/api/webui/index.html +++ b/lightrag/api/webui/index.html @@ -8,7 +8,7 @@ Lightrag - + @@ -16,7 +16,7 @@ - +