feat: 代理 timing 细分指标与前端展示优化

- aether-proxy 新增 auth_ms/body_read_ms/body_parse_ms/body_size 计时字段
- 链路追踪面板代理耗时改为分阶段展示,密钥和代理信息改为堆叠布局
- 硬件信息从 Tooltip 改为 Popover,新增 FD Limit 展示
- 新增区域代码格式化工具函数,统一显示区域中文名称
This commit is contained in:
fawney19
2026-02-11 15:33:01 +08:00
parent d51234f202
commit 2a2a4b817e
6 changed files with 142 additions and 54 deletions

View File

@@ -169,7 +169,7 @@
<code class="text-xs text-muted-foreground">{{ node.is_manual ? (node.proxy_url || `${node.ip}:${node.port}`) : `${node.ip}:${node.port}` }}</code>
</TableCell>
<TableCell class="py-4">
<span class="text-sm text-muted-foreground">{{ node.region || '-' }}</span>
<span class="text-sm text-muted-foreground">{{ formatRegion(node.region) }}</span>
</TableCell>
<TableCell class="py-4 text-center">
<Badge
@@ -286,7 +286,7 @@
<div class="grid grid-cols-3 gap-2 text-xs text-muted-foreground mb-3">
<div>
<span class="block text-foreground/60">区域</span>
<span>{{ node.region || '-' }}</span>
<span>{{ formatRegion(node.region) }}</span>
</div>
<div>
<span class="block text-foreground/60">连接</span>
@@ -565,6 +565,7 @@ import {
} from '@/components/ui'
import { Search, Trash2, Plus, SquarePen, Activity, Loader2, Settings } from 'lucide-vue-next'
import { formatRegion } from '@/utils/region'
import HardwareTooltip from './components/HardwareTooltip.vue'
const { success, error: toastError } = useToast()

View File

@@ -1,10 +1,9 @@
<script setup lang="ts">
import type { ProxyNode } from '@/api/proxy-nodes'
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
Popover,
PopoverContent,
PopoverTrigger,
} from '@/components/ui'
import { Cpu } from 'lucide-vue-next'
@@ -24,28 +23,35 @@ function formatNumber(n: number) {
</script>
<template>
<TooltipProvider v-if="!node.is_manual && node.hardware_info">
<Tooltip>
<TooltipTrigger as-child>
<Cpu class="h-3.5 w-3.5 text-muted-foreground cursor-default" />
</TooltipTrigger>
<TooltipContent
side="right"
class="text-xs space-y-0.5"
<Popover v-if="!node.is_manual && node.hardware_info">
<PopoverTrigger as-child>
<button
type="button"
class="inline-flex items-center justify-center rounded-sm p-0.5 hover:bg-muted/60 transition-colors"
>
<div v-if="node.hardware_info.cpu_cores">
CPU: {{ node.hardware_info.cpu_cores }} cores
</div>
<div v-if="node.hardware_info.total_memory_mb">
RAM: {{ formatMemory(node.hardware_info.total_memory_mb) }}
</div>
<div v-if="node.hardware_info.os_info">
OS: {{ node.hardware_info.os_info }}
</div>
<div v-if="node.estimated_max_concurrency">
Max Concurrency: ~{{ formatNumber(node.estimated_max_concurrency) }}
</div>
</TooltipContent>
</Tooltip>
</TooltipProvider>
<Cpu class="h-3.5 w-3.5 text-muted-foreground" />
</button>
</PopoverTrigger>
<PopoverContent
side="right"
:side-offset="8"
class="w-auto p-3 text-xs space-y-1"
>
<div v-if="node.hardware_info.cpu_cores">
CPU: {{ node.hardware_info.cpu_cores }} cores
</div>
<div v-if="node.hardware_info.total_memory_mb">
RAM: {{ formatMemory(node.hardware_info.total_memory_mb) }}
</div>
<div v-if="node.hardware_info.os_info">
OS: {{ node.hardware_info.os_info }}
</div>
<div v-if="node.estimated_max_concurrency">
Max Concurrency: ~{{ formatNumber(node.estimated_max_concurrency) }}
</div>
<div v-if="node.hardware_info.fd_limit">
FD Limit: {{ formatNumber(node.hardware_info.fd_limit) }}
</div>
</PopoverContent>
</Popover>
</template>