update deps and fix eslint errors

This commit is contained in:
Maxi Quoß
2025-07-02 18:02:28 +02:00
parent a86cce9ed5
commit 2e8ecd4947
16 changed files with 1643 additions and 787 deletions

View File

@@ -38,7 +38,7 @@ require (
github.com/spf13/pflag v1.0.6 // indirect
github.com/stretchr/testify v1.8.1 // indirect
golang.org/x/crypto v0.39.0 // indirect
golang.org/x/exp v0.0.0-20250606033433-dcc06ee1d476 // indirect
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect
golang.org/x/image v0.28.0 // indirect
golang.org/x/net v0.41.0 // indirect
golang.org/x/oauth2 v0.30.0 // indirect

View File

@@ -97,8 +97,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM=
golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U=
golang.org/x/exp v0.0.0-20250606033433-dcc06ee1d476 h1:bsqhLWFR6G6xiQcb+JoGqdKdRU6WzPWmK8E0jxTjzo4=
golang.org/x/exp v0.0.0-20250606033433-dcc06ee1d476/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8=
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b h1:M2rDM6z3Fhozi9O7NWsxAkg/yqS/lQJ6PmkyIV3YP+o=
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8=
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.28.0 h1:gdem5JW1OLS4FbkWgLO+7ZeFzYtL3xClb97GaUzYMFE=
golang.org/x/image v0.28.0/go.mod h1:GUJYXtnGKEUgggyzh+Vxt+AviiCcyiwpsl8iQ8MvwGY=

View File

@@ -22,16 +22,16 @@
"@sveltejs/adapter-static": "^3.0.8",
"@sveltejs/kit": "^2.22.2",
"@sveltejs/vite-plugin-svelte": "^5.1.0",
"daisyui": "^5.0.42",
"daisyui": "^5.0.43",
"eslint": "^9.30.1",
"eslint-config-prettier": "^10.1.5",
"eslint-plugin-svelte": "^2.46.1",
"globals": "^15.15.0",
"eslint-plugin-svelte": "^3.10.1",
"globals": "^16.3.0",
"husky": "^9.1.7",
"prettier": "^3.6.2",
"prettier-plugin-svelte": "^3.4.0",
"prettier-plugin-tailwindcss": "^0.6.13",
"svelte": "^5.34.9",
"svelte": "^5.35.0",
"svelte-check": "^4.2.2",
"tailwindcss": "^4.1.11",
"tslib": "^2.8.1",
@@ -47,7 +47,7 @@
"dependencies": {
"@fortawesome/free-solid-svg-icons": "^6.7.2",
"@tailwindcss/postcss": "^4.1.11",
"cron-parser": "^4.9.0",
"cron-parser": "^5.3.0",
"date-fns": "^4.1.0",
"pocketbase": "^0.26.1",
"postcss": "^8.5.6",

2361
frontend/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -56,6 +56,7 @@
$: {
clearInterval(interval);
interval = setInterval(() => {
// eslint-disable-next-line svelte/infinite-reactive-loop
now = Date.now();
}, 1000);
}
@@ -142,7 +143,7 @@
</span>
{#if moreButtons.filter((btn) => btn.requires).length > 0}
<div class="ms-auto flex flex-row flex-wrap gap-1">
{#each moreButtons as btn}
{#each moreButtons as btn, i (i)}
{#if btn.requires}
<div class="tooltip" data-tip={btn.text}>
<button class="btn btn-sm btn-circle" on:click={btn.onClick}>

View File

@@ -16,6 +16,7 @@
let modalShutdown: HTMLDialogElement;
$: if (device.status === 'pending' && !interval) {
// eslint-disable-next-line svelte/infinite-reactive-loop
countdown(Date.parse(device.updated), 'wake');
}
$: minutes = Math.floor(timeout / 60);
@@ -113,6 +114,7 @@
if (timeout <= 0 || device.status !== 'pending') {
clearInterval(interval);
// eslint-disable-next-line svelte/infinite-reactive-loop
interval = 0;
}
}, 1000);
@@ -174,7 +176,7 @@
<div>{device.mac}</div>
<div class="flex flex-wrap gap-x-4">
{#if device?.expand?.ports}
{#each device?.expand?.ports.sort((a, b) => a.number - b.number) as port}
{#each device?.expand?.ports.sort((a, b) => a.number - b.number) as port (port.id)}
<span class="flex items-center gap-1 break-all">
{#if port.status}
<div class="inline-grid *:[grid-area:1/1]">

View File

@@ -269,7 +269,7 @@
<div class="w-full">
<div class="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
<!-- eslint-disable-next-line @typescript-eslint/no-unused-vars -->
{#each device.expand.ports as _, index}
{#each device.expand.ports as _, index (index)}
<DeviceFormPort bind:device {index} />
{/each}
</div>
@@ -660,7 +660,7 @@ second (059, optional)
{m.device_groups_desc()}
</p>
<div class="flex flex-row flex-wrap gap-2">
{#each deviceGroups as group}
{#each deviceGroups as group (group.id)}
<div class="join">
<div class=" tooltip" data-tip="Delete">
<button

View File

@@ -57,7 +57,7 @@
'silk'
];
let activeTheme: string | null = '';
$: avatar = $pocketbase.authStore.record?.avatar;
let avatar = $pocketbase.authStore.record?.avatar;
onMount(() => {
themeChange(false);
@@ -140,7 +140,7 @@
>
<ul>
<div class="h-fit max-h-72 overflow-scroll">
{#each availableThemes as theme}
{#each availableThemes as theme (theme)}
<li class="w-full">
<button
class="gap-3 px-2"
@@ -212,7 +212,7 @@
</button>
<div class="dropdown-content bg-base-200 rounded-box z-1 mt-3 w-52 shadow-sm">
<ul class="menu menu-horizontal h-fit max-h-96 overflow-y-auto">
{#each availableThemes as theme}
{#each availableThemes as theme (theme)}
<li class="w-full">
<button
class="gap-3 px-2"

View File

@@ -169,7 +169,7 @@
</div>
</div>
{#if scanResponse.devices?.length > 0}
{#each scanResponse.devices.sort( (a, b) => a.ip.localeCompare( b.ip, $localeStore, { numeric: true } ) ) as device, index}
{#each scanResponse.devices.sort( (a, b) => a.ip.localeCompare( b.ip, $localeStore, { numeric: true } ) ) as device, index (device.mac)}
<div class="collapse-arrow bg-base-100 collapse">
<input type="radio" name="scanned-devices" checked={index === 0} />
<div class="collapse-title font-bold">

View File

@@ -7,8 +7,12 @@ import { get } from 'svelte/store';
export function nextCronDate(expression: string) {
try {
const cron = cronParser.parseExpression(expression, {});
return formatDate(cron.next().toISOString(), 'PPpp', {
const cron = cronParser.parse(expression);
const cronStr = cron.next().toISOString();
if (!cronStr) {
throw new Error(m.settings_invalid_cron());
}
return formatDate(cronStr, 'PPpp', {
locale: get(dateFnsLocale) as unknown as Locale
});
} catch {

View File

@@ -112,7 +112,7 @@
</Transition>
<div class="hidden">
{#each locales as locale}
{#each locales as locale (locale)}
<a href={localizeHref(page.url.pathname, { locale })}>{locale}</a>
{/each}
</div>

View File

@@ -165,12 +165,12 @@
<div class="space-y-6">
{#if devicesWithoutGroups().length > 0}
<div class={gridClass}>
{#each devicesWithoutGroups().sort( (a, b) => a[orderBy].localeCompare( b[orderBy], $localeStore, { numeric: true } ) ) as device}
{#each devicesWithoutGroups().sort( (a, b) => a[orderBy].localeCompare( b[orderBy], $localeStore, { numeric: true } ) ) as device (device.id)}
<DeviceCard {device} />
{/each}
</div>
{/if}
{#each Object.entries(devicesWithGroup()).sort( ([a], [b]) => a.localeCompare( b, $localeStore, { numeric: true } ) ) as [group, groupDevices]}
{#each Object.entries(devicesWithGroup()).sort( ([a], [b]) => a.localeCompare( b, $localeStore, { numeric: true } ) ) as [group, groupDevices], i (i)}
<div>
<h1 class="mb-3 text-2xl font-bold">
{groupDevices[0].expand.groups.find((grp) => grp.id === group)?.name ||
@@ -180,7 +180,7 @@
>
</h1>
<div class={gridClass}>
{#each groupDevices.sort( (a, b) => a[orderBy].localeCompare( b[orderBy], $localeStore, { numeric: true } ) ) as device}
{#each groupDevices.sort( (a, b) => a[orderBy].localeCompare( b[orderBy], $localeStore, { numeric: true } ) ) as device (device.id)}
<DeviceCard {device} />
{/each}
</div>
@@ -189,7 +189,7 @@
</div>
{:else}
<div class={gridClass}>
{#each filteredDevices().sort( (a, b) => a[orderBy].localeCompare( b[orderBy], $localeStore, { numeric: true } ) ) as device}
{#each filteredDevices().sort( (a, b) => a[orderBy].localeCompare( b[orderBy], $localeStore, { numeric: true } ) ) as device (device.id)}
<DeviceCard {device} />
{/each}
</div>

View File

@@ -156,7 +156,7 @@
<form on:submit|preventDefault={saveUser}>
<h2 class="card-title mt-4 mb-2">{m.account_avatar_title()}</h2>
<div class="flex flex-row flex-wrap gap-4">
{#each [...Array(10).keys()] as i}
{#each [...Array(10).keys()] as i (i)}
<div class="avatar">
<div
class="hover:ring-neutral w-11 rounded-full hover:ring-2 hover:ring-offset-2"
@@ -184,7 +184,7 @@
</div>
<h2 class="card-title mt-4 mb-2">{m.account_language_title()}</h2>
<select class="select w-full max-w-xs" bind:value={selectedLang}>
{#each [...locales].sort( (a, b) => a.localeCompare( b, $localeStore, { sensitivity: 'base' } ) ) as lang}
{#each [...locales].sort( (a, b) => a.localeCompare( b, $localeStore, { sensitivity: 'base' } ) ) as lang (lang)}
<option value={lang} selected={$localeStore === lang}>
{languageEmojis[lang]}
{localeToFullName(lang)} [{lang}]

View File

@@ -73,7 +73,7 @@
<h1 class="mb-8 text-3xl font-bold">{m.device_page_title()}</h1>
<div class="mb-6 flex justify-center">
<ul class="menu menu-horizontal rounded-box bg-base-200 gap-1">
{#each tabs as tab}
{#each tabs as tab (tab)}
{#if tab.show}
<li>
<button class:menu-active={activeTab === tab.name} on:click={() => (activeTab = tab.name)}

View File

@@ -116,7 +116,7 @@
</li>
{#await $pocketbase.collection('users').listAuthMethods() then authMethods}
{#if authMethods.oauth2.enabled && authMethods.oauth2.providers.length > 0}
{#each authMethods.oauth2.providers as provider}
{#each authMethods.oauth2.providers as provider (provider)}
<li>
<button type="button" on:click={() => loginWithProvider(provider)}
>{provider.displayName}</button

View File

@@ -182,7 +182,7 @@
<PageLoading />
{:then}
<h1 class="mb-8 text-3xl font-bold">{m.users_page_title()}</h1>
{#each users as user, index}
{#each users as user, index (user.id)}
<form on:submit|preventDefault={() => save(user)}>
<div class="card bg-base-200 mt-6 w-full shadow-sm">
<div class="card-body gap-4">
@@ -194,7 +194,7 @@
</label>
{user.username}
</h2>
{#each permissions.filter((perm) => perm.user === user.id) as permission}
{#each permissions.filter((perm) => perm.user === user.id) as permission (permission.id)}
<div class="w-fit">
<label class="label cursor-pointer gap-2 text-wrap">
<input type="checkbox" bind:checked={permission.create} class="checkbox" />
@@ -217,9 +217,9 @@
<div class="font-bold">{m.users_update()}</div>
<div class="font-bold">{m.users_delete()}</div>
<div class="font-bold">{m.users_power()}</div>
{#each devices as device}
{#each devices as device (device.id)}
<hr class="border-neutral col-span-full w-full border-b-1 opacity-30" />
{#each permissions.filter((perm) => perm.user === user.id) as permission}
{#each permissions.filter((perm) => perm.user === user.id) as permission (permission.id)}
<div
class="col-span-full flex flex-row flex-wrap gap-2 place-self-start break-all md:col-span-1"
>