From 82bfdb87e3c1678386e94c5ad7488bd72757b6d8 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 25 Mar 2022 10:36:47 +0100 Subject: [PATCH] UI fixes --- src/app.d.ts | 1 + src/lib/queues/builder.ts | 3 +- src/routes/applications/[id]/__layout.svelte | 9 ++- .../configuration/_GithubRepositories.svelte | 4 +- .../[id]/configuration/source.svelte | 8 +-- src/routes/applications/[id]/index.svelte | 2 +- .../[id]/logs/build/_BuildLog.svelte | 2 +- .../applications/[id]/logs/build/index.svelte | 1 - src/routes/applications/index.svelte | 31 +++------- .../applications/{index.json.ts => index.ts} | 0 .../index.json.ts => applications/new.ts} | 5 +- src/routes/dashboard.json.ts | 22 +++++-- src/routes/databases/index.svelte | 32 +++------- .../databases/{index.json.ts => index.ts} | 1 + .../index.json.ts => databases/new.ts} | 6 +- src/routes/new/application/import.json.ts | 29 --------- src/routes/new/application/index.svelte | 53 ----------------- src/routes/new/database/index.svelte | 59 ------------------- src/routes/new/service/index.svelte | 59 ------------------- src/routes/services/index.svelte | 31 +++------- .../services/{index.json.ts => index.ts} | 0 .../service/index.json.ts => services/new.ts} | 4 +- src/routes/teams/index.svelte | 34 +++++------ src/tailwind.css | 2 +- 24 files changed, 81 insertions(+), 317 deletions(-) rename src/routes/applications/{index.json.ts => index.ts} (100%) rename src/routes/{new/application/index.json.ts => applications/new.ts} (81%) rename src/routes/databases/{index.json.ts => index.ts} (99%) rename src/routes/{new/database/index.json.ts => databases/new.ts} (83%) delete mode 100644 src/routes/new/application/import.json.ts delete mode 100644 src/routes/new/application/index.svelte delete mode 100644 src/routes/new/database/index.svelte delete mode 100644 src/routes/new/service/index.svelte rename src/routes/services/{index.json.ts => index.ts} (100%) rename src/routes/{new/service/index.json.ts => services/new.ts} (91%) diff --git a/src/app.d.ts b/src/app.d.ts index 40f503598..d69042fe8 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -10,6 +10,7 @@ declare namespace App { interface Stuff { application: any; isRunning: boolean; + appId: string; } } diff --git a/src/lib/queues/builder.ts b/src/lib/queues/builder.ts index 1cb3d2a6a..3898bcdb5 100644 --- a/src/lib/queues/builder.ts +++ b/src/lib/queues/builder.ts @@ -55,8 +55,7 @@ export default async function (job) { } = job.data; const { debug } = settings; - await asyncSleep(1000); - + await asyncSleep(500); await db.prisma.build.updateMany({ where: { status: 'queued', diff --git a/src/routes/applications/[id]/__layout.svelte b/src/routes/applications/[id]/__layout.svelte index c41f33282..4a79bba44 100644 --- a/src/routes/applications/[id]/__layout.svelte +++ b/src/routes/applications/[id]/__layout.svelte @@ -88,7 +88,14 @@ try { const { buildId } = await post(`/applications/${id}/deploy.json`, { ...application }); toast.push('Deployment queued.'); - return await goto(`/applications/${id}/logs/build?buildId=${buildId}`); + console.log($page.url); + if ($page.url.pathname.startsWith(`/applications/${id}/logs/build`)) { + return window.location.assign(`/applications/${id}/logs/build?buildId=${buildId}`); + } else { + return await goto(`/applications/${id}/logs/build?buildId=${buildId}`, { + replaceState: true + }); + } } catch ({ error }) { return errorNotification(error); } diff --git a/src/routes/applications/[id]/configuration/_GithubRepositories.svelte b/src/routes/applications/[id]/configuration/_GithubRepositories.svelte index f69db0476..4afbea65c 100644 --- a/src/routes/applications/[id]/configuration/_GithubRepositories.svelte +++ b/src/routes/applications/[id]/configuration/_GithubRepositories.svelte @@ -151,8 +151,8 @@ {:else} -
-
+ +
{#if loading.repositories} - -
- -
diff --git a/src/routes/new/database/index.svelte b/src/routes/new/database/index.svelte deleted file mode 100644 index 4ee9ee6fb..000000000 --- a/src/routes/new/database/index.svelte +++ /dev/null @@ -1,59 +0,0 @@ - - - - -
-
Add New Database
-
-
-
-
- - -
-
-
diff --git a/src/routes/new/service/index.svelte b/src/routes/new/service/index.svelte deleted file mode 100644 index f658a4ec2..000000000 --- a/src/routes/new/service/index.svelte +++ /dev/null @@ -1,59 +0,0 @@ - - - - -
-
Add New Service
-
-
-
-
- - -
-
-
diff --git a/src/routes/services/index.svelte b/src/routes/services/index.svelte index 1ea70b904..a4d34cd5f 100644 --- a/src/routes/services/index.svelte +++ b/src/routes/services/index.svelte @@ -1,24 +1,3 @@ - -
Services
- +
- +
diff --git a/src/routes/services/index.json.ts b/src/routes/services/index.ts similarity index 100% rename from src/routes/services/index.json.ts rename to src/routes/services/index.ts diff --git a/src/routes/new/service/index.json.ts b/src/routes/services/new.ts similarity index 91% rename from src/routes/new/service/index.json.ts rename to src/routes/services/new.ts index 3594f7920..2faad169c 100644 --- a/src/routes/new/service/index.json.ts +++ b/src/routes/services/new.ts @@ -6,9 +6,7 @@ import type { RequestHandler } from '@sveltejs/kit'; export const post: RequestHandler = async (event) => { const { teamId, status, body } = await getUserDetails(event); if (status === 401) return { status, body }; - - const { name } = await event.request.json(); - + const name = uniqueName(); try { const { id } = await db.newService({ name, teamId }); return { status: 201, body: { id } }; diff --git a/src/routes/teams/index.svelte b/src/routes/teams/index.svelte index c8572d5fc..05c020cdf 100644 --- a/src/routes/teams/index.svelte +++ b/src/routes/teams/index.svelte @@ -91,23 +91,21 @@
{/if} -
-
- {#each teams as team} - - diff --git a/src/tailwind.css b/src/tailwind.css index 1eb6fe580..1a30a3ac0 100644 --- a/src/tailwind.css +++ b/src/tailwind.css @@ -85,7 +85,7 @@ a { } .nav-side { - @apply relative right-0 top-0 z-50 m-5 flex flex-wrap items-center justify-end space-x-2 bg-coolblack/40 text-white sm:absolute; + @apply absolute right-0 top-0 z-50 m-5 flex flex-wrap items-center justify-end space-x-2 bg-coolblack/40 text-white; } .add-icon {