弹窗用原生 <dialog>,焦点捕获和 Esc 关闭是浏览器自带的,自己实现只会更差。 表单字段由那张从内核源码提取的字段表驱动:公共字段加当前类型的必填项。 20 种类型合计 398 个字段,全铺出来没人填得完,冷门的留给配置文件手写。 默认入站不再显示出站选择块——那一整块对它都是不可选的,画出来只是噪音, 换成一行说明。另外去掉了行里那根装饰线,导航把仪表盘挪到路由前面。
30 lines
1.1 KiB
TypeScript
30 lines
1.1 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: 'dashboard', label: '仪表盘', icon: IconDashboard, pending: true },
|
|
{ key: 'router', label: '路由', icon: IconRoute },
|
|
{ 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 },
|
|
]
|