🐛 Updates svelte-modals
This commit is contained in:
+1
-1
@@ -55,7 +55,7 @@
|
|||||||
"jwt-decode": "^4.0.0",
|
"jwt-decode": "^4.0.0",
|
||||||
"nipplejs": "^0.10.1",
|
"nipplejs": "^0.10.1",
|
||||||
"svelte-dnd-list": "^0.1.8",
|
"svelte-dnd-list": "^0.1.8",
|
||||||
"svelte-modals": "^1.3.0",
|
"svelte-modals": "^2.0.0",
|
||||||
"three": "^0.162.0",
|
"three": "^0.162.0",
|
||||||
"urdf-loader": "^0.12.1",
|
"urdf-loader": "^0.12.1",
|
||||||
"uzip": "^0.20201231.0",
|
"uzip": "^0.20201231.0",
|
||||||
|
|||||||
Generated
+6
-6
@@ -33,8 +33,8 @@ importers:
|
|||||||
specifier: ^0.1.8
|
specifier: ^0.1.8
|
||||||
version: 0.1.8
|
version: 0.1.8
|
||||||
svelte-modals:
|
svelte-modals:
|
||||||
specifier: ^1.3.0
|
specifier: ^2.0.0
|
||||||
version: 1.3.0(svelte@5.20.4)
|
version: 2.0.0(svelte@5.20.4)
|
||||||
three:
|
three:
|
||||||
specifier: ^0.162.0
|
specifier: ^0.162.0
|
||||||
version: 0.162.0
|
version: 0.162.0
|
||||||
@@ -1813,10 +1813,10 @@ packages:
|
|||||||
svelte-focus-trap@1.2.0:
|
svelte-focus-trap@1.2.0:
|
||||||
resolution: {integrity: sha512-/hIUHgKcFlewsQreq8v7DYNBkQe7rR0c94PNBOCsmeUwoIYAy6iXJ1pH0k3rWpjwZHKtUxeXbX1iRFlFhipbeg==}
|
resolution: {integrity: sha512-/hIUHgKcFlewsQreq8v7DYNBkQe7rR0c94PNBOCsmeUwoIYAy6iXJ1pH0k3rWpjwZHKtUxeXbX1iRFlFhipbeg==}
|
||||||
|
|
||||||
svelte-modals@1.3.0:
|
svelte-modals@2.0.0:
|
||||||
resolution: {integrity: sha512-b1Ylnyv9O6b7VYeWGJVToaVU2lw7GtErVwiEdojyfnOuZcrhNlQ5eDqbTrL3xyKz8j2VTy/QiGUl1lm/6SnQ2A==}
|
resolution: {integrity: sha512-wBClXmScNStF/rG75ZP7hEiKXRJ5H+DhA2dkMPQd+FX2Hc1XTj1n5cZGC7uTYCYOVmQwrsDOlL5a2V5E6q3f+A==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
svelte: ^3.0.0 || ^4.0.0
|
svelte: '>=5'
|
||||||
|
|
||||||
svelte@5.20.4:
|
svelte@5.20.4:
|
||||||
resolution: {integrity: sha512-2Mo/AfObaw9zuD0u1JJ7sOVzRCGcpETEyDkLbtkcctWpCMCIyT0iz83xD8JT29SR7O4SgswuPRIDYReYF/607A==}
|
resolution: {integrity: sha512-2Mo/AfObaw9zuD0u1JJ7sOVzRCGcpETEyDkLbtkcctWpCMCIyT0iz83xD8JT29SR7O4SgswuPRIDYReYF/607A==}
|
||||||
@@ -3740,7 +3740,7 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
mousetrap: 1.6.5
|
mousetrap: 1.6.5
|
||||||
|
|
||||||
svelte-modals@1.3.0(svelte@5.20.4):
|
svelte-modals@2.0.0(svelte@5.20.4):
|
||||||
dependencies:
|
dependencies:
|
||||||
svelte: 5.20.4
|
svelte: 5.20.4
|
||||||
|
|
||||||
|
|||||||
@@ -1,65 +1,61 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { createBubbler } from 'svelte/legacy';
|
import { focusTrap } from 'svelte-focus-trap';
|
||||||
|
import { fly } from 'svelte/transition';
|
||||||
|
import { Cancel, Check } from '$lib/components/icons';
|
||||||
|
import { modals, exitBeforeEnter } from 'svelte-modals';
|
||||||
|
|
||||||
const bubble = createBubbler();
|
// provided by <Modals />
|
||||||
import { closeModal } from 'svelte-modals';
|
|
||||||
import { focusTrap } from 'svelte-focus-trap';
|
|
||||||
import { fly } from 'svelte/transition';
|
|
||||||
import { Cancel, Check } from '$lib/components/icons';
|
|
||||||
|
|
||||||
// provided by <Modals />
|
interface Props {
|
||||||
|
isOpen: boolean;
|
||||||
|
title: string;
|
||||||
|
message: string;
|
||||||
|
onConfirm: any;
|
||||||
|
labels?: any;
|
||||||
|
}
|
||||||
|
|
||||||
interface Props {
|
let {
|
||||||
isOpen: boolean;
|
isOpen,
|
||||||
title: string;
|
title,
|
||||||
message: string;
|
message,
|
||||||
onConfirm: any;
|
onConfirm,
|
||||||
labels?: any;
|
labels = {
|
||||||
}
|
cancel: { label: 'Cancel', icon: Cancel },
|
||||||
|
confirm: { label: 'OK', icon: Check }
|
||||||
let {
|
}
|
||||||
isOpen,
|
}: Props = $props();
|
||||||
title,
|
|
||||||
message,
|
|
||||||
onConfirm,
|
|
||||||
labels = {
|
|
||||||
cancel: { label: 'Cancel', icon: Cancel },
|
|
||||||
confirm: { label: 'OK', icon: Check }
|
|
||||||
}
|
|
||||||
}: Props = $props();
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if isOpen}
|
{#if isOpen}
|
||||||
{@const SvelteComponent = labels?.confirm.icon}
|
{@const SvelteComponent = labels?.confirm.icon}
|
||||||
<div
|
<div
|
||||||
role="dialog"
|
role="dialog"
|
||||||
class="pointer-events-none fixed inset-0 z-50 flex items-center justify-center"
|
class="pointer-events-none fixed inset-0 z-50 flex items-center justify-center"
|
||||||
transition:fly={{ y: 50 }}
|
transition:fly={{ y: 50 }}
|
||||||
onintrostart={bubble('introstart')}
|
use:exitBeforeEnter
|
||||||
onoutroend={bubble('outroend')}
|
|
||||||
use:focusTrap
|
use:focusTrap
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="rounded-box bg-base-100 pointer-events-auto flex min-w-fit max-w-md flex-col justify-between p-4 shadow-lg"
|
class="rounded-box bg-base-100 pointer-events-auto flex min-w-fit max-w-md flex-col justify-between p-4 shadow-lg"
|
||||||
>
|
>
|
||||||
<h2 class="text-base-content text-start text-2xl font-bold">{title}</h2>
|
<h2 class="text-base-content text-start text-2xl font-bold">{title}</h2>
|
||||||
<div class="divider my-2"></div>
|
<div class="divider my-2"></div>
|
||||||
<p class="text-base-content mb-1 text-start">{message}</p>
|
<p class="text-base-content mb-1 text-start">{message}</p>
|
||||||
<div class="divider my-2"></div>
|
<div class="divider my-2"></div>
|
||||||
<div class="flex justify-end gap-2">
|
<div class="flex justify-end gap-2">
|
||||||
<button class="btn btn-primary inline-flex items-center" onclick={closeModal}
|
<button
|
||||||
><labels.cancel.icon class="mr-2 h-5 w-5" /><span
|
class="btn btn-primary inline-flex items-center"
|
||||||
>{labels?.cancel.label}</span
|
onclick={() => modals.close()}
|
||||||
></button
|
>
|
||||||
>
|
<labels.cancel.icon class="mr-2 h-5 w-5" /><span>{labels?.cancel.label}</span>
|
||||||
<button
|
</button>
|
||||||
class="btn btn-warning text-warning-content inline-flex items-center"
|
<button
|
||||||
onclick={onConfirm}
|
class="btn btn-warning text-warning-content inline-flex items-center"
|
||||||
><SvelteComponent class="mr-2 h-5 w-5" /><span
|
onclick={onConfirm}
|
||||||
>{labels?.confirm.label}</span
|
>
|
||||||
></button
|
<SvelteComponent class="mr-2 h-5 w-5" /><span>{labels?.confirm.label}</span>
|
||||||
>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -1,105 +1,104 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { run, createBubbler } from 'svelte/legacy';
|
import { run } from 'svelte/legacy';
|
||||||
|
|
||||||
const bubble = createBubbler();
|
import { focusTrap } from 'svelte-focus-trap';
|
||||||
import { closeAllModals, onBeforeClose } from 'svelte-modals';
|
import { fly } from 'svelte/transition';
|
||||||
import { focusTrap } from 'svelte-focus-trap';
|
import { telemetry } from '$lib/stores/telemetry';
|
||||||
import { fly } from 'svelte/transition';
|
import { Cancel } from './icons';
|
||||||
import { telemetry } from '$lib/stores/telemetry';
|
import { modals, exitBeforeEnter, onBeforeClose } from 'svelte-modals';
|
||||||
import { Cancel } from './icons';
|
|
||||||
|
|
||||||
// provided by <Modals />
|
// provided by <Modals />
|
||||||
interface Props {
|
interface Props {
|
||||||
isOpen: boolean;
|
isOpen: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { isOpen }: Props = $props();
|
let { isOpen }: Props = $props();
|
||||||
|
|
||||||
let updating = $state(true);
|
let updating = $state(true);
|
||||||
|
|
||||||
let progress = $state(0);
|
let progress = $state(0);
|
||||||
run(() => {
|
run(() => {
|
||||||
if ($telemetry.download_ota.status == 'progress') {
|
if ($telemetry.download_ota.status == 'progress') {
|
||||||
progress = $telemetry.download_ota.progress;
|
progress = $telemetry.download_ota.progress;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
run(() => {
|
run(() => {
|
||||||
if ($telemetry.download_ota.status == 'error') {
|
if ($telemetry.download_ota.status == 'error') {
|
||||||
updating = false;
|
updating = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let message = $state('Preparing ...');
|
let message = $state('Preparing ...');
|
||||||
let timerId: number = $state();
|
let timerId: number = $state();
|
||||||
|
|
||||||
run(() => {
|
run(() => {
|
||||||
if ($telemetry.download_ota.status == 'progress') {
|
if ($telemetry.download_ota.status == 'progress') {
|
||||||
message = 'Downloading ...';
|
message = 'Downloading ...';
|
||||||
} else if ($telemetry.download_ota.status == 'error') {
|
} else if ($telemetry.download_ota.status == 'error') {
|
||||||
message = $telemetry.download_ota.error;
|
message = $telemetry.download_ota.error;
|
||||||
} else if ($telemetry.download_ota.status == 'finished') {
|
} else if ($telemetry.download_ota.status == 'finished') {
|
||||||
message = 'Restarting ...';
|
message = 'Restarting ...';
|
||||||
progress = 0;
|
progress = 0;
|
||||||
// Reload page after 5 sec
|
// Reload page after 5 sec
|
||||||
timerId = setTimeout(() => {
|
timerId = setTimeout(() => {
|
||||||
closeAllModals();
|
modals.closeAll();
|
||||||
location.reload();
|
location.reload();
|
||||||
}, 5000);
|
}, 5000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
onBeforeClose(() => {
|
onBeforeClose(() => {
|
||||||
if (updating) {
|
if (updating) {
|
||||||
// prevents modal from closing
|
// prevents modal from closing
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
$telemetry.download_ota.status = 'idle';
|
$telemetry.download_ota.status = 'idle';
|
||||||
$telemetry.download_ota.error = '';
|
$telemetry.download_ota.error = '';
|
||||||
$telemetry.download_ota.progress = 0;
|
$telemetry.download_ota.progress = 0;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if isOpen}
|
{#if isOpen}
|
||||||
<div
|
<div
|
||||||
role="dialog"
|
role="dialog"
|
||||||
class="pointer-events-none fixed inset-0 z-50 flex items-center justify-center"
|
class="pointer-events-none fixed inset-0 z-50 flex items-center justify-center"
|
||||||
transition:fly={{ y: 50 }}
|
transition:fly={{ y: 50 }}
|
||||||
onintrostart={bubble('introstart')}
|
use:exitBeforeEnter
|
||||||
onoutroend={bubble('outroend')}
|
use:focusTrap
|
||||||
use:focusTrap
|
>
|
||||||
>
|
<div
|
||||||
<div
|
class="bg-base-100 rounded-box pointer-events-auto flex max-h-full min-w-fit max-w-md flex-col justify-between p-4 shadow-lg"
|
||||||
class="bg-base-100 rounded-box pointer-events-auto flex max-h-full min-w-fit max-w-md flex-col justify-between p-4 shadow-lg"
|
>
|
||||||
>
|
<h2 class="text-base-content text-start text-2xl font-bold">Updating Firmware</h2>
|
||||||
<h2 class="text-base-content text-start text-2xl font-bold">Updating Firmware</h2>
|
<div class="divider my-2"></div>
|
||||||
<div class="divider my-2"></div>
|
<div class="overflow-y-auto">
|
||||||
<div class="overflow-y-auto">
|
<div class="bg-base-100 flex flex-col items-center justify-center p-6">
|
||||||
<div class="bg-base-100 flex flex-col items-center justify-center p-6">
|
{#if $telemetry.download_ota.status == 'progress'}
|
||||||
{#if $telemetry.download_ota.status == 'progress'}
|
<progress class="progress progress-primary w-56" value={progress} max="100"
|
||||||
<progress class="progress progress-primary w-56" value={progress} max="100"></progress>
|
></progress>
|
||||||
{:else}
|
{:else}
|
||||||
<progress class="progress progress-primary w-56"></progress>
|
<progress class="progress progress-primary w-56"></progress>
|
||||||
{/if}
|
{/if}
|
||||||
<p class="mt-8 text-2xl">{message}</p>
|
<p class="mt-8 text-2xl">{message}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="divider my-2"></div>
|
<div class="divider my-2"></div>
|
||||||
<div class="flex flex-wrap justify-end gap-2">
|
<div class="flex flex-wrap justify-end gap-2">
|
||||||
<div class="flex-grow"></div>
|
<div class="flex-grow"></div>
|
||||||
<button
|
<button
|
||||||
class="btn btn-warning text-warning-content inline-flex flex-none items-center"
|
class="btn btn-warning text-warning-content inline-flex flex-none items-center"
|
||||||
disabled={updating}
|
disabled={updating}
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
closeAllModals();
|
closeAllModals();
|
||||||
location.reload();
|
location.reload();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Cancel class="mr-2 h-5 w-5" /><span>Close</span></button
|
<Cancel class="mr-2 h-5 w-5" /><span>Close</span></button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -1,54 +1,51 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { createBubbler } from 'svelte/legacy';
|
import { focusTrap } from 'svelte-focus-trap';
|
||||||
|
import { fly } from 'svelte/transition';
|
||||||
|
import { Check } from './icons';
|
||||||
|
import { exitBeforeEnter } from 'svelte-modals';
|
||||||
|
|
||||||
const bubble = createBubbler();
|
// provided by <Modals />
|
||||||
import { focusTrap } from 'svelte-focus-trap';
|
|
||||||
import { fly } from 'svelte/transition';
|
|
||||||
import { Check } from './icons';
|
|
||||||
|
|
||||||
// provided by <Modals />
|
interface Props {
|
||||||
|
isOpen: boolean;
|
||||||
|
title: string;
|
||||||
|
message: string;
|
||||||
|
onDismiss: any;
|
||||||
|
dismiss?: any;
|
||||||
|
}
|
||||||
|
|
||||||
interface Props {
|
let {
|
||||||
isOpen: boolean;
|
isOpen,
|
||||||
title: string;
|
title,
|
||||||
message: string;
|
message,
|
||||||
onDismiss: any;
|
onDismiss,
|
||||||
dismiss?: any;
|
dismiss = { label: 'Dismiss', icon: Check }
|
||||||
}
|
}: Props = $props();
|
||||||
|
|
||||||
let {
|
|
||||||
isOpen,
|
|
||||||
title,
|
|
||||||
message,
|
|
||||||
onDismiss,
|
|
||||||
dismiss = { label: 'Dismiss', icon: Check }
|
|
||||||
}: Props = $props();
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if isOpen}
|
{#if isOpen}
|
||||||
<div
|
<div
|
||||||
role="dialog"
|
role="dialog"
|
||||||
class="pointer-events-none fixed inset-0 z-50 flex items-center justify-center"
|
class="pointer-events-none fixed inset-0 z-50 flex items-center justify-center"
|
||||||
transition:fly={{ y: 50 }}
|
transition:fly={{ y: 50 }}
|
||||||
onintrostart={bubble('introstart')}
|
use:exitBeforeEnter
|
||||||
onoutroend={bubble('outroend')}
|
use:focusTrap
|
||||||
use:focusTrap
|
>
|
||||||
>
|
<div
|
||||||
<div
|
class="rounded-box bg-base-100 pointer-events-auto flex min-w-fit max-w-md flex-col justify-between p-4 shadow-lg"
|
||||||
class="rounded-box bg-base-100 pointer-events-auto flex min-w-fit max-w-md flex-col justify-between p-4 shadow-lg"
|
>
|
||||||
>
|
<h2 class="text-base-content text-start text-2xl font-bold">{title}</h2>
|
||||||
<h2 class="text-base-content text-start text-2xl font-bold">{title}</h2>
|
<div class="divider my-2"></div>
|
||||||
<div class="divider my-2"></div>
|
<p class="text-base-content mb-1 text-start">{message}</p>
|
||||||
<p class="text-base-content mb-1 text-start">{message}</p>
|
<div class="divider my-2"></div>
|
||||||
<div class="divider my-2"></div>
|
<div class="flex justify-end gap-2">
|
||||||
<div class="flex justify-end gap-2">
|
<button
|
||||||
<button
|
class="btn btn-warning text-warning-content inline-flex items-center"
|
||||||
class="btn btn-warning text-warning-content inline-flex items-center"
|
onclick={onDismiss}
|
||||||
onclick={onDismiss}
|
>
|
||||||
><dismiss.icon class="mr-2 h-5 w-5" /><span>{dismiss.label}</span
|
<dismiss.icon class="mr-2 h-5 w-5" /><span>{dismiss.label}</span>
|
||||||
></button
|
</button>
|
||||||
>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -1,28 +1,28 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { useFeatureFlags } from '$lib/stores';
|
import { useFeatureFlags } from '$lib/stores';
|
||||||
import { closeModal, openModal } from 'svelte-modals';
|
import { closeModal, openModal } from 'svelte-modals/legacy';
|
||||||
import ConfirmDialog from '$lib/components/ConfirmDialog.svelte';
|
import ConfirmDialog from '$lib/components/ConfirmDialog.svelte';
|
||||||
import { api } from '$lib/api';
|
import { api } from '$lib/api';
|
||||||
import { Cancel, Power } from '../icons';
|
import { Cancel, Power } from '../icons';
|
||||||
|
|
||||||
const features = useFeatureFlags();
|
const features = useFeatureFlags();
|
||||||
|
|
||||||
const postSleep = async () => await api.post('/api/system/sleep');
|
const postSleep = async () => await api.post('/api/system/sleep');
|
||||||
|
|
||||||
const confirmSleep = () => {
|
const confirmSleep = () => {
|
||||||
openModal(ConfirmDialog, {
|
openModal(ConfirmDialog, {
|
||||||
title: 'Confirm Power Down',
|
title: 'Confirm Power Down',
|
||||||
message: 'Are you sure you want to switch off the device?',
|
message: 'Are you sure you want to switch off the device?',
|
||||||
labels: {
|
labels: {
|
||||||
cancel: { label: 'Abort', icon: Cancel },
|
cancel: { label: 'Abort', icon: Cancel },
|
||||||
confirm: { label: 'Switch Off', icon: Power }
|
confirm: { label: 'Switch Off', icon: Power }
|
||||||
},
|
},
|
||||||
onConfirm: () => {
|
onConfirm: () => {
|
||||||
closeModal();
|
closeModal();
|
||||||
postSleep();
|
postSleep();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if $features.sleep}
|
{#if $features.sleep}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/stores';
|
||||||
import { openModal, closeAllModals } from 'svelte-modals';
|
import { openModal, closeAllModals } from 'svelte-modals/legacy';
|
||||||
import { notifications } from '$lib/components/toasts/notifications';
|
import { notifications } from '$lib/components/toasts/notifications';
|
||||||
import ConfirmDialog from '$lib/components/ConfirmDialog.svelte';
|
import ConfirmDialog from '$lib/components/ConfirmDialog.svelte';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { onDestroy, onMount } from 'svelte';
|
import { onDestroy, onMount } from 'svelte';
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/stores';
|
||||||
import { Modals, closeModal } from 'svelte-modals';
|
import { Modals, closeModal } from 'svelte-modals/legacy';
|
||||||
import Toast from '$lib/components/toasts/Toast.svelte';
|
import Toast from '$lib/components/toasts/Toast.svelte';
|
||||||
import { notifications } from '$lib/components/toasts/notifications';
|
import { notifications } from '$lib/components/toasts/notifications';
|
||||||
import { fade } from 'svelte/transition';
|
import { fade } from 'svelte/transition';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { onDestroy, onMount } from 'svelte';
|
import { onDestroy, onMount } from 'svelte';
|
||||||
import { openModal, closeModal } from 'svelte-modals';
|
import { openModal, closeModal } from 'svelte-modals/legacy';
|
||||||
import ConfirmDialog from '$lib/components/ConfirmDialog.svelte';
|
import ConfirmDialog from '$lib/components/ConfirmDialog.svelte';
|
||||||
import SettingsCard from '$lib/components/SettingsCard.svelte';
|
import SettingsCard from '$lib/components/SettingsCard.svelte';
|
||||||
import Spinner from '$lib/components/Spinner.svelte';
|
import Spinner from '$lib/components/Spinner.svelte';
|
||||||
@@ -107,10 +107,10 @@
|
|||||||
|
|
||||||
<SettingsCard collapsible={false}>
|
<SettingsCard collapsible={false}>
|
||||||
{#snippet icon()}
|
{#snippet icon()}
|
||||||
<Health class="lex-shrink-0 mr-2 h-6 w-6 self-end" />
|
<Health class="lex-shrink-0 mr-2 h-6 w-6 self-end" />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
{#snippet title()}
|
{#snippet title()}
|
||||||
<span >System Status</span>
|
<span>System Status</span>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|
||||||
<div class="w-full overflow-x-auto">
|
<div class="w-full overflow-x-auto">
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/stores';
|
||||||
import { openModal, closeModal, closeAllModals } from 'svelte-modals';
|
import { openModal, closeModal, closeAllModals } from 'svelte-modals/legacy';
|
||||||
import { slide } from 'svelte/transition';
|
import { slide } from 'svelte/transition';
|
||||||
import { cubicOut } from 'svelte/easing';
|
import { cubicOut } from 'svelte/easing';
|
||||||
import ConfirmDialog from '$lib/components/ConfirmDialog.svelte';
|
import ConfirmDialog from '$lib/components/ConfirmDialog.svelte';
|
||||||
@@ -82,10 +82,10 @@
|
|||||||
|
|
||||||
<SettingsCard collapsible={false}>
|
<SettingsCard collapsible={false}>
|
||||||
{#snippet icon()}
|
{#snippet icon()}
|
||||||
<Github class="lex-shrink-0 mr-2 h-6 w-6 self-end rounded-full" />
|
<Github class="lex-shrink-0 mr-2 h-6 w-6 self-end rounded-full" />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
{#snippet title()}
|
{#snippet title()}
|
||||||
<span >Github Firmware Manager</span>
|
<span>Github Firmware Manager</span>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
{#await getGithubAPI()}
|
{#await getGithubAPI()}
|
||||||
<Spinner />
|
<Spinner />
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { openModal, closeModal } from 'svelte-modals';
|
import { openModal, closeModal } from 'svelte-modals/legacy';
|
||||||
import ConfirmDialog from '$lib/components/ConfirmDialog.svelte';
|
import ConfirmDialog from '$lib/components/ConfirmDialog.svelte';
|
||||||
import SettingsCard from '$lib/components/SettingsCard.svelte';
|
import SettingsCard from '$lib/components/SettingsCard.svelte';
|
||||||
|
|
||||||
@@ -33,10 +33,10 @@
|
|||||||
|
|
||||||
<SettingsCard collapsible={false}>
|
<SettingsCard collapsible={false}>
|
||||||
{#snippet icon()}
|
{#snippet icon()}
|
||||||
<OTA class="lex-shrink-0 mr-2 h-6 w-6 self-end rounded-full" />
|
<OTA class="lex-shrink-0 mr-2 h-6 w-6 self-end rounded-full" />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
{#snippet title()}
|
{#snippet title()}
|
||||||
<span >Upload Firmware</span>
|
<span>Upload Firmware</span>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
<div class="alert alert-warning shadow-lg">
|
<div class="alert alert-warning shadow-lg">
|
||||||
<Warning class="h-6 w-6 flex-shrink-0" />
|
<Warning class="h-6 w-6 flex-shrink-0" />
|
||||||
|
|||||||
@@ -1,16 +1,12 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { createBubbler } from 'svelte/legacy';
|
|
||||||
|
|
||||||
const bubble = createBubbler();
|
|
||||||
import { closeModal } from 'svelte-modals';
|
|
||||||
import { focusTrap } from 'svelte-focus-trap';
|
import { focusTrap } from 'svelte-focus-trap';
|
||||||
import { fly } from 'svelte/transition';
|
import { fly } from 'svelte/transition';
|
||||||
|
|
||||||
import { onMount, onDestroy } from 'svelte';
|
import { onMount, onDestroy } from 'svelte';
|
||||||
import RssiIndicator from '$lib/components/statusbar/RSSIIndicator.svelte';
|
import RssiIndicator from '$lib/components/statusbar/RSSIIndicator.svelte';
|
||||||
import type { NetworkItem, NetworkList } from '$lib/types/models';
|
import type { NetworkItem, NetworkList } from '$lib/types/models';
|
||||||
import { api } from '$lib/api';
|
import { api } from '$lib/api';
|
||||||
import { AP, Network, Reload, Cancel } from '$lib/components/icons';
|
import { AP, Network, Reload, Cancel } from '$lib/components/icons';
|
||||||
|
import { modals, exitBeforeEnter } from 'svelte-modals';
|
||||||
|
|
||||||
// provided by <Modals />
|
// provided by <Modals />
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -80,8 +76,7 @@
|
|||||||
role="dialog"
|
role="dialog"
|
||||||
class="pointer-events-none fixed inset-0 z-50 flex items-center justify-center"
|
class="pointer-events-none fixed inset-0 z-50 flex items-center justify-center"
|
||||||
transition:fly={{ y: 50 }}
|
transition:fly={{ y: 50 }}
|
||||||
onintrostart={bubble('introstart')}
|
use:exitBeforeEnter
|
||||||
onoutroend={bubble('outroend')}
|
|
||||||
use:focusTrap
|
use:focusTrap
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
@@ -135,14 +130,17 @@
|
|||||||
class="btn btn-primary inline-flex flex-none items-center"
|
class="btn btn-primary inline-flex flex-none items-center"
|
||||||
disabled={scanActive}
|
disabled={scanActive}
|
||||||
onclick={scanNetworks}
|
onclick={scanNetworks}
|
||||||
><Reload class="mr-2 h-5 w-5" /><span>Scan again</span></button
|
|
||||||
>
|
>
|
||||||
|
<Reload class="mr-2 h-5 w-5" /><span>Scan again</span>
|
||||||
|
</button>
|
||||||
|
|
||||||
<div class="flex-grow"></div>
|
<div class="flex-grow"></div>
|
||||||
<button
|
<button
|
||||||
class="btn btn-warning text-warning-content inline-flex flex-none items-center"
|
class="btn btn-warning text-warning-content inline-flex flex-none items-center"
|
||||||
onclick={closeModal}><Cancel class="mr-2 h-5 w-5" /><span>Cancel</span></button
|
onclick={() => modals.close()}
|
||||||
>
|
>
|
||||||
|
<Cancel class="mr-2 h-5 w-5" /><span>Cancel</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { onMount, onDestroy } from 'svelte';
|
import { onMount, onDestroy } from 'svelte';
|
||||||
import { openModal, closeModal } from 'svelte-modals';
|
import { openModal, closeModal } from 'svelte-modals/legacy';
|
||||||
import { slide } from 'svelte/transition';
|
import { slide } from 'svelte/transition';
|
||||||
import { cubicOut } from 'svelte/easing';
|
import { cubicOut } from 'svelte/easing';
|
||||||
import { notifications } from '$lib/components/toasts/notifications';
|
import { notifications } from '$lib/components/toasts/notifications';
|
||||||
|
|||||||
Reference in New Issue
Block a user