fix: display version number
This commit is contained in:
parent
e6ab5700de
commit
d91c90a5c2
@ -41,7 +41,11 @@
|
|||||||
<div class={cn('grid gap-2', className)}>
|
<div class={cn('grid gap-2', className)}>
|
||||||
<Popover.Root>
|
<Popover.Root>
|
||||||
<Popover.Trigger
|
<Popover.Trigger
|
||||||
class={cn(buttonVariants({ variant: 'input' }), 'bg-based', !value && 'text-subtext')}
|
class={cn(
|
||||||
|
buttonVariants({ variant: 'input' }),
|
||||||
|
'bg-based text-md md:text-sm',
|
||||||
|
!value && 'text-subtext'
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
<CalendarIcon class="mr-2 size-4" />
|
<CalendarIcon class="mr-2 size-4" />
|
||||||
{#if value && value.start}
|
{#if value && value.start}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
bind:ref
|
bind:ref
|
||||||
data-slot="tabs-list"
|
data-slot="tabs-list"
|
||||||
class={cn(
|
class={cn(
|
||||||
'bg-based inline-flex h-9 w-fit items-center justify-center gap-1 rounded-lg p-[3px]',
|
'bg-based inline-flex h-11 w-fit items-center justify-center gap-1 rounded-lg p-[3px]',
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
{...restProps}
|
{...restProps}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import pkg from '../../../package.json' with { type: 'json' };
|
||||||
import * as Sheet from '$lib/ui/sheet';
|
import * as Sheet from '$lib/ui/sheet';
|
||||||
import * as DropdownMenu from '$lib/ui/dropdown-menu';
|
import * as DropdownMenu from '$lib/ui/dropdown-menu';
|
||||||
import * as Avatar from '$lib/ui/avatar';
|
import * as Avatar from '$lib/ui/avatar';
|
||||||
@ -223,6 +224,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footer class="border-surface text-subtext bg-mantle flex justify-center border-t py-1 text-xs">
|
<footer class="border-surface text-subtext bg-mantle flex justify-center border-t py-1 text-xs">
|
||||||
v. version
|
v. {pkg.version}
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
|
@ -27,11 +27,9 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="mx-4 my-2 flex flex-wrap items-center justify-center gap-2">
|
<div class="mx-4 my-2 flex flex-wrap items-center justify-center gap-2">
|
||||||
<LoaderCircle class={cn('invisible animate-spin', get.loading() && 'visible')} />
|
|
||||||
|
|
||||||
<Input
|
<Input
|
||||||
bind:value={get.input.filter}
|
bind:value={get.input.filter}
|
||||||
class="bg-based w-md"
|
class="bg-based max-w-sm"
|
||||||
placeholder="Filter"
|
placeholder="Filter"
|
||||||
onchange={() => {
|
onchange={() => {
|
||||||
get.submit();
|
get.submit();
|
||||||
@ -65,6 +63,8 @@
|
|||||||
get.submit();
|
get.submit();
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<LoaderCircle class={cn('invisible animate-spin', get.loading() && 'visible')} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#snippet editModal(item: Item)}
|
{#snippet editModal(item: Item)}
|
||||||
@ -260,9 +260,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-wrap justify-center gap-2 px-4 sm:hidden">
|
<div class="flex flex-wrap justify-center gap-2 px-4 sm:hidden">
|
||||||
{#if get.loading() && get.output.items.length == 0}
|
{#if get.output.items.length > 0}
|
||||||
<span>Loading</span>
|
|
||||||
{:else}
|
|
||||||
{#each get.output.items as item (item.id)}
|
{#each get.output.items as item (item.id)}
|
||||||
<Card class="flex flex-wrap gap-4">
|
<Card class="flex flex-wrap gap-4">
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
|
@ -17,6 +17,9 @@
|
|||||||
let tabValue = $state('login');
|
let tabValue = $state('login');
|
||||||
|
|
||||||
async function redirect() {
|
async function redirect() {
|
||||||
|
localStorage.setItem('username', login.input.username);
|
||||||
|
login.input.password = '';
|
||||||
|
|
||||||
if (page.url.searchParams.has('redir')) {
|
if (page.url.searchParams.has('redir')) {
|
||||||
const uri = decodeURIComponent(page.url.searchParams.get('redir')!);
|
const uri = decodeURIComponent(page.url.searchParams.get('redir')!);
|
||||||
await goto(uri);
|
await goto(uri);
|
||||||
@ -27,6 +30,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const login = coolForm(AuthClient, AuthService.method.login, {
|
const login = coolForm(AuthClient, AuthService.method.login, {
|
||||||
|
init: {
|
||||||
|
username: localStorage.getItem('username') ?? ''
|
||||||
|
},
|
||||||
|
reset: false,
|
||||||
onResult: () => {
|
onResult: () => {
|
||||||
redirect();
|
redirect();
|
||||||
}
|
}
|
||||||
@ -93,7 +100,7 @@
|
|||||||
<div class="flex gap-1">
|
<div class="flex gap-1">
|
||||||
<Button type="submit" loading={login.loading()} class="grow">Submit</Button>
|
<Button type="submit" loading={login.loading()} class="grow">Submit</Button>
|
||||||
{#if login.input.username}
|
{#if login.input.username}
|
||||||
<Button type="button" onclick={passkeyLogin}><Fingerprint /></Button>
|
<Button type="button" onclick={passkeyLogin} class="min-w-18"><Fingerprint /></Button>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -15,6 +15,9 @@ export default defineConfig({
|
|||||||
changeOrigin: true
|
changeOrigin: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
fs: {
|
||||||
|
allow: ['package.json']
|
||||||
|
},
|
||||||
host: '0.0.0.0'
|
host: '0.0.0.0'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -6,7 +6,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"log/slog"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
@ -30,9 +29,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
logger := slog.New(slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{}))
|
|
||||||
slog.SetDefault(logger)
|
|
||||||
|
|
||||||
// Get env
|
// Get env
|
||||||
env, err := getEnv()
|
env, err := getEnv()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -91,7 +87,7 @@ func main() {
|
|||||||
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
|
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
|
||||||
go func() {
|
go func() {
|
||||||
sig := <-sigs
|
sig := <-sigs
|
||||||
slog.Warn(fmt.Sprintf("Received signal %s, exiting", sig))
|
log.Printf("Received signal %s, exiting", sig)
|
||||||
|
|
||||||
// Close HTTP server
|
// Close HTTP server
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||||
@ -120,7 +116,7 @@ type env struct {
|
|||||||
func getEnv() (*env, error) {
|
func getEnv() (*env, error) {
|
||||||
err := godotenv.Load()
|
err := godotenv.Load()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
slog.Warn("Failed to load .env file, using environment variables")
|
log.Println("Failed to load .env file, using environment variables")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create
|
// Create
|
||||||
|
Loading…
x
Reference in New Issue
Block a user