Просмотр исходного кода

chore: auto bump version and changelog [skip ci]

iwt 2 месяцев назад
Родитель
Сommit
e44134e1e0

+ 73 - 0
cfc-backend/src/main/java/com/etotem/cfc/controller/admin/AdminSystemController.java

@@ -0,0 +1,73 @@
+package com.etotem.cfc.controller.admin;
+
+import com.etotem.cfc.common.Result;
+import io.swagger.v3.oas.annotations.Operation;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.lang.management.ManagementFactory;
+import java.lang.management.MemoryMXBean;
+import java.lang.management.OperatingSystemMXBean;
+import java.lang.management.RuntimeMXBean;
+import java.util.HashMap;
+import java.util.Map;
+
+@RestController
+@RequestMapping("/api/system")
+public class AdminSystemController {
+
+    @Operation(summary = "服务器运行状态")
+    @PostMapping("/health")
+    public Result<Map<String, Object>> health() {
+        Map<String, Object> data = new HashMap<>();
+
+        // JVM uptime
+        RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean();
+        long uptimeMs = runtimeMXBean.getUptime();
+        data.put("uptime", formatUptime(uptimeMs));
+
+        // JVM start time
+        data.put("startTime", new java.util.Date(runtimeMXBean.getStartTime()).toString());
+
+        // Memory
+        MemoryMXBean memoryMXBean = ManagementFactory.getMemoryMXBean();
+        long heapUsed = memoryMXBean.getHeapMemoryUsage().getUsed();
+        long heapMax = memoryMXBean.getHeapMemoryUsage().getMax();
+        data.put("memUsed", formatBytes(heapUsed));
+        data.put("memMax", formatBytes(heapMax));
+        data.put("memUsagePercent", heapMax > 0 ? String.format("%.1f", (double) heapUsed / heapMax * 100) : "0");
+
+        // OS info
+        OperatingSystemMXBean osMXBean = ManagementFactory.getOperatingSystemMXBean();
+        int cpuCores = osMXBean.getAvailableProcessors();
+        double systemLoadAvg = osMXBean.getSystemLoadAverage();
+        data.put("cpuCores", cpuCores);
+        data.put("cpuLoad", systemLoadAvg >= 0 ? String.format("%.2f", systemLoadAvg) : "N/A");
+        data.put("cpuUsagePercent", systemLoadAvg >= 0 && cpuCores > 0 ? String.format("%.1f", systemLoadAvg / cpuCores * 100) : "N/A");
+
+        // Java version
+        data.put("javaVersion", System.getProperty("java.version"));
+        data.put("osName", osMXBean.getName() + " " + osMXBean.getArch());
+        data.put("osVersion", osMXBean.getVersion());
+
+        return Result.success(data);
+    }
+
+    private String formatUptime(long ms) {
+        long seconds = ms / 1000;
+        long days = seconds / 86400;
+        long hours = (seconds % 86400) / 3600;
+        long minutes = (seconds % 3600) / 60;
+        if (days > 0) return days + "天" + hours + "小时" + minutes + "分钟";
+        if (hours > 0) return hours + "小时" + minutes + "分钟";
+        return minutes + "分钟";
+    }
+
+    private String formatBytes(long bytes) {
+        if (bytes < 1024) return bytes + "B";
+        if (bytes < 1024 * 1024) return String.format("%.1fKB", bytes / 1024.0);
+        if (bytes < 1024 * 1024 * 1024) return String.format("%.1fMB", bytes / (1024.0 * 1024));
+        return String.format("%.2fGB", bytes / (1024.0 * 1024 * 1024));
+    }
+}

+ 1 - 1
cfc-web/.last_build_commit

@@ -1 +1 @@
-afa236deee2705de265ce3ed5ced592b2422ef02
+b024dd7913513b9e9e744b1b4769d2ca2bf71566

+ 20 - 0
cfc-web/CHANGELOG.md

@@ -1,6 +1,26 @@
 # 更新日志 (Changelog)
 
 此文件记录所有构建版本的变更。
+## v1.0.83 (2026-07-10)
+
+### 新功能
+- tongue diagnosis as health report type
+
+### 其他
+- - report-confirm.vue: add tongue indicators card, route confirm to confirmTongue
+- - report-list.vue: add tongue badge display
+- - body/index.vue: redirect tongue entry to report-upload?reportType=tongue
+- - tongue-index.vue: deprecate — redirect to new report flow
+- - api.js: parseReportPreview accepts optional type param
+- 
+
+
+## v1.0.82 (2026-07-10)
+
+### 工程化
+- auto bump version and changelog [skip ci]
+
+
 ## v1.0.81 (2026-07-10)
 
 ### 新功能

+ 2 - 2
cfc-web/package-lock.json

@@ -1,12 +1,12 @@
 {
   "name": "cfc-web",
-  "version": "1.0.80",
+  "version": "1.0.82",
   "lockfileVersion": 3,
   "requires": true,
   "packages": {
     "": {
       "name": "cfc-web",
-      "version": "1.0.80",
+      "version": "1.0.82",
       "dependencies": {
         "@wangeditor/editor": "^5.1.23",
         "@wangeditor/editor-for-vue": "^1.0.2",

+ 1 - 1
cfc-web/package.json

@@ -1,6 +1,6 @@
 {
   "name": "cfc-web",
-  "version": "1.0.81",
+  "version": "1.0.83",
   "private": true,
   "scripts": {
     "dev": "vue-cli-service serve",

+ 9 - 0
cfc-web/src/api/admin.js

@@ -848,6 +848,15 @@ export function deleteBloodTypeConfig(id) {
   })
 }
 
+// ========== 服务器运行状态 ==========
+
+export function getSystemHealth() {
+  return request({
+    url: '/api/system/health',
+    method: 'post'
+  })
+}
+
 // 关系类型管理
 export function listRelationshipTypes() {
   return request({

+ 13 - 1
cfc-web/src/views/Dashboard.vue

@@ -308,7 +308,19 @@ export default {
   trendData: { familyTrend: {}, userTrend: {} },
   trendChart: null,
   memberChart: null,
-  resizeHandler: null
+  resizeHandler: null,
+  changelogVisible: false,
+  changelogContent: '',
+  changelogLoading: false,
+  serverHealth: {
+    uptime: '加载中...',
+    memUsed: '--',
+    memMax: '--',
+    memUsagePercent: '--',
+    cpuCores: '--',
+    cpuLoad: '--',
+    cpuUsagePercent: '--'
+  }
   }
   },
   computed: {