Can configure network autostart

This commit is contained in:
2023-12-06 19:10:25 +01:00
parent 23f2029deb
commit 8b53875349
7 changed files with 143 additions and 22 deletions

View File

@ -1,6 +1,6 @@
import { Checkbox, Grid } from "@mui/material";
import React from "react";
import { IpConfig, NetworkInfo } from "../../api/NetworksApi";
import { IpConfig, NetworkApi, NetworkInfo } from "../../api/NetworksApi";
import { ServerApi } from "../../api/ServerApi";
import { AsyncWidget } from "../AsyncWidget";
import { EditSection } from "../forms/EditSection";
@ -9,6 +9,7 @@ import { SelectInput } from "../forms/SelectInput";
import { TextInput } from "../forms/TextInput";
import { useConfirm } from "../../hooks/providers/ConfirmDialogProvider";
import { CheckboxInput } from "../forms/CheckboxInput";
import { ResAutostartInput } from "../forms/ResAutostartInput";
interface DetailsProps {
net: NetworkInfo;
@ -75,8 +76,16 @@ function NetworkDetailsInner(
}}
multiline={true}
/>
{p.net.uuid && (
<ResAutostartInput
editable={p.editable}
ressourceName="Network"
checkAutotostart={() => NetworkApi.IsAutostart(p.net)}
setAutotostart={(e) => NetworkApi.SetAutostart(p.net, e)}
/>
)}
</EditSection>
{/* TODO : autostart */}
<EditSection title="General settings">
<SelectInput