diff --git a/AGENTS.md b/AGENTS.md index 6cf9176..e4c0358 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -14,6 +14,9 @@ Fork of [AnotherRedisDesktopManager](https://github.com/qishibo/AnotherRedisDesk - **Module system:** `"type": "module"` (ESM) — main outputs `.js`, preload outputs `.mjs` - **Redis client:** ioredis 5 (main process only) - **Persistence:** electron-store + safeStorage (credentials) +- **Virtual scrolling:** @tanstack/vue-virtual (large list rendering) +- **Code editor:** @guolao/vue-monaco-editor (Monaco editor integration) +- **SSH tunnel:** ssh2 (SSH tunnel support for Redis connections) ## Commands @@ -64,8 +67,8 @@ Renderer (src/renderer/) ├── App.vue # Shell layout (TitleBar + Sidebar + MainArea + StatusBar) ├── env.d.ts # Vite client + *.vue / *.css module declarations ├── stores/ - │ ├── app.ts # theme, fontSize, scanCount - │ ├── connection.ts # connections CRUD, connect/disconnect, health check + │ ├── app.ts # theme, fontSize, zoom, fontFamily + │ ├── connection.ts # connections CRUD, connect/disconnect, health check, import/export │ └── key.ts # key list, scan, tree view, selected key data ├── components/ │ ├── layout/ # App shell @@ -90,13 +93,15 @@ Renderer (src/renderer/) │ │ ├── ZsetEditor.vue # sorted set with scores │ │ ├── StreamEditor.vue # stream entries │ │ └── ReJsonEditor.vue # JSON.GET / JSON.SET editing + │ ├── common/ # Shared components + │ │ └── VirtualScrollList.vue # virtual scrolling for large lists │ └── views/ # Tab content views │ ├── StatusView.vue # INFO dashboard with stat cards │ ├── CliView.vue # interactive terminal │ ├── SlowLogView.vue # slow log table │ ├── MemoryAnalysis.vue # MEMORY USAGE scan & sort │ ├── CommandLog.vue # command execution history - │ └── SettingsView.vue # theme, language, font + │ └── SettingsView.vue # theme, language, font, zoom ├── i18n/ │ ├── index.ts # useI18n composable │ └── locales/ @@ -106,7 +111,8 @@ Renderer (src/renderer/) │ ├── ko.ts # 한국어 │ └── de.ts # Deutsch ├── composables/ - │ └── useKeyboard.ts # keyboard shortcut handler + │ ├── useKeyboard.ts # keyboard shortcut handler + │ └── useTypeColor.ts # Redis type color mapping ├── styles/ │ ├── variables.css # CSS custom properties │ └── global.css # global overrides @@ -250,6 +256,27 @@ If output directory or file extensions change, update these paths accordingly. - `safeStorage` - OS-level encryption for credentials - All Redis operations go through typed IPC to main process +## Connection Features + +### SSH Tunnel +- TCP tunnel via ssh2 library +- Password or private key authentication +- Passphrase support for encrypted keys + +### Sentinel Mode +- Redis Sentinel support for high availability +- Configure sentinel host, port, and master name +- Automatic failover support + +### Cluster Mode +- Redis Cluster support +- Automatic slot routing +- Multi-node connection handling + +### TLS/SSL +- CA certificate, client certificate, and private key support +- Optional server certificate verification + ## Legacy The `legacy/` directory contains the old Vue 2 + Webpack 4 codebase. It is gitignored and not part of the v2 build. See `legacy/AGENTS.md` for its documentation. diff --git a/README.md b/README.md index 8057570..e46003b 100644 --- a/README.md +++ b/README.md @@ -2,16 +2,18 @@ 基于 Electron + Vue 3 + Vite 的现代 Redis 桌面管理器。 -> Fork 自 [AnotherRedisDesktopManager](https://github.com/qishibo/AnotherRedisDesktopManager)。 -> 旧版 Vue 2 代码库已归档至 [`legacy/`](legacy/)。 - ## 功能特性 ### 连接管理 - 创建、编辑、删除连接(主机/端口/密码) -- TLS/SSL 支持 +- **SSH 隧道** - 通过 SSH 安全连接 Redis +- **Sentinel 模式** - 支持 Redis Sentinel 高可用 +- **Cluster 模式** - 支持 Redis Cluster 集群 +- **TLS/SSL** - 支持 CA 证书、客户端证书和私钥 - **测试连接** - 保存前验证连接是否成功 - **导入/导出** - JSON 格式连接配置 +- **连接颜色** - 为连接设置自定义颜色 +- **连接复制** - 一键复制连接配置 - 健康检查 + 自动重连指示器 ### Key 浏览器 @@ -21,6 +23,8 @@ - 树形视图(按 key 分隔符分组) - 多选批量操作 - 批量删除(pipeline) +- **Key 导入/导出** - 批量导出/导入 key +- **内存分析** - 扫描并排序 key 内存占用 ### 类型编辑器 - **String** - 查看/编辑,自动 JSON 格式化 @@ -28,25 +32,30 @@ - **List** - 分页查看,支持推入/编辑/移除 - **Set** - 成员列表,支持过滤/添加/移除 - **Zset** - 有序集合,显示分数 -- **Stream** - 流数据查看,字段管理 +- **Stream** - 流数据查看,字段管理,消费者组支持 +- **ReJSON** - RedisJSON 模块支持(JSON.GET / JSON.SET) ### Key 操作 - **TTL** - 查看和编辑过期时间 - **重命名** - 支持存在性检查 - **复制键名** - 一键复制到剪贴板 - 单个/批量删除 +- **内存占用** - 查看单个 key 内存占用 ### 分析工具 -- **Redis CLI** - 交互式终端,支持命令历史 +- **Redis CLI** - 交互式终端,支持命令历史、事务、Pub/Sub、Monitor - **慢日志** - 查看慢命令及耗时 - **INFO 仪表板** - 服务器统计信息 +- **命令日志** - 记录所有执行的命令 - **数据库选择器** - 切换 DB 0-15 ### 设置 - **主题** - 深色、浅色、跟随系统 -- **语言** - English / 中文 +- **语言** - English / 中文 / 日本語 / 한국어 / Deutsch - **SCAN 数量** - 每次扫描的 key 数量 - **字体大小** - 可调节 +- **页面缩放** - 50% - 200% +- **字体族** - 可选择等宽字体 ### 快捷键 | 快捷键 | 功能 | @@ -73,6 +82,25 @@ npm run build:mac npm run build:win ``` +## 环境要求 + +- Node.js 18+ +- npm 或 yarn +- 对于 Linux 构建:可能需要额外的依赖(如 `libsecret-1-dev`) + +## 项目结构 + +``` +JRedisDesktop/ +├── src/ +│ ├── main/ # Electron 主进程 +│ ├── preload/ # 预加载脚本 +│ └── renderer/ # Vue 3 渲染进程 +├── build/ # 构建资源(图标等) +├── out/ # 构建输出 +└── release/ # 打包输出 +``` + ## 技术栈 - **主进程:** Electron 33 @@ -81,6 +109,9 @@ npm run build:win - **构建工具:** electron-vite + Vite 6 + TypeScript 5 - **Redis 客户端:** ioredis 5 - **持久化:** electron-store + safeStorage(加密凭据) +- **虚拟滚动:** @tanstack/vue-virtual(大数据量渲染) +- **代码编辑器:** Monaco Editor(通过 vue-monaco-editor) +- **SSH 隧道:** ssh2 ## 架构 @@ -97,10 +128,12 @@ Electron 主进程 (src/main/) 渲染进程 (src/renderer/src/) ├── stores/ # Pinia 状态管理(connection, key, app) ├── components/ # Vue 3 组件 - ├── i18n/ # 国际化(英文 + 中文) - └── composables/ # 组合式函数(useKeyboard) + │ ├── layout/ # 应用布局 + │ ├── connection/ # 连接管理 + │ ├── key/ # Key 浏览 + │ ├── editors/ # 类型编辑器 + │ ├── common/ # 通用组件(虚拟滚动) + │ └── views/ # 视图(CLI、慢日志、内存分析等) + ├── i18n/ # 国际化(英文、中文、日语、韩语、德语) + └── composables/ # 组合式函数(useKeyboard, useTypeColor) ``` - -## License - -MIT