From 658f441463c5ba763b886bccb2697082e19d951f Mon Sep 17 00:00:00 2001 From: Aidan Jones Date: Wed, 15 Apr 2026 16:25:28 -0500 Subject: [PATCH 01/25] Add sidebar --- src/app.css | 1 + src/routes/(ui)/+layout.svelte | 193 +++++++++++++++++++++++++-------- 2 files changed, 149 insertions(+), 45 deletions(-) diff --git a/src/app.css b/src/app.css index 421c1462..4eb13a66 100644 --- a/src/app.css +++ b/src/app.css @@ -1,6 +1,7 @@ @import 'tailwindcss'; @plugin 'daisyui' { + exclude: rootscrollgutter; themes: light --default, dark --prefersdark; diff --git a/src/routes/(ui)/+layout.svelte b/src/routes/(ui)/+layout.svelte index e1fe5692..6778416e 100644 --- a/src/routes/(ui)/+layout.svelte +++ b/src/routes/(ui)/+layout.svelte @@ -12,60 +12,158 @@ let { children, data }: Props = $props(); function isUrlActive(route: string) { - return page.url.pathname === route; + return page.url.pathname.startsWith(route); + } + + let drawerToggle: HTMLInputElement; + function closeDrawer() { + if (drawerToggle.checked) { + drawerToggle.click(); + } } -
- +
+
+
+ {@render children?.()} +
+
+ - - -
-
- {@render children?.()} -
-
- + From 787d6a6f19423dc40203481ec60dccba64733609 Mon Sep 17 00:00:00 2001 From: Aidan Jones Date: Wed, 15 Apr 2026 16:31:00 -0500 Subject: [PATCH 02/25] Port icon implementation from Scriptoria --- src/lib/components/SortTable.svelte | 7 ++++--- src/lib/icons/ArrowDownIcon.svelte | 10 ---------- src/lib/icons/ArrowUpIcon.svelte | 10 ---------- src/lib/{components => icons}/IconContainer.svelte | 7 ++++--- src/lib/icons/index.ts | 14 +++++++++++--- src/routes/(ui)/+layout.svelte | 11 ++++++----- src/routes/(ui)/build-admin/+page.svelte | 7 ++++--- src/routes/(ui)/client-admin/+page.svelte | 9 +++++---- src/routes/(ui)/job-admin/+page.svelte | 7 ++++--- src/routes/(ui)/project-admin/+page.svelte | 7 ++++--- src/routes/(ui)/release-admin/+page.svelte | 7 ++++--- 11 files changed, 46 insertions(+), 50 deletions(-) delete mode 100644 src/lib/icons/ArrowDownIcon.svelte delete mode 100644 src/lib/icons/ArrowUpIcon.svelte rename src/lib/{components => icons}/IconContainer.svelte (84%) diff --git a/src/lib/components/SortTable.svelte b/src/lib/components/SortTable.svelte index 58b72aa3..f052094e 100644 --- a/src/lib/components/SortTable.svelte +++ b/src/lib/components/SortTable.svelte @@ -4,7 +4,8 @@ --> -
-
+ diff --git a/src/lib/icons/index.ts b/src/lib/icons/index.ts index 1799b70c..3aedb7b1 100644 --- a/src/lib/icons/index.ts +++ b/src/lib/icons/index.ts @@ -1,4 +1,12 @@ -import ArrowDownIcon from './ArrowDownIcon.svelte'; -import ArrowUpIcon from './ArrowUpIcon.svelte'; +export const Icons = { + Delete: 'mdi:trash', + Edit: 'mdi:pencil', + Hamburger: 'mdi:hamburger-menu', + Logout: 'mdi:logout', + SortAsc: 'bx:sort-a-z', + SortDesc: 'bx:sort-z-a', + User: 'mdi:user', + View: 'mdi:eye' +} as const; -export { ArrowDownIcon, ArrowUpIcon }; +export type IconType = (typeof Icons)[keyof typeof Icons]; diff --git a/src/routes/(ui)/+layout.svelte b/src/routes/(ui)/+layout.svelte index 6778416e..4044e9cb 100644 --- a/src/routes/(ui)/+layout.svelte +++ b/src/routes/(ui)/+layout.svelte @@ -2,7 +2,8 @@ import type { Snippet } from 'svelte'; import type { PageData } from './$types'; import { page } from '$app/state'; - import IconContainer from '$lib/components/IconContainer.svelte'; + import { Icons } from '$lib/icons'; + import IconContainer from '$lib/icons/IconContainer.svelte'; interface Props { children: Snippet; @@ -112,7 +113,7 @@ for="primary-content-drawer" class="btn btn-ghost btn-circle p-1 drawer-button lg:hidden text-primary-content hover:text-base-content" > - + SIL Global @@ -123,12 +124,12 @@
  • @@ -57,6 +58,7 @@ href="/project-admin" onclick={closeDrawer} > + Projects @@ -67,6 +69,7 @@ href="/job-admin" onclick={closeDrawer} > + Jobs @@ -77,6 +80,7 @@ href="/build-admin" onclick={closeDrawer} > + Builds @@ -87,6 +91,7 @@ href="/release-admin" onclick={closeDrawer} > + Releases @@ -96,8 +101,11 @@ class:active-menu-item={isUrlActive('/queue-admin')} href="/queue-admin" onclick={closeDrawer} + target="_blank" > + Queues + From ae1a2dc5040d1e1b0139bb0ad4c6d630bd326c8e Mon Sep 17 00:00:00 2001 From: Aidan Jones Date: Thu, 16 Apr 2026 11:09:54 -0500 Subject: [PATCH 04/25] Display record counts in sidebar --- src/routes/(ui)/+layout.server.ts | 12 ++++- src/routes/(ui)/+layout.svelte | 79 +++++++++---------------------- src/routes/(ui)/+page.svelte | 11 ----- 3 files changed, 34 insertions(+), 68 deletions(-) diff --git a/src/routes/(ui)/+layout.server.ts b/src/routes/(ui)/+layout.server.ts index e5cf9daa..62e7f036 100644 --- a/src/routes/(ui)/+layout.server.ts +++ b/src/routes/(ui)/+layout.server.ts @@ -1,5 +1,15 @@ import type { LayoutServerLoad } from './$types'; +import { prisma } from '$lib/server/prisma'; export const load = (async ({ locals }) => { - return { userEmail: locals.userEmail }; + return { + userEmail: locals.userEmail, + count: { + client: await prisma.client.count(), + project: await prisma.project.count(), + job: await prisma.job.count(), + build: await prisma.build.count(), + release: await prisma.release.count() + } + }; }) satisfies LayoutServerLoad; diff --git a/src/routes/(ui)/+layout.svelte b/src/routes/(ui)/+layout.svelte index 050e2223..b9be6623 100644 --- a/src/routes/(ui)/+layout.svelte +++ b/src/routes/(ui)/+layout.svelte @@ -2,7 +2,7 @@ import type { Snippet } from 'svelte'; import type { PageData } from './$types'; import { page } from '$app/state'; - import { Icons } from '$lib/icons'; + import { type IconType, Icons } from '$lib/icons'; import IconContainer from '$lib/icons/IconContainer.svelte'; interface Props { @@ -22,6 +22,14 @@ drawerToggle.click(); } } + + const links: { target: keyof PageData['count']; icon: IconType; title: string }[] = [ + { target: 'client', icon: Icons.User, title: 'Clients' }, + { target: 'project', icon: Icons.Project, title: 'Projects' }, + { target: 'job', icon: Icons.Product, title: 'Jobs' }, + { target: 'build', icon: Icons.Build, title: 'Builds' }, + { target: 'release', icon: Icons.Publish, title: 'Releases' } + ];
    @@ -40,61 +48,20 @@ >
    From c0e72a2f68f47cd00809934cbc1d0a0dd743889f Mon Sep 17 00:00:00 2001 From: Aidan Jones Date: Thu, 16 Apr 2026 12:53:21 -0500 Subject: [PATCH 05/25] Redo home page info display --- src/routes/(ui)/+page.server.ts | 13 ++++ src/routes/(ui)/+page.svelte | 104 ++++++++++++++++---------------- 2 files changed, 66 insertions(+), 51 deletions(-) create mode 100644 src/routes/(ui)/+page.server.ts diff --git a/src/routes/(ui)/+page.server.ts b/src/routes/(ui)/+page.server.ts new file mode 100644 index 00000000..e235fe16 --- /dev/null +++ b/src/routes/(ui)/+page.server.ts @@ -0,0 +1,13 @@ +import type { PageServerLoad } from './$types'; +import { prisma } from '$lib/server/prisma'; + +export const load = (async () => { + return { + aggregate: { + project: await prisma.project.groupBy({ by: ['app_id'], _count: true }), + job: await prisma.job.groupBy({ by: ['app_id'], _count: true }), + build: await prisma.build.groupBy({ by: ['result'], _count: true }), + release: await prisma.release.groupBy({ by: ['result'], _count: true }) + } + }; +}) satisfies PageServerLoad; diff --git a/src/routes/(ui)/+page.svelte b/src/routes/(ui)/+page.svelte index d242cf3d..f3d0f9aa 100644 --- a/src/routes/(ui)/+page.svelte +++ b/src/routes/(ui)/+page.svelte @@ -1,9 +1,24 @@ -
    @@ -11,58 +26,45 @@

    App Publishing Service

    Administration

    -
    -
    -

    Job

    -

    - View, edit, or remove entries from the job table. Jobs point to the AWS S3 repository that - contains the source for the builds and publishes associated with this job. Deleting job - entries also deletes any associated builds and releases associated with the job. -

    - Job Administration » -
    -
    -

    Build

    -

    - View, edit, or remove entries from the build table. Each entry in this table contains a url - link to the instance of the associated AWS Codebuild build attempt. Deleting the build also - deletes any releases associated with this build. -

    - Build Administration » -
    -
    -

    Release

    -

    - View, edit, or remove entries from the release table. Entries in this table relate to - attempts to publish builds in Google Play store or other customized locations. Each entry in - this table contains a url link to the instance of the associated AWS Codebuild publish - attempt. -

    - Release Administration » -
    -
    -

    Client

    -

    - View, edit, or remove entries from the client table. Used if multiple Scriptoria sites are - sending requests to the build engine. Access tokens, which are used for the Authentication: - Bearer fields of requests are entered along with a prefix that is used in naming jobs - associated with this client. -

    - Client Administration » -
    -
    -

    Project

    -

    - View, edit, or remove entries from the project table. Each entry contains a link to be used - by Scripture App Builder to create or update a source repository in AWS S3. -

    - Project Administration » -
    +
    + {#each cards as { target, title }} +
    + + + + + + + + + + {#each data.aggregate[target] as entry} + + + + + {/each} + +
    + {('result' in entry ? entry.result : entry.app_id) || 'UNKNOWN'} + + {entry._count} +
    +
    + {/each}
    From ba62edd63275c047f3d12600abc7368152126809 Mon Sep 17 00:00:00 2001 From: Aidan Jones Date: Thu, 16 Apr 2026 12:55:00 -0500 Subject: [PATCH 06/25] Remove unused function --- src/lib/server/utils.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/lib/server/utils.ts b/src/lib/server/utils.ts index 98863cea..e69de29b 100644 --- a/src/lib/server/utils.ts +++ b/src/lib/server/utils.ts @@ -1,5 +0,0 @@ -export class Utils { - public static getPrefix() { - return new Date().toISOString(); - } -} From 958b7e6ce45ea91ce1358329ae1edf9641662784 Mon Sep 17 00:00:00 2001 From: Aidan Jones Date: Thu, 16 Apr 2026 12:55:09 -0500 Subject: [PATCH 07/25] Fix index display in lists --- src/routes/(ui)/client-admin/+page.svelte | 2 +- src/routes/(ui)/job-admin/+page.svelte | 2 +- src/routes/(ui)/project-admin/+page.svelte | 2 +- src/routes/(ui)/release-admin/+page.svelte | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/routes/(ui)/client-admin/+page.svelte b/src/routes/(ui)/client-admin/+page.svelte index 13838e17..b7522418 100644 --- a/src/routes/(ui)/client-admin/+page.svelte +++ b/src/routes/(ui)/client-admin/+page.svelte @@ -102,7 +102,7 @@ > {#snippet row(client, index)} - {index + 1} + {index + $form.page.page * $form.page.size + 1} {client.id} {client.access_token} {client.prefix} diff --git a/src/routes/(ui)/job-admin/+page.svelte b/src/routes/(ui)/job-admin/+page.svelte index 36f1032c..e13abedb 100644 --- a/src/routes/(ui)/job-admin/+page.svelte +++ b/src/routes/(ui)/job-admin/+page.svelte @@ -105,7 +105,7 @@ > {#snippet row(job, index)} - {index + 1} + {index + $form.page.page * $form.page.size + 1} {job.id} {job.request_id} {job.git_url} diff --git a/src/routes/(ui)/project-admin/+page.svelte b/src/routes/(ui)/project-admin/+page.svelte index a32d6af9..f0f626a3 100644 --- a/src/routes/(ui)/project-admin/+page.svelte +++ b/src/routes/(ui)/project-admin/+page.svelte @@ -105,7 +105,7 @@ > {#snippet row(project, index)} - {index + 1} + {index + $form.page.page * $form.page.size + 1} {project.id} {project.status} {project.url} diff --git a/src/routes/(ui)/release-admin/+page.svelte b/src/routes/(ui)/release-admin/+page.svelte index 2e43839d..62dce691 100644 --- a/src/routes/(ui)/release-admin/+page.svelte +++ b/src/routes/(ui)/release-admin/+page.svelte @@ -100,7 +100,7 @@ > {#snippet row(release, index)} - {index + 1} + {index + $form.page.page * $form.page.size + 1} {release.id} From 425f450747c4a26093966e6ec12c75152e41be39 Mon Sep 17 00:00:00 2001 From: Aidan Jones Date: Thu, 16 Apr 2026 13:01:26 -0500 Subject: [PATCH 08/25] Fix route highlight --- src/routes/(ui)/+layout.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/(ui)/+layout.svelte b/src/routes/(ui)/+layout.svelte index b9be6623..6ad2aad3 100644 --- a/src/routes/(ui)/+layout.svelte +++ b/src/routes/(ui)/+layout.svelte @@ -12,8 +12,8 @@ let { children, data }: Props = $props(); - function isUrlActive(route: string) { - return page.url.pathname.startsWith(route); + function isUrlActive(route: string, exact = false) { + return exact ? page.url.pathname === route : page.url.pathname.startsWith(route); } let drawerToggle: HTMLInputElement; @@ -94,7 +94,7 @@ -
    -
    +
    +