mirror of
https://github.com/gosticks/web.git
synced 2026-10-06 06:37:07 +00:00
Don't use arbitrary strings for loading and error states in settings
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
@@ -23,13 +23,13 @@ import {
|
||||
|
||||
class DHCPInfo extends Component {
|
||||
state = {
|
||||
active: "---",
|
||||
ip_start: "---",
|
||||
ip_end: "---",
|
||||
router_ip: "---",
|
||||
lease_time: "---",
|
||||
domain: "---",
|
||||
ipv6_support: "---"
|
||||
active: false,
|
||||
ip_start: "",
|
||||
ip_end: "",
|
||||
router_ip: "",
|
||||
lease_time: 24,
|
||||
domain: "",
|
||||
ipv6_support: false
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
@@ -54,18 +54,7 @@ class DHCPInfo extends Component {
|
||||
ipv6_support: res.ipv6_support
|
||||
});
|
||||
})
|
||||
.catch(ignoreCancel)
|
||||
.catch(() => {
|
||||
this.setState({
|
||||
active: "-!-",
|
||||
ip_start: "-!-",
|
||||
ip_end: "-!-",
|
||||
router_ip: "-!-",
|
||||
lease_time: "-!-",
|
||||
domain: "-!-",
|
||||
ipv6_support: "-!-"
|
||||
});
|
||||
});
|
||||
.catch(ignoreCancel);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
@@ -14,17 +14,17 @@ import { api, ignoreCancel, makeCancelable } from "../../utils";
|
||||
|
||||
class DNSInfo extends Component {
|
||||
state = {
|
||||
upstream_dns: ["---"],
|
||||
upstream_dns: [],
|
||||
conditional_forwarding: {
|
||||
enabled: "---",
|
||||
router_ip: "---",
|
||||
domain: "---"
|
||||
enabled: false,
|
||||
router_ip: "",
|
||||
domain: ""
|
||||
},
|
||||
options: {
|
||||
fqdn_required: "---",
|
||||
bogus_priv: "---",
|
||||
dnssec: "---",
|
||||
listening_type: "---"
|
||||
fqdn_required: false,
|
||||
bogus_priv: false,
|
||||
dnssec: false,
|
||||
listening_type: "single"
|
||||
}
|
||||
};
|
||||
|
||||
@@ -42,23 +42,7 @@ class DNSInfo extends Component {
|
||||
.then(res => {
|
||||
this.setState(res);
|
||||
})
|
||||
.catch(ignoreCancel)
|
||||
.catch(() => {
|
||||
this.setState({
|
||||
upstream_dns: ["-!-"],
|
||||
options: {
|
||||
fqdn_required: "-!-",
|
||||
bogus_priv: "-!-",
|
||||
dnssec: "-!-",
|
||||
listening_type: "-!-"
|
||||
},
|
||||
conditional_forwarding: {
|
||||
enabled: "-!-",
|
||||
router_ip: "-!-",
|
||||
domain: "-!-"
|
||||
}
|
||||
});
|
||||
});
|
||||
.catch(ignoreCancel);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
@@ -14,9 +14,9 @@ import { api, ignoreCancel, makeCancelable } from "../../utils";
|
||||
|
||||
class FTLInfo extends Component {
|
||||
state = {
|
||||
filesize: "---",
|
||||
queries: "---",
|
||||
sqlite_version: "---"
|
||||
filesize: 0,
|
||||
queries: 0,
|
||||
sqlite_version: ""
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
@@ -37,14 +37,7 @@ class FTLInfo extends Component {
|
||||
sqlite_version: res.sqlite_version
|
||||
});
|
||||
})
|
||||
.catch(ignoreCancel)
|
||||
.catch(() => {
|
||||
this.setState({
|
||||
queries: "-!-",
|
||||
filesize: "-!-",
|
||||
sqlite_version: "-!-"
|
||||
});
|
||||
});
|
||||
.catch(ignoreCancel);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
@@ -15,10 +15,10 @@ import { Col, Form, FormGroup, Input, Label } from "reactstrap";
|
||||
|
||||
class NetworkInfo extends Component {
|
||||
state = {
|
||||
interface: "---",
|
||||
ipv4_address: "---",
|
||||
ipv6_address: "---",
|
||||
hostname: "---"
|
||||
interface: "",
|
||||
ipv4_address: "",
|
||||
ipv6_address: "",
|
||||
hostname: ""
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
@@ -40,15 +40,7 @@ class NetworkInfo extends Component {
|
||||
hostname: res.hostname
|
||||
});
|
||||
})
|
||||
.catch(ignoreCancel)
|
||||
.catch(() => {
|
||||
this.setState({
|
||||
interface: "-!-",
|
||||
ipv4_address: "-!-",
|
||||
ipv6_address: "-!-",
|
||||
hostname: "-!-"
|
||||
});
|
||||
});
|
||||
.catch(ignoreCancel);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
@@ -16,24 +16,24 @@ import VersionCard from "./VersionCard";
|
||||
class VersionInfo extends Component {
|
||||
state = {
|
||||
api: {
|
||||
branch: "---",
|
||||
hash: "---",
|
||||
tag: "---"
|
||||
branch: "unknown",
|
||||
hash: "unknown",
|
||||
tag: "unknown"
|
||||
},
|
||||
core: {
|
||||
branch: "---",
|
||||
hash: "---",
|
||||
tag: "---"
|
||||
branch: "unknown",
|
||||
hash: "unknown",
|
||||
tag: "unknown"
|
||||
},
|
||||
ftl: {
|
||||
branch: "---",
|
||||
hash: "---",
|
||||
tag: "---"
|
||||
branch: "unknown",
|
||||
hash: "unknown",
|
||||
tag: "unknown"
|
||||
},
|
||||
web: {
|
||||
branch: "---",
|
||||
hash: "---",
|
||||
tag: "---"
|
||||
branch: "unknown",
|
||||
hash: "unknown",
|
||||
tag: "unknown"
|
||||
}
|
||||
};
|
||||
|
||||
@@ -51,31 +51,7 @@ class VersionInfo extends Component {
|
||||
.then(res => {
|
||||
this.setState(res);
|
||||
})
|
||||
.catch(ignoreCancel)
|
||||
.catch(() => {
|
||||
this.setState({
|
||||
api: {
|
||||
branch: "-!-",
|
||||
hash: "-!-",
|
||||
tag: "-!-"
|
||||
},
|
||||
core: {
|
||||
branch: "-!-",
|
||||
hash: "-!-",
|
||||
tag: "-!-"
|
||||
},
|
||||
ftl: {
|
||||
branch: "-!-",
|
||||
hash: "-!-",
|
||||
tag: "-!-"
|
||||
},
|
||||
web: {
|
||||
branch: "-!-",
|
||||
hash: "-!-",
|
||||
tag: "-!-"
|
||||
}
|
||||
});
|
||||
});
|
||||
.catch(ignoreCancel);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
Reference in New Issue
Block a user