diff --git a/ROADMAP.md b/ROADMAP.md index c345ce8..618c961 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -13,7 +13,7 @@ ## P1 — 核心功能缺失 -- [ ] **内存分析** — `MEMORY USAGE` 扫描所有 key,虚拟化列表,按大小排序,暂停/恢复,大小过滤 +- [x] **内存分析** — `MEMORY USAGE` 扫描所有 key,虚拟化列表,按大小排序,暂停/恢复,大小过滤 - [ ] **命令日志** — 记录每次命令的耗时/连接/时间,最多 5000 条,只写模式过滤 - [ ] **自动更新** — electron-updater 集成,启动检查,下载进度,发行说明 - [ ] **多标签页** — 单连接支持同时打开 Status/Keys/CLI/SlowLog/内存分析/批量删除 多个标签 diff --git a/src/components/MainArea.vue b/src/components/MainArea.vue index d88202d..3c395ab 100644 --- a/src/components/MainArea.vue +++ b/src/components/MainArea.vue @@ -7,6 +7,7 @@ import StatusView from './StatusView.vue' import KeyBrowser from './KeyBrowser.vue' import CliView from './CliView.vue' import SlowLogView from './SlowLogView.vue' +import MemoryAnalysis from './MemoryAnalysis.vue' import SettingsView from './SettingsView.vue' const connStore = useConnectionStore() @@ -15,7 +16,7 @@ const { t } = useI18n() const props = defineProps<{ showSettings: boolean }>() const emit = defineEmits<{ 'update:showSettings': [v: boolean] }>() -type Tab = 'status' | 'keys' | 'cli' | 'slowlog' +type Tab = 'status' | 'keys' | 'cli' | 'slowlog' | 'memory' const activeTab = ref('status') watch( @@ -63,6 +64,14 @@ watch( {{ t('slowlog.title') }} +
JRD
diff --git a/src/components/MemoryAnalysis.vue b/src/components/MemoryAnalysis.vue new file mode 100644 index 0000000..f7b0c6e --- /dev/null +++ b/src/components/MemoryAnalysis.vue @@ -0,0 +1,267 @@ + + + + + diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts index 078e181..66a8bf5 100644 --- a/src/i18n/locales/en.ts +++ b/src/i18n/locales/en.ts @@ -138,6 +138,24 @@ export default { duration: 'Duration', command: 'Command', }, + memory: { + title: 'Memory Analysis', + scan: 'Start Scan', + pause: 'Pause', + resume: 'Resume', + stop: 'Stop', + scanning: 'Scanning...', + paused: 'Paused', + noData: 'No data', + key: 'Key', + size: 'Size', + type: 'Type', + totalSize: 'Total Size', + minSize: 'Min Size (KB)', + sortAsc: 'Ascending', + sortDesc: 'Descending', + scanned: '{n} keys scanned', + }, status: { title: 'Status', database: 'Database', diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index abfb912..65f6d3d 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -138,6 +138,24 @@ export default { duration: '耗时', command: '命令', }, + memory: { + title: '内存分析', + scan: '开始扫描', + pause: '暂停', + resume: '继续', + stop: '停止', + scanning: '扫描中...', + paused: '已暂停', + noData: '暂无数据', + key: '键名', + size: '大小', + type: '类型', + totalSize: '总大小', + minSize: '最小大小 (KB)', + sortAsc: '升序', + sortDesc: '降序', + scanned: '已扫描 {n} 个', + }, status: { title: '状态', database: '数据库',