feat: add models management and usage history components
- Introduced RequestContentDialog for displaying request content details. - Added UsageBarChart for visualizing token usage data. - Implemented UsageHistorySection to manage and display usage history with filtering and pagination. - Created provider-types for managing provider-related types. - Developed ModelsPage to encapsulate models configuration, providers, and usage history. - Defined usage-history types and utility functions for managing usage data. - Updated routing to include models page and redirect agents to models. - Refactored chat store to integrate models instead of agents. - Established models store for managing model-related state and data fetching.
This commit is contained in:
@@ -3,7 +3,7 @@ import { Navigate, Route, Routes, useLocation, useNavigate } from 'react-router-
|
||||
import MainLayout from '../components/layout/MainLayout';
|
||||
import HomePage from '../pages/Home';
|
||||
import LoginPage from '../pages/Login';
|
||||
import AgentsPage from '../pages/agents';
|
||||
import ModelsPage from '../pages/Models';
|
||||
import SkillsPage from '../pages/Skills';
|
||||
import CronPage from '../pages/Cron';
|
||||
import ScriptsPage from '../pages/Scripts';
|
||||
@@ -45,7 +45,8 @@ export function AppRouter() {
|
||||
<Route element={<RequireAuth />}>
|
||||
<Route element={<MainLayout />}>
|
||||
<Route path="/home" element={<HomePage />} />
|
||||
<Route path="/agents" element={<AgentsPage />} />
|
||||
<Route path="/models" element={<ModelsPage />} />
|
||||
<Route path="/agents" element={<Navigate to="/models" replace />} />
|
||||
<Route path="/skills" element={<SkillsPage />} />
|
||||
<Route path="/cron" element={<CronPage />} />
|
||||
<Route path="/scripts" element={<ScriptsPage />} />
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export type AppPath =
|
||||
| '/home'
|
||||
| '/agents'
|
||||
| '/models'
|
||||
| '/skills'
|
||||
| '/cron'
|
||||
| '/scripts'
|
||||
@@ -27,7 +27,7 @@ export const DEFAULT_PATH: WorkspacePath = '/home';
|
||||
export const NAV_ITEMS: NavItem[] = [
|
||||
{ path: '/home', labelKey: 'sidebar.home' },
|
||||
{ path: '/knowledge', labelKey: 'sidebar.knowledge' },
|
||||
{ path: '/agents', labelKey: 'sidebar.models' },
|
||||
{ path: '/models', labelKey: 'sidebar.models' },
|
||||
{ path: '/skills', labelKey: 'sidebar.skills' },
|
||||
{ path: '/cron', labelKey: 'sidebar.cron' },
|
||||
{ path: '/scripts', labelKey: 'sidebar.scripts' },
|
||||
@@ -37,12 +37,13 @@ export const NAV_ITEMS: NavItem[] = [
|
||||
export function normalizeWorkspacePath(pathname: string): WorkspacePath {
|
||||
switch (pathname) {
|
||||
case '/knowledge':
|
||||
case '/models':
|
||||
case '/agents':
|
||||
case '/skills':
|
||||
case '/cron':
|
||||
case '/scripts':
|
||||
case '/setting':
|
||||
return pathname;
|
||||
return pathname === '/agents' ? '/models' : pathname;
|
||||
case '/home':
|
||||
default:
|
||||
return DEFAULT_PATH;
|
||||
|
||||
Reference in New Issue
Block a user