Skip to content

Modern Docker Management, Designed for Everyone

fix: mobile layout and performence issues

Kyle Mendell981651263da0
diff --git a/frontend/src/lib/components/form/mobile-floating-form-actions.svelte b/frontend/src/lib/components/form/mobile-floating-form-actions.svelte
new file mode 100644
index 000000000..0865eefac
--- /dev/null
+++ b/frontend/src/lib/components/form/mobile-floating-form-actions.svelte
@@ -0,0 +1,128 @@
+<script lang="ts">
+ import { ArcaneButton } from '$lib/components/arcane-button/index.js';
+ import { getEffectiveNavigationSettings } from '$lib/utils/navigation.utils';
+ import { IsMobile } from '$lib/hooks/is-mobile.svelte.js';
+ import { IsTablet } from '$lib/hooks/is-tablet.svelte.js';
+ import settingsStore from '$lib/stores/config-store';
+ import { cn } from '$lib/utils';
+
+ interface Props {
+ hasChanges: boolean | null;
+ isLoading: boolean;
+ onSave: () => void | Promise<void>;
+ onReset: () => void;
+ }
+
+ let { hasChanges, isLoading, onSave, onReset }: Props = $props();
+
+ const isMobile = new IsMobile();
+ const isTablet = new IsTablet();
+ const isGlassEnabled = $derived.by(() => $settingsStore?.glassEffectEnabled ?? false);
+ const navigationSettings = $derived(getEffectiveNavigationSettings());
+ const navigationMode = $derived(navigationSettings.mode);
+ const scrollToHideEnabled = $derived(navigationSettings.scrollToHide);
+
+ // Track mobile nav visibility for FAB positioning
+ let mobileNavVisible = $state(true);
+
+ // Monitor mobile nav visibility when scroll-to-hide is enabled
+ $effect(() => {
+ if (typeof window === 'undefined') return;
+ if (!scrollToHideEnabled || !(isMobile.current || isTablet.current)) {
+ mobileNavVisible = true;
+ return;
+ }
+
+ // Check the mobile nav element's transform to determine visibility
+ const checkNavVisibility = () => {
+ const navElement = document.querySelector('[data-testid="mobile-floating-nav"], [data-testid="mobile-docked-nav"]');
+ if (!navElement) {
+ mobileNavVisible = true;
+ return;
+ }
+
+ const style = window.getComputedStyle(navElement);
+ const transform = style.transform;
+ const opacity = parseFloat(style.opacity);
+
+ // Check if nav is translated away or has low opacity
+ if (transform !== 'none' && transform.includes('matrix')) {
+ const matrix = transform.match(/matrix.*\((.+)\)/);
+ if (matrix) {
+ const values = matrix[1].split(', ');
+ const translateY = parseFloat(values[5] || '0');
+ // If translateY is positive (moved down), nav is hidden
+ mobileNavVisible = translateY === 0 && opacity > 0.5;
+ }
+ } else {
+ mobileNavVisible = opacity > 0.5;
+ }
+ };
+
+ // Initial check
+ checkNavVisibility();
+
+ // Use MutationObserver to watch for style changes on nav
+ const observer = new MutationObserver(checkNavVisibility);
+ const navElement = document.querySelector('[data-testid="mobile-floating-nav"], [data-testid="mobile-docked-nav"]');
+
+ if (navElement) {
+ observer.observe(navElement, {
+ attributes: true,
+ attributeFilter: ['style', 'class']
+ });
+ }
+
+ // Also check on scroll as a fallback
+ const handleScroll = () => {
+ requestAnimationFrame(checkNavVisibility);
+ };
+
+ window.addEventListener('scroll', handleScroll, { passive: true });
+
+ return () => {
+ observer.disconnect();
+ window.removeEventListener('scroll', handleScroll);
+ };
+ });
+</script>
+
+{#if isMobile.current || isTablet.current}
+ <div
+ class="fixed right-4 z-50 flex flex-col gap-3 transition-all duration-300 ease-out sm:hidden"
+ style="bottom: {scrollToHideEnabled && !mobileNavVisible
+ ? '1rem'
+ : 'calc(var(--mobile-' +
+ navigationMode +
+ '-nav-offset, ' +
+ (navigationMode === 'docked' ? 'calc(3.5rem + env(safe-area-inset-bottom))' : '6rem') +
+ ') + 1rem)'};"
+ >
+ {#if hasChanges}
+ <ArcaneButton
+ action="restart"
+ tone="outline"
+ size="lg"
+ onclick={onReset}
+ disabled={isLoading}
+ class={cn('size-14 rounded-full border-2 shadow-lg', isGlassEnabled ? 'bg-background/80 backdrop-blur-md' : 'bg-card')}
+ showLabel={false}
+ />
+ {/if}
+
+ <ArcaneButton
+ action="save"
+ onclick={onSave}
+ disabled={isLoading || !hasChanges}
+ loading={isLoading}
+ size="lg"
+ class="size-14 rounded-full shadow-lg"
+ showLabel={false}
+ />
+
+ <!-- Status indicator for mobile -->
+ {#if hasChanges}
+ <div class="absolute -top-2 -left-2 size-3 animate-pulse rounded-full bg-orange-500"></div>
+ {/if}
+ </div>
+{/if}
diff --git a/frontend/src/lib/components/quick-actions.svelte b/frontend/src/lib/components/quick-actions.svelte
index a8f2753a5..f1a5133ad 100644
--- a/frontend/src/lib/components/quick-actions.svelte
+++ b/frontend/src/lib/components/quick-actions.svelte
@@ -1,6 +1,7 @@
<script lang="ts">
import { Spinner } from '$lib/components/ui/spinner/index.js';
import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
+ import { ArcaneButton } from '$lib/components/arcane-button/index.js';
import { m } from '$lib/paraglide/messages';
import type { DockerInfo } from '$lib/types/docker-info.type';
import { RefreshIcon, StartIcon, StopIcon, TrashIcon, EllipsisIcon } from '$lib/icons';
@@ -118,50 +119,57 @@
</button>
</div>
- <DropdownMenu.Root>
- <DropdownMenu.Trigger
- class="bg-card/60 inline-flex size-9 items-center justify-center rounded-lg border backdrop-blur-sm sm:hidden"
- >
- <span class="sr-only">{m.common_open_menu()}</span>
- <EllipsisIcon class="size-4" />
- </DropdownMenu.Trigger>
+ <div class="sm:hidden">
+ <DropdownMenu.Root>
+ <DropdownMenu.Trigger>
+ {#snippet child({ props })}
+ <ArcaneButton {...props} action="base" tone="ghost" size="icon" class="bg-background/70 size-9 border">
+ <span class="sr-only">{m.common_open_menu()}</span>
+ <EllipsisIcon class="size-4" />
+ </ArcaneButton>
+ {/snippet}
+ </DropdownMenu.Trigger>
- <DropdownMenu.Content align="end" class="bg-popover/90 z-50 min-w-[160px] rounded-md p-1 shadow-lg backdrop-blur-md">
- <DropdownMenu.Group>
- <DropdownMenu.Item
- onclick={onStartAll}
- disabled={!dockerInfo || stoppedContainers === 0 || isLoading.starting || isLoading.stopping || isLoading.pruning}
- >
- {m.quick_actions_start_all()}
- </DropdownMenu.Item>
+ <DropdownMenu.Content
+ align="end"
+ class="bg-popover/90 z-50 min-w-[160px] rounded-xl border p-1 shadow-lg backdrop-blur-md"
+ >
+ <DropdownMenu.Group>
+ <DropdownMenu.Item
+ onclick={onStartAll}
+ disabled={!dockerInfo || stoppedContainers === 0 || isLoading.starting || isLoading.stopping || isLoading.pruning}
+ >
+ {m.quick_actions_start_all()}
+ </DropdownMenu.Item>
- <DropdownMenu.Item
- onclick={onStopAll}
- disabled={!dockerInfo ||
- (dockerInfo?.ContainersRunning ?? 0) === 0 ||
- isLoading.starting ||
- isLoading.stopping ||
- isLoading.pruning}
- >
- {m.quick_actions_stop_all()}
- </DropdownMenu.Item>
+ <DropdownMenu.Item
+ onclick={onStopAll}
+ disabled={!dockerInfo ||
+ (dockerInfo?.ContainersRunning ?? 0) === 0 ||
+ isLoading.starting ||
+ isLoading.stopping ||
+ isLoading.pruning}
+ >
+ {m.quick_actions_stop_all()}
+ </DropdownMenu.Item>
- <DropdownMenu.Item
- onclick={onOpenPruneDialog}
- disabled={!dockerInfo || isLoading.starting || isLoading.stopping || isLoading.pruning}
- >
- {m.quick_actions_prune_system()}
- </DropdownMenu.Item>
+ <DropdownMenu.Item
+ onclick={onOpenPruneDialog}
+ disabled={!dockerInfo || isLoading.starting || isLoading.stopping || isLoading.pruning}
+ >
+ {m.quick_actions_prune_system()}
+ </DropdownMenu.Item>
- <DropdownMenu.Item
- onclick={onRefresh}
- disabled={isLoading.starting || isLoading.stopping || isLoading.pruning || refreshing}
- >
- {m.common_refresh()}
- </DropdownMenu.Item>
- </DropdownMenu.Group>
- </DropdownMenu.Content>
- </DropdownMenu.Root>
+ <DropdownMenu.Item
+ onclick={onRefresh}
+ disabled={isLoading.starting || isLoading.stopping || isLoading.pruning || refreshing}
+ >
+ {m.common_refresh()}
+ </DropdownMenu.Item>
+ </DropdownMenu.Group>
+ </DropdownMenu.Content>
+ </DropdownMenu.Root>
+ </div>
{/if}
{:else}
<h2 class="mb-3 text-lg font-semibold tracking-tight">{m.quick_actions_title()}</h2>
diff --git a/frontend/src/routes/(app)/dashboard/+page.svelte b/frontend/src/routes/(app)/dashboard/+page.svelte
index ae5383344..58f3d222f 100644
--- a/frontend/src/routes/(app)/dashboard/+page.svelte
+++ b/frontend/src/routes/(app)/dashboard/+page.svelte
@@ -37,12 +37,14 @@
});
$effect(() => {
- containers = data.containers;
- images = data.images;
- dockerInfo = data.dockerInfo;
- containerStatusCounts = data.containerStatusCounts;
- dashboardStates.dockerInfo = data.dockerInfo;
- dashboardStates.settings = data.settings;
+ untrack(() => {
+ containers = data.containers;
+ images = data.images;
+ dockerInfo = data.dockerInfo;
+ containerStatusCounts = data.containerStatusCounts;
+ dashboardStates.dockerInfo = data.dockerInfo;
+ dashboardStates.settings = data.settings;
+ });
});
type PruneType = 'containers' | 'images' | 'networks' | 'volumes' | 'buildCache';
@@ -287,29 +289,27 @@
}
</script>
-<div class="flex min-h-full flex-col space-y-8">
- <div class="flex flex-col gap-4">
- <div class="flex items-start justify-between gap-3">
- <div class="flex-1 space-y-1">
- <h1 class="text-3xl font-bold tracking-tight">{m.dashboard_title()}</h1>
- <p class="text-muted-foreground max-w-2xl text-sm">{m.dashboard_subtitle()}</p>
- </div>
-
- <QuickActions
- class="shrink-0"
- compact
- dockerInfo={dashboardStates.dockerInfo}
- {stoppedContainers}
- {runningContainers}
- loadingDockerInfo={isLoading.loadingDockerInfo}
- isLoading={{ starting: isLoading.starting, stopping: isLoading.stopping, pruning: isLoading.pruning }}
- onStartAll={handleStartAll}
- onStopAll={handleStopAll}
- onOpenPruneDialog={() => (dashboardStates.isPruneDialogOpen = true)}
- onRefresh={refreshData}
- refreshing={isLoading.refreshing}
- />
+<div class="flex min-h-full flex-col space-y-8 pb-5 md:space-y-10 md:pb-5">
+ <div class="relative flex flex-col justify-between gap-4 sm:flex-row sm:items-center">
+ <div class="flex-1">
+ <h1 class="text-2xl font-bold tracking-tight sm:text-3xl">{m.dashboard_title()}</h1>
+ <p class="text-muted-foreground mt-1 text-sm">{m.dashboard_subtitle()}</p>
</div>
+
+ <QuickActions
+ class="absolute top-4 right-4 shrink-0 sm:static"
+ compact
+ dockerInfo={dashboardStates.dockerInfo}
+ {stoppedContainers}
+ {runningContainers}
+ loadingDockerInfo={isLoading.loadingDockerInfo}
+ isLoading={{ starting: isLoading.starting, stopping: isLoading.stopping, pruning: isLoading.pruning }}
+ onStartAll={handleStartAll}
+ onStopAll={handleStopAll}
+ onOpenPruneDialog={() => (dashboardStates.isPruneDialogOpen = true)}
+ onRefresh={refreshData}
+ refreshing={isLoading.refreshing}
+ />
</div>
<section>
diff --git a/frontend/src/routes/(app)/dashboard/dash-container-table.svelte b/frontend/src/routes/(app)/dashboard/dash-container-table.svelte
index c3ec83d51..2bd6f0197 100644
--- a/frontend/src/routes/(app)/dashboard/dash-container-table.svelte
+++ b/frontend/src/routes/(app)/dashboard/dash-container-table.svelte
@@ -12,6 +12,8 @@
import { m } from '$lib/paraglide/messages';
import { containerService } from '$lib/services/container-service';
import { goto } from '$app/navigation';
+ import { untrack } from 'svelte';
+ import { IsMobile } from '$lib/hooks';
import { ContainersIcon, ArrowRightIcon } from '$lib/icons';
let {
@@ -22,8 +24,10 @@
isLoading: boolean;
} = $props();
+ const isMobile = new IsMobile();
let selectedIds = $state<string[]>([]);
let contentHeight = $state(0);
+ let lastFetchedLimit = $state(5);
// Estimate row height: ~57px per row (including borders/padding), plus ~145px for header
const ROW_HEIGHT = 57;
@@ -45,6 +49,7 @@
});
const calculatedLimit = $derived.by(() => {
+ if (isMobile.current) return 10;
if (contentHeight <= 0) return 5;
let availableHeight = contentHeight - HEADER_HEIGHT;
if (shouldReserveFooter) {
@@ -54,18 +59,29 @@
return Math.max(MIN_ROWS, Math.min(MAX_ROWS, rows));
});
- let lastFetchedLimit = $state(5);
-
$effect(() => {
- const currentLimit = containers.pagination?.itemsPerPage;
- if (
- requestOptions.pagination &&
- (calculatedLimit !== lastFetchedLimit || (currentLimit !== undefined && currentLimit !== calculatedLimit))
- ) {
- lastFetchedLimit = calculatedLimit;
- requestOptions.pagination.limit = calculatedLimit;
- containerService.getContainers(requestOptions).then((result) => (containers = result));
- }
+ const limit = calculatedLimit;
+
+ const tid = untrack(() => {
+ const currentLimit = containers.pagination?.itemsPerPage;
+ if (requestOptions.pagination && (limit !== lastFetchedLimit || (currentLimit !== undefined && currentLimit !== limit))) {
+ return setTimeout(() => {
+ untrack(() => {
+ lastFetchedLimit = limit;
+ if (requestOptions.pagination) {
+ requestOptions.pagination.limit = limit;
+ containerService.getContainers(requestOptions).then((result) => {
+ untrack(() => {
+ containers = result;
+ });
+ });
+ }
+ });
+ }, 300);
+ }
+ });
+
+ if (tid) return () => clearTimeout(tid);
});
const columns = [
diff --git a/frontend/src/routes/(app)/dashboard/dash-image-table.svelte b/frontend/src/routes/(app)/dashboard/dash-image-table.svelte
index 56eef0775..a23236048 100644
--- a/frontend/src/routes/(app)/dashboard/dash-image-table.svelte
+++ b/frontend/src/routes/(app)/dashboard/dash-image-table.svelte
@@ -11,6 +11,8 @@
import { m } from '$lib/paraglide/messages';
import { imageService } from '$lib/services/image-service';
import { goto } from '$app/navigation';
+ import { untrack } from 'svelte';
+ import { IsMobile } from '$lib/hooks';
import { ImagesIcon, ArrowRightIcon } from '$lib/icons';
let {
@@ -21,6 +23,7 @@
isLoading: boolean;
} = $props();
+ const isMobile = new IsMobile();
let contentHeight = $state(0);
// Estimate row height: ~57px per row (including borders/padding), plus ~145px for header
@@ -43,6 +46,7 @@
});
const calculatedLimit = $derived.by(() => {
+ if (isMobile.current) return 10;
if (contentHeight <= 0) return 5;
let availableHeight = contentHeight - HEADER_HEIGHT;
if (shouldReserveFooter) {
@@ -56,15 +60,28 @@
let lastFetchedLimit = $state(5);
$effect(() => {
- const currentLimit = images.pagination?.itemsPerPage;
- if (
- requestOptions.pagination &&
- (calculatedLimit !== lastFetchedLimit || (currentLimit !== undefined && currentLimit !== calculatedLimit))
- ) {
- lastFetchedLimit = calculatedLimit;
- requestOptions.pagination.limit = calculatedLimit;
- imageService.getImages(requestOptions).then((result) => (images = result));
- }
+ const limit = calculatedLimit;
+
+ const tid = untrack(() => {
+ const currentLimit = images.pagination?.itemsPerPage;
+ if (requestOptions.pagination && (limit !== lastFetchedLimit || (currentLimit !== undefined && currentLimit !== limit))) {
+ return setTimeout(() => {
+ untrack(() => {
+ lastFetchedLimit = limit;
+ if (requestOptions.pagination) {
+ requestOptions.pagination.limit = limit;
+ imageService.getImages(requestOptions).then((result) => {
+ untrack(() => {
+ images = result;
+ });
+ });
+ }
+ });
+ }, 300);
+ }
+ });
+
+ if (tid) return () => clearTimeout(tid);
});
const columns = [
diff --git a/frontend/src/routes/(app)/environments/[id]/+page.svelte b/frontend/src/routes/(app)/environments/[id]/+page.svelte
index d37294243..c0d00ca2b 100644
--- a/frontend/src/routes/(app)/environments/[id]/+page.svelte
+++ b/frontend/src/routes/(app)/environments/[id]/+page.svelte
@@ -21,6 +21,7 @@
import type { AppVersionInformation } from '$lib/types/application-configuration';
import SelectWithLabel from '$lib/components/form/select-with-label.svelte';
import TextInputWithLabel from '$lib/components/form/text-input-with-label.svelte';
+ import MobileFloatingFormActions from '$lib/components/form/mobile-floating-form-actions.svelte';
import {
ArrowLeftIcon,
EnvironmentsIcon,
@@ -395,30 +396,32 @@
</div>
<div class="flex flex-wrap items-center gap-2">
- {#if hasChanges}
- <span class="text-xs text-orange-600 dark:text-orange-400">{m.environments_unsaved_changes()}</span>
- {:else}
- <span class="text-xs text-green-600 dark:text-green-400">{m.environments_all_changes_saved()}</span>
- {/if}
+ <div class="hidden items-center gap-2 sm:flex">
+ {#if hasChanges}
+ <span class="text-xs text-orange-600 dark:text-orange-400">{m.environments_unsaved_changes()}</span>
+ {:else}
+ <span class="text-xs text-green-600 dark:text-green-400">{m.environments_all_changes_saved()}</span>
+ {/if}
+
+ {#if hasChanges}
+ <ArcaneButton
+ action="restart"
+ tone="outline"
+ onclick={handleReset}
+ disabled={isSaving}
+ customLabel={m.common_reset()}
+ />
+ {/if}
- {#if hasChanges}
<ArcaneButton
- action="restart"
- tone="outline"
- onclick={handleReset}
- disabled={isSaving}
- customLabel={m.common_reset()}
+ action="save"
+ onclick={handleSave}
+ disabled={!hasChanges || isSaving}
+ loading={isSaving}
+ customLabel={m.common_save()}
+ loadingLabel={m.common_saving()}
/>
- {/if}
-
- <ArcaneButton
- action="save"
- onclick={handleSave}
- disabled={!hasChanges || isSaving}
- loading={isSaving}
- customLabel={m.common_save()}
- loadingLabel={m.common_saving()}
- />
+ </div>
{#if environment.id !== '0'}
<ArcaneButton
@@ -860,3 +863,5 @@
</AlertDialog.Content>
</AlertDialog.Root>
</div>
+
+<MobileFloatingFormActions {hasChanges} isLoading={isSaving} onSave={handleSave} onReset={handleReset} />
diff --git a/frontend/src/routes/(app)/settings/+layout.svelte b/frontend/src/routes/(app)/settings/+layout.svelte
index 721345c9e..a20438542 100644
--- a/frontend/src/routes/(app)/settings/+layout.svelte
+++ b/frontend/src/routes/(app)/settings/+layout.svelte
@@ -12,6 +12,7 @@
import { getEffectiveNavigationSettings } from '$lib/utils/navigation.utils';
import { cn } from '$lib/utils';
import { navigationItems } from '$lib/config/navigation-config';
+ import MobileFloatingFormActions from '$lib/components/form/mobile-floating-form-actions.svelte';
interface Props {
children: import('svelte').Snippet;
@@ -252,41 +253,10 @@
<!-- Mobile Floating Action Buttons -->
{#if isSubPage && !isReadOnly && formState.saveFunction}
- <div
- class="fixed right-4 z-50 flex flex-col gap-3 transition-all duration-300 ease-out sm:hidden"
- style="bottom: {scrollToHideEnabled && !mobileNavVisible
- ? '1rem'
- : 'calc(var(--mobile-' +
- navigationMode +
- '-nav-offset, ' +
- (navigationMode === 'docked' ? 'calc(3.5rem + env(safe-area-inset-bottom))' : '6rem') +
- ') + 1rem)'};"
- >
- {#if formState.hasChanges && formState.resetFunction}
- <ArcaneButton
- action="restart"
- tone="outline"
- size="lg"
- onclick={() => formState.resetFunction && formState.resetFunction()}
- disabled={formState.isLoading}
- class={cn('size-14 rounded-full border-2 shadow-lg', isGlassEnabled ? 'bg-background/80 backdrop-blur-md' : 'bg-card')}
- showLabel={false}
- />
- {/if}
-
- <ArcaneButton
- action="save"
- onclick={handleSave}
- disabled={formState.isLoading || !formState.hasChanges || !formState.saveFunction}
- loading={formState.isLoading}
- size="lg"
- class="size-14 rounded-full shadow-lg"
- showLabel={false}
- />
-
- <!-- Status indicator for mobile -->
- {#if formState.hasChanges}
- <div class="absolute -top-2 -left-2 size-3 animate-pulse rounded-full bg-orange-500"></div>
- {/if}
- </div>
+ <MobileFloatingFormActions
+ hasChanges={formState.hasChanges}
+ isLoading={formState.isLoading}
+ onSave={handleSave}
+ onReset={() => formState.resetFunction && formState.resetFunction()}
+ />
{/if}
diff --git a/frontend/src/routes/(auth)/login/+page.svelte b/frontend/src/routes/(auth)/login/+page.svelte
index cc675fc69..ecfd62f93 100644
--- a/frontend/src/routes/(auth)/login/+page.svelte
+++ b/frontend/src/routes/(auth)/login/+page.svelte
@@ -15,7 +15,10 @@
let { data }: { data: PageData } = $props();
- let loading = $state(false);
+ let isLoading = $state({
+ local: false,
+ oidc: false
+ });
let error = $state<string | null>(null);
let username = $state('');
let password = $state('');
@@ -28,9 +31,11 @@
const localAuthEnabledBySettings = $derived(data.settings?.authLocalEnabled !== false);
const showLocalLoginForm = $derived(localAuthEnabledBySettings);
- function handleOidcLogin() {
+ async function handleOidcLogin() {
+ isLoading.oidc = true;
const currentRedirect = data.redirectTo || '/dashboard';
- goto(`/oidc/login?redirect=${encodeURIComponent(currentRedirect)}`);
+ await goto(`/oidc/login?redirect=${encodeURIComponent(currentRedirect)}`);
+ isLoading.oidc = false;
}
async function handleLogin(event: Event) {
@@ -41,18 +46,18 @@
return;
}
- loading = true;
+ isLoading.local = true;
error = null;
try {
const user = await authService.login({ username, password });
userStore.setUser(user);
const redirectTo = data.redirectTo || '/dashboard';
- goto(redirectTo, { replaceState: true });
+ await goto(redirectTo, { replaceState: true });
} catch (err) {
error = err instanceof Error ? err.message : 'Login failed';
} finally {
- loading = false;
+ isLoading.local = false;
}
}
@@ -110,145 +115,165 @@
</Motion>
</div>
-<div class="relative flex min-h-screen flex-col items-center justify-center p-6 md:p-10">
- <div class="w-full max-w-md">
- <div class="mb-8 flex justify-center">
- <div class="bg-card/60 flex items-center justify-center rounded-2xl border p-6 shadow-lg backdrop-blur-2xl">
- <img class="h-24 w-auto" src={logoUrl} alt={m.layout_title()} />
+<div class="relative flex min-h-dvh flex-col items-center p-6 md:p-10">
+ <div class="flex w-full flex-1 flex-col items-center justify-center">
+ <div class="w-full max-w-md">
+ <div class="mb-8 flex justify-center">
+ <div class="bg-card/60 flex items-center justify-center rounded-2xl border p-6 shadow-lg backdrop-blur-2xl">
+ <img class="h-24 w-auto" src={logoUrl} alt={m.layout_title()} />
+ </div>
</div>
- </div>
- <Card.Root class="bg-card/60 flex flex-col gap-6 overflow-hidden border shadow-lg backdrop-blur-2xl">
- <Card.Content class="p-8">
- <div class="mb-8 flex flex-col items-center text-center">
- <h1 class="text-3xl font-bold tracking-tight">{m.auth_welcome_back_title()}</h1>
- <p class="text-muted-foreground mt-2 text-sm text-balance">{m.auth_login_subtitle()}</p>
- </div>
+ <Card.Root class="bg-card/60 flex flex-col gap-6 overflow-hidden border shadow-lg backdrop-blur-2xl">
+ <Card.Content class="p-8">
+ <div class="mb-8 flex flex-col items-center text-center">
+ <h1 class="text-3xl font-bold tracking-tight">{m.auth_welcome_back_title()}</h1>
+ <p class="text-muted-foreground mt-2 text-sm text-balance">{m.auth_login_subtitle()}</p>
+ </div>
+
+ <div class="space-y-4">
+ {#if data.error}
+ <Alert.Root variant="destructive" class="bg-card/60 border backdrop-blur-2xl">
+ <AlertIcon class="size-4" />
+ <Alert.Title>{m.auth_login_problem_title()}</Alert.Title>
+ <Alert.Description>
+ {#if data.error === 'oidc_invalid_response'}
+ {m.auth_oidc_invalid_response()}
+ {:else if data.error === 'oidc_misconfigured'}
+ {m.auth_oidc_misconfigured()}
+ {:else if data.error === 'oidc_userinfo_failed'}
+ {m.auth_oidc_userinfo_failed()}
+ {:else if data.error === 'oidc_missing_sub'}
+ {m.auth_oidc_missing_sub()}
+ {:else if data.error === 'oidc_email_collision'}
+ {m.auth_oidc_email_collision()}
+ {:else if data.error === 'oidc_token_error'}
+ {m.auth_oidc_token_error()}
+ {:else if data.error === 'user_processing_failed'}
+ {m.auth_user_processing_failed()}
+ {:else}
+ {m.auth_unexpected_error()}
+ {/if}
+ </Alert.Description>
+ </Alert.Root>
+ {/if}
+
+ {#if error}
+ <Alert.Root variant="destructive" class="bg-card/60 border backdrop-blur-2xl">
+ <AlertIcon class="size-4" />
+ <Alert.Title>{m.auth_failed_title()}</Alert.Title>
+ <Alert.Description>{error}</Alert.Description>
+ </Alert.Root>
+ {/if}
+
+ {#if !showLocalLoginForm && !showOidcLoginButton}
+ <Alert.Root variant="destructive" class="bg-card/60 border backdrop-blur-2xl">
+ <AlertIcon class="size-4" />
+ <Alert.Title>{m.auth_no_login_methods_title()}</Alert.Title>
+ <Alert.Description>{m.auth_no_login_methods_description()}</Alert.Description>
+ </Alert.Root>
+ {/if}
- <div class="space-y-4">
- {#if data.error}
- <Alert.Root variant="destructive" class="bg-card/60 border backdrop-blur-2xl">
- <AlertIcon class="size-4" />
- <Alert.Title>{m.auth_login_problem_title()}</Alert.Title>
- <Alert.Description>
- {#if data.error === 'oidc_invalid_response'}
- {m.auth_oidc_invalid_response()}
- {:else if data.error === 'oidc_misconfigured'}
- {m.auth_oidc_misconfigured()}
- {:else if data.error === 'oidc_userinfo_failed'}
- {m.auth_oidc_userinfo_failed()}
- {:else if data.error === 'oidc_missing_sub'}
- {m.auth_oidc_missing_sub()}
- {:else if data.error === 'oidc_email_collision'}
- {m.auth_oidc_email_collision()}
- {:else if data.error === 'oidc_token_error'}
- {m.auth_oidc_token_error()}
- {:else if data.error === 'user_processing_failed'}
- {m.auth_user_processing_failed()}
- {:else}
- {m.auth_unexpected_error()}
- {/if}
- </Alert.Description>
- </Alert.Root>
- {/if}
-
- {#if error}
- <Alert.Root variant="destructive" class="bg-card/60 border backdrop-blur-2xl">
- <AlertIcon class="size-4" />
- <Alert.Title>{m.auth_failed_title()}</Alert.Title>
- <Alert.Description>{error}</Alert.Description>
- </Alert.Root>
- {/if}
-
- {#if !showLocalLoginForm && !showOidcLoginButton}
- <Alert.Root variant="destructive" class="bg-card/60 border backdrop-blur-2xl">
- <AlertIcon class="size-4" />
- <Alert.Title>{m.auth_no_login_methods_title()}</Alert.Title>
- <Alert.Description>{m.auth_no_login_methods_description()}</Alert.Description>
- </Alert.Root>
- {/if}
-
- {#if showOidcLoginButton && !showLocalLoginForm}
- <ArcaneButton hoverEffect="none" action="oidc_login" onclick={() => handleOidcLogin()} {loading} />
- {/if}
-
- {#if showLocalLoginForm}
- <form onsubmit={handleLogin} class="space-y-4">
- <div class="space-y-2">
- <Label for="username" class="text-xs">{m.common_username()}</Label>
- <InputGroup.Root>
- <InputGroup.Addon>
- <UserIcon />
- </InputGroup.Addon>
- <InputGroup.Input
- id="username"
- name="username"
- type="text"
- autocomplete="username"
- required
- bind:value={username}
- placeholder={m.auth_username_placeholder()}
- disabled={loading}
- />
- </InputGroup.Root>
- </div>
- <div class="space-y-2">
- <Label for="password" class="text-xs">{m.common_password()}</Label>
- <InputGroup.Root>
- <InputGroup.Addon>
- <LockIcon />
- </InputGroup.Addon>
- <InputGroup.Input
- id="password"
- name="password"
- type="password"
- autocomplete="current-password"
- required
- bind:value={password}
- placeholder={m.auth_password_placeholder()}
- disabled={loading}
- />
- </InputGroup.Root>
- </div>
- <ArcaneButton type="submit" action="login" {loading} hoverEffect="none" />
- </form>
-
- {#if showDivider}
- <div class="relative my-4">
- <div class="absolute inset-0 flex items-center">
- <div class="border-border/60 w-full border-t"></div>
+ {#if showOidcLoginButton && !showLocalLoginForm}
+ <ArcaneButton
+ hoverEffect="none"
+ action="oidc_login"
+ onclick={() => handleOidcLogin()}
+ loading={isLoading.oidc}
+ disabled={isLoading.local}
+ />
+ {/if}
+
+ {#if showLocalLoginForm}
+ <form onsubmit={handleLogin} class="space-y-4">
+ <div class="space-y-2">
+ <Label for="username" class="text-xs">{m.common_username()}</Label>
+ <InputGroup.Root>
+ <InputGroup.Addon>
+ <UserIcon />
+ </InputGroup.Addon>
+ <InputGroup.Input
+ id="username"
+ name="username"
+ type="text"
+ autocomplete="username"
+ required
+ bind:value={username}
+ placeholder={m.auth_username_placeholder()}
+ disabled={isLoading.local || isLoading.oidc}
+ />
+ </InputGroup.Root>
</div>
- <div class="relative flex justify-center text-xs">
- <span class="bg-card/60 text-muted-foreground rounded-full border px-3 py-1 backdrop-blur-2xl">
- {m.auth_or_continue()}
- </span>
+ <div class="space-y-2">
+ <Label for="password" class="text-xs">{m.common_password()}</Label>
+ <InputGroup.Root>
+ <InputGroup.Addon>
+ <LockIcon />
+ </InputGroup.Addon>
+ <InputGroup.Input
+ id="password"
+ name="password"
+ type="password"
+ autocomplete="current-password"
+ required
+ bind:value={password}
+ placeholder={m.auth_password_placeholder()}
+ disabled={isLoading.local || isLoading.oidc}
+ />
+ </InputGroup.Root>
</div>
- </div>
- {/if}
+ <ArcaneButton
+ type="submit"
+ action="login"
+ loading={isLoading.local}
+ disabled={isLoading.oidc}
+ hoverEffect="none"
+ />
+ </form>
+
+ {#if showDivider}
+ <div class="relative my-4">
+ <div class="absolute inset-0 flex items-center">
+ <div class="border-border/60 w-full border-t"></div>
+ </div>
+ <div class="relative flex justify-center text-xs">
+ <span class="bg-card/60 text-muted-foreground rounded-full border px-3 py-1 backdrop-blur-2xl">
+ {m.auth_or_continue()}
+ </span>
+ </div>
+ </div>
+ {/if}
- {#if showOidcLoginButton && showDivider}
- <ArcaneButton action="oidc_login" hoverEffect="none" onclick={() => handleOidcLogin()} {loading} />
+ {#if showOidcLoginButton && showDivider}
+ <ArcaneButton
+ action="oidc_login"
+ hoverEffect="none"
+ onclick={() => handleOidcLogin()}
+ loading={isLoading.oidc}
+ disabled={isLoading.local}
+ />
+ {/if}
{/if}
- {/if}
- </div>
- </Card.Content>
- </Card.Root>
+ </div>
+ </Card.Content>
+ </Card.Root>
+ </div>
</div>
-</div>
-<div class="fixed right-0 bottom-4 left-0 p-4">
- <div class="text-muted-foreground flex flex-col items-center justify-center gap-2">
- <a
- href="https://github.com/ofkm/arcane"
- target="_blank"
- rel="noopener noreferrer"
- class="bg-card/60 hover:text-primary inline-flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-xs shadow-sm backdrop-blur-2xl transition-colors"
- >
- <GithubIcon class="size-4" />
- {m.common_view_on_github()}
- </a>
- {#if data.versionInformation?.displayVersion}
- <span class="text-xs opacity-50">{data.versionInformation.displayVersion}</span>
- {/if}
+ <div class="mt-auto pt-8 pb-4">
+ <div class="text-muted-foreground flex flex-col items-center justify-center gap-2">
+ <a
+ href="https://github.com/ofkm/arcane"
+ target="_blank"
+ rel="noopener noreferrer"
+ class="bg-card/60 hover:text-primary inline-flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-xs shadow-sm backdrop-blur-2xl transition-colors"
+ >
+ <GithubIcon class="size-4" />
+ {m.common_view_on_github()}
+ </a>
+ {#if data.versionInformation?.displayVersion}
+ <span class="text-xs opacity-50">{data.versionInformation.displayVersion}</span>
+ {/if}
+ </div>
</div>
</div>