From 38e6d94b109106df1bdef8f44cb50dfe202af374 Mon Sep 17 00:00:00 2001 From: thsrite Date: Mon, 6 Jan 2025 13:19:04 +0800 Subject: [PATCH] fix total_cnt --- docs/Lucky.md | 2 ++ plugins/lucky/__init__.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/Lucky.md b/docs/Lucky.md index cf82b32..c51a744 100644 --- a/docs/Lucky.md +++ b/docs/Lucky.md @@ -25,6 +25,8 @@ HomePage services.yaml配置 label: 公网ip地址 - field: expire_time label: 证书过期日期 + - field: total_cnt + label: 总配置数量 # - field: connections # label: 链接数 # - field: trafficIn diff --git a/plugins/lucky/__init__.py b/plugins/lucky/__init__.py index dce54eb..3159bbe 100644 --- a/plugins/lucky/__init__.py +++ b/plugins/lucky/__init__.py @@ -116,6 +116,7 @@ class Lucky(_PluginBase): expire_time = expire_time.split(' ')[0] logging.info( + f"Proxy Rules Total: {len(rules)}\n" f"Proxy Rules Enabled: {enabled_cnt}\n" f"Proxy Rules Closed: {closed_cnt}\n" f"Connections: {connections}\n" @@ -125,6 +126,7 @@ class Lucky(_PluginBase): f"SSL Expire Time: {expire_time}\n") return { + 'total_cnt': len(rules), 'enabled_cnt': enabled_cnt, 'closed_cnt': closed_cnt, 'ipaddr': ipaddr, @@ -152,7 +154,7 @@ class Lucky(_PluginBase): "path": "/lucky", "endpoint": self.lucky, "methods": ["GET"], - "summary": "Lucky", + "summary": "Lucky HomePage自定义API", "description": "Lucky", }]