Compare commits
5 Commits
fb44cf9fa3
...
1782e68984
| Author | SHA1 | Date | |
|---|---|---|---|
| 1782e68984 | |||
| de1184b742 | |||
| 0ea3624ecd | |||
| 2f0fd05d35 | |||
| 456131602f |
@ -3,4 +3,9 @@
|
|||||||
|
|
||||||
* {
|
* {
|
||||||
font-family: 'Inter', sans-serif;
|
font-family: 'Inter', sans-serif;
|
||||||
|
scrollbar-color: var(--color-neutral-600) transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
background-color: var(--color-neutral-800);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,7 +29,7 @@ export class LowUserRepo implements IUserRepo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async create(user: New<User>) {
|
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;
|
return UserErrors.DUPLICATE_NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
import { Button } from 'bits-ui';
|
import { Button } from 'bits-ui';
|
||||||
import IconPlus from '~icons/tabler/plus';
|
import IconPlus from '~icons/tabler/plus';
|
||||||
|
|
||||||
let { createHref = null, msgAdd = '', children } = $props();
|
let { createHref = null, msgAdd = '', empty = false, children } = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if createHref}
|
{#if createHref}
|
||||||
@ -21,7 +21,8 @@
|
|||||||
<div class="w-full sm:px-6 px-3 py-4 max-w-3xl mx-auto">
|
<div class="w-full sm:px-6 px-3 py-4 max-w-3xl mx-auto">
|
||||||
{#if children}
|
{#if children}
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
{:else}
|
{/if}
|
||||||
|
{#if empty}
|
||||||
<div class="p-4 text-center text-neutral-700">
|
<div class="p-4 text-center text-neutral-700">
|
||||||
<p>Nothing here.</p>
|
<p>Nothing here.</p>
|
||||||
{#if createHref}
|
{#if createHref}
|
||||||
|
|||||||
@ -4,10 +4,11 @@
|
|||||||
let { Icon = null, children, active, ...others } = $props();
|
let { Icon = null, children, active, ...others } = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<li role="none">
|
<li role="none" class="grow-1">
|
||||||
<Button.Root
|
<Button.Root
|
||||||
role="menuitem"
|
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'}"
|
{active ? 'bg-neutral-100 text-neutral-900' : 'hover:bg-neutral-600'}"
|
||||||
{...others}
|
{...others}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -34,10 +34,12 @@
|
|||||||
<NavBarLink Icon={IconHome} active={isActive('devices')} href="/dash/devices"
|
<NavBarLink Icon={IconHome} active={isActive('devices')} href="/dash/devices"
|
||||||
>Devices</NavBarLink
|
>Devices</NavBarLink
|
||||||
>
|
>
|
||||||
<NavBarLink Icon={IconUsers} active={isActive('users')} href="/dash/users">Users</NavBarLink>
|
{#if data.user.admin}
|
||||||
<NavBarLink Icon={IconUsersGroup} active={isActive('groups')} href="/dash/groups"
|
<NavBarLink Icon={IconUsers} active={isActive('users')} href="/dash/users">Users</NavBarLink>
|
||||||
>Groups</NavBarLink
|
<NavBarLink Icon={IconUsersGroup} active={isActive('groups')} href="/dash/groups"
|
||||||
>
|
>Groups</NavBarLink
|
||||||
|
>
|
||||||
|
{/if}
|
||||||
</NavBar>
|
</NavBar>
|
||||||
<div class="flex grow">
|
<div class="flex grow">
|
||||||
<div
|
<div
|
||||||
@ -97,6 +99,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</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()}
|
{@render children()}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -28,7 +28,11 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</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">
|
<div class="flex gap-4 flex-wrap justify-center">
|
||||||
{#each data.devices as device}
|
{#each data.devices as device}
|
||||||
<ResCard
|
<ResCard
|
||||||
|
|||||||
@ -8,7 +8,11 @@
|
|||||||
store.pageTitle = 'Listing all groups';
|
store.pageTitle = 'Listing all groups';
|
||||||
</script>
|
</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">
|
<div class="flex gap-4 flex-wrap justify-center">
|
||||||
{#each data.groups as group}
|
{#each data.groups as group}
|
||||||
<ResCard
|
<ResCard
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
<title>{env.PUBLIC_SITE_NAME} - Sign In</title>
|
<title>{env.PUBLIC_SITE_NAME} - Sign In</title>
|
||||||
</svelte:head>
|
</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
|
<div
|
||||||
class="flex flex-col m-4 w-full max-w-120 bg-neutral-950 p-8 sm:p-12 sm:px
|
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"
|
rounded-2xl border border-neutral-700 shadow-xl"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user