feat: refactor sidebar and settings to include agents and models; update routing and i18n messages
This commit is contained in:
@@ -8,8 +8,6 @@ import { onAuthLogout } from './auth-session';
|
||||
|
||||
const HomePage = lazy(() => import('../pages/Home'));
|
||||
const ChannelsPage = lazy(() => import('../pages/Channels'));
|
||||
const AgentsPage = lazy(() => import('../pages/Agents'));
|
||||
const ModelsPage = lazy(() => import('../pages/Models'));
|
||||
const SkillsPage = lazy(() => import('../pages/Skills'));
|
||||
const CronPage = lazy(() => import('../pages/Cron'));
|
||||
const ScriptsPage = lazy(() => import('../pages/Scripts'));
|
||||
@@ -32,6 +30,10 @@ function renderLazyPage(element: ReactNode) {
|
||||
);
|
||||
}
|
||||
|
||||
function renderSettingViewRedirect(view: 'agents' | 'models') {
|
||||
return <Navigate to={`/setting?view=${view}`} replace />;
|
||||
}
|
||||
|
||||
function AuthLogoutRedirector() {
|
||||
const location = useLocation();
|
||||
const navigate = useNavigate();
|
||||
@@ -65,8 +67,8 @@ export function AppRouter() {
|
||||
<Route element={<MainLayout />}>
|
||||
<Route path="/home" element={renderLazyPage(<HomePage />)} />
|
||||
<Route path="/channels" element={renderLazyPage(<ChannelsPage />)} />
|
||||
<Route path="/agents" element={renderLazyPage(<AgentsPage />)} />
|
||||
<Route path="/models" element={renderLazyPage(<ModelsPage />)} />
|
||||
<Route path="/agents" element={renderSettingViewRedirect('agents')} />
|
||||
<Route path="/models" element={renderSettingViewRedirect('models')} />
|
||||
<Route path="/skills" element={renderLazyPage(<SkillsPage />)} />
|
||||
<Route path="/cron" element={renderLazyPage(<CronPage />)} />
|
||||
<Route path="/scripts" element={renderLazyPage(<ScriptsPage />)} />
|
||||
|
||||
Reference in New Issue
Block a user