Fixes ui warnings

This commit is contained in:
Rune Harlyk
2024-04-29 21:47:39 +02:00
committed by Rune Harlyk
parent 0a144a7473
commit a706a377b2
2 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ export type WifiStatus = {
export type WifiSettings = { export type WifiSettings = {
hostname: string; hostname: string;
priority_RSSI: boolean; priority_RSSI: boolean;
wifi_networks: networkItem[]; wifi_networks: KnownNetworkItem[];
}; };
export type KnownNetworkItem = { export type KnownNetworkItem = {
+6 -6
View File
@@ -46,6 +46,8 @@
dns_ip_2: undefined dns_ip_2: undefined
}; };
let static_ip_config = false
let newNetwork: boolean = true; let newNetwork: boolean = true;
let showNetworkEditor: boolean = false; let showNetworkEditor: boolean = false;
@@ -156,6 +158,8 @@
formErrors.ssid = false; formErrors.ssid = false;
} }
networkEditable.static_ip_config = static_ip_config;
if (networkEditable.static_ip_config) { if (networkEditable.static_ip_config) {
// RegEx for IPv4 // RegEx for IPv4
const regexExp = const regexExp =
@@ -613,13 +617,13 @@
> >
<input <input
type="checkbox" type="checkbox"
bind:checked={networkEditable.static_ip_config} bind:checked={static_ip_config}
class="checkbox checkbox-primary sm:-mb-5" class="checkbox checkbox-primary sm:-mb-5"
/> />
<span class="sm:-mb-5">Static IP Config?</span> <span class="sm:-mb-5">Static IP Config?</span>
</label> </label>
</div> </div>
{#if networkEditable.static_ip_config} {#if static_ip_config}
<div <div
class="grid w-full grid-cols-1 content-center gap-x-4 px-4 sm:grid-cols-2" class="grid w-full grid-cols-1 content-center gap-x-4 px-4 sm:grid-cols-2"
transition:slide|local={{ duration: 300, easing: cubicOut }} transition:slide|local={{ duration: 300, easing: cubicOut }}
@@ -660,7 +664,6 @@
maxlength="15" maxlength="15"
size="15" size="15"
bind:value={networkEditable.gateway_ip} bind:value={networkEditable.gateway_ip}
id="gateway"
required required
/> />
<label class="label" for="gateway"> <label class="label" for="gateway">
@@ -683,7 +686,6 @@
maxlength="15" maxlength="15"
size="15" size="15"
bind:value={networkEditable.subnet_mask} bind:value={networkEditable.subnet_mask}
id="subnet"
required required
/> />
<label class="label" for="subnet"> <label class="label" for="subnet">
@@ -706,7 +708,6 @@
maxlength="15" maxlength="15"
size="15" size="15"
bind:value={networkEditable.dns_ip_1} bind:value={networkEditable.dns_ip_1}
id="gateway"
required required
/> />
<label class="label" for="gateway"> <label class="label" for="gateway">
@@ -728,7 +729,6 @@
maxlength="15" maxlength="15"
size="15" size="15"
bind:value={networkEditable.dns_ip_2} bind:value={networkEditable.dns_ip_2}
id="subnet"
required required
/> />
<label class="label" for="subnet"> <label class="label" for="subnet">