Refactor code and update environment type definitions.
- Consolidate type definitions in vite-env.d.ts - Update TypeScript include paths
This commit is contained in:
@@ -236,23 +236,23 @@ ${(t=e.config)==null?void 0:t.url}`):e});const sq=async(e,t,n)=>(await Mr.get(`/
|
||||
margin-right: `).concat(u,"px ").concat(r,`;
|
||||
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
||||
}
|
||||
|
||||
|
||||
.`).concat(hd,` {
|
||||
right: `).concat(u,"px ").concat(r,`;
|
||||
}
|
||||
|
||||
|
||||
.`).concat(md,` {
|
||||
margin-right: `).concat(u,"px ").concat(r,`;
|
||||
}
|
||||
|
||||
|
||||
.`).concat(hd," .").concat(hd,` {
|
||||
right: 0 `).concat(r,`;
|
||||
}
|
||||
|
||||
|
||||
.`).concat(md," .").concat(md,` {
|
||||
margin-right: 0 `).concat(r,`;
|
||||
}
|
||||
|
||||
|
||||
body[`).concat(cl,`] {
|
||||
`).concat(X8,": ").concat(u,`px;
|
||||
}
|
||||
@@ -702,7 +702,7 @@ void main() {
|
||||
vec2 sourceCompensationVector =
|
||||
vec2(-sourceDirection * unitNormal.y, sourceDirection * unitNormal.x)
|
||||
* (webGLSourceRadius + webGLSourceArrowHeadLength);
|
||||
|
||||
|
||||
// Target arrow head
|
||||
float targetRadius = a_targetRadius * a_targetRadiusCoef;
|
||||
float targetDirection = sign(targetRadius);
|
||||
@@ -1009,7 +1009,7 @@ void main() {
|
||||
|
||||
position = viewportToClipspace(viewportOffsetPosition, u_dimensions);
|
||||
gl_Position = vec4(position, 0, 1);
|
||||
|
||||
|
||||
`).concat(n?`
|
||||
v_targetSize = a_targetSize * u_pixelRatio / u_sizeRatio;
|
||||
v_targetPoint = viewportTarget;
|
||||
|
@@ -523,19 +523,19 @@ class LightRAG:
|
||||
"""
|
||||
# get params supported by get_knowledge_graph of specified storage
|
||||
import inspect
|
||||
storage_params = inspect.signature(self.chunk_entity_relation_graph.get_knowledge_graph).parameters
|
||||
|
||||
kwargs = {
|
||||
'node_label': node_label,
|
||||
'max_depth': max_depth
|
||||
}
|
||||
|
||||
if 'min_degree' in storage_params and min_degree > 0:
|
||||
kwargs['min_degree'] = min_degree
|
||||
|
||||
if 'inclusive' in storage_params:
|
||||
kwargs['inclusive'] = inclusive
|
||||
|
||||
|
||||
storage_params = inspect.signature(
|
||||
self.chunk_entity_relation_graph.get_knowledge_graph
|
||||
).parameters
|
||||
|
||||
kwargs = {"node_label": node_label, "max_depth": max_depth}
|
||||
|
||||
if "min_degree" in storage_params and min_degree > 0:
|
||||
kwargs["min_degree"] = min_degree
|
||||
|
||||
if "inclusive" in storage_params:
|
||||
kwargs["inclusive"] = inclusive
|
||||
|
||||
return await self.chunk_entity_relation_graph.get_knowledge_graph(**kwargs)
|
||||
|
||||
def _get_storage_class(self, storage_name: str) -> Callable[..., Any]:
|
||||
|
7
lightrag_webui/src/env.d.ts
vendored
7
lightrag_webui/src/env.d.ts
vendored
@@ -1,7 +0,0 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_API_PROXY: string
|
||||
readonly VITE_API_ENDPOINTS: string
|
||||
readonly VITE_BACKEND_URL: string
|
||||
}
|
10
lightrag_webui/src/vite-env.d.ts
vendored
10
lightrag_webui/src/vite-env.d.ts
vendored
@@ -1 +1,11 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_API_PROXY: string
|
||||
readonly VITE_API_ENDPOINTS: string
|
||||
readonly VITE_BACKEND_URL: string
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv
|
||||
}
|
||||
|
@@ -26,5 +26,5 @@
|
||||
"@/*": ["./src/*"]
|
||||
}
|
||||
},
|
||||
"include": ["src"]
|
||||
"include": ["src", "vite.config.ts"]
|
||||
}
|
||||
|
@@ -18,14 +18,14 @@ export default defineConfig({
|
||||
emptyOutDir: true
|
||||
},
|
||||
server: {
|
||||
proxy: import.meta.env.VITE_API_PROXY === 'true' && import.meta.env.VITE_API_ENDPOINTS ?
|
||||
proxy: import.meta.env.VITE_API_PROXY === 'true' && import.meta.env.VITE_API_ENDPOINTS ?
|
||||
Object.fromEntries(
|
||||
import.meta.env.VITE_API_ENDPOINTS.split(',').map(endpoint => [
|
||||
endpoint,
|
||||
{
|
||||
target: import.meta.env.VITE_BACKEND_URL || 'http://localhost:9621',
|
||||
changeOrigin: true,
|
||||
rewrite: endpoint === '/api' ?
|
||||
rewrite: endpoint === '/api' ?
|
||||
(path) => path.replace(/^\/api/, '') : undefined
|
||||
}
|
||||
])
|
||||
|
Reference in New Issue
Block a user