From abd9c75e7f5fbf5b5db29e5f5cb4a720de072f0e Mon Sep 17 00:00:00 2001 From: wood chen Date: Sun, 27 Oct 2024 20:57:27 +0800 Subject: [PATCH] style(public/css, public/index.html): Update fade class and endpoint-link color, fetch stats from local server, add view column and update interval --- public/css/main.css | 4 ++-- public/index.html | 32 +++++++++++++++++--------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/public/css/main.css b/public/css/main.css index f4c9e34..64c4e08 100644 --- a/public/css/main.css +++ b/public/css/main.css @@ -108,9 +108,9 @@ table { transition: opacity 0.3s ease; } -.fade { +/* .fade { opacity: 0.6; -} +} */ .endpoint-link { /* color: #666; 默认字体颜色改为深灰色 */ diff --git a/public/index.html b/public/index.html index ba6e851..5d3603c 100644 --- a/public/index.html +++ b/public/index.html @@ -67,7 +67,7 @@ if (detailElement) detailElement.classList.add('fade'); // 获取数据 - const response = await fetch('https://random-api.czl.net/stats'); + const response = await fetch('/stats'); const stats = await response.json(); // 更新统计 @@ -136,6 +136,7 @@ 接口 今日调用 总调用 + 查看 @@ -143,19 +144,20 @@ sortedEndpoints.forEach(([endpoint, stat]) => { detailHtml += ` - - - - ${getDisplayName(endpoint, endpointConfig)} - - - ${stat.today_calls} - ${stat.total_calls} - - `; + + + + ${getDisplayName(endpoint, endpointConfig)} + + + ${stat.today_calls} + ${stat.total_calls} + 👀 + + `; }); detailHtml += ` @@ -226,7 +228,7 @@ .catch(error => console.error('Error loading index.md:', error)); // 定期更新统计数据 - setInterval(loadStats, 3 * 1000); + setInterval(loadStats, 5 * 1000);