refactor: simplify server stats widget system

Replaced complex drag-and-drop grid layout with simple checkbox-based
configuration and static responsive grid display.

- Removed react-grid-layout dependency and 6 related packages
- Simplified StatsConfig from complex Widget objects to simple array
- Added Statistics tab in HostManagerEditor for checkbox selection
- Refactored Server.tsx to use CSS Grid instead of ResponsiveGridLayout
- Simplified widget components by removing edit mode and size selection
- Deleted unused AddWidgetDialog and registry files
- Fixed statsConfig serialization in backend routes

Net result: -787 lines of code, cleaner architecture.
This commit is contained in:
ZacharyZcR
2025-10-09 12:51:13 +08:00
parent 5446875113
commit d87cabb708
14 changed files with 426 additions and 1230 deletions

View File

@@ -730,7 +730,10 @@
"folderRenamed": "Folder \"{{oldName}}\" renamed to \"{{newName}}\" successfully",
"failedToRenameFolder": "Failed to rename folder",
"movedToFolder": "Host \"{{name}}\" moved to \"{{folder}}\" successfully",
"failedToMoveToFolder": "Failed to move host to folder"
"failedToMoveToFolder": "Failed to move host to folder",
"statistics": "Statistics",
"enabledWidgets": "Enabled Widgets",
"enabledWidgetsDesc": "Select which statistics widgets to display for this host"
},
"terminal": {
"title": "Terminal",
@@ -1143,6 +1146,7 @@
"loadAverageNA": "Avg: N/A",
"cpuUsage": "CPU Usage",
"memoryUsage": "Memory Usage",
"diskUsage": "Disk Usage",
"rootStorageSpace": "Root Storage Space",
"of": "of",
"feedbackMessage": "Have ideas for what should come next for server management? Share them on",

View File

@@ -752,7 +752,10 @@
"folderRenamed": "文件夹\"{{oldName}}\"已成功重命名为\"{{newName}}\"",
"failedToRenameFolder": "重命名文件夹失败",
"movedToFolder": "主机\"{{name}}\"已成功移动到\"{{folder}}\"",
"failedToMoveToFolder": "移动主机到文件夹失败"
"failedToMoveToFolder": "移动主机到文件夹失败",
"statistics": "统计",
"enabledWidgets": "已启用组件",
"enabledWidgetsDesc": "选择要为此主机显示的统计组件"
},
"terminal": {
"title": "终端",
@@ -1124,6 +1127,7 @@
"loadAverageNA": "平均: N/A",
"cpuUsage": "CPU 使用率",
"memoryUsage": "内存使用率",
"diskUsage": "磁盘使用率",
"rootStorageSpace": "根目录存储空间",
"of": "的",
"feedbackMessage": "对服务器管理的下一步功能有想法?在这里分享吧",