diff --git a/admin/dashboard/templates/index.html b/admin/dashboard/templates/index.html index 4ca1fe1..a8a9376 100644 --- a/admin/dashboard/templates/index.html +++ b/admin/dashboard/templates/index.html @@ -106,26 +106,26 @@ - +

插件使用排行

- +

成功率分析

- +
- +

使用趋势

- +
@@ -133,9 +133,6 @@
-
-
系统状态
-
@@ -146,50 +143,56 @@
-
-
+
+
操作系统: - 加载中... + {% raw %}{{ systemInfo.os }} {{ systemInfo.os_version }}{% endraw %}
-
+
Python版本: - 加载中... + {% raw %}{{ systemInfo.python_version }}{% endraw %}
-
+
运行时间: - 加载中... + {% raw %}{{ formattedUptime }}{% endraw %}
-
-
+
+
CPU使用率: - 0% -
-
-
+ {% raw %}{{ systemInfo.cpu_usage }}{% endraw %}%
+ + -
+
内存使用率: - 0% -
-
-
+ {% raw %}{{ systemInfo.memory_usage }}{% endraw %}%
+ + -
+
磁盘使用率: - 0% -
-
-
+ {% raw %}{{ systemInfo.disk_usage }}{% endraw %}%
+ +
-
最后更新: -
+
最后更新: {% raw %}{{ systemInfo.timestamp }}{% endraw %}
@@ -228,10 +231,26 @@ } } }, + computed: { + // 计算属性:格式化的运行时间 + formattedUptime() { + const seconds = this.systemInfo.uptime; + const days = Math.floor(seconds / 86400); + const hours = Math.floor((seconds % 86400) / 3600); + const minutes = Math.floor((seconds % 3600) / 60); + + let result = ''; + if (days > 0) result += days + '天 '; + if (hours > 0 || days > 0) result += hours + '小时 '; + result += minutes + '分钟'; + + return result; + } + }, mounted() { this.currentView = '1'; this.loadData(); - // 添加加载系统信息 + // 加载系统信息 this.loadSystemInfo(); // 设置定时刷新系统信息(每30秒) this.systemInfoTimer = setInterval(this.loadSystemInfo, 30000); @@ -255,7 +274,6 @@ .then(response => { if (response.data.success) { this.systemInfo = response.data.data; - this.updateSystemInfoUI(); } }) .catch(error => { @@ -543,5 +561,28 @@ font-size: 16px; color: #606266; } + + /* 系统状态卡片样式 */ + .system-info-item { + margin-bottom: 15px; + } + + .system-info-row { + display: flex; + justify-content: space-between; + margin-bottom: 8px; + } + + .system-update-time { + text-align: right; + font-size: 12px; + color: #909399; + margin-top: 10px; + } + + /* 进度条样式调整 */ + .el-progress { + margin-bottom: 15px; + } {% endblock %} \ No newline at end of file