diff --git a/main.go b/main.go index 624119b..6da7297 100644 --- a/main.go +++ b/main.go @@ -520,79 +520,79 @@ func handleRoot(w http.ResponseWriter, r *http.Request) {

📥 下载地址

-

🔧 RouterOS 使用方法%s

+

🔧 RouterOS 使用方法%[2]s

- %s + %[3]s

一键导入脚本

-
# SSH 登录 RouterOS 后执行
-/tool fetch url="%s/chnroute.rsc" mode=%s
+                
# SSH login to RouterOS and execute
+/tool fetch url="%[1]s/chnroute.rsc" mode=%[4]s
 /import chnroute.rsc
 
-# 验证导入
+# Verify import
 /ip firewall address-list print count-only where list=chnroute

自动更新脚本(推荐)

-
# 创建更新脚本
+                
# Create update script
 /system script add name=update-chnroute source={
-    :log info "开始更新 CHNRoute"
+    :log info "Start updating CHNRoute"
     /file remove [find name="chnroute.rsc"]
-    /tool fetch url="%s/chnroute.rsc" mode=%s
+    /tool fetch url="%[1]s/chnroute.rsc" mode=%[4]s
     :delay 3s
     /ip firewall address-list remove [find list=chnroute]
     /import chnroute.rsc
     :local count [/ip firewall address-list print count-only where list=chnroute]
-    :log info ("CHNRoute 更新完成,共 " . $count . " 条")
+    :log info ("CHNRoute updated: " . \$count . " entries")
 }
 
-# 设置每周自动执行(每周日凌晨3点)
+# Set weekly auto-run (every Sunday at 3:00 AM)
 /system scheduler add name=auto-update-chnroute interval=7d00:00:00 on-event="/system script run update-chnroute" start-time=03:00:00

IPv6 导入脚本

-
# IPv6 路由列表导入
-/tool fetch url="%s/chnroute_v6.rsc" mode=%s
+                
# Import IPv6 route list
+/tool fetch url="%[1]s/chnroute_v6.rsc" mode=%[4]s
 /import chnroute_v6.rsc
 
-# 验证导入
+# Verify import
 /ipv6 firewall address-list print count-only where list=chnroute6
-

IPv6 自动更新脚本

-
- -
# 创建 IPv6 更新脚本
+            

IPv6 自动更新脚本

+
+ +
# Create IPv6 update script
 /system script add name=update-chnroute-v6 source={
-    :log info "开始更新 CHNRoute IPv6"
+    :log info "Start updating CHNRoute IPv6"
     /file remove [find name="chnroute_v6.rsc"]
-    /tool fetch url="%s/chnroute_v6.rsc" mode=%s
+    /tool fetch url="%[1]s/chnroute_v6.rsc" mode=%[4]s
     :delay 3s
     /ipv6 firewall address-list remove [find list=chnroute6]
     /import chnroute_v6.rsc
     :local count [/ipv6 firewall address-list print count-only where list=chnroute6]
-    :log info ("CHNRoute IPv6 更新完成,共 " . $count . " 条")
+    :log info ("CHNRoute IPv6 updated: " . \$count . " entries")
 }
 
-# 设置每周日凌晨3点自动执行
+# Set weekly auto-run (every Sunday at 3:00 AM)
 /system scheduler add name=auto-update-chnroute-v6 interval=7d00:00:00 on-event="/system script run update-chnroute-v6" start-time=03:00:00
@@ -602,14 +602,14 @@ func handleRoot(w http.ResponseWriter, r *http.Request) {

📊 服务状态运行中

-
%s
+
%[5]s
IPv4 缓存
-
已缓存 %v
+
已缓存 %[6]v
-
%s
+
%[7]s
IPv6 缓存
-
已缓存 %v
+
已缓存 %[8]v
@@ -650,15 +650,14 @@ func handleRoot(w http.ResponseWriter, r *http.Request) { `, - 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 状态图标 + 缓存时间 + baseURL, // %[1]s - 重复使用多次 + protocolBadge, // %[2]s - 协议徽章 + protocolNote, // %[3]s - 协议提示 + fetchMode, // %[4]s - 重复使用多次 + statusIPv4, // %[5]s - IPv4 状态 + cacheAgeIPv4, // %[6]v - IPv4 缓存时间 + statusIPv6, // %[7]s - IPv6 状态 + cacheAgeIPv6) // %[8]v - IPv6 缓存时间 w.Header().Set("Content-Type", "text/html; charset=utf-8") w.Write([]byte(html))