From 57d43664728392f3c478398f03bd3957a921890f Mon Sep 17 00:00:00 2001 From: MrMelon54 Date: Mon, 13 Nov 2023 20:19:52 +0000 Subject: [PATCH] Some minor changes on the sites view --- src/views/SitesView.svelte | 23 ++++++++++++++++++----- test-server/main.go | 4 ++-- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/views/SitesView.svelte b/src/views/SitesView.svelte index d3061f4..2b77267 100644 --- a/src/views/SitesView.svelte +++ b/src/views/SitesView.svelte @@ -91,15 +91,21 @@ {#each tableKeys as key (key)} + {@const site = $sitesTable[key]} + {@const domain = site.domain.replace(/[^0-9a-z-]/gi, "-")} - {$sitesTable[key].domain} + {site.domain} - {#each $sitesTable[key].branches as branch} -
{branch}
-
+ {#each site.branches as branch} + {#if branch == ""} +
main or master
+ {:else} +
{branch}
+ {/if} +
{/each} - + {/each} @@ -117,5 +123,12 @@ .branch-cell { display: grid; grid-template-columns: repeat(2, auto); + + width: fit-content; + gap: 8px; + } + + .main-or-master { + color: lightgreen; } diff --git a/test-server/main.go b/test-server/main.go index 17b97de..5481fae 100644 --- a/test-server/main.go +++ b/test-server/main.go @@ -173,13 +173,13 @@ func apiServer(verify mjwt.Verifier) { for i := 0; i < 20; i++ { m = append(m, map[string]any{ "domain": uuid.NewString() + ".example.com", - "branches": []string{"@", "@beta"}, + "branches": []string{"", "beta"}, }) } for i := 0; i < 20; i++ { m = append(m, map[string]any{ "domain": uuid.NewString() + ".example.org", - "branches": []string{"@", "@alpha"}, + "branches": []string{"", "alpha"}, }) } json.NewEncoder(rw).Encode(m)