MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / loadRegistryImages

Function loadRegistryImages

vmm/ui/src/composables/useVmManager.ts:1484–1504  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1482 let registryRefreshTimer: ReturnType<typeof setInterval> | null = null;
1483
1484 async function loadRegistryImages() {
1485 const isInitialLoad = registryImages.value.length === 0;
1486 if (isInitialLoad) {
1487 registryLoading.value = true;
1488 }
1489 try {
1490 const data = await vmmRpc.listRegistryImages({});
1491 registryImages.value = (data.images || []).sort((a: any, b: any) => {
1492 // Sort by tag descending (newest versions first)
1493 return (b.tag || '').localeCompare(a.tag || '', undefined, { numeric: true });
1494 });
1495 // If any image is pulling, refresh local images too
1496 if (registryImages.value.some((img: any) => img.pulling)) {
1497 loadImages();
1498 }
1499 } catch (error) {
1500 recordError('failed to load registry images', error);
1501 } finally {
1502 registryLoading.value = false;
1503 }
1504 }
1505
1506 async function pullRegistryImage(tag: string) {
1507 // Optimistic update: mark as pulling immediately, clear previous error

Callers 2

deleteImageFunction · 0.85
openImageRegistryFunction · 0.85

Calls 2

loadImagesFunction · 0.85
recordErrorFunction · 0.85

Tested by

no test coverage detected