主界面修改及代理模块初始化
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import type { Component } from 'vue'
|
||||
import {
|
||||
Settings,
|
||||
Globe,
|
||||
ClipboardList,
|
||||
Camera,
|
||||
Activity,
|
||||
Download,
|
||||
Search
|
||||
} from '@lucide/vue'
|
||||
|
||||
/**
|
||||
* 模块图标映射表
|
||||
*
|
||||
* 模块配置中使用字符串标识(如 'proxy'),通过此表转换为实际图标组件。
|
||||
* 新增模块时,在对应模块的 index.ts 中使用一致的 icon 字符串,
|
||||
* 并在此处添加映射。
|
||||
*/
|
||||
export const moduleIconMap: Record<string, Component> = {
|
||||
settings: Settings,
|
||||
proxy: Globe,
|
||||
clipboard: ClipboardList,
|
||||
screenshot: Camera,
|
||||
monitor: Activity,
|
||||
downloader: Download,
|
||||
finder: Search
|
||||
}
|
||||
|
||||
/** 获取模块图标组件,未找到时回退到 Settings 图标 */
|
||||
export function getModuleIcon(iconName: string): Component {
|
||||
return moduleIconMap[iconName] ?? Settings
|
||||
}
|
||||
Reference in New Issue
Block a user