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,`;
|
margin-right: `).concat(u,"px ").concat(r,`;
|
||||||
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
||||||
}
|
}
|
||||||
|
|
||||||
.`).concat(hd,` {
|
.`).concat(hd,` {
|
||||||
right: `).concat(u,"px ").concat(r,`;
|
right: `).concat(u,"px ").concat(r,`;
|
||||||
}
|
}
|
||||||
|
|
||||||
.`).concat(md,` {
|
.`).concat(md,` {
|
||||||
margin-right: `).concat(u,"px ").concat(r,`;
|
margin-right: `).concat(u,"px ").concat(r,`;
|
||||||
}
|
}
|
||||||
|
|
||||||
.`).concat(hd," .").concat(hd,` {
|
.`).concat(hd," .").concat(hd,` {
|
||||||
right: 0 `).concat(r,`;
|
right: 0 `).concat(r,`;
|
||||||
}
|
}
|
||||||
|
|
||||||
.`).concat(md," .").concat(md,` {
|
.`).concat(md," .").concat(md,` {
|
||||||
margin-right: 0 `).concat(r,`;
|
margin-right: 0 `).concat(r,`;
|
||||||
}
|
}
|
||||||
|
|
||||||
body[`).concat(cl,`] {
|
body[`).concat(cl,`] {
|
||||||
`).concat(X8,": ").concat(u,`px;
|
`).concat(X8,": ").concat(u,`px;
|
||||||
}
|
}
|
||||||
@@ -702,7 +702,7 @@ void main() {
|
|||||||
vec2 sourceCompensationVector =
|
vec2 sourceCompensationVector =
|
||||||
vec2(-sourceDirection * unitNormal.y, sourceDirection * unitNormal.x)
|
vec2(-sourceDirection * unitNormal.y, sourceDirection * unitNormal.x)
|
||||||
* (webGLSourceRadius + webGLSourceArrowHeadLength);
|
* (webGLSourceRadius + webGLSourceArrowHeadLength);
|
||||||
|
|
||||||
// Target arrow head
|
// Target arrow head
|
||||||
float targetRadius = a_targetRadius * a_targetRadiusCoef;
|
float targetRadius = a_targetRadius * a_targetRadiusCoef;
|
||||||
float targetDirection = sign(targetRadius);
|
float targetDirection = sign(targetRadius);
|
||||||
@@ -1009,7 +1009,7 @@ void main() {
|
|||||||
|
|
||||||
position = viewportToClipspace(viewportOffsetPosition, u_dimensions);
|
position = viewportToClipspace(viewportOffsetPosition, u_dimensions);
|
||||||
gl_Position = vec4(position, 0, 1);
|
gl_Position = vec4(position, 0, 1);
|
||||||
|
|
||||||
`).concat(n?`
|
`).concat(n?`
|
||||||
v_targetSize = a_targetSize * u_pixelRatio / u_sizeRatio;
|
v_targetSize = a_targetSize * u_pixelRatio / u_sizeRatio;
|
||||||
v_targetPoint = viewportTarget;
|
v_targetPoint = viewportTarget;
|
||||||
|
@@ -523,19 +523,19 @@ class LightRAG:
|
|||||||
"""
|
"""
|
||||||
# get params supported by get_knowledge_graph of specified storage
|
# get params supported by get_knowledge_graph of specified storage
|
||||||
import inspect
|
import inspect
|
||||||
storage_params = inspect.signature(self.chunk_entity_relation_graph.get_knowledge_graph).parameters
|
|
||||||
|
storage_params = inspect.signature(
|
||||||
kwargs = {
|
self.chunk_entity_relation_graph.get_knowledge_graph
|
||||||
'node_label': node_label,
|
).parameters
|
||||||
'max_depth': max_depth
|
|
||||||
}
|
kwargs = {"node_label": node_label, "max_depth": max_depth}
|
||||||
|
|
||||||
if 'min_degree' in storage_params and min_degree > 0:
|
if "min_degree" in storage_params and min_degree > 0:
|
||||||
kwargs['min_degree'] = min_degree
|
kwargs["min_degree"] = min_degree
|
||||||
|
|
||||||
if 'inclusive' in storage_params:
|
if "inclusive" in storage_params:
|
||||||
kwargs['inclusive'] = inclusive
|
kwargs["inclusive"] = inclusive
|
||||||
|
|
||||||
return await self.chunk_entity_relation_graph.get_knowledge_graph(**kwargs)
|
return await self.chunk_entity_relation_graph.get_knowledge_graph(**kwargs)
|
||||||
|
|
||||||
def _get_storage_class(self, storage_name: str) -> Callable[..., Any]:
|
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" />
|
/// <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/*"]
|
"@/*": ["./src/*"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"include": ["src"]
|
"include": ["src", "vite.config.ts"]
|
||||||
}
|
}
|
||||||
|
@@ -18,14 +18,14 @@ export default defineConfig({
|
|||||||
emptyOutDir: true
|
emptyOutDir: true
|
||||||
},
|
},
|
||||||
server: {
|
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(
|
Object.fromEntries(
|
||||||
import.meta.env.VITE_API_ENDPOINTS.split(',').map(endpoint => [
|
import.meta.env.VITE_API_ENDPOINTS.split(',').map(endpoint => [
|
||||||
endpoint,
|
endpoint,
|
||||||
{
|
{
|
||||||
target: import.meta.env.VITE_BACKEND_URL || 'http://localhost:9621',
|
target: import.meta.env.VITE_BACKEND_URL || 'http://localhost:9621',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: endpoint === '/api' ?
|
rewrite: endpoint === '/api' ?
|
||||||
(path) => path.replace(/^\/api/, '') : undefined
|
(path) => path.replace(/^\/api/, '') : undefined
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
Reference in New Issue
Block a user