feat(maintenance): add Docker build-cache prune action
Add an admin-only POST /api/docker/prune-build-cache endpoint plus a Settings > Maintenance danger-zone button to reclaim disk used by the Docker build cache (image + static-site builds), which previously grew unbounded with no UI lever. Prunes unused-only (all=false) so a warm cache is preserved for apps redeploying soon. Mirrors the existing prune-images vertical slice; full en/ru i18n parity.
This commit is contained in:
@@ -438,6 +438,10 @@ export function pruneImages(): Promise<{ images_removed: number; space_reclaimed
|
||||
return post<{ images_removed: number; space_reclaimed_mb: number }>('/api/docker/prune-images');
|
||||
}
|
||||
|
||||
export function pruneBuildCache(): Promise<{ caches_deleted: number; space_reclaimed_mb: number }> {
|
||||
return post<{ caches_deleted: number; space_reclaimed_mb: number }>('/api/docker/prune-build-cache');
|
||||
}
|
||||
|
||||
export function testNpmConnection(data: { npm_url?: string; npm_email?: string; npm_password?: string }): Promise<{ status: string }> {
|
||||
return post<{ status: string }>('/api/settings/npm/test', data);
|
||||
}
|
||||
|
||||
@@ -123,6 +123,12 @@
|
||||
"pruneResult": "Removed {count} images, reclaimed {mb} MB",
|
||||
"pruneConfirmMessage": "This will remove unused Docker images belonging to your projects. Images used by active instances will not be affected.",
|
||||
"pruneFailed": "Failed to prune images",
|
||||
"buildCacheCleanupHelp": "Reclaim disk used by Docker build cache from image and static-site builds. Only unused cache is removed — apps redeploying still hit any cache that is still in use.",
|
||||
"pruneBuildCache": "Prune Build Cache",
|
||||
"pruningCache": "Pruning...",
|
||||
"pruneCacheResult": "Removed {count} build-cache records, reclaimed {mb} MB",
|
||||
"pruneBuildCacheConfirmMessage": "This removes unused Docker build-cache layers daemon-wide. Layers still in use are kept, so apps that redeploy soon keep their warm cache; others rebuild from scratch on their next deploy.",
|
||||
"pruneCacheFailed": "Failed to prune build cache",
|
||||
"proxyProvider": "Proxy Provider",
|
||||
"proxyProviderHelp": "Select how reverse proxy routes are managed for deployed containers.",
|
||||
"proxyNone": "None",
|
||||
|
||||
@@ -123,6 +123,12 @@
|
||||
"pruneResult": "Удалено {count} образов, освобождено {mb} МБ",
|
||||
"pruneConfirmMessage": "Будут удалены неиспользуемые Docker-образы ваших проектов. Образы активных экземпляров не затрагиваются.",
|
||||
"pruneFailed": "Не удалось очистить образы",
|
||||
"buildCacheCleanupHelp": "Освобождение места на диске, занятого кэшем сборки Docker (сборки образов и статических сайтов). Удаляется только неиспользуемый кэш — при следующем развёртывании приложения используют кэш, который ещё задействован.",
|
||||
"pruneBuildCache": "Очистить кэш сборки",
|
||||
"pruningCache": "Очистка...",
|
||||
"pruneCacheResult": "Удалено записей кэша сборки: {count}, освобождено {mb} МБ",
|
||||
"pruneBuildCacheConfirmMessage": "Будут удалены неиспользуемые слои кэша сборки Docker во всём демоне. Используемые слои сохраняются, поэтому приложения, которые скоро переразвернутся, сохранят тёплый кэш; остальные пересоберутся с нуля при следующем развёртывании.",
|
||||
"pruneCacheFailed": "Не удалось очистить кэш сборки",
|
||||
"proxyProvider": "Провайдер прокси",
|
||||
"proxyProviderHelp": "Выберите способ управления обратным прокси для развёрнутых контейнеров.",
|
||||
"proxyNone": "Нет",
|
||||
|
||||
Reference in New Issue
Block a user