Add DHCP rapid commit checkbox

Requires pi-hole/api#139

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
Mcat12
2019-05-04 15:20:40 -07:00
parent 6a9b88fd49
commit 49ef4d902a
4 changed files with 18 additions and 3 deletions
+2 -1
View File
@@ -343,7 +343,8 @@ function getDHCPInfo() {
.word()
.toLowerCase()
.split(" ", 2)[0],
ipv6_support: faker.random.boolean()
ipv6_support: faker.random.boolean(),
rapid_commit: faker.random.boolean()
};
}
+13 -1
View File
@@ -46,7 +46,8 @@ class DHCPInfo extends Component<WithNamespaces, DHCPInfoState> {
router_ip: "",
lease_time: 0,
domain: "",
ipv6_support: false
ipv6_support: false,
rapid_commit: false
}
};
@@ -298,6 +299,17 @@ class DHCPInfo extends Component<WithNamespaces, DHCPInfoState> {
{t("IPv6 Support")}
</Label>
</FormGroup>
<FormGroup check>
<Label check>
<Input
type="checkbox"
disabled={!this.state.settings.active}
checked={this.state.settings.rapid_commit}
onChange={this.onChange("rapid_commit", "checked")}
/>
{t("Rapid Commit")}
</Label>
</FormGroup>
<Button
type="submit"
disabled={
@@ -24,7 +24,8 @@ const fakeData = {
router_ip: "192.168.1.1",
lease_time: "24",
domain: "lan",
ipv6_support: false
ipv6_support: false,
rapid_commit: false
};
it("retrieves settings correctly", async () => {
+1
View File
@@ -67,6 +67,7 @@ interface ApiDhcpSettings {
lease_time: number;
domain: string;
ipv6_support: boolean;
rapid_commit: boolean;
}
interface ApiFtlDbResponse {