feat: 实现 Redfish API 标准接口;支持通过前端开关控制 Redfish 服务#257
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
实现 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-Tokenroutes/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 APIsrc/web/routes.rs- 根据redfish.enabled动态挂载 Redfish 路由,添加OData-Version: 4.0响应头前端
web/src/views/SettingsView.vue- 网络设置区新增 Redfish API 开关卡片web/src/api/config.ts- 新增redfishConfigApiweb/src/i18n/- 中英文国际化文本备注