Compare commits

..

5 Commits

Author SHA1 Message Date
1782e68984 fix: mobile layout white spaces / underlying body showing 2025-04-21 00:31:07 +02:00
de1184b742 fix: navbar must only display devices if non-admin
also changed mobile layout a tiny bit
2025-04-21 00:26:44 +02:00
0ea3624ecd fix: scrollbar issues
untested on windows - todo
2025-04-20 22:59:50 +02:00
2f0fd05d35 fix: missing empty list placeholder 2025-04-20 22:35:37 +02:00
456131602f fix: reversed unique check 2025-04-20 22:27:40 +02:00
8 changed files with 30 additions and 13 deletions

View File

@ -3,4 +3,9 @@
* {
font-family: 'Inter', sans-serif;
scrollbar-color: var(--color-neutral-600) transparent;
}
body {
background-color: var(--color-neutral-800);
}

View File

@ -29,7 +29,7 @@ export class LowUserRepo implements IUserRepo {
}
async create(user: New<User>) {
if (!this.db.data.users.find((u) => u.name == user.name)) {
if (this.db.data.users.some((u) => u.name == user.name)) {
return UserErrors.DUPLICATE_NAME;
}

View File

@ -2,7 +2,7 @@
import { Button } from 'bits-ui';
import IconPlus from '~icons/tabler/plus';
let { createHref = null, msgAdd = '', children } = $props();
let { createHref = null, msgAdd = '', empty = false, children } = $props();
</script>
{#if createHref}
@ -21,7 +21,8 @@
<div class="w-full sm:px-6 px-3 py-4 max-w-3xl mx-auto">
{#if children}
{@render children?.()}
{:else}
{/if}
{#if empty}
<div class="p-4 text-center text-neutral-700">
<p>Nothing here.</p>
{#if createHref}

View File

@ -4,10 +4,11 @@
let { Icon = null, children, active, ...others } = $props();
</script>
<li role="none">
<li role="none" class="grow-1">
<Button.Root
role="menuitem"
class="flex items-center cursor-pointer px-4 py-1 rounded-full transition-all duration-300 ease-in-out
class="flex items-center justify-center cursor-pointer px-4 py-1 rounded-full
transition-all duration-300 ease-in-out
{active ? 'bg-neutral-100 text-neutral-900' : 'hover:bg-neutral-600'}"
{...others}
>

View File

@ -34,10 +34,12 @@
<NavBarLink Icon={IconHome} active={isActive('devices')} href="/dash/devices"
>Devices</NavBarLink
>
<NavBarLink Icon={IconUsers} active={isActive('users')} href="/dash/users">Users</NavBarLink>
<NavBarLink Icon={IconUsersGroup} active={isActive('groups')} href="/dash/groups"
>Groups</NavBarLink
>
{#if data.user.admin}
<NavBarLink Icon={IconUsers} active={isActive('users')} href="/dash/users">Users</NavBarLink>
<NavBarLink Icon={IconUsersGroup} active={isActive('groups')} href="/dash/groups"
>Groups</NavBarLink
>
{/if}
</NavBar>
<div class="flex grow">
<div
@ -97,6 +99,6 @@
</div>
</div>
<div class="w-full h-svh bg-neutral-900 overflow-y-scroll sm:pt-20 pt-28">
<div class="w-full h-dvh bg-neutral-900 overflow-y-auto sm:pt-20 pt-28">
{@render children()}
</div>

View File

@ -28,7 +28,11 @@
});
</script>
<ListPage createHref={data.user.admin ? '/dash/devices/new' : null} msgAdd="Add Device">
<ListPage
createHref={data.user.admin ? '/dash/devices/new' : null}
empty={data.devices.length == 0}
msgAdd="Add Device"
>
<div class="flex gap-4 flex-wrap justify-center">
{#each data.devices as device}
<ResCard

View File

@ -8,7 +8,11 @@
store.pageTitle = 'Listing all groups';
</script>
<ListPage createHref={data.user.admin ? '/dash/groups/new' : null} msgAdd="Add Group">
<ListPage
createHref={data.user.admin ? '/dash/groups/new' : null}
empty={data.groups.length == 0}
msgAdd="Add Group"
>
<div class="flex gap-4 flex-wrap justify-center">
{#each data.groups as group}
<ResCard

View File

@ -28,7 +28,7 @@
<title>{env.PUBLIC_SITE_NAME} - Sign In</title>
</svelte:head>
<div class="flex items-center justify-center w-svw h-svh bg-neutral-900">
<div class="flex items-center justify-center w-svw h-dvh bg-neutral-900">
<div
class="flex flex-col m-4 w-full max-w-120 bg-neutral-950 p-8 sm:p-12 sm:px
rounded-2xl border border-neutral-700 shadow-xl"