feat(frontend): add Helm chart browser, monitoring, chart-references and values templates pages
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.
This commit is contained in:
41
backend/internal/domain/entity/chart_reference.go
Normal file
41
backend/internal/domain/entity/chart_reference.go
Normal file
@ -0,0 +1,41 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// ChartReference Chart 引用实体
|
||||
type ChartReference struct {
|
||||
ID string
|
||||
WorkspaceID string
|
||||
RegistryID string
|
||||
Repository string
|
||||
ChartName string
|
||||
Description string
|
||||
IsEnabled bool
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
// NewChartReference 创建新 Chart 引用
|
||||
func NewChartReference(workspaceID, registryID, repository, chartName, description string) *ChartReference {
|
||||
now := time.Now()
|
||||
return &ChartReference{
|
||||
WorkspaceID: workspaceID,
|
||||
RegistryID: registryID,
|
||||
Repository: repository,
|
||||
ChartName: chartName,
|
||||
Description: description,
|
||||
IsEnabled: true,
|
||||
CreatedAt: now,
|
||||
UpdatedAt: now,
|
||||
}
|
||||
}
|
||||
|
||||
// Validate 验证 Chart 引用数据
|
||||
func (c *ChartReference) Validate() error {
|
||||
if c.Repository == "" {
|
||||
return ErrInvalidChart
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user