diff --git a/apps/ui/src/routes/index.svelte b/apps/ui/src/routes/index.svelte index 4b41d56e5..c349b2135 100644 --- a/apps/ui/src/routes/index.svelte +++ b/apps/ui/src/routes/index.svelte @@ -41,25 +41,44 @@ let numberOfGetStatus = 0; let status: any = {}; + let noInitialStatus: any = { + applications: false, + services: false, + databases: false + }; + let loading = { + applications: false, + services: false, + databases: false + }; doSearch(); async function refreshStatusApplications() { + loading.applications = true; + noInitialStatus.applications = false; numberOfGetStatus = 0; for (const application of applications) { - getStatus(application, true); + await getStatus(application, true); } + loading.applications = false; } async function refreshStatusServices() { + loading.services = true; + noInitialStatus.services = false; numberOfGetStatus = 0; for (const service of services) { - getStatus(service, true); + await getStatus(service, true); } + loading.services = false; } async function refreshStatusDatabases() { + loading.databases = true; + noInitialStatus.databases = false; numberOfGetStatus = 0; for (const database of databases) { - getStatus(database, true); + await getStatus(database, true); } + loading.databases = false; } function setInitials(onlyOthers: boolean = false) { return { @@ -109,9 +128,15 @@ async function getStatus(resources: any, force: boolean = false) { const { id, buildPack, dualCerts, type } = resources; if (buildPack && applications.length > 10 && !force) { + noInitialStatus.applications = true; return; } if (type && services.length > 10 && !force) { + noInitialStatus.services = true; + return; + } + if (databases.length > 10 && !force) { + noInitialStatus.databases = true; return; } if (status[id] && !force) return status[id]; @@ -498,8 +523,12 @@ {#if (filtered.applications.length > 0 && applications.length > 0) || filtered.otherApplications.length > 0}