feat: 服务器管理前后端字段对齐 — 移除CMDB幽灵字段 + SSH导向表单 + GB→MB内存转换
This commit is contained in:
1 parent
56e0cb15ac
commit
a1237587f6
4 files changed
+146
-187
No files matched your search
@@ -148,6 +148,10 @@ func (h *ServerHandler) CreateServer(c *gin.Context) {
|
||||
Status: "stopped",
|
||||
}
|
||||
|
||||
if req.Status != "" {
|
||||
server.Status = req.Status
|
||||
}
|
||||
|
||||
if server.Port == 0 {
|
||||
server.Port = 22
|
||||
}
|
||||
|
||||
@@ -144,6 +144,7 @@ type CreateServerRequest struct {
|
||||
CPU int `json:"cpu"`
|
||||
Memory int64 `json:"memory"`
|
||||
Disk int64 `json:"disk"`
|
||||
Status string `json:"status" binding:"omitempty,oneof=running stopped maintenance error"`
|
||||
RegionID *uint `json:"region_id"`
|
||||
CloudID *uint `json:"cloud_id"`
|
||||
Tags string `json:"tags"`
|
||||
|
||||
Reference in new issue
Block a user