1
0
forked from lxh/go-wxhelper

🎨 首页显示效果优化

This commit is contained in:
李寻欢 2024-04-24 15:49:17 +08:00
parent 1fca021b38
commit 448ac83514
2 changed files with 26 additions and 4 deletions

View File

@ -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

View File

@ -24,11 +24,13 @@
<dl class="mt-5 grid grid-cols-1 gap-5 sm:grid-cols-3">
<div class="overflow-hidden rounded-lg bg-white px-4 py-5 shadow sm:p-6">
<dt class="truncate text-sm font-medium text-gray-500">好友数量</dt>
<dd class="mt-1 text-3xl font-semibold tracking-tight text-gray-900">{{ .friendCount }}</dd>
<dd class="mt-1 text-2xl font-semibold tracking-tight text-gray-900">{{ .friendCount }}/{{ .friendWithoutCount }}</dd>
<dd class="mt-1 text-xs font-semibold tracking-tight text-red-300">通讯录/已删除</dd>
</div>
<div class="overflow-hidden rounded-lg bg-white px-4 py-5 shadow sm:p-6">
<dt class="truncate text-sm font-medium text-gray-500">群组数量</dt>
<dd class="mt-1 text-3xl font-semibold tracking-tight text-gray-900">{{ .groupCount }}</dd>
<dd class="mt-1 text-3xl font-semibold tracking-tight text-gray-900">{{ .groupCount }}/{{ .groupWithoutCount }}</dd>
<dd class="mt-1 text-xs font-semibold tracking-tight text-red-300">在群聊/已退出</dd>
</div>
<div class="overflow-hidden rounded-lg bg-white px-4 py-5 shadow sm:p-6">
<dt class="truncate text-sm font-medium text-gray-500">是否配置VNC</dt>