From fc1a89cc638c3355b8bca5284b8db16147ee78a5 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 26 Aug 2022 17:11:54 +0000 Subject: [PATCH 01/10] fix: UI thinkgs --- apps/api/src/lib/common.ts | 2 +- .../lib/components/svg/services/Ghost.svelte | 2 +- .../lib/components/svg/services/Hasura.svelte | 2 +- .../svg/services/LanguageTool.svelte | 2 +- .../svg/services/MeiliSearch.svelte | 2 +- .../lib/components/svg/services/MinIO.svelte | 2 +- .../lib/components/svg/services/Moodle.svelte | 2 +- .../lib/components/svg/services/N8n.svelte | 2 +- .../lib/components/svg/services/NocoDB.svelte | 2 +- .../lib/components/svg/services/Umami.svelte | 2 +- .../svg/services/VSCodeServer.svelte | 2 +- .../svg/services/VaultWarden.svelte | 2 +- .../components/svg/services/Wordpress.svelte | 2 +- apps/ui/src/routes/index.svelte | 20 +++++++++---------- package.json | 2 +- 15 files changed, 24 insertions(+), 24 deletions(-) diff --git a/apps/api/src/lib/common.ts b/apps/api/src/lib/common.ts index e73093d08..0d452a320 100644 --- a/apps/api/src/lib/common.ts +++ b/apps/api/src/lib/common.ts @@ -19,7 +19,7 @@ import * as serviceFields from './serviceFields' import { saveBuildLog } from './buildPacks/common'; import { scheduler } from './scheduler'; -export const version = '3.8.3'; +export const version = '3.8.4'; export const isDev = process.env.NODE_ENV === 'development'; const algorithm = 'aes-256-ctr'; diff --git a/apps/ui/src/lib/components/svg/services/Ghost.svelte b/apps/ui/src/lib/components/svg/services/Ghost.svelte index 567ab69bc..d01ab2e3f 100644 --- a/apps/ui/src/lib/components/svg/services/Ghost.svelte +++ b/apps/ui/src/lib/components/svg/services/Ghost.svelte @@ -4,6 +4,6 @@ ghost logo diff --git a/apps/ui/src/lib/components/svg/services/Hasura.svelte b/apps/ui/src/lib/components/svg/services/Hasura.svelte index aaac145ca..51a427ccd 100644 --- a/apps/ui/src/lib/components/svg/services/Hasura.svelte +++ b/apps/ui/src/lib/components/svg/services/Hasura.svelte @@ -3,7 +3,7 @@ diff --git a/apps/ui/src/lib/components/svg/services/Moodle.svelte b/apps/ui/src/lib/components/svg/services/Moodle.svelte index ad8aec880..a52ddc6f7 100644 --- a/apps/ui/src/lib/components/svg/services/Moodle.svelte +++ b/apps/ui/src/lib/components/svg/services/Moodle.svelte @@ -3,6 +3,6 @@ moodle logo diff --git a/apps/ui/src/lib/components/svg/services/N8n.svelte b/apps/ui/src/lib/components/svg/services/N8n.svelte index 04b2e8216..da7ab2b88 100644 --- a/apps/ui/src/lib/components/svg/services/N8n.svelte +++ b/apps/ui/src/lib/components/svg/services/N8n.svelte @@ -3,7 +3,7 @@ diff --git a/apps/ui/src/lib/components/svg/services/NocoDB.svelte b/apps/ui/src/lib/components/svg/services/NocoDB.svelte index ba93c4f78..fcaac6a96 100644 --- a/apps/ui/src/lib/components/svg/services/NocoDB.svelte +++ b/apps/ui/src/lib/components/svg/services/NocoDB.svelte @@ -4,6 +4,6 @@ nocodb logo diff --git a/apps/ui/src/lib/components/svg/services/Umami.svelte b/apps/ui/src/lib/components/svg/services/Umami.svelte index e1c9b1e67..7faeca3fb 100644 --- a/apps/ui/src/lib/components/svg/services/Umami.svelte +++ b/apps/ui/src/lib/components/svg/services/Umami.svelte @@ -7,7 +7,7 @@ xmlns="http://www.w3.org/2000/svg" viewBox="0 0 856.000000 856.000000" preserveAspectRatio="xMidYMid meet" - class={isAbsolute ? 'w-10 h-10 absolute top-0 left-0 -m-5' : 'w-8 mx-auto'} + class={isAbsolute ? 'w-10 h-10 absolute top-0 left-0 -m-5' : 'w-8 h-8 mx-auto'} > Created by potrace 1.11, written by Peter Selinger 2001-2013 - +
{$t('index.dashboard')}
-
+
{#if $appSession.teamId === '0'} {/if}

Applications

-
+
{#if applications.length > 0} {#each applications as application} @@ -97,8 +97,8 @@ {/if} {/await}
- -
+ +

{application.name} {#if application.settings.isBot} @@ -167,7 +167,7 @@

Services

-
+
{#if services.length > 0} {#each services as service} @@ -182,8 +182,8 @@ {/if} {/await}
- -
+ +

{service.name}

{#if service?.fqdn} @@ -225,7 +225,7 @@

Databases

-
+
{#if databases.length > 0} {#each databases as database} @@ -240,8 +240,8 @@ {/if} {/await}
- -
+ +

{database.name}

diff --git a/package.json b/package.json index ecf58e487..4e3a1d486 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "coolify", "description": "An open-source & self-hostable Heroku / Netlify alternative.", - "version": "3.8.3", + "version": "3.8.4", "license": "Apache-2.0", "repository": "github:coollabsio/coolify", "scripts": { From 3884483bca8812434a91f6e032a9e007e2bae3cb Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 26 Aug 2022 18:25:20 +0000 Subject: [PATCH 02/10] ui: dashbord fixes --- apps/ui/src/lib/components/Usage.svelte | 32 +++++++++---------- .../components/svg/applications/Docker.svelte | 2 +- apps/ui/src/routes/index.svelte | 6 ++-- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/apps/ui/src/lib/components/Usage.svelte b/apps/ui/src/lib/components/Usage.svelte index a461f8419..0e7630370 100644 --- a/apps/ui/src/lib/components/Usage.svelte +++ b/apps/ui/src/lib/components/Usage.svelte @@ -86,8 +86,8 @@
-

Hardware Details

-
+

Hardware Details

+
{#if $appSession.teamId === '0'}
-
-
-
Memory
+
+
-
Total
+
Total Memory
{(usage?.memory.totalMemMb).toFixed(0)}MB
-
Used
+
Used Memory
{(usage?.memory.usedMemMb).toFixed(0)}MB
-
Free
+
Free Memory
{usage?.memory.freeMemPercentage}%
-
-
CPU
+
+
-
Total
+
Total CPU
{usage?.cpu.count}
-
Usage
+
CPU Usage
{usage?.cpu.usage}%
@@ -147,24 +146,23 @@
{usage?.cpu.load}
-
-
Disk
+
-
Total
+
Total Disk
{usage?.disk.totalGb}GB
-
Used
+
Used Disk
{usage?.disk.usedGb}GB
-
Free
+
Free Disk
{usage?.disk.freePercentage}%
diff --git a/apps/ui/src/lib/components/svg/applications/Docker.svelte b/apps/ui/src/lib/components/svg/applications/Docker.svelte index ea1787bd9..74ba0ebf0 100644 --- a/apps/ui/src/lib/components/svg/applications/Docker.svelte +++ b/apps/ui/src/lib/components/svg/applications/Docker.svelte @@ -3,7 +3,7 @@ - + diff --git a/apps/ui/src/routes/index.svelte b/apps/ui/src/routes/index.svelte index 38c5931ee..d56ef77fe 100644 --- a/apps/ui/src/routes/index.svelte +++ b/apps/ui/src/routes/index.svelte @@ -80,7 +80,7 @@ {#if $appSession.teamId === '0'} {/if} -

Applications

+

Applications

{#if applications.length > 0} @@ -165,7 +165,7 @@

Nothing is configured yet.

{/if}
-

Services

+

Services

{#if services.length > 0} @@ -223,7 +223,7 @@ {/if}
-

Databases

+

Databases

{#if databases.length > 0} From 4c5e71f33c3f3e3fe6a2b47a64e75598147cc01a Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 26 Aug 2022 18:39:13 +0000 Subject: [PATCH 03/10] fix: delete team while it is active --- .gitignore | 3 ++- apps/api/src/routes/api/v1/iam/handlers.ts | 6 ++++-- apps/ui/src/routes/iam/team/[id]/__layout.svelte | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index cb934cd76..500cd6776 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ dist client apps/api/db/*.db local-serve -apps/api/db/migration.db-journal \ No newline at end of file +apps/api/db/migration.db-journal +apps/api/core* \ No newline at end of file diff --git a/apps/api/src/routes/api/v1/iam/handlers.ts b/apps/api/src/routes/api/v1/iam/handlers.ts index 72d648793..29740d9cf 100644 --- a/apps/api/src/routes/api/v1/iam/handlers.ts +++ b/apps/api/src/routes/api/v1/iam/handlers.ts @@ -158,8 +158,10 @@ export async function getTeam(request: FastifyRequest, reply: FastifyRep }); const team = await prisma.team.findUnique({ where: { id }, include: { permissions: true } }); const invitations = await prisma.teamInvitation.findMany({ where: { teamId: team.id } }); + const { teams } = await prisma.user.findUnique({ where: { id: userId }, include: { teams: true } }) return { team, + teams, permissions, invitations }; @@ -275,10 +277,10 @@ export async function inviteToTeam(request: FastifyRequest, reply: if (!userFound) { throw { message: `No user found with '${email}' email address.` - }; + }; } const uid = userFound.id; - if (uid === userId) { + if (uid === userId) { throw { message: `Invitation to yourself? Whaaaaat?` }; diff --git a/apps/ui/src/routes/iam/team/[id]/__layout.svelte b/apps/ui/src/routes/iam/team/[id]/__layout.svelte index ff308d5db..8623b66f5 100644 --- a/apps/ui/src/routes/iam/team/[id]/__layout.svelte +++ b/apps/ui/src/routes/iam/team/[id]/__layout.svelte @@ -25,18 +25,33 @@