generated from kevisual/vite-react-template
feat: integrate knowledge base creation in RepoCard and update app context key
- Updated the context key for the QueryRouterServer from 'router' to 'app'. - Added functionality to create a knowledge base in RepoCard component. - Introduced a new BookOpen icon and tooltip for knowledge base indication. - Implemented a toast notification for successful knowledge base creation. - Cleaned up imports in main.tsx by commenting out unused app import.
This commit is contained in:
@@ -3,8 +3,7 @@ import { QueryRouterServer } from '@kevisual/router/browser'
|
||||
import { useContextKey } from '@kevisual/context'
|
||||
import { useConfigStore } from '@/app/config/store'
|
||||
import { CNB } from '@kevisual/cnb'
|
||||
|
||||
export const app = useContextKey('router', new QueryRouterServer())
|
||||
export const app = useContextKey('app', new QueryRouterServer())
|
||||
|
||||
export const cnb: CNB = useContextKey('cnb', () => {
|
||||
const state = useConfigStore.getState()
|
||||
@@ -13,9 +12,19 @@ export const cnb: CNB = useContextKey('cnb', () => {
|
||||
if (config.ENABLE_CORS) {
|
||||
cors.baseUrl = config.CNB_CORS_URL || 'https://cors.kevisual.cn'
|
||||
}
|
||||
console.log('state', state)
|
||||
// if(state.config.)
|
||||
return new CNB({
|
||||
token: config.CNB_API_KEY,
|
||||
cookie: config.CNB_COOKIE,
|
||||
cors
|
||||
})
|
||||
})
|
||||
})
|
||||
//
|
||||
|
||||
// import '@kevisual/cnb-ai'
|
||||
|
||||
const url = 'https://kevisual.cn/root/cnb-ai/dist/app.js'
|
||||
setTimeout(() => {
|
||||
import(/* @vite-ignore */url)
|
||||
}, 2000)
|
||||
Reference in New Issue
Block a user