Skip to content

feat: 实现 Redfish API 标准接口;支持通过前端开关控制 Redfish 服务#257

Merged
mofeng-git merged 2 commits into
mofeng-git:mainfrom
btzen:redfish
May 13, 2026
Merged

feat: 实现 Redfish API 标准接口;支持通过前端开关控制 Redfish 服务#257
mofeng-git merged 2 commits into
mofeng-git:mainfrom
btzen:redfish

Conversation

@fcsha
Copy link
Copy Markdown
Contributor

@fcsha fcsha commented May 12, 2026

概述

实现 DMTF Redfish API 标准接口(#254),使 One-KVM 可被标准 BMC 管理工具发现和管理。同时在前端设置页面提供 Redfish 服务开关。

改动

后端

  • 新增 src/redfish/ 模块,实现完整的 Redfish 标准资源端点:
    • schema.rs - Redfish 数据模型(ServiceRoot、ComputerSystem、Chassis、Manager、VirtualMedia、Session、Account、EventService)
    • routes/systems.rs - 系统信息查询、启动顺序配置、ComputerSystem.Reset 电源控制(对接 ATX 短按/长按/重启)
    • routes/virtual_media.rs - InsertMedia / EjectMedia 动作(对接 MSD 虚拟盘挂载/卸载)
    • routes/session.rs - 会话创建/删除,返回 X-Auth-Token
    • routes/account.rs - 账户列表
    • routes/event.rs - 事件服务
    • routes/chassis.rs / routes/managers.rs - 机箱与管理器信息
    • auth.rs - 认证中间件,支持 HTTP Basic Auth 和 X-Auth-Token,公共端点免认证
  • src/config/schema.rs - 新增 RedfishConfig { enabled: bool },默认关闭
  • src/web/handlers/config/redfish.rs - Redfish 配置 GET/PATCH API
  • src/web/routes.rs - 根据 redfish.enabled 动态挂载 Redfish 路由,添加 OData-Version: 4.0 响应头

前端

  • web/src/views/SettingsView.vue - 网络设置区新增 Redfish API 开关卡片
  • web/src/api/config.ts - 新增 redfishConfigApi
  • web/src/i18n/ - 中英文国际化文本

备注

  • Redfish 默认关闭,需手动启用
  • 认证复用 One-KVM 现有用户系统
  • 开关变更后需重启服务生效

@mofeng-git mofeng-git merged commit e5d6279 into mofeng-git:main May 13, 2026
1 check passed
@fcsha fcsha deleted the redfish branch May 13, 2026 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants