From 0a43e4672e47c4754f563a2f4f7a97278c7306a7 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Mon, 24 Mar 2025 17:57:28 +0800 Subject: [PATCH] style: format codes --- astrbot/dashboard/routes/stat.py | 9 ++------- dashboard/src/views/PlatformPage.vue | 6 +++--- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/astrbot/dashboard/routes/stat.py b/astrbot/dashboard/routes/stat.py index 04b2d21ee..e73c09455 100644 --- a/astrbot/dashboard/routes/stat.py +++ b/astrbot/dashboard/routes/stat.py @@ -65,14 +65,9 @@ class StatRoute(Route): stat_dict = stat.__dict__ - # 获取CPU使用率 - 修复CPU始终为0的问题 - process = psutil.Process() - # 获取系统CPU使用率而不是进程CPU使用率 cpu_percent = psutil.cpu_percent(interval=0.5) - - # 获取线程数 thread_count = threading.active_count() - + # 获取插件信息 plugins = self.core_lifecycle.star_context.get_all_stars() plugin_info = [] @@ -80,7 +75,7 @@ class StatRoute(Route): info = { "name": getattr(plugin, "name", plugin.__class__.__name__), "version": getattr(plugin, "version", "1.0.0"), - "is_enabled": True + "is_enabled": True, } plugin_info.append(info) diff --git a/dashboard/src/views/PlatformPage.vue b/dashboard/src/views/PlatformPage.vue index 38fa08e68..1af951306 100644 --- a/dashboard/src/views/PlatformPage.vue +++ b/dashboard/src/views/PlatformPage.vue @@ -96,7 +96,7 @@ - + {{ updatingMode ? 'mdi-pencil' : 'mdi-plus' }} @@ -105,12 +105,12 @@ - + - + mdi-refresh 刷新