feat: 实现Redis集成协议并重构项目控制台

refactor(backend): 重构后端服务以支持Redis协议
feat(backend): 添加Redis客户端和服务模块
feat(backend): 实现命令和日志路由处理Redis交互
refactor(frontend): 重构前端状态管理和组件结构
feat(frontend): 实现基于Redis的日志和命令功能
docs: 添加Redis集成协议文档
chore: 更新ESLint配置和依赖
This commit is contained in:
2026-01-12 19:55:51 +08:00
parent 95a4613965
commit 19e65d78dc
29 changed files with 1061 additions and 349 deletions

View File

@@ -0,0 +1,15 @@
## MODIFIED Requirements
### Requirement: Command Sending to Redis
The system SHALL send commands to a per-target Redis key.
#### Scenario: Console enqueues a command for a target project
- **WHEN** the user sends a command from the console
- **THEN** the backend SHALL append a JSON message to Redis LIST key `${targetProjectName}_控制`
- **AND** the JSON message SHALL represent the command payload (an object)
#### Scenario: Target project consumes a command
- **WHEN** a target project listens for commands
- **THEN** it SHALL consume messages from `${projectName}_控制` as JSON objects
- **AND** it SHOULD use Redis LIST queue semantics (producer `RPUSH`, consumer `BLPOP`)
- **AND** if `BLPOP` is not available, it MAY use a `LRANGE` + `LTRIM` compatibility pattern

View File

@@ -0,0 +1,14 @@
## MODIFIED Requirements
### Requirement: Log Reading from Redis
The system SHALL read log records from per-project Redis keys.
#### Scenario: External project writes console logs
- **WHEN** an external project emits debug/error information
- **THEN** it SHALL append entries to a Redis LIST key named `${projectName}_项目控制台`
- **AND** each entry SHALL be a JSON string representing a log record
#### Scenario: Server reads project console logs
- **WHEN** the server is configured to show a given project
- **THEN** it SHALL read entries from `${projectName}_项目控制台`
- **AND** it SHALL present them in the console UI with timestamp, level and message

View File

@@ -0,0 +1,9 @@
## ADDED Requirements
### Requirement: Per-Project Status Key
The system SHALL standardize a per-project Redis status key for connected projects.
#### Scenario: External project writes status
- **WHEN** an external project integrates with this console
- **THEN** it SHALL write a Redis STRING key named `${projectName}_项目状态`
- **AND** the value SHALL be one of: `在线`, `离线`, `故障`, `报错`