From fd7aa3b759f676a3e2ec683d9f1a972bcbe4495b Mon Sep 17 00:00:00 2001 From: jxxghp Date: Wed, 26 Jul 2023 18:13:16 +0800 Subject: [PATCH] fix plugin --- app/plugins/autosignin/__init__.py | 57 ++++++----- app/plugins/sitestatistic/__init__.py | 140 ++++++++++++++++++++++++++ 2 files changed, 173 insertions(+), 24 deletions(-) diff --git a/app/plugins/autosignin/__init__.py b/app/plugins/autosignin/__init__.py index 9d1fef85..1e397a63 100644 --- a/app/plugins/autosignin/__init__.py +++ b/app/plugins/autosignin/__init__.py @@ -276,30 +276,30 @@ class AutoSignIn(_PluginBase): break if sign_data: contents = [ - { - 'component': 'tr', - 'props': { - 'class': 'text-sm' - }, - 'content': [ - { - 'component': 'td', - 'props': { - 'class': 'whitespace-nowrap break-keep' - }, - 'text': current_day - }, - { - 'component': 'td', - 'text': data.get("site") - }, - { - 'component': 'td', - 'text': data.get("status") - } - ] - } for data in sign_data - ] + { + 'component': 'tr', + 'props': { + 'class': 'text-sm' + }, + 'content': [ + { + 'component': 'td', + 'props': { + 'class': 'whitespace-nowrap break-keep' + }, + 'text': current_day + }, + { + 'component': 'td', + 'text': data.get("site") + }, + { + 'component': 'td', + 'text': data.get("status") + } + ] + } for data in sign_data + ] else: contents = [ { @@ -331,14 +331,23 @@ class AutoSignIn(_PluginBase): 'content': [ { 'component': 'th', + 'props': { + 'class': 'text-start ps-4' + }, 'text': '日期' }, { 'component': 'th', + 'props': { + 'class': 'text-start ps-4' + }, 'text': '站点' }, { 'component': 'th', + 'props': { + 'class': 'text-start ps-4' + }, 'text': '状态' } ] diff --git a/app/plugins/sitestatistic/__init__.py b/app/plugins/sitestatistic/__init__.py index a51fcc47..e060e72f 100644 --- a/app/plugins/sitestatistic/__init__.py +++ b/app/plugins/sitestatistic/__init__.py @@ -299,6 +299,57 @@ class SiteStatistic(_PluginBase): total_seed_size = sum([data.get("seeding_size") for data in stattistic_data.values() if data.get("seeding_size")]) + # 站点数据明细 + site_trs = [ + { + 'component': 'tr', + 'props': { + 'class': 'text-sm' + }, + 'content': [ + { + 'component': 'td', + 'props': { + 'class': 'whitespace-nowrap break-keep' + }, + 'text': site + }, + { + 'component': 'td', + 'text': data.get("username") + }, + { + 'component': 'td', + 'text': data.get("user_level") + }, + { + 'component': 'td', + 'text': StringUtils.str_filesize(data.get("upload")) + }, + { + 'component': 'td', + 'text': StringUtils.str_filesize(data.get("download")) + }, + { + 'component': 'td', + 'text': data.get('ratio') + }, + { + 'component': 'td', + 'text': data.get('bonus') + }, + { + 'component': 'td', + 'text': data.get('seeding') + }, + { + 'component': 'td', + 'text': StringUtils.str_filesize(data.get('seeding_size')) + } + ] + } for site, data in stattistic_data.items() if not data.get("err_msg") + ] + # 拼装页面 return [ { @@ -575,6 +626,95 @@ class SiteStatistic(_PluginBase): ] } ] + }, + # 各站点数据明细 + { + 'component': 'VCol', + 'props': { + 'cols': 12, + }, + 'content': [ + { + 'component': 'VTable', + 'props': { + 'hover': True + }, + 'content': [ + { + 'component': 'thead', + 'content': [ + { + 'component': 'th', + 'props': { + 'class': 'text-start ps-4' + }, + 'text': '站点' + }, + { + 'component': 'th', + 'props': { + 'class': 'text-start ps-4' + }, + 'text': '用户名' + }, + { + 'component': 'th', + 'props': { + 'class': 'text-start ps-4' + }, + 'text': '用户等级' + }, + { + 'component': 'th', + 'props': { + 'class': 'text-start ps-4' + }, + 'text': '上传量' + }, + { + 'component': 'th', + 'props': { + 'class': 'text-start ps-4' + }, + 'text': '下载量' + }, + { + 'component': 'th', + 'props': { + 'class': 'text-start ps-4' + }, + 'text': '分享率' + }, + { + 'component': 'th', + 'props': { + 'class': 'text-start ps-4' + }, + 'text': '魔力值' + }, + { + 'component': 'th', + 'props': { + 'class': 'text-start ps-4' + }, + 'text': '做种数' + }, + { + 'component': 'th', + 'props': { + 'class': 'text-start ps-4' + }, + 'text': '做种体积' + } + ] + }, + { + 'component': 'tbody', + 'content': site_trs + } + ] + } + ] } ] }