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.
35 lines
653 B
Go
35 lines
653 B
Go
package entity
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// Workspace 工作空间实体
|
|
type Workspace struct {
|
|
ID string
|
|
Name string
|
|
Description string
|
|
CreatedBy string // 创建者用户 ID
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
// NewWorkspace 创建新工作空间
|
|
func NewWorkspace(name, description, createdBy string) *Workspace {
|
|
now := time.Now()
|
|
return &Workspace{
|
|
Name: name,
|
|
Description: description,
|
|
CreatedBy: createdBy,
|
|
CreatedAt: now,
|
|
UpdatedAt: now,
|
|
}
|
|
}
|
|
|
|
// Validate 验证工作空间数据
|
|
func (w *Workspace) Validate() error {
|
|
if w.Name == "" {
|
|
return ErrInvalidWorkspaceName
|
|
}
|
|
return nil
|
|
} |