WIP ESLint fixes

This commit is contained in:
2025-03-28 11:35:51 +01:00
parent 4b9df95721
commit 9a905e83f7
40 changed files with 92 additions and 91 deletions

View File

@ -260,7 +260,7 @@ function IPSection(p: {
const confirm = useConfirm();
const toggleNetwork = async () => {
if (!!p.config) {
if (p.config) {
if (
!(await confirm(
`Do you really want to disable IPv${p.version} on this network? Specific configuration will be deleted!`
@ -268,11 +268,11 @@ function IPSection(p: {
)
return;
p.onChange?.(undefined);
p.onChange(undefined);
return;
}
p.onChange?.({
p.onChange({
bridge_address: p.version === 4 ? "192.168.1.1" : "fd00::1",
prefix: p.version === 4 ? 24 : 8,
});
@ -298,7 +298,7 @@ function IPSection(p: {
p.config!.dhcp = undefined;
}
p.onChange?.(p.config);
p.onChange(p.config);
};
const toggleNAT = async (v: boolean) => {
@ -315,7 +315,7 @@ function IPSection(p: {
p.config!.nat = undefined;
}
p.onChange?.(p.config);
p.onChange(p.config);
};
if (!p.config && !p.editable) return <></>;
@ -338,10 +338,10 @@ function IPSection(p: {
editable={p.editable}
label="Bridge address"
version={p.version}
value={p.config?.bridge_address}
value={p.config.bridge_address}
onValueChange={(v) => {
p.config!.bridge_address = v ?? "";
p.onChange?.(p.config);
p.onChange(p.config);
}}
/>
@ -352,7 +352,7 @@ function IPSection(p: {
type="number"
onValueChange={(v) => {
p.config!.prefix = Number(v);
p.onChange?.(p.config);
p.onChange(p.config);
}}
size={
p.version === 4 ? { min: 0, max: 32 } : { min: 0, max: 128 }
@ -407,7 +407,7 @@ function IPSection(p: {
dhcp={p.config.dhcp}
onChange={(d) => {
p.config!.dhcp = d;
p.onChange?.(p.config);
p.onChange(p.config);
}}
/>
</EditSection>
@ -431,7 +431,7 @@ function IPSection(p: {
nat={p.config.nat}
onChange={(n) => {
p.config!.nat = n;
p.onChange?.(p.config);
p.onChange(p.config);
}}
/>
)}

View File

@ -29,13 +29,13 @@ export function NetworkStatusWidget(p: {
}
};
const changedAction = () => setState(undefined);
const changedAction = () => { setState(undefined); };
React.useEffect(() => {
refresh();
const i = setInterval(() => refresh(), 3000);
return () => clearInterval(i);
return () => { clearInterval(i); };
});
if (state === undefined)