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.
33 lines
1.1 KiB
Go
33 lines
1.1 KiB
Go
package repository
|
|
|
|
import (
|
|
"context"
|
|
"github.com/ocdp/cluster-service/internal/domain/entity"
|
|
)
|
|
|
|
// ChartReferenceRepository Chart 引用仓储接口
|
|
type ChartReferenceRepository interface {
|
|
// Create 创建 Chart 引用
|
|
Create(ctx context.Context, chartRef *entity.ChartReference) error
|
|
|
|
// GetByID 根据 ID 获取 Chart 引用
|
|
GetByID(ctx context.Context, id string) (*entity.ChartReference, error)
|
|
|
|
// GetByWorkspace 获取 workspace 的所有 Chart 引用
|
|
GetByWorkspace(ctx context.Context, workspaceID string) ([]*entity.ChartReference, error)
|
|
|
|
// GetByRegistry 获取 registry 的所有 Chart 引用
|
|
GetByRegistry(ctx context.Context, registryID string) ([]*entity.ChartReference, error)
|
|
|
|
// GetByName 根据名称获取 Chart 引用
|
|
GetByName(ctx context.Context, workspaceID, chartName string) (*entity.ChartReference, error)
|
|
|
|
// Update 更新 Chart 引用
|
|
Update(ctx context.Context, chartRef *entity.ChartReference) error
|
|
|
|
// Delete 删除 Chart 引用
|
|
Delete(ctx context.Context, id string) error
|
|
|
|
// List 列出所有 Chart 引用(管理员用)
|
|
List(ctx context.Context) ([]*entity.ChartReference, error)
|
|
} |