feat: show local Docker images on project detail page
- Add GET /api/projects/{id}/images endpoint returning local images matching the project
- Add ListImagesByRef with tag, size, and created timestamp to Docker client
- Display images table on project page with tag, ID (truncated), size (MB), and created date
- Only shown when Docker is available and images exist locally
This commit is contained in:
@@ -9,6 +9,7 @@ import type {
|
||||
EventLogStats,
|
||||
InspectResult,
|
||||
Instance,
|
||||
LocalImage,
|
||||
NpmCertificate,
|
||||
NpmAccessList,
|
||||
ProxyRoute,
|
||||
@@ -278,6 +279,10 @@ export function listProxyRoutes(): Promise<ProxyRoute[]> {
|
||||
|
||||
// ── Docker Management ──────────────────────────────────────────────
|
||||
|
||||
export function listProjectImages(projectId: string): Promise<LocalImage[]> {
|
||||
return get<LocalImage[]>(`/api/projects/${projectId}/images`);
|
||||
}
|
||||
|
||||
export function pruneImages(): Promise<{ images_removed: number; space_reclaimed_mb: number }> {
|
||||
return post<{ images_removed: number; space_reclaimed_mb: number }>('/api/docker/prune-images');
|
||||
}
|
||||
|
||||
@@ -105,6 +105,11 @@
|
||||
"enableProxy": "Enable Proxy",
|
||||
"accessListId": "NPM Access List ID",
|
||||
"accessListIdHelp": "Per-project override. 0 = use global default from NPM settings.",
|
||||
"localImages": "Local Docker Images",
|
||||
"imageTag": "Tag",
|
||||
"imageId": "Image ID",
|
||||
"imageSize": "Size",
|
||||
"imageCreated": "Created",
|
||||
"cpuLimit": "CPU Limit (cores)",
|
||||
"cpuLimitHelp": "e.g., 0.5, 1, 2. Leave 0 for unlimited",
|
||||
"memoryLimit": "Memory Limit (MB)",
|
||||
|
||||
@@ -105,6 +105,11 @@
|
||||
"enableProxy": "Включить прокси",
|
||||
"accessListId": "ID списка доступа NPM",
|
||||
"accessListIdHelp": "Переопределение для проекта. 0 = использовать глобальное из настроек NPM.",
|
||||
"localImages": "Локальные Docker-образы",
|
||||
"imageTag": "Тег",
|
||||
"imageId": "ID образа",
|
||||
"imageSize": "Размер",
|
||||
"imageCreated": "Создан",
|
||||
"cpuLimit": "Лимит CPU (ядра)",
|
||||
"cpuLimitHelp": "напр., 0.5, 1, 2. Оставьте 0 для без ограничений",
|
||||
"memoryLimit": "Лимит памяти (МБ)",
|
||||
|
||||
@@ -262,6 +262,15 @@ export interface ProxyHealth {
|
||||
error?: string;
|
||||
}
|
||||
|
||||
/** A local Docker image. */
|
||||
export interface LocalImage {
|
||||
id: string;
|
||||
ref: string;
|
||||
tag: string;
|
||||
size: number;
|
||||
created: number;
|
||||
}
|
||||
|
||||
/** An NPM access list for proxy authentication. */
|
||||
export interface NpmAccessList {
|
||||
id: number;
|
||||
|
||||
Reference in New Issue
Block a user