Refactor UUID generation, remove unused logger and encryption utilities, and clean up request handling
- Updated `generateUUID` function for improved readability and performance. - Deleted `logger.ts`, `other.ts`, `request.ts`, `storage.ts`, `tansParams.ts`, and `validate.ts` as they were no longer needed. - Simplified TypeScript configuration by removing unnecessary paths and aliases. - Enhanced Vite configuration for better project structure and maintainability.
This commit is contained in:
44
src/router/routes.ts
Normal file
44
src/router/routes.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
export type AppPath =
|
||||
| '/home'
|
||||
| '/agents'
|
||||
| '/skills'
|
||||
| '/cron'
|
||||
| '/scripts'
|
||||
| '/setting'
|
||||
| '/knowledge'
|
||||
| '/login';
|
||||
|
||||
export type WorkspacePath = Exclude<AppPath, '/login'>;
|
||||
|
||||
export type NavItem = {
|
||||
path: WorkspacePath;
|
||||
label: string;
|
||||
description: string;
|
||||
};
|
||||
|
||||
export const DEFAULT_PATH: WorkspacePath = '/home';
|
||||
|
||||
export const NAV_ITEMS: NavItem[] = [
|
||||
{ path: '/home', label: '首页', description: '对话与首页入口' },
|
||||
{ path: '/knowledge', label: '知识库', description: '知识库与内容管理' },
|
||||
{ path: '/agents', label: '模型', description: '智能体与提供方' },
|
||||
{ path: '/skills', label: '技能', description: '技能与能力集' },
|
||||
{ path: '/cron', label: '定时任务', description: '计划与调度' },
|
||||
{ path: '/scripts', label: '脚本', description: '脚本与自动化' },
|
||||
{ path: '/setting', label: '设置', description: '应用配置' },
|
||||
];
|
||||
|
||||
export function normalizeWorkspacePath(pathname: string): WorkspacePath {
|
||||
switch (pathname) {
|
||||
case '/knowledge':
|
||||
case '/agents':
|
||||
case '/skills':
|
||||
case '/cron':
|
||||
case '/scripts':
|
||||
case '/setting':
|
||||
return pathname;
|
||||
case '/home':
|
||||
default:
|
||||
return DEFAULT_PATH;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user