From 45e2c7bd03f2181255286b732c6c1f1ebf6e5886 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 12 Aug 2022 16:14:37 +0000 Subject: [PATCH 1/2] fix: debounce dashboard status requests --- apps/api/src/lib/common.ts | 2 +- apps/ui/src/routes/index.svelte | 19 +++++++++++++++---- package.json | 2 +- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/apps/api/src/lib/common.ts b/apps/api/src/lib/common.ts index 9456d5920..ce8b8051d 100644 --- a/apps/api/src/lib/common.ts +++ b/apps/api/src/lib/common.ts @@ -17,7 +17,7 @@ import { checkContainer, removeContainer } from './docker'; import { day } from './dayjs'; import * as serviceFields from './serviceFields' -export const version = '3.3.1'; +export const version = '3.3.2'; export const isDev = process.env.NODE_ENV === 'development'; const algorithm = 'aes-256-ctr'; diff --git a/apps/ui/src/routes/index.svelte b/apps/ui/src/routes/index.svelte index 2379ea108..f615ae927 100644 --- a/apps/ui/src/routes/index.svelte +++ b/apps/ui/src/routes/index.svelte @@ -23,9 +23,9 @@ import { get, post } from '$lib/api'; import Usage from '$lib/components/Usage.svelte'; import { t } from '$lib/translations'; - import { errorNotification } from '$lib/common'; + import { errorNotification, asyncSleep } from '$lib/common'; import { addToast, appSession } from '$lib/store'; - + import ApplicationsIcons from '$lib/components/svg/applications/ApplicationIcons.svelte'; import DatabaseIcons from '$lib/components/svg/databases/DatabaseIcons.svelte'; import ServiceIcons from '$lib/components/svg/services/ServiceIcons.svelte'; @@ -37,8 +37,18 @@ export let applications: any; export let databases: any; export let services: any; + let numberOfGetStatus = 0; + + function getRndInteger(min, max) { + return Math.floor(Math.random() * (max - min + 1) ) + min; + } + async function getStatus(resources: any) { + while (numberOfGetStatus > 1){ + await asyncSleep(getRndInteger(100,200)); + } try { + numberOfGetStatus++; const { id, buildPack, dualCerts } = resources; let isRunning = false; if (buildPack) { @@ -58,7 +68,9 @@ } } catch (error) { return 'Error'; - } + } finally { + numberOfGetStatus--; + } } async function manuallyCleanupStorage() { try { @@ -82,7 +94,6 @@ >Cleanup Storage -
diff --git a/package.json b/package.json index d9c9790d8..9a11294f8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "coolify", "description": "An open-source & self-hostable Heroku / Netlify alternative.", - "version": "3.3.1", + "version": "3.3.2", "license": "Apache-2.0", "repository": "github:coollabsio/coolify", "scripts": { From 645d5e19db3bfdff9391263893c61d09aa8d1140 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 12 Aug 2022 16:19:56 +0000 Subject: [PATCH 2/2] ui fixes on dashboard --- apps/ui/src/routes/index.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/ui/src/routes/index.svelte b/apps/ui/src/routes/index.svelte index f615ae927..ec5132a4f 100644 --- a/apps/ui/src/routes/index.svelte +++ b/apps/ui/src/routes/index.svelte @@ -124,7 +124,7 @@ Application
- + {#if application.fqdn} - + {#if service.fqdn} - +