2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-05 18:17:18 +08:00

feat: 添加磁盘管理工具到工具箱 (#1195)

* Initial plan

* 实现磁盘管理工具的后端和前端基础功能

Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com>

* 完成磁盘管理工具功能实现并验证构建成功

Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com>

* 添加输入验证防止命令注入攻击

Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com>

* 移除命令注入验证并修复评审意见

Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com>

* feat: merge main

* feat: merge main

* feat: 分区优化

* feat: fstab管理

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com>
Co-authored-by: 耗子 <haozi@loli.email>
This commit is contained in:
Copilot
2026-01-09 03:22:35 +08:00
committed by GitHub
parent 24312f5993
commit 54b3b60efd
10 changed files with 1748 additions and 20 deletions

View File

@@ -0,0 +1,76 @@
package request
// ToolboxDiskDevice 磁盘设备请求
type ToolboxDiskDevice struct {
Device string `form:"device" json:"device" validate:"required"`
}
// ToolboxDiskMount 挂载请求
type ToolboxDiskMount struct {
Device string `form:"device" json:"device" validate:"required"`
Path string `form:"path" json:"path" validate:"required"`
WriteFstab bool `form:"write_fstab" json:"write_fstab"`
MountOption string `form:"mount_option" json:"mount_option"`
}
// ToolboxDiskUmount 卸载请求
type ToolboxDiskUmount struct {
Path string `form:"path" json:"path" validate:"required"`
}
// ToolboxDiskFormat 格式化请求
type ToolboxDiskFormat struct {
Device string `form:"device" json:"device" validate:"required"`
FsType string `form:"fs_type" json:"fs_type" validate:"required|in:ext4,ext3,xfs,btrfs"`
}
// ToolboxDiskVG 卷组请求
type ToolboxDiskVG struct {
Name string `form:"name" json:"name" validate:"required"`
Devices []string `form:"devices" json:"devices" validate:"required"`
}
// ToolboxDiskLV 逻辑卷请求
type ToolboxDiskLV struct {
Name string `form:"name" json:"name" validate:"required"`
VGName string `form:"vg_name" json:"vg_name" validate:"required"`
Size int `form:"size" json:"size" validate:"required|min:1"`
}
// ToolboxDiskVGName 卷组名称请求
type ToolboxDiskVGName struct {
Name string `form:"name" json:"name" validate:"required"`
}
// ToolboxDiskLVPath 逻辑卷路径请求
type ToolboxDiskLVPath struct {
Path string `form:"path" json:"path" validate:"required"`
}
// ToolboxDiskExtendLV 扩容逻辑卷请求
type ToolboxDiskExtendLV struct {
Path string `form:"path" json:"path" validate:"required"`
Size int `form:"size" json:"size" validate:"required|min:1"`
Resize bool `form:"resize" json:"resize"`
}
// ToolboxDiskInit 初始化磁盘请求
type ToolboxDiskInit struct {
Device string `form:"device" json:"device" validate:"required"`
FsType string `form:"fs_type" json:"fs_type" validate:"required|in:ext4,ext3,xfs,btrfs"`
}
// ToolboxDiskFstabEntry fstab 条目结构
type ToolboxDiskFstabEntry struct {
Device string `json:"device"` // 设备UUID=xxx 或 /dev/xxx
MountPoint string `json:"mount_point"` // 挂载点
FsType string `json:"fs_type"` // 文件系统类型
Options string `json:"options"` // 挂载选项
Dump string `json:"dump"` // 备份标志
Pass string `json:"pass"` // 检查顺序
}
// ToolboxDiskFstabDelete 删除 fstab 条目请求
type ToolboxDiskFstabDelete struct {
MountPoint string `form:"mount_point" json:"mount_point" validate:"required"`
}