Refactor graph search and add local Vite config.
- Simplify graph search parameters in API - Add inclusive search and min degree options - Update Vite config for local development - Enhance graph query endpoint in web UI - Add new Vite config file for local setup
This commit is contained in:
@@ -4,11 +4,11 @@
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "bunx --bun vite",
|
||||
"dev": "bunx --bun vite --config vite.config.local.js",
|
||||
"build": "bunx --bun vite build",
|
||||
"lint": "eslint .",
|
||||
"preview": "bunx --bun vite preview",
|
||||
"dev-no-bun": "vite",
|
||||
"dev-no-bun": "vite --config vite.config.local.js",
|
||||
"build-no-bun": "vite build --emptyOutDir",
|
||||
"preview-no-bun": "vite preview"
|
||||
},
|
||||
|
@@ -161,8 +161,12 @@ axiosInstance.interceptors.response.use(
|
||||
)
|
||||
|
||||
// API methods
|
||||
export const queryGraphs = async (label: string, maxDepth: number): Promise<LightragGraphType> => {
|
||||
const response = await axiosInstance.get(`/graphs?label=${label}&max_depth=${maxDepth}`)
|
||||
export const queryGraphs = async (
|
||||
label: string,
|
||||
maxDepth: number,
|
||||
inclusive: boolean = false
|
||||
): Promise<LightragGraphType> => {
|
||||
const response = await axiosInstance.get(`/graphs?label=${encodeURIComponent(label)}&max_depth=${maxDepth}&inclusive=${inclusive}`)
|
||||
return response.data
|
||||
}
|
||||
|
||||
|
38
lightrag_webui/vite.config.local.js
Normal file
38
lightrag_webui/vite.config.local.js
Normal file
@@ -0,0 +1,38 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import baseConfig from './vite.config'
|
||||
import { mergeConfig } from 'vite'
|
||||
|
||||
export default mergeConfig(
|
||||
baseConfig,
|
||||
defineConfig({
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:9621',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, '')
|
||||
},
|
||||
'/documents': {
|
||||
target: 'http://localhost:9621',
|
||||
changeOrigin: true
|
||||
},
|
||||
'/graphs': {
|
||||
target: 'http://localhost:9621',
|
||||
changeOrigin: true
|
||||
},
|
||||
'/graph': {
|
||||
target: 'http://localhost:9621',
|
||||
changeOrigin: true
|
||||
},
|
||||
'/health': {
|
||||
target: 'http://localhost:9621',
|
||||
changeOrigin: true
|
||||
},
|
||||
'/query': {
|
||||
target: 'http://localhost:9621',
|
||||
changeOrigin: true
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
)
|
Reference in New Issue
Block a user