@futo-org/backups-orchestrator-ui 0.47.0 → 0.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/backends/dialogs/OAuthDeviceFlowModal.svelte +7 -3
- package/dist/components/backups/BackupStatus.svelte +30 -5
- package/dist/components/backups/BackupStatus.svelte.d.ts +2 -0
- package/dist/components/backups/BackupTaskMonitor.svelte +6 -0
- package/dist/components/{dashboard/DashboardInstall.svelte.d.ts → backups/BackupTaskMonitor.svelte.d.ts} +3 -3
- package/dist/components/backups/dialogs/RestoreSnapshotModal.svelte +7 -11
- package/dist/components/backups/dialogs/ViewStatusModal.svelte +4 -1
- package/dist/components/backups/metrics-history/MetricsHistoryModal.svelte +131 -124
- package/dist/components/dashboard/DashboardAvgBackupTime.svelte +2 -0
- package/dist/components/dashboard/DashboardBackupHealth.svelte +73 -67
- package/dist/components/dashboard/DashboardCurrentUsage.svelte +6 -1
- package/dist/components/dashboard/DashboardDailyBackupTime.svelte +2 -0
- package/dist/components/dashboard/DashboardPage.svelte +51 -23
- package/dist/components/dashboard/DashboardRecentBackups.svelte +1 -1
- package/dist/components/dashboard/DashboardTotalStored.svelte +3 -1
- package/dist/components/integrations/immich/ImmichBackupsAdminNavButton.svelte +3 -2
- package/dist/components/integrations/immich/ImmichBackupsAdminNavButton.svelte.d.ts +1 -0
- package/dist/components/integrations/immich/ImmichBackupsPage.svelte +1 -5
- package/dist/components/integrations/immich/ImmichBackupsPage.svelte.d.ts +0 -2
- package/dist/components/integrations/immich/ImmichBackupsSidebarItem.svelte +3 -1
- package/dist/components/integrations/immich/ImmichBackupsSidebarItem.svelte.d.ts +1 -0
- package/dist/components/integrations/immich/ImmichManageBackupOverview.svelte +34 -28
- package/dist/components/integrations/immich/ImmichManageBackupPage.svelte +2 -0
- package/dist/components/integrations/immich/ImmichOnboardingRestoreFlow.svelte +43 -22
- package/dist/components/integrations/immich/ImmichOnboardingSetupFlow.svelte +71 -73
- package/dist/components/integrations/immich/settings/ImmichSettingsBackupContents.svelte +24 -16
- package/dist/components/integrations/immich/settings/ImmichSettingsBandwidth.svelte +25 -21
- package/dist/components/integrations/immich/settings/ImmichSettingsStorage.svelte +8 -1
- package/dist/components/onboarding/OnboardingLogin.svelte +4 -2
- package/dist/components/onboarding/RecoveryKeyDisplay.svelte +17 -10
- package/dist/components/onboarding/SampleOnboarding.svelte +39 -38
- package/dist/components/onboarding/restore-point-flow/RestorePointFlow2SelectSnapshot.svelte +8 -4
- package/dist/components/onboarding/restore-point-flow/RestorePointFlow3ConfirmRestore.svelte +25 -15
- package/dist/components/onboarding/restore-point-flow/RestorePointFlow4Restore.svelte +8 -3
- package/dist/components/onboarding/steps/OnboardingStep1FinishSetup.svelte +0 -1
- package/dist/components/onboarding/steps/OnboardingStep2ConnectAccount.svelte +4 -4
- package/dist/components/onboarding/steps/OnboardingStep3SaveRecoveryKey.svelte +14 -3
- package/dist/components/onboarding/steps/OnboardingStep3SaveRecoveryKey.svelte.d.ts +1 -0
- package/dist/components/onboarding/steps/OnboardingStep4FirstBackup.svelte +4 -4
- package/dist/components/onboarding/steps/OnboardingStepBackupServices.svelte +52 -0
- package/dist/components/onboarding/steps/OnboardingStepBackupServices.svelte.d.ts +7 -0
- package/dist/components/onboarding/steps/OnboardingStepChooseStorage.svelte +82 -0
- package/dist/components/onboarding/steps/OnboardingStepChooseStorage.svelte.d.ts +6 -0
- package/dist/components/onboarding/steps/OnboardingStepConfirmRecoveryKey.svelte +62 -0
- package/dist/components/onboarding/steps/OnboardingStepConfirmRecoveryKey.svelte.d.ts +9 -0
- package/dist/components/onboarding/steps/OnboardingStepImportRecoveryKey.svelte +42 -0
- package/dist/components/onboarding/steps/OnboardingStepImportRecoveryKey.svelte.d.ts +8 -0
- package/dist/components/onboarding/steps/OnboardingStepLayout.svelte +15 -9
- package/dist/components/onboarding/steps/OnboardingStepLayout.svelte.d.ts +2 -2
- package/dist/components/onboarding/steps/OnboardingStepModal.svelte +19 -0
- package/dist/components/onboarding/steps/OnboardingStepModal.svelte.d.ts +11 -0
- package/dist/components/onboarding/steps/OnboardingStepTelemetry.svelte +44 -0
- package/dist/components/onboarding/steps/OnboardingStepTelemetry.svelte.d.ts +7 -0
- package/dist/components/onboarding/upsell/UpsellBackupFeaturesGrid.svelte +3 -3
- package/dist/components/onboarding/upsell/UpsellExplainFutoBackups.svelte +3 -16
- package/dist/components/onboarding/upsell/UpsellExplainFutoBackups.svelte.d.ts +0 -2
- package/dist/components/onboarding/upsell/UpsellFrequentlyAskedQuestions.svelte +3 -3
- package/dist/components/onboarding/upsell/UpsellFutoBackupsBadge.svelte +1 -1
- package/dist/components/onboarding/upsell/UpsellHowItWorks.svelte +4 -4
- package/dist/components/onboarding/upsell/UpsellModal.svelte +7 -13
- package/dist/components/onboarding/upsell/UpsellModal.svelte.d.ts +0 -1
- package/dist/components/onboarding/upsell/UpsellPage.svelte +3 -5
- package/dist/components/onboarding/upsell/UpsellPage.svelte.d.ts +0 -2
- package/dist/components/onboarding/upsell/UpsellProtectYourImmichLibrary.svelte +6 -14
- package/dist/components/onboarding/upsell/UpsellProtectYourImmichLibrary.svelte.d.ts +0 -1
- package/dist/components/schedules/RepositoryPicker.svelte +28 -10
- package/dist/components/schedules/dialogs/ConfigureScheduleModal.svelte +14 -3
- package/dist/components/schedules/dialogs/CreateScheduleModal.svelte +14 -3
- package/dist/components/settings/SettingsBilling.svelte +1 -0
- package/dist/components/test/ImmichTestUi.svelte +62 -44
- package/dist/components/test/TestUi.svelte +53 -69
- package/dist/components/test/dashboard/BackupHealth.svelte +6 -7
- package/dist/components/test/immich/MockImmichHideBackupsReminder.svelte +3 -2
- package/dist/components/test/immich/MockImmichHideBackupsReminder.svelte.d.ts +17 -2
- package/dist/components/ui/Accordion.svelte +43 -30
- package/dist/components/ui/Accordion.svelte.d.ts +1 -0
- package/dist/components/ui/IconTile.svelte +27 -0
- package/dist/components/ui/IconTile.svelte.d.ts +10 -0
- package/dist/components/ui/ListToolbar.svelte +1 -0
- package/dist/components/ui/PageLayout.svelte +1 -1
- package/dist/components/ui/PathListField.svelte +21 -4
- package/dist/components/ui/PathPickerField.svelte +14 -3
- package/dist/components/ui/PathPickerModal.svelte +30 -12
- package/dist/components/ui/Section.svelte +26 -0
- package/dist/components/ui/Section.svelte.d.ts +9 -0
- package/dist/components/ui/SkipLink.svelte +19 -0
- package/dist/components/ui/SkipLink.svelte.d.ts +6 -0
- package/dist/components/ui/StackList.svelte +4 -13
- package/dist/components/ui/StackListItem.svelte +4 -16
- package/dist/components/ui/StackListItem.svelte.d.ts +3 -3
- package/dist/components/ui/VisualisationGauge.svelte +18 -11
- package/dist/components/ui/VisualisationGauge.svelte.d.ts +1 -0
- package/dist/components/ui/VisualisationSegmentedBar.svelte +14 -22
- package/dist/components/ui/VisualisationSegmentedBar.svelte.d.ts +0 -3
- package/dist/components/util/DeviceFlowCode.svelte +6 -5
- package/dist/fetch-client.d.ts +146 -1
- package/dist/fetch-client.js +144 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/locales/en-XA.js +1 -1
- package/dist/locales/en-XA.po +272 -125
- package/dist/locales/en.js +1 -1
- package/dist/locales/en.po +288 -389
- package/dist/options.d.ts +1 -0
- package/dist/options.js +1 -0
- package/dist/services/immich.integration.service.d.ts +2 -1
- package/dist/services/immich.integration.service.js +5 -2
- package/dist/services/log.service.svelte.js +1 -1
- package/dist/services/runHistory.service.d.ts +9 -0
- package/dist/services/runHistory.service.js +43 -2
- package/dist/utils/clipboard.d.ts +1 -0
- package/dist/utils/clipboard.js +11 -0
- package/dist/utils/focus.d.ts +12 -0
- package/dist/utils/focus.js +34 -0
- package/package.json +22 -22
- package/dist/components/dashboard/DashboardInstall.svelte +0 -16
- package/dist/components/onboarding/stages/OnboardingStageBackupServices.svelte +0 -71
- package/dist/components/onboarding/stages/OnboardingStageBackupServices.svelte.d.ts +0 -8
- package/dist/components/onboarding/stages/OnboardingStageKeyImport.svelte +0 -58
- package/dist/components/onboarding/stages/OnboardingStageKeyImport.svelte.d.ts +0 -8
- package/dist/components/onboarding/stages/OnboardingStageTelemetry.svelte +0 -59
- package/dist/components/onboarding/stages/OnboardingStageTelemetry.svelte.d.ts +0 -7
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
AppShellHeader,
|
|
5
5
|
AppShellSidebar,
|
|
6
6
|
Heading,
|
|
7
|
+
IconButton,
|
|
7
8
|
NavbarItem,
|
|
8
9
|
ThemeSwitcher,
|
|
9
10
|
} from "@immich/ui";
|
|
@@ -11,95 +12,78 @@
|
|
|
11
12
|
mdiBackupRestore,
|
|
12
13
|
mdiClock,
|
|
13
14
|
mdiCog,
|
|
15
|
+
mdiMenu,
|
|
14
16
|
mdiViewDashboard,
|
|
15
17
|
} from "@mdi/js";
|
|
16
18
|
import GlobalSettings from "../settings/GlobalSettings.svelte";
|
|
17
19
|
import BackupsList from "../backups/BackupsList.svelte";
|
|
18
20
|
import DashboardPage from "../dashboard/DashboardPage.svelte";
|
|
19
21
|
import ScheduleList from "../schedules/ScheduleList.svelte";
|
|
22
|
+
import SkipLink from "../ui/SkipLink.svelte";
|
|
23
|
+
import { MediaQuery } from "svelte/reactivity";
|
|
24
|
+
import { goto } from "$app/navigation";
|
|
25
|
+
import { page } from "$app/state";
|
|
20
26
|
|
|
21
|
-
|
|
22
|
-
let
|
|
27
|
+
const fullSidebar = new MediaQuery("min-width: 48rem");
|
|
28
|
+
let open = $derived(fullSidebar.current);
|
|
29
|
+
const routes = [
|
|
30
|
+
{ id: "dashboard", title: "Dashboard", icon: mdiViewDashboard },
|
|
31
|
+
{ id: "backups", title: "Backups", icon: mdiBackupRestore },
|
|
32
|
+
{ id: "schedules", title: "Schedules", icon: mdiClock },
|
|
33
|
+
{ id: "config", title: "Configure", icon: mdiCog },
|
|
34
|
+
];
|
|
35
|
+
const currentRoute = $derived(
|
|
36
|
+
routes.find(({ id }) => id === page.url.hash.slice(1)) ?? routes[0],
|
|
37
|
+
);
|
|
38
|
+
const route = $derived(currentRoute.id);
|
|
23
39
|
</script>
|
|
24
40
|
|
|
25
41
|
<AppShell class="h-full">
|
|
26
42
|
<AppShellHeader>
|
|
43
|
+
<SkipLink target="main-content" />
|
|
44
|
+
|
|
27
45
|
<div class="flex items-center justify-between w-full px-4 py-2">
|
|
28
|
-
<
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
46
|
+
<div class="flex items-center gap-1">
|
|
47
|
+
<IconButton
|
|
48
|
+
shape="round"
|
|
49
|
+
color="secondary"
|
|
50
|
+
variant="ghost"
|
|
51
|
+
size="medium"
|
|
52
|
+
aria-label="Main menu"
|
|
53
|
+
aria-expanded={open}
|
|
54
|
+
icon={mdiMenu}
|
|
55
|
+
onclick={() => (open = fullSidebar.current ? true : !open)}
|
|
56
|
+
class="md:hidden"
|
|
33
57
|
/>
|
|
34
|
-
|
|
58
|
+
<Heading>
|
|
59
|
+
<img
|
|
60
|
+
alt="App Name Here"
|
|
61
|
+
src="/app-name-here.png"
|
|
62
|
+
class="inline h-12"
|
|
63
|
+
/>
|
|
64
|
+
</Heading>
|
|
65
|
+
</div>
|
|
35
66
|
<ThemeSwitcher size="medium" color="secondary" />
|
|
36
67
|
</div>
|
|
37
68
|
</AppShellHeader>
|
|
38
69
|
|
|
39
70
|
<AppShellSidebar bind:open>
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
role="button"
|
|
46
|
-
aria-label="Dashboard"
|
|
47
|
-
>
|
|
48
|
-
<NavbarItem
|
|
49
|
-
href="#"
|
|
50
|
-
title="Dashboard"
|
|
51
|
-
icon={mdiViewDashboard}
|
|
52
|
-
active={route === "dashboard"}
|
|
53
|
-
/>
|
|
54
|
-
</div>
|
|
55
|
-
<div
|
|
56
|
-
onclick={() => (route = "backups")}
|
|
57
|
-
onkeydown={() => (route = "backups")}
|
|
58
|
-
tabindex={0}
|
|
59
|
-
role="button"
|
|
60
|
-
aria-label="Backups"
|
|
61
|
-
>
|
|
62
|
-
<NavbarItem
|
|
63
|
-
href="#"
|
|
64
|
-
title="Backups"
|
|
65
|
-
icon={mdiBackupRestore}
|
|
66
|
-
active={route === "backups"}
|
|
67
|
-
/>
|
|
68
|
-
</div>
|
|
69
|
-
<div
|
|
70
|
-
onclick={() => (route = "schedules")}
|
|
71
|
-
onkeydown={() => (route = "schedules")}
|
|
72
|
-
tabindex={0}
|
|
73
|
-
role="button"
|
|
74
|
-
aria-label="Schedules"
|
|
75
|
-
>
|
|
76
|
-
<NavbarItem
|
|
77
|
-
href="#"
|
|
78
|
-
title="Schedules"
|
|
79
|
-
icon={mdiClock}
|
|
80
|
-
active={route === "schedules"}
|
|
81
|
-
/>
|
|
82
|
-
</div>
|
|
83
|
-
<div
|
|
84
|
-
onclick={() => (route = "config")}
|
|
85
|
-
onkeydown={() => (route = "config")}
|
|
86
|
-
tabindex={0}
|
|
87
|
-
role="button"
|
|
88
|
-
aria-label="Configure"
|
|
89
|
-
>
|
|
90
|
-
<NavbarItem
|
|
91
|
-
href="#"
|
|
92
|
-
title="Configure"
|
|
93
|
-
icon={mdiCog}
|
|
94
|
-
active={route === "config"}
|
|
95
|
-
/>
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
71
|
+
<nav class="pt-4 pr-2" aria-label="Main">
|
|
72
|
+
{#each routes as { id, title, icon } (id)}
|
|
73
|
+
<NavbarItem href="#{id}" {title} {icon} active={route === id} />
|
|
74
|
+
{/each}
|
|
75
|
+
</nav>
|
|
98
76
|
</AppShellSidebar>
|
|
99
77
|
|
|
100
|
-
<
|
|
78
|
+
<main
|
|
79
|
+
id="main-content"
|
|
80
|
+
tabindex="-1"
|
|
81
|
+
class="p-4 flex flex-col gap-2 max-w-6xl m-auto outline-none"
|
|
82
|
+
>
|
|
83
|
+
<Heading tag="h1" class="sr-only">{currentRoute.title}</Heading>
|
|
84
|
+
|
|
101
85
|
{#if route === "dashboard"}
|
|
102
|
-
<DashboardPage onViewBackups={() => (
|
|
86
|
+
<DashboardPage onViewBackups={() => goto("#backups")} />
|
|
103
87
|
{:else if route === "backups"}
|
|
104
88
|
<BackupsList />
|
|
105
89
|
{:else if route === "config"}
|
|
@@ -107,5 +91,5 @@
|
|
|
107
91
|
{:else if route === "schedules"}
|
|
108
92
|
<ScheduleList />
|
|
109
93
|
{/if}
|
|
110
|
-
</
|
|
94
|
+
</main>
|
|
111
95
|
</AppShell>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { LocalRepositoryDto } from "../../../fetch-client";
|
|
3
3
|
import { getBackupOutcome } from "../../../utils/backup-status";
|
|
4
|
-
import { Alert, Text } from "@immich/ui";
|
|
4
|
+
import { Alert, HStack, Text } from "@immich/ui";
|
|
5
5
|
import SegmentedBar from "../../ui/VisualisationSegmentedBar.svelte";
|
|
6
6
|
|
|
7
7
|
type Props = {
|
|
@@ -62,33 +62,32 @@
|
|
|
62
62
|
</Alert>
|
|
63
63
|
{/if}
|
|
64
64
|
|
|
65
|
+
<HStack class="justify-between">
|
|
66
|
+
<Text size="large">Backup Health</Text>
|
|
67
|
+
<Text color="secondary">{status.success} of {total} successful</Text>
|
|
68
|
+
</HStack>
|
|
69
|
+
|
|
65
70
|
<SegmentedBar
|
|
66
|
-
title="Backup Health"
|
|
67
|
-
summary="{status.success} of {total} successful"
|
|
68
71
|
segments={[
|
|
69
72
|
{
|
|
70
73
|
value: status.success,
|
|
71
74
|
label: "Successful",
|
|
72
75
|
color: "var(--immich-ui-success-500)",
|
|
73
|
-
badge: "success",
|
|
74
76
|
},
|
|
75
77
|
{
|
|
76
78
|
value: status.offline,
|
|
77
79
|
label: "Offline",
|
|
78
80
|
color: "var(--immich-ui-warning-500)",
|
|
79
|
-
badge: "warning",
|
|
80
81
|
},
|
|
81
82
|
{
|
|
82
83
|
value: status.failed,
|
|
83
84
|
label: "Failed",
|
|
84
85
|
color: "var(--immich-ui-danger-500)",
|
|
85
|
-
badge: "danger",
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
value: status.neverRun,
|
|
89
89
|
label: "Never Run",
|
|
90
90
|
color: "var(--immich-ui-light-400)",
|
|
91
|
-
badge: "secondary",
|
|
92
91
|
},
|
|
93
92
|
]}
|
|
94
93
|
/>
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { options } from "../../../options";
|
|
2
3
|
import { Field, Switch } from "@immich/ui";
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
const { hideBackupsReminder } = options;
|
|
5
6
|
</script>
|
|
6
7
|
|
|
7
8
|
<Field
|
|
8
9
|
label="Hide backups reminder"
|
|
9
10
|
description="If you already manage backups outside of Immich, you can hide the backup setup reminder."
|
|
10
11
|
>
|
|
11
|
-
<Switch bind:checked={
|
|
12
|
+
<Switch bind:checked={$hideBackupsReminder} />
|
|
12
13
|
</Field>
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const MockImmichHideBackupsReminder: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type MockImmichHideBackupsReminder = InstanceType<typeof MockImmichHideBackupsReminder>;
|
|
3
18
|
export default MockImmichHideBackupsReminder;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { Icon, Text } from "@immich/ui";
|
|
3
3
|
import { mdiChevronDown } from "@mdi/js";
|
|
4
4
|
import type { Snippet } from "svelte";
|
|
5
|
+
import { MediaQuery } from "svelte/reactivity";
|
|
5
6
|
import { slide } from "svelte/transition";
|
|
6
7
|
|
|
7
8
|
type Props = {
|
|
@@ -9,6 +10,7 @@
|
|
|
9
10
|
subtitle?: string;
|
|
10
11
|
icon?: string;
|
|
11
12
|
isOpen?: boolean;
|
|
13
|
+
headingTag?: "h2" | "h3" | "h4";
|
|
12
14
|
children?: Snippet;
|
|
13
15
|
};
|
|
14
16
|
|
|
@@ -17,50 +19,61 @@
|
|
|
17
19
|
subtitle,
|
|
18
20
|
icon,
|
|
19
21
|
isOpen = $bindable(false),
|
|
22
|
+
headingTag = "h2",
|
|
20
23
|
children,
|
|
21
24
|
}: Props = $props();
|
|
25
|
+
|
|
26
|
+
const panelId = $props.id();
|
|
27
|
+
const reducedMotion = new MediaQuery("prefers-reduced-motion: reduce");
|
|
22
28
|
</script>
|
|
23
29
|
|
|
24
30
|
<div
|
|
25
|
-
class="border-primary/20 mt-4 rounded-2xl border-2 px-6 py-4 transition-all"
|
|
31
|
+
class="border-primary/20 mt-4 rounded-2xl border-2 px-6 py-4 transition-all motion-reduce:transition-none"
|
|
26
32
|
class:border-primary={isOpen}
|
|
27
33
|
class:shadow-md={isOpen}
|
|
28
34
|
>
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
<svelte:element this={headingTag}>
|
|
36
|
+
<button
|
|
37
|
+
type="button"
|
|
38
|
+
aria-expanded={isOpen}
|
|
39
|
+
aria-controls={isOpen ? panelId : undefined}
|
|
40
|
+
onclick={() => (isOpen = !isOpen)}
|
|
41
|
+
class="flex w-full place-items-center justify-between gap-4 text-start"
|
|
42
|
+
>
|
|
43
|
+
<div>
|
|
44
|
+
<div class="flex place-items-center gap-2">
|
|
45
|
+
{#if icon}
|
|
46
|
+
<Icon {icon} class="text-primary" size="1.5rem" aria-hidden="true" />
|
|
47
|
+
{/if}
|
|
48
|
+
<Text fontWeight="medium" color="primary">{title}</Text>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
{#if subtitle}
|
|
52
|
+
<Text size="small" color="muted" class="mt-1">{subtitle}</Text>
|
|
39
53
|
{/if}
|
|
40
|
-
<Text fontWeight="medium" color="primary">{title}</Text>
|
|
41
54
|
</div>
|
|
42
55
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
56
|
+
<div
|
|
57
|
+
class="hover:bg-primary/10 flex shrink-0 place-content-center place-items-center rounded-full p-3 transition-all"
|
|
58
|
+
>
|
|
59
|
+
<Icon
|
|
60
|
+
icon={mdiChevronDown}
|
|
61
|
+
size="1.25rem"
|
|
62
|
+
class="transition-transform duration-200 ease-in motion-reduce:transition-none {isOpen
|
|
63
|
+
? 'rotate-180'
|
|
64
|
+
: ''}"
|
|
65
|
+
aria-hidden="true"
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
</button>
|
|
69
|
+
</svelte:element>
|
|
47
70
|
|
|
71
|
+
{#if isOpen}
|
|
48
72
|
<div
|
|
49
|
-
|
|
73
|
+
id={panelId}
|
|
74
|
+
transition:slide={{ duration: reducedMotion.current ? 0 : 150 }}
|
|
75
|
+
class="mb-2 ms-4"
|
|
50
76
|
>
|
|
51
|
-
<Icon
|
|
52
|
-
icon={mdiChevronDown}
|
|
53
|
-
size="1.25rem"
|
|
54
|
-
class="transition-transform duration-200 ease-in {isOpen
|
|
55
|
-
? 'rotate-180'
|
|
56
|
-
: ''}"
|
|
57
|
-
aria-hidden="true"
|
|
58
|
-
/>
|
|
59
|
-
</div>
|
|
60
|
-
</button>
|
|
61
|
-
|
|
62
|
-
{#if isOpen}
|
|
63
|
-
<div transition:slide={{ duration: 150 }} class="mb-2 ms-4">
|
|
64
77
|
{@render children?.()}
|
|
65
78
|
</div>
|
|
66
79
|
{/if}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
export type TileColor = "primary" | "success" | "warning" | "danger";
|
|
3
|
+
|
|
4
|
+
export const tints: Record<TileColor, string> = {
|
|
5
|
+
primary: "bg-primary-50 text-primary",
|
|
6
|
+
success: "bg-success-50 text-success-700",
|
|
7
|
+
warning: "bg-warning-50 text-warning-800",
|
|
8
|
+
danger: "bg-danger-50 text-danger-700",
|
|
9
|
+
};
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import type { Snippet } from "svelte";
|
|
14
|
+
|
|
15
|
+
type Props = {
|
|
16
|
+
color?: TileColor;
|
|
17
|
+
children: Snippet;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const { color = "primary", children }: Props = $props();
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<div
|
|
24
|
+
class={`flex size-10 shrink-0 items-center justify-center rounded-lg text-xl ${tints[color]}`}
|
|
25
|
+
>
|
|
26
|
+
{@render children()}
|
|
27
|
+
</div>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type TileColor = "primary" | "success" | "warning" | "danger";
|
|
2
|
+
export declare const tints: Record<TileColor, string>;
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
4
|
+
type Props = {
|
|
5
|
+
color?: TileColor;
|
|
6
|
+
children: Snippet;
|
|
7
|
+
};
|
|
8
|
+
declare const IconTile: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type IconTile = ReturnType<typeof IconTile>;
|
|
10
|
+
export default IconTile;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { FilesystemListingResponseDto } from "../../fetch-client";
|
|
3
|
+
import { FocusGroup } from "../../utils/focus";
|
|
3
4
|
import {
|
|
4
5
|
Button,
|
|
5
6
|
Heading,
|
|
@@ -41,6 +42,15 @@
|
|
|
41
42
|
handleGetListing,
|
|
42
43
|
}: Props = $props();
|
|
43
44
|
|
|
45
|
+
const id = $props.id();
|
|
46
|
+
const removeButtons = new FocusGroup(`${id}-remove`);
|
|
47
|
+
const manageButton = new FocusGroup(`${id}-manage`);
|
|
48
|
+
|
|
49
|
+
const remove = (path: string, index: number) => {
|
|
50
|
+
paths.delete(path);
|
|
51
|
+
void removeButtons.focusAt(index, manageButton);
|
|
52
|
+
};
|
|
53
|
+
|
|
44
54
|
const openPicker = () =>
|
|
45
55
|
modalManager.show(PathPickerModal, {
|
|
46
56
|
title: pickerTitle,
|
|
@@ -60,17 +70,18 @@
|
|
|
60
70
|
|
|
61
71
|
{#if paths.size > 0}
|
|
62
72
|
<StackList>
|
|
63
|
-
{#each [...paths] as path (path)}
|
|
73
|
+
{#each [...paths] as path, index (path)}
|
|
64
74
|
<StackListItem>
|
|
65
75
|
<Text class="grow truncate" title={path}>{path}</Text>
|
|
66
76
|
|
|
67
77
|
{#snippet trailing()}
|
|
68
78
|
<IconButton
|
|
69
79
|
icon={mdiClose}
|
|
70
|
-
aria-label={$t
|
|
80
|
+
aria-label={$t({ message: "Remove {path}", values: { path } })}
|
|
71
81
|
size="tiny"
|
|
72
82
|
variant="ghost"
|
|
73
|
-
|
|
83
|
+
{...removeButtons.attributes()}
|
|
84
|
+
onclick={() => remove(path, index)}
|
|
74
85
|
/>
|
|
75
86
|
{/snippet}
|
|
76
87
|
</StackListItem>
|
|
@@ -82,7 +93,13 @@
|
|
|
82
93
|
</HStack>
|
|
83
94
|
{/if}
|
|
84
95
|
|
|
85
|
-
<Button
|
|
96
|
+
<Button
|
|
97
|
+
class="w-fit"
|
|
98
|
+
size="small"
|
|
99
|
+
variant="ghost"
|
|
100
|
+
{...manageButton.attributes()}
|
|
101
|
+
onclick={openPicker}
|
|
102
|
+
>
|
|
86
103
|
{paths.size > 0 ? addLabel : manageLabel}
|
|
87
104
|
</Button>
|
|
88
105
|
</Stack>
|
|
@@ -36,6 +36,10 @@
|
|
|
36
36
|
handleGetListing,
|
|
37
37
|
}: Props = $props();
|
|
38
38
|
|
|
39
|
+
const id = $props.id();
|
|
40
|
+
const titleId = `${id}-title`;
|
|
41
|
+
const descriptionId = `${id}-description`;
|
|
42
|
+
|
|
39
43
|
const browse = () =>
|
|
40
44
|
modalManager.open(PathPickerModal, {
|
|
41
45
|
title: pickerTitle,
|
|
@@ -55,15 +59,22 @@
|
|
|
55
59
|
{#if title || description}
|
|
56
60
|
<Stack gap={0}>
|
|
57
61
|
{#if title}
|
|
58
|
-
<Heading class="px-1" size="tiny">{@render title()}</Heading>
|
|
62
|
+
<Heading id={titleId} class="px-1" size="tiny">{@render title()}</Heading>
|
|
59
63
|
{/if}
|
|
60
64
|
{#if description}
|
|
61
|
-
<Text color="secondary" size="small"
|
|
65
|
+
<Text id={descriptionId} color="secondary" size="small"
|
|
66
|
+
>{@render description()}</Text
|
|
67
|
+
>
|
|
62
68
|
{/if}
|
|
63
69
|
</Stack>
|
|
64
70
|
{/if}
|
|
65
71
|
<HStack gap={2}>
|
|
66
|
-
<Input
|
|
72
|
+
<Input
|
|
73
|
+
bind:value
|
|
74
|
+
{placeholder}
|
|
75
|
+
aria-labelledby={title ? titleId : undefined}
|
|
76
|
+
aria-describedby={description ? descriptionId : undefined}
|
|
77
|
+
/>
|
|
67
78
|
<IconButton
|
|
68
79
|
icon={mdiFolder}
|
|
69
80
|
aria-label={$t`Choose folder`}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import StackList from "./StackList.svelte";
|
|
3
3
|
import type { FilesystemListingResponseDto } from "../../fetch-client";
|
|
4
4
|
import { handleGetFileListing } from "../../services/filesystem.service";
|
|
5
|
+
import { FocusGroup } from "../../utils/focus";
|
|
5
6
|
import {
|
|
6
7
|
Button,
|
|
7
8
|
FormModal,
|
|
@@ -51,13 +52,26 @@
|
|
|
51
52
|
// svelte-ignore state_referenced_locally
|
|
52
53
|
const selected = new SvelteSet(initial);
|
|
53
54
|
let listing: FilesystemListingResponseDto | undefined = $state();
|
|
55
|
+
const id = $props.id();
|
|
56
|
+
const browseRows = new FocusGroup(`${id}-browse`);
|
|
57
|
+
const removeSelectedButtons = new FocusGroup(`${id}-remove-selected`);
|
|
54
58
|
|
|
55
|
-
const
|
|
59
|
+
const load = async (path?: string) => {
|
|
56
60
|
listing = undefined;
|
|
57
61
|
listing = await (handleGetListing ?? handleGetFileListing)(path);
|
|
58
62
|
};
|
|
59
63
|
|
|
60
|
-
onMount(() => void
|
|
64
|
+
onMount(() => void load());
|
|
65
|
+
|
|
66
|
+
const browse = async (path: string) => {
|
|
67
|
+
await load(path);
|
|
68
|
+
await browseRows.focusAt(0);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const removeSelected = (path: string, index: number) => {
|
|
72
|
+
selected.delete(path);
|
|
73
|
+
void removeSelectedButtons.focusAt(index, browseRows);
|
|
74
|
+
};
|
|
61
75
|
|
|
62
76
|
const sortedItems = $derived(
|
|
63
77
|
listing
|
|
@@ -117,22 +131,23 @@
|
|
|
117
131
|
{#snippet title()}
|
|
118
132
|
{$t`Selected paths`}
|
|
119
133
|
{/snippet}
|
|
120
|
-
{#each [...selected] as path (path)}
|
|
134
|
+
{#each [...selected] as path, index (path)}
|
|
121
135
|
<HStack gap={2} class="items-center px-4 py-3">
|
|
122
136
|
<Text class="grow truncate" title={path}>{path}</Text>
|
|
123
137
|
<IconButton
|
|
124
138
|
icon={mdiClose}
|
|
125
|
-
aria-label={$t
|
|
139
|
+
aria-label={$t({ message: "Remove {path}", values: { path } })}
|
|
126
140
|
size="tiny"
|
|
127
141
|
variant="ghost"
|
|
128
|
-
|
|
142
|
+
{...removeSelectedButtons.attributes()}
|
|
143
|
+
onclick={() => removeSelected(path, index)}
|
|
129
144
|
/>
|
|
130
145
|
</HStack>
|
|
131
146
|
{/each}
|
|
132
147
|
</StackList>
|
|
133
148
|
{:else}
|
|
134
149
|
<Stack gap={2}>
|
|
135
|
-
<Heading class="px-1" size="tiny">{$t`Selected paths`}</Heading>
|
|
150
|
+
<Heading tag="h3" class="px-1" size="tiny">{$t`Selected paths`}</Heading>
|
|
136
151
|
<Text color="muted" class="text-center py-6"
|
|
137
152
|
>{$t`No paths selected`}</Text
|
|
138
153
|
>
|
|
@@ -142,7 +157,7 @@
|
|
|
142
157
|
|
|
143
158
|
{#if !listing}
|
|
144
159
|
<Stack gap={2}>
|
|
145
|
-
<Heading class="px-1" size="tiny">{$t`Browse`}</Heading>
|
|
160
|
+
<Heading tag="h3" class="px-1" size="tiny">{$t`Browse`}</Heading>
|
|
146
161
|
<div class="py-6 flex justify-center">
|
|
147
162
|
<LoadingSpinner />
|
|
148
163
|
</div>
|
|
@@ -169,6 +184,7 @@
|
|
|
169
184
|
aria-label={$t`Go up`}
|
|
170
185
|
size="tiny"
|
|
171
186
|
variant="ghost"
|
|
187
|
+
{...browseRows.attributes()}
|
|
172
188
|
onclick={() => browse(listing!.parent)}
|
|
173
189
|
/>
|
|
174
190
|
{/if}
|
|
@@ -177,6 +193,7 @@
|
|
|
177
193
|
{#each sortedItems as item (item.path)}
|
|
178
194
|
{#if item.isDirectory || !foldersOnly}
|
|
179
195
|
{@const isSelected = selected.has(item.path)}
|
|
196
|
+
{@const name = item.path.split(/[\\/]/).pop()}
|
|
180
197
|
<HStack
|
|
181
198
|
gap={2}
|
|
182
199
|
class="items-center px-2 py-1 {isSelected
|
|
@@ -186,10 +203,11 @@
|
|
|
186
203
|
{#if item.isDirectory}
|
|
187
204
|
<ListButton
|
|
188
205
|
leadingIcon={mdiFolderOutline}
|
|
206
|
+
{...browseRows.attributes()}
|
|
189
207
|
onclick={() => browse(item.path)}
|
|
190
208
|
class="flex-1 justify-start"
|
|
191
209
|
>
|
|
192
|
-
{
|
|
210
|
+
{name}
|
|
193
211
|
</ListButton>
|
|
194
212
|
{:else}
|
|
195
213
|
<HStack gap={2} class="items-center grow px-2 py-2">
|
|
@@ -199,17 +217,17 @@
|
|
|
199
217
|
color="secondary"
|
|
200
218
|
title={item.path}
|
|
201
219
|
>
|
|
202
|
-
{
|
|
220
|
+
{name}
|
|
203
221
|
</Text>
|
|
204
222
|
</HStack>
|
|
205
223
|
{/if}
|
|
206
224
|
<IconButton
|
|
207
225
|
icon={isSelected ? mdiCheck : mdiPlus}
|
|
208
226
|
aria-label={isSelected
|
|
209
|
-
? $t
|
|
227
|
+
? $t({ message: "{name} selected", values: { name } })
|
|
210
228
|
: single
|
|
211
|
-
? $t
|
|
212
|
-
: $t
|
|
229
|
+
? $t({ message: "Select {name}", values: { name } })
|
|
230
|
+
: $t({ message: "Add {name}", values: { name } })}
|
|
213
231
|
size="tiny"
|
|
214
232
|
variant="ghost"
|
|
215
233
|
color={isSelected ? "primary" : undefined}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Heading, HStack, Stack } from "@immich/ui";
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
title?: Snippet;
|
|
7
|
+
action?: Snippet;
|
|
8
|
+
children?: Snippet;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const { title, action, children }: Props = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Stack gap={2}>
|
|
15
|
+
{#if title || action}
|
|
16
|
+
<HStack class="items-center justify-between px-1">
|
|
17
|
+
{#if title}
|
|
18
|
+
<Heading tag="h2" size="tiny">{@render title()}</Heading>
|
|
19
|
+
{/if}
|
|
20
|
+
|
|
21
|
+
{@render action?.()}
|
|
22
|
+
</HStack>
|
|
23
|
+
{/if}
|
|
24
|
+
|
|
25
|
+
{@render children?.()}
|
|
26
|
+
</Stack>
|