refactor: 优化卡片显示一致性与可扩展性
- 统一 Summary Cards 和 Target Cards 宽度为 280px(CSS 变量控制) - 分组统计改为徽章展示(纯数字 + 颜色区分) - 目标名称添加 title 属性支持显示完整名称 - 建立类型映射系统,Command 显示为 CMD,支持扩展 - 移除移动端响应式代码,简化维护 - 新增 target-type-display 能力规格 - 更新 card-dashboard 和 target-detail-modal 规格
This commit is contained in:
10
src/web/constants/target-type-display.ts
Normal file
10
src/web/constants/target-type-display.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
export const TARGET_TYPE_DISPLAY = {
|
||||
http: "HTTP",
|
||||
command: "CMD",
|
||||
} as const;
|
||||
|
||||
export type TargetType = keyof typeof TARGET_TYPE_DISPLAY;
|
||||
|
||||
export function getTargetTypeDisplay(type: string): string {
|
||||
return TARGET_TYPE_DISPLAY[type as TargetType] || type.toUpperCase();
|
||||
}
|
||||
Reference in New Issue
Block a user