图标用 unplugin-icons 在打包时内联成 SVG,运行时不发网络请求——目标机器可能没外网, 而且一个图标一次请求对 2 核的机器不划算。autoInstall 关掉,不让构建过程偷偷联网装东西。 出站显示从「跟着规则走」改成 RULE,其余解释性长句删掉或收进 title。 新增了紧凑模式(只显示图标),默认关:这工具是隔一阵子才动一次的,纯图标对偶尔来的人不友好。
31 lines
1.2 KiB
TypeScript
31 lines
1.2 KiB
TypeScript
/**
|
|
* 左侧导航。
|
|
*
|
|
* 顺序按使用频率排:路由是这个工具存在的理由,放在最上面;仪表盘和连接是「看一眼」
|
|
* 类的,中间;设置很少动,垫底。
|
|
*/
|
|
import IconRoute from '~icons/ri/route-line'
|
|
import IconDashboard from '~icons/ri/dashboard-line'
|
|
import IconConfig from '~icons/ri/file-list-3-line'
|
|
import IconRequests from '~icons/ri/pulse-line'
|
|
import IconConnections from '~icons/ri/links-line'
|
|
import IconSettings from '~icons/ri/settings-3-line'
|
|
import type { Component } from 'vue'
|
|
|
|
export interface NavItem {
|
|
key: string
|
|
label: string
|
|
icon: Component
|
|
/** 还没做的页面标 true,导航上显示但点进去是占位 */
|
|
pending?: boolean
|
|
}
|
|
|
|
export const NAV: NavItem[] = [
|
|
{ key: 'router', label: '路由', icon: IconRoute },
|
|
{ key: 'dashboard', label: '仪表盘', icon: IconDashboard, pending: true },
|
|
{ key: 'config', label: '配置', icon: IconConfig, pending: true },
|
|
{ key: 'requests', label: '请求', icon: IconRequests, pending: true },
|
|
{ key: 'connections', label: '连接', icon: IconConnections, pending: true },
|
|
{ key: 'settings', label: '设置', icon: IconSettings, pending: true },
|
|
]
|