forked from aabacada/CloudNav-abcd
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
91 lines (78 loc) · 3.12 KB
/
types.ts
File metadata and controls
91 lines (78 loc) · 3.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
export interface LinkItem {
id: string;
title: string;
url: string;
icon?: string;
description?: string;
categoryId: string;
createdAt: number;
pinned?: boolean; // New field for pinning
pinnedOrder?: number; // Field for pinned link sorting order
}
export interface Category {
id: string;
name: string;
icon: string; // Lucide icon name or emoji
password?: string; // Optional password for category protection
}
export interface SiteSettings {
title: string;
navTitle: string;
favicon: string;
cardStyle: 'detailed' | 'simple';
passwordExpiryDays: number; // 密码过期天数,0表示永久不退出
}
export interface AppState {
links: LinkItem[];
categories: Category[];
darkMode: boolean;
settings?: SiteSettings;
}
export interface WebDavConfig {
url: string;
username: string;
password: string;
enabled: boolean;
}
export type AIProvider = 'gemini' | 'openai';
export interface AIConfig {
provider: AIProvider;
apiKey: string;
baseUrl: string;
model: string;
websiteTitle?: string; // 网站标题 (浏览器标签)
faviconUrl?: string; // 网站图标URL
navigationName?: string;
}
// 搜索模式类型
export type SearchMode = 'internal' | 'external';
// 外部搜索源配置
export interface ExternalSearchSource {
id: string;
name: string;
url: string;
icon?: string;
enabled: boolean;
createdAt: number;
}
// 搜索配置
export interface SearchConfig {
mode: SearchMode;
externalSources: ExternalSearchSource[];
selectedSource?: ExternalSearchSource | null; // 选中的搜索源
}
export const DEFAULT_CATEGORIES: Category[] = [
{ id: 'common', name: '常用推荐', icon: 'Star' },
{ id: 'dev', name: '开发工具', icon: 'Code' },
{ id: 'design', name: '设计资源', icon: 'Palette' },
{ id: 'read', name: '阅读资讯', icon: 'BookOpen' },
{ id: 'ent', name: '休闲娱乐', icon: 'Gamepad2' },
{ id: 'ai', name: '人工智能', icon: 'Bot' },
];
export const INITIAL_LINKS: LinkItem[] = [
{ id: '1', title: 'GitHub', url: 'https://github.com', categoryId: 'dev', createdAt: Date.now(), description: '代码托管平台', pinned: true, icon: 'https://www.faviconextractor.com/favicon/github.com?larger=true' },
{ id: '2', title: 'React', url: 'https://react.dev', categoryId: 'dev', createdAt: Date.now(), description: '构建Web用户界面的库', pinned: true, icon: 'https://www.faviconextractor.com/favicon/react.dev?larger=true' },
{ id: '3', title: 'Tailwind CSS', url: 'https://tailwindcss.com', categoryId: 'design', createdAt: Date.now(), description: '原子化CSS框架', pinned: true, icon: 'https://www.faviconextractor.com/favicon/tailwindcss.com?larger=true' },
{ id: '4', title: 'ChatGPT', url: 'https://chat.openai.com', categoryId: 'ai', createdAt: Date.now(), description: 'OpenAI聊天机器人', pinned: true, icon: 'https://www.faviconextractor.com/favicon/chat.openai.com?larger=true' },
{ id: '5', title: 'Gemini', url: 'https://gemini.google.com', categoryId: 'ai', createdAt: Date.now(), description: 'Google DeepMind AI', pinned: true, icon: 'https://www.faviconextractor.com/favicon/gemini.google.com?larger=true' },
];