From 448ac83514e699263b5dc6a02dd7d18a387689bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AF=BB=E6=AC=A2?= Date: Wed, 24 Apr 2024 15:49:17 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E9=A6=96=E9=A1=B5=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=95=88=E6=9E=9C=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/pages.go | 24 ++++++++++++++++++++++-- views/index.html | 6 ++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/app/pages.go b/app/pages.go index c1ab8b7..13d5fc7 100644 --- a/app/pages.go +++ b/app/pages.go @@ -20,8 +20,28 @@ func Index(ctx *gin.Context) { if err != nil { result["msg"] = fmt.Sprintf("数据获取失败: %s", err.Error()) } - result["friendCount"] = len(friends) - result["groupCount"] = len(groups) + var in, notIn int + for _, d := range friends { + if d.IsOk { + in++ + } else { + notIn++ + } + } + result["friendCount"] = in + result["friendWithoutCount"] = notIn + + var gin, gnotIn int + for _, d := range groups { + if d.IsOk { + gin++ + } else { + gnotIn++ + } + } + result["groupCount"] = gin + result["groupWithoutCount"] = gnotIn + result["vnc"] = config.Conf.Wechat.VncUrl result["isVnc"] = config.Conf.Wechat.VncUrl != "" result["aiModels"] = config.Conf.Ai.Models diff --git a/views/index.html b/views/index.html index 53988cc..d0bfbf7 100644 --- a/views/index.html +++ b/views/index.html @@ -24,11 +24,13 @@
好友数量
-
{{ .friendCount }}
+
{{ .friendCount }}/{{ .friendWithoutCount }}
+
通讯录/已删除
群组数量
-
{{ .groupCount }}
+
{{ .groupCount }}/{{ .groupWithoutCount }}
+
在群聊/已退出
是否配置VNC