1
0

fix: 启动参数 duration 候选值对齐后端标准格式

前端 Select 使用 Go time.Duration.String() 标准字符串作为 value,
与后端查询/保存响应保持一致,解决保存后反显不匹配的问题。
This commit is contained in:
2026-05-08 14:18:09 +08:00
parent 6b00045f4e
commit c524e8f928
9 changed files with 197 additions and 16 deletions

View File

@@ -248,7 +248,7 @@ server 和 desktop 发布产物自包含运行时数据库迁移资源(通过
- **Desktop 模式**:查询返回配置文件编辑视图(`~/.nex/config.yaml` + 默认值),允许保存到配置文件,保存后当前运行服务不受影响,需重启 Desktop 生效
- **Server 模式**:查询返回当前运行有效配置,保存请求始终返回 403
响应包含 `mode``editable``config_path``restart_required` 元数据和完整启动参数配置。Duration 字段使用字符串格式(如 `30s``1h`
响应包含 `mode``editable``config_path``restart_required` 元数据和完整启动参数配置。Duration 字段使用 Go `time.Duration.String()` 标准字符串格式(如 `30s``1m0s``1h0m0s`);配置文件中用户可手写任意合法 Go duration 字符串(如 `1h``30m`),保存时系统会统一为标准格式
#### 版本信息
- `GET /api/version` - 获取后端构建版本信息(`version``commit``build_time`),用于前端 About 页面诊断前后端版本一致性
@@ -281,7 +281,7 @@ database:
# dbname: nex
max_idle_conns: 10
max_open_conns: 100
conn_max_lifetime: 1h
conn_max_lifetime: 1h0m0s
log:
level: info