Add new frontend pages for the multi-tenant OCDP platform: - Charts page (/charts): Browse Harbor OCI registries to list Helm chart repositories and versions, with deploy modal to launch charts on selected clusters - Monitoring page (/monitoring): Display cluster metrics (CPU/Memory/GPU usage) and per-node details with resource utilization bars - Chart References page (/chart-references): CRUD for chart metadata references - Values Templates page (/templates): CRUD for Helm values templates with version history and rollback support - Sidebar: Add Charts navigation, update Storage and Templates links - api.ts: Add all API client functions (clusterApi, registryApi, instanceApi, monitoringApi, storageApi, chartReferenceApi, valuesTemplateApi, workspaceApi, userApi) with full TypeScript types Note: deploy flow and values template rollback not yet end-to-end tested.
67 lines
1.9 KiB
Go
67 lines
1.9 KiB
Go
package dto
|
|
|
|
import "time"
|
|
|
|
// WorkspaceDTO 工作空间 DTO
|
|
type WorkspaceDTO struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description,omitempty"`
|
|
CreatedBy string `json:"created_by"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
// CreateWorkspaceRequest 创建工作空间请求
|
|
type CreateWorkspaceRequest struct {
|
|
Name string `json:"name" validate:"required"`
|
|
Description string `json:"description"`
|
|
}
|
|
|
|
// UpdateWorkspaceRequest 更新工作空间请求
|
|
type UpdateWorkspaceRequest struct {
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
}
|
|
|
|
// QuotaDTO 配额 DTO
|
|
type QuotaDTO struct {
|
|
ID string `json:"id"`
|
|
WorkspaceID string `json:"workspace_id"`
|
|
ResourceType string `json:"resource_type"`
|
|
HardLimit float64 `json:"hard_limit"`
|
|
SoftLimit float64 `json:"soft_limit"`
|
|
Used float64 `json:"used"`
|
|
}
|
|
|
|
// SetQuotaRequest 设置配额请求
|
|
type SetQuotaRequest struct {
|
|
ResourceType string `json:"resource_type" validate:"required"`
|
|
HardLimit float64 `json:"hard_limit" validate:"required"`
|
|
SoftLimit float64 `json:"soft_limit"`
|
|
}
|
|
|
|
// SetQuotasRequest 批量设置配额请求
|
|
type SetQuotasRequest struct {
|
|
CPU *QuotaValue `json:"cpu"`
|
|
GPU *QuotaValue `json:"gpu"`
|
|
GPUMemory *QuotaValue `json:"gpu_memory"`
|
|
}
|
|
|
|
// QuotaValue 配额值
|
|
type QuotaValue struct {
|
|
HardLimit float64 `json:"hard_limit"`
|
|
SoftLimit float64 `json:"soft_limit"`
|
|
}
|
|
|
|
// WorkspaceResponse 工作空间响应
|
|
type WorkspaceResponse struct {
|
|
Workspace *WorkspaceDTO `json:"workspace"`
|
|
Quotas []*QuotaDTO `json:"quotas,omitempty"`
|
|
}
|
|
|
|
// WorkspaceListResponse 工作空间列表响应
|
|
type WorkspaceListResponse struct {
|
|
Workspaces []*WorkspaceDTO `json:"workspaces"`
|
|
Total int `json:"total"`
|
|
} |