From 42f1483a805246f5c50fd111e675e88040d6f609 Mon Sep 17 00:00:00 2001 From: XOF Date: Tue, 30 Dec 2025 03:51:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20main.go?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 87 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 43 insertions(+), 44 deletions(-) diff --git a/main.go b/main.go index 5864f96..76e265f 100644 --- a/main.go +++ b/main.go @@ -175,7 +175,7 @@ func handleRoot(w http.ResponseWriter, r *http.Request) { statusIPv6 = "🟡" } - // 🔥 自动检测访问协议和地址 + // 自动检测访问协议和地址 protocol := "http" if r.TLS != nil || r.Header.Get("X-Forwarded-Proto") == "https" { protocol = "https" @@ -263,35 +263,35 @@ func handleRoot(w http.ResponseWriter, r *http.Request) { } h1 { - font-size: 2.5em; - margin-bottom: 10px; - position: relative; - /* 🔥 先设置普通颜色作为基础 */ - color: #667eea; - } - /* 只在支持的浏览器上应用渐变 */ - @supports (background-clip: text) or (-webkit-background-clip: text) { - h1 { - background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); - -webkit-background-clip: text; - -webkit-text-fill-color: transparent; - background-clip: text; - } - } - @media (prefers-color-scheme: dark) { - h1 { - color: #818cf8; - } - - @supports (background-clip: text) or (-webkit-background-clip: text) { - h1 { - background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%); - -webkit-background-clip: text; - -webkit-text-fill-color: transparent; - background-clip: text; - } - } - } + font-size: 2.5em; + margin-bottom: 10px; + position: relative; + color: #667eea; + } + + @supports (background-clip: text) or (-webkit-background-clip: text) { + h1 { + background: linear-gradient(135deg, #667eea 0%%, #764ba2 100%%); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + background-clip: text; + } + } + + @media (prefers-color-scheme: dark) { + h1 { + color: #818cf8; + } + + @supports (background-clip: text) or (-webkit-background-clip: text) { + h1 { + background: linear-gradient(135deg, #818cf8 0%%, #a78bfa 100%%); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + background-clip: text; + } + } + } .subtitle { color: var(--text-secondary); @@ -511,8 +511,8 @@ func handleRoot(w http.ResponseWriter, r *http.Request) {
-

CHNRoute RSC 服务

-

自动转换 IP 列表为 RouterOS 可导入格式

+

🇨🇳 CHNRoute RSC 服务

+

自动转换中国 IP 列表为 RouterOS 可导入格式

@@ -588,12 +588,12 @@ func handleRoot(w http.ResponseWriter, r *http.Request) {
%s
IPv4 缓存
-
已缓存 %s
+
已缓存 %v
%s
IPv6 缓存
-
已缓存 %s
+
已缓存 %v
@@ -634,21 +634,20 @@ func handleRoot(w http.ResponseWriter, r *http.Request) { `, - baseURL, baseURL, // 下载地址 IPv4 - baseURL, baseURL, // 下载地址 IPv6 - protocolBadge, // 协议徽章 - protocolNote, // 协议提示 - baseURL, fetchMode, // 一键导入 - baseURL, fetchMode, // 自动更新 - baseURL, fetchMode, // IPv6 导入 - statusIPv4, cacheAgeIPv4, // 状态 IPv4 - statusIPv6, cacheAgeIPv6) // 状态 IPv6 + baseURL, baseURL, // 1-2: 下载地址 IPv4 (href + 显示文本) + baseURL, baseURL, // 3-4: 下载地址 IPv6 (href + 显示文本) + protocolBadge, // 5: 协议徽章 + protocolNote, // 6: 协议提示 + baseURL, fetchMode, // 7-8: 一键导入 (url + mode) + baseURL, fetchMode, // 9-10: 自动更新 (url + mode) + baseURL, fetchMode, // 11-12: IPv6 导入 (url + mode) + statusIPv4, cacheAgeIPv4, // 13-14: IPv4 状态图标 + 缓存时间 + statusIPv6, cacheAgeIPv6) // 15-16: IPv6 状态图标 + 缓存时间 w.Header().Set("Content-Type", "text/html; charset=utf-8") w.Write([]byte(html)) } - func main() { // 启动时预热缓存 go func() {