Commit Graph

134 Commits

Author SHA1 Message Date
Jokul bb3adeb688 perf: increase SCAN_COUNT to 1000 for faster memory scan
Virtual scroll now handles large batches without lag, so we can
increase the per-iteration key count from 200 to 1000. This reduces
the number of SCAN iterations and IPC round-trips by 5x.
2026-07-12 10:11:58 +08:00
Jokul 9c16dbdb15 perf: replace el-table with virtual scroll for memory analysis
- Replace el-table (renders all DOM rows) with lightweight virtual scroll
  (only renders visible rows + buffer). This is the key fix for scan lag.
- Reduce flush interval from 300ms to 100ms (matches legacy setTimeout(100))
- Virtual list uses fixed 36px row height, calculates visible range from
  scrollTop, and translates only the rendered window.
- Stripe rows via CSS alt class instead of Element Plus stripe prop.
- Column layout: flex-based with key (flex:1), type (80px), size (100px).
2026-07-12 10:07:03 +08:00
Jokul c8eeb7c0b9 fix: memory analysis dark mode stripe, scan speed, and NaN total size
- Dark mode: add --el-fill-color-lighter and --el-table-current-row-bg-color
  to .el-table overrides so striped rows render with proper contrast
- Scan speed: add batchKeyMemoryUsage pipeline (TYPE + MEMORY USAGE in one
  Redis round-trip instead of 2×N sequential IPC calls)
- Scan speed: decouple scan loop from UI via 300ms flush buffer, keeping
  el-table re-render frequency capped at ~3/s
- Scan speed: use shallowRef for entries to skip deep reactive proxies
- NaN fix: handle ioredis stringNumbers:true by converting via Number()
  instead of typeof === 'number'
- formatSize: guard against non-finite input, add TB/PB units
2026-07-12 10:01:30 +08:00
Jokul 72967c45e9 更新版本号 2026-07-12 00:42:49 +08:00
Jokul c6265fdaf5 fix: 模板中通过变量引用 __APP_VERSION__ 全局常量 2026-07-12 00:40:49 +08:00
Jokul faedfd7fa3 fix: StatusBar 版本号改为从 package.json 动态注入
- electron.vite.config.ts 读取 package.json 注入 __APP_VERSION__ 全局常量
- StatusBar.vue 使用 __APP_VERSION__ 替代硬编码 v2.0
- env.d.ts 添加 __APP_VERSION__ 类型声明
2026-07-12 00:37:06 +08:00
Jokul 19672045d6 fix: StatusBar 版本号改为从 package.json 动态读取 2026-07-12 00:31:57 +08:00
Jokul 83159151b9 fix: DbSelector 连接后自动选择第一个有数据的 DB,切换 DB 时重新加载键树
- 新增 getDefaultDb(): 优先恢复 lastDbMap > 第一个有数据的 DB > DB0
- onMounted 执行 DB 选择(覆盖首次连接和右键重连场景)
- activeId watcher 改为完整 DB 选择流程(不再硬编码 DB0)
- isConnected watcher 精简为仅加载自定义名称(避免竞态重复调用)
- switchDb() 新增 scanKeys 重新加载键树
2026-07-12 00:28:14 +08:00
Jokul 76c9758f0a 更改切换redis连接操作方式 2026-07-12 00:01:01 +08:00
Jokul b4aab76141 fix: DbSelector 数据库 key 数量使用 INFO keyspace 直接获取
- 改用 INFO keyspace 命令替代解析完整 INFO 输出,避免正则匹配 Keyspace 段失败
- activeId 变化时重新获取 DB 数量和 key 计数
- expose refreshDbCounts 方法供父组件调用
2026-07-11 23:03:53 +08:00
Jokul b7e9c80022 fix: 连接断开后 IPC handler 不再报 Client null / Connection closed
- connection.ts: 新增 requireClient(id),状态非 ready 时抛明确错误
- connection.ts: Redis client 监听 close 事件自动从 Map 清理
- 8 个 redis 模块: getClient + null check 统一替换为 requireClient
- sentinel/cluster/普通连接三种模式均添加 close 自动清理
2026-07-11 22:31:55 +08:00
Jokul 0ffe3ae83f feat: 连接相关提示信息国际化
- 右键连接: 成功/失败弹出 ElMessage 提示
- 测试连接: testSuccess/testFailed 替换硬编码
- 保存连接: created/updated/saveFailed 替换硬编码
- 导入/导出: exported/imported/importTitle 替换硬编码
- connection store: serverInfoUnavailable/connectFailed 国际化
- 新增 11 个 i18n key (5 语言): hostRequired, nameHostRequired,
  connectSuccess, connectFailed, created, updated, saveFailed,
  exported, importTitle, imported, serverInfoUnavailable
2026-07-11 22:15:56 +08:00
Jokul 19b5a3d1d0 fix: key 类型为 none 时显示过期提示并自动移除失效 key
- KeyDetail: 新增 'none' 类型专用视图,显示过期提示 + 刷新按钮
- key store: TYPE 返回 none 时自动从列表移除失效 key 并重建 tree
- 新增 i18n keyExpired 多语言 (zh-CN/en/ja/ko/de)
2026-07-11 21:44:08 +08:00
Jokul 3dea59f703 refactor: 组件按功能分组到子目录
components/ 拆分为 5 个子目录:
- layout/       TitleBar, StatusBar, Sidebar, MainArea
- connection/   ConnectionList, ConnectionCard, NewConnectionDialog
- key/          KeyBrowser, KeyList, KeyDetail, DbSelector
- editors/      String/Hash/List/Set/Zset/Stream/ReJson Editor
- views/        StatusView, CliView, SlowLogView, MemoryAnalysis, CommandLog, SettingsView

更新 4 个文件的跨目录引用 (App.vue, Sidebar, MainArea, KeyDetail)
AGENTS.md 架构树同步更新
2026-07-11 21:21:47 +08:00
Jokul 12134ec896 fix: tooltip 浅色模式不可见 - 覆盖 Element Plus CSS 变量
根因: .el-popper 全局规则覆盖了 tooltip 背景为浅色, 但 is-dark 类
仍将文字设为白色。现在同时覆盖 --el-text-color-primary 和
--el-bg-color 变量, 确保 tooltip 背景和文字都有对比度。
2026-07-11 21:15:44 +08:00
Jokul 3142f84334 fix: tooltip 文字颜色与背景同色 - 精确匹配 is-dark/is-light 选择器 2026-07-11 21:10:07 +08:00
Jokul ee619589ac ux: 优化 Key 搜索区布局和操作逻辑
- 去掉 MATCH 前缀标签, 改为搜索图标 (Search icon prefix)
- Go 按钮改为搜索图标按钮, 带 tooltip 说明通配符用法
- Filter 输入框加 Filter 图标前缀, 与扫描区分
- placeholder 更新: '扫描 Key (如 user:*, 支持 * ?)'
- 新增 scanHint i18n (5 语言): 说明 * ? 通配符和回车扫描
2026-07-11 21:03:04 +08:00
Jokul f3af1e415a fix: MATCH 前缀背景色跟随深色/浅色主题切换 2026-07-11 20:50:55 +08:00
Jokul 464a40840a 紧凑布局 2026-07-11 17:54:51 +08:00
Jokul 0b7b512094 调整连接信息弹框样式以及国际化 2026-07-11 17:38:23 +08:00
Jokul a49d088540 中文名称 2026-07-11 17:10:07 +08:00
Jokul 9188829eae 调整redis连接展开收缩按钮样式 2026-07-11 17:01:10 +08:00
Jokul ca10707fbf fix: 加载更多按钮浅色模式文字不可见 - 去掉 text 属性 2026-07-11 16:34:42 +08:00
Jokul 1831acc7f0 fix: 树状视图深层级节点支持水平滚动 2026-07-11 16:32:27 +08:00
Jokul 392c64fc4a fix: WRONGTYPE 根因 - selectedKey 在类型加载前设置导致竞争
KeyList.selectKey 在调用 loadKeyData 之前设置了 selectedKey,
触发编辑器 watch 时 selectedType 还是上一个 key 的类型。
如果上一个 key 是 set 而新 key 不是, SetEditor 会对新 key
调用 SMEMBERS 导致 WRONGTYPE。

loadKeyData 内部已在校验类型后设置 selectedKey,
KeyList 中的提前设置是多余且有害的, 移除即可。
2026-07-11 16:30:07 +08:00
Jokul a20730f1e5 feat: 键 tab 自动打开, 去掉右上角键按钮
- keys tab 和 status tab 一样不可关闭 (closable: false)
- 连接成功时自动打开 status + keys 两个 tab
- 右上角按钮组移除键按钮
2026-07-11 16:23:12 +08:00
Jokul 8dfd3aecad hash的保存和删除按钮宽度修改 2026-07-11 16:13:44 +08:00
Jokul ff83315b64 style: HashEditor 按钮一排显示 + 颜色对比 + TTL 内联编辑
- 去掉设置 TTL 按钮, TTL 列改为 el-input-number 内联编辑
- saveField 保存时一并提交 TTL (HEXPIRE)
- 保存和删除按钮改为一排显示 (列宽 120px)
- 按钮从 text 改为 outline 样式, 确保浅色模式下文字可见
- 移除 setFieldTtl 函数和 .field-ttl 样式
2026-07-11 16:06:17 +08:00
Jokul 53ffa1043c style: HashEditor 表格高度适配 + 文字颜色对比
- max-height=400 改为 height=100%, 表格填满剩余空间
- hash-table-wrap overflow hidden + min-height:0 配合 flex 布局
- 表格正文文字用 --text-primary (深色模式下白色)
- 表头用 --text-secondary + --bg-tertiary 背景
- 行悬停用 --bg-hover
- 输入框文字用 --text-primary 确保可读性
2026-07-11 15:58:37 +08:00
Jokul 78695c0b7f fix: WRONGTYPE 错误处理 - key 类型变更时不崩溃
- loadKeyData: 类型特定命令 (SCARD/LLEN 等) 失败时重新获取 key 类型,
  避免显示错误的编辑器
- SetEditor.loadMembers: 添加 catch 块, WRONGTYPE 时清空成员列表而非
  抛出未捕获异常
2026-07-11 15:52:33 +08:00
Jokul 99f8a8b250 fix: keyStore.selectedType (string | null) 传参类型不匹配 2026-07-11 15:44:13 +08:00
Jokul 54350b152e fix: 移除空 CSS 规则 .leaf-item 2026-07-11 15:42:31 +08:00
Jokul a782180dd3 Revert "feat: 树状视图路径压缩 - 单子节点文件夹自动合并"
This reverts commit ccb91731fc.
2026-07-11 15:37:33 +08:00
Jokul ccb91731fc feat: 树状视图路径压缩 - 单子节点文件夹自动合并
文件夹只有 1 个子节点时合并名称, 避免不必要的层级展开:
- a:b:c:d (单个 key) 直接显示为 a:b:c:d 而非 4 层嵌套
- a:b:c + a:b:d 仍展开为 a > b > {c, d} (b 有 2 个子节点)
- a:b:c + a:d:e 显示为 a > {b:c, d:e} (b/d 各 1 子节点, 合并)
2026-07-11 15:35:06 +08:00
Jokul 4305773f0d refactor: KeyList 移除列表模式, 只保留树状模式
- 移除 viewMode、虚拟滚动 (useVirtualizer)、scrollRef
- 移除列表视图模板和样式 (.key-flat-list, .key-item 等)
- 移除工具栏的列表/树状切换按钮
- 树状叶子节点新增多选 checkbox (原先只有列表模式有)
- 保留 .key-checkbox 样式供树状多选使用
2026-07-11 15:30:56 +08:00
Jokul 5a479d416e refactor: Scan Count 从全局设置移到连接配置
- ConnectionConfig 新增 scanCount 字段 (默认 100)
- NewConnectionDialog 基本信息区新增 Scan Count 输入框
- key.ts 改为从 activeConnection.scanCount 读取
- SettingsView 移除 Scan Count 设置项
- app store 移除 scanCount 和 setScanCount
- 主进程 store ConnectionConfig 同步新增字段
2026-07-11 15:22:58 +08:00
Jokul ac0e6af233 fix: key scan 使用 app store 的 scanCount 设置替代硬编码 100 2026-07-11 15:18:21 +08:00
Jokul fd40207af5 fix: 树状视图展开文件夹为空 - 递归拍平渲染
原模板只遍历 treeData 根级节点, 从不渲染 node.children, 导致展开后为空。
改为 flattenedTree computed 将树拍平为列表:
- 只包含已展开文件夹的子节点
- 每项带 level 用于缩进 (paddingLeft)
- 文件夹和叶子节点在列表中按正确顺序排列
- 叶子节点支持 active/selected 高亮和右键菜单
2026-07-11 15:13:51 +08:00
Jokul 4602ec5979 fix: vItem.key 类型 Key (含 bigint) 转为 String 兼容 Vue :key 2026-07-11 15:10:25 +08:00
Jokul 16175a4635 fix: 移除渲染进程中的 Buffer 调用, 改用浏览器兼容的 hex 转换
- binary.ts 新增 strToHex/hexToStr/binaryToHex/hexToBinary 四个函数
- KeyList.vue 导入导出功能用这些函数替代 Buffer.from()
- 渲染进程无 Node.js 访问权限, 不应使用 Buffer 全局对象
2026-07-11 15:09:23 +08:00
Jokul 8f6bf7841c fix: KeyList useVirtualizer getScrollElement 类型不匹配 (undefined -> null) 2026-07-11 15:06:55 +08:00
Jokul f6b85106a2 style: 优化连接弹窗 - 分区折叠 + 视觉层次
- 基本连接信息始终显示, 带卡片背景和图标标题
- TLS/Sentinel/Cluster/SSH 改为可折叠面板, 默认折叠
- 折叠标题显示已启用标签 (Enabled tag)
- 内联样式替换为 CSS 类 (.file-input-row, .form-input)
- 弹窗宽度 520px -> 580px
- 深色/浅色主题适配
2026-07-11 14:55:39 +08:00
Jokul 6be62e0fe6 style: Key Statistics 表格列宽合理分配, 全部 min-width 拉满 2026-07-11 14:36:35 +08:00
Jokul 0d55b10822 fix: Key Statistics 表格宽度拉满 2026-07-11 14:34:13 +08:00
Jokul 823652e418 fix: 配置 renderer publicDir 指向项目根 public/ 2026-07-11 14:24:28 +08:00
Jokul c68306b26b feat: 标题栏和占位图使用 icon.svg 替代 JRD 文字 2026-07-11 14:22:07 +08:00
Jokul 5da3462131 fix: 移除 tsconfig.web.json 中已弃用的 baseUrl 2026-07-11 01:03:44 +08:00
Jokul 56e0b05b6b fix: Linux 开发模式任务栏图标与 VS Code 归为一组
开发模式下 electron 进程 WM_CLASS 默认为 "Electron",导致桌面环境
将其与其他 Electron 应用(如 VS Code)归为一组并使用其图标。
在 app.whenReady 前调用 app.setName('JRedisDesktop') 修正 WM_CLASS。
2026-07-11 01:00:29 +08:00
Jokul d804e377a3 fix: 右键菜单删除项使用 common.delete i18n key 2026-07-11 00:33:21 +08:00
Jokul 260cbb36d0 fix: 右键删除国际化 + 移除连接卡片左键事件
- 修复删除确认弹窗使用正确的 i18n key (connection.deleteConfirm)
- 删除按钮使用 common.delete 而非不存在的 connection.delete
- 新增 switchTo i18n key (5 种语言)
- ConnectionCard 移除 @click 左键事件
- 右键菜单新增「切换到」选项 (已连接但非活跃时显示)
2026-07-11 00:30:47 +08:00