WIP ESLint fixes
This commit is contained in:
@ -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);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user