From 310f627a9e44b64c21ecd8fab23eae309470a851 Mon Sep 17 00:00:00 2001 From: wood chen Date: Sat, 14 Jun 2025 22:03:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A6=96=E9=A1=B5=E5=B8=83?= =?UTF-8?q?=E5=B1=80=EF=BC=8C=E6=9B=B4=E6=96=B0=E8=83=8C=E6=99=AF=E5=9B=BE?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=EF=BC=8C=E8=B0=83=E6=95=B4=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E4=BB=A5=E6=8F=90=E5=8D=87=E8=A7=86=E8=A7=89=E6=95=88=E6=9E=9C?= =?UTF-8?q?=EF=BC=9B=E7=AE=80=E5=8C=96=E7=B3=BB=E7=BB=9F=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=92=8CAPI=E7=AB=AF=E7=82=B9=E7=BB=9F=E8=AE=A1=E9=83=A8?= =?UTF-8?q?=E5=88=86=E7=9A=84=E5=B1=95=E7=A4=BA=EF=BC=8C=E5=A2=9E=E5=BC=BA?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BD=93=E9=AA=8C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/app/page.tsx | 195 ++++++++++++++++++++++------------------------- 1 file changed, 93 insertions(+), 102 deletions(-) diff --git a/web/app/page.tsx b/web/app/page.tsx index de0d4a7..96f068e 100644 --- a/web/app/page.tsx +++ b/web/app/page.tsx @@ -214,154 +214,145 @@ export default function Home() { return (
- {/* 背景遮罩 */} -
+ {/* 背景遮罩 - 让背景图若影若现 */} +
-
-
- {/* Header - 更简洁 */} -
-
- + {/* 简洁背景 */} +
+
+
+ +
+
+ {/* Header - 简洁 */} +
+
+
+

+ Random API Service +

+

随机API服务

- {/* System Status Section - 性冷淡风格 */} + {/* System Status Section - 冷淡风格 */} {systemMetrics && ( -
-

+
+

系统状态

-
+
{/* 运行时间 */} -
-
-

运行时间

-
+
+
+

运行时间

+
-

+

{formatUptime(systemMetrics.uptime)}

-

+

{formatStartTime(systemMetrics.start_time)}

{/* CPU核心数 */} -
-
-

CPU核心

- +
+
+

CPU核心

+
-

- {systemMetrics.num_cpu} 核 +

+ {systemMetrics.num_cpu}

+

核心

{/* Goroutine数量 */} -
-
-

协程数

- +
+
+

协程数

+
-

+

{systemMetrics.num_goroutine}

{/* 平均延迟 */} -
-
-

平均延迟

- +
+
+

平均延迟

+
-

- {systemMetrics.average_latency.toFixed(2)} ms +

+ {systemMetrics.average_latency.toFixed(2)}

+

毫秒

{/* 堆内存分配 */} -
-
-

堆内存

- +
+
+

堆内存

+
-

+

{formatBytes(systemMetrics.memory_stats.heap_alloc)}

-

+

系统: {formatBytes(systemMetrics.memory_stats.heap_sys)}

- - {/* 当前时间 -
-
-

当前时间

- - - -
-

- {new Date().toLocaleString('zh-CN', { - month: '2-digit', - day: '2-digit', - hour: '2-digit', - minute: '2-digit' - })} -

-
*/}
)} - - - {/* API端点统计 - 全宽布局 */} + {/* API端点统计 - 简洁风格 */} {visibleEndpoints.length > 0 && ( -
-

- API 端点统计 +
+

+ API 端点

-
+
{visibleEndpoints.map((endpoint: Endpoint) => { const endpointStats = stats.Stats?.[endpoint.url] || { TotalCalls: 0, TodayCalls: 0 } const urlCount = urlStats[endpoint.url]?.total_urls || 0 return ( -
-
+
+
-

+

{endpoint.name}

-

+

/{endpoint.url}

-
+
-
-
-
-

今日

-

+

+
+

今日

+

{endpointStats.TodayCalls}

-
-

总计

-

+

+

总计

+

{endpointStats.TotalCalls}

-
-

URL

-

+

+

URL

+

{urlCount}

{endpoint.description && ( -

+

{endpoint.description}

)} @@ -415,25 +406,25 @@ export default function Home() {
)} - {/* Main Content - 半透明 */} -
-
+ {/* Main Content - 简洁内容区 */} +
+

{children}

, - h2: ({children}) =>

{children}

, - h3: ({children}) =>

{children}

, - p: ({children}) =>

{children}

, - ul: ({children}) =>
    {children}
, - ol: ({children}) =>
    {children}
, - li: ({children}) =>
  • {children}
  • , - strong: ({children}) => {children}, - em: ({children}) => {children}, - code: ({children}) => {children}, - pre: ({children}) =>
    {children}
    , - blockquote: ({children}) =>
    {children}
    , - a: ({href, children}) => {children}, + h1: ({children}) =>

    {children}

    , + h2: ({children}) =>

    {children}

    , + h3: ({children}) =>

    {children}

    , + p: ({children}) =>

    {children}

    , + ul: ({children}) =>
      {children}
    , + ol: ({children}) =>
      {children}
    , + li: ({children}) =>
  • {children}
  • , + strong: ({children}) => {children}, + em: ({children}) => {children}, + code: ({children}) => {children}, + pre: ({children}) =>
    {children}
    , + blockquote: ({children}) =>
    {children}
    , + a: ({href, children}) => {children}, }} > {content}