Remove unused fullDetails prop on status pages

This commit is contained in:
Rick Watson 2019-04-29 21:52:11 +01:00
parent 11a81150d2
commit 33be3ab1b2
5 changed files with 18 additions and 18 deletions

View File

@ -29,7 +29,7 @@ class APConfiguration extends Component {
<Tab value="apStatus" label="AP Status" /> <Tab value="apStatus" label="AP Status" />
<Tab value="apSettings" label="AP Settings" /> <Tab value="apSettings" label="AP Settings" />
</Tabs> </Tabs>
{selectedTab === "apStatus" && <APStatus fullDetails={true} />} {selectedTab === "apStatus" && <APStatus />}
{selectedTab === "apSettings" && <APSettings />} {selectedTab === "apSettings" && <APSettings />}
</MenuAppBar> </MenuAppBar>
) )

View File

@ -50,7 +50,7 @@ class APStatus extends Component {
return data.active ? "Active" : "Inactive"; return data.active ? "Active" : "Inactive";
} }
createListItems(data, fullDetails, classes){ createListItems(data, classes){
return ( return (
<Fragment> <Fragment>
<ListItem> <ListItem>
@ -83,12 +83,12 @@ class APStatus extends Component {
); );
} }
renderAPStatus(data, fullDetails, classes){ renderAPStatus(data, classes){
return ( return (
<div> <div>
<List> <List>
<Fragment> <Fragment>
{this.createListItems(data, fullDetails, classes)} {this.createListItems(data, classes)}
</Fragment> </Fragment>
</List> </List>
<Button variant="contained" color="secondary" className={classes.button} onClick={this.props.loadData}> <Button variant="contained" color="secondary" className={classes.button} onClick={this.props.loadData}>
@ -99,7 +99,7 @@ class APStatus extends Component {
} }
render() { render() {
const { data, fetched, errorMessage, classes, fullDetails } = this.props; const { data, fetched, errorMessage, classes } = this.props;
return ( return (
<SectionContent title="AP Status"> <SectionContent title="AP Status">
@ -112,7 +112,7 @@ class APStatus extends Component {
</Typography> </Typography>
</div> </div>
: :
data ? this.renderAPStatus(data, fullDetails, classes) data ? this.renderAPStatus(data, classes)
: :
<div> <div>
<Typography variant="display1" className={classes.fetching}> <Typography variant="display1" className={classes.fetching}>

View File

@ -51,7 +51,7 @@ class NTPStatus extends Component {
this.props.loadData(); this.props.loadData();
} }
createListItems(data, fullDetails, classes){ createListItems(data, classes){
return ( return (
<Fragment> <Fragment>
<ListItem> <ListItem>
@ -104,11 +104,11 @@ class NTPStatus extends Component {
); );
} }
renderNTPStatus(data, fullDetails, classes){ renderNTPStatus(data, classes){
return ( return (
<div> <div>
<List> <List>
{this.createListItems(data, fullDetails, classes)} {this.createListItems(data, classes)}
</List> </List>
<Button variant="contained" color="secondary" className={classes.button} onClick={this.props.loadData}> <Button variant="contained" color="secondary" className={classes.button} onClick={this.props.loadData}>
Refresh Refresh
@ -118,7 +118,7 @@ class NTPStatus extends Component {
} }
render() { render() {
const { data, fetched, errorMessage, classes, fullDetails } = this.props; const { data, fetched, errorMessage, classes } = this.props;
return ( return (
<SectionContent title="NTP Status"> <SectionContent title="NTP Status">
@ -131,7 +131,7 @@ class NTPStatus extends Component {
</Typography> </Typography>
</div> </div>
: :
data ? this.renderNTPStatus(data, fullDetails, classes) data ? this.renderNTPStatus(data, classes)
: :
<div> <div>
<Typography variant="display1" className={classes.fetching}> <Typography variant="display1" className={classes.fetching}>

View File

@ -43,7 +43,7 @@ class WiFiConfiguration extends Component {
<Tab value="networkScanner" label="Network Scanner" /> <Tab value="networkScanner" label="Network Scanner" />
<Tab value="wifiSettings" label="WiFi Settings" /> <Tab value="wifiSettings" label="WiFi Settings" />
</Tabs> </Tabs>
{selectedTab === "wifiStatus" && <WiFiStatus fullDetails={true} />} {selectedTab === "wifiStatus" && <WiFiStatus />}
{selectedTab === "networkScanner" && <WiFiNetworkScanner selectNetwork={this.selectNetwork} />} {selectedTab === "networkScanner" && <WiFiNetworkScanner selectNetwork={this.selectNetwork} />}
{selectedTab === "wifiSettings" && <WiFiSettings deselectNetwork={this.deselectNetwork} selectedNetwork={this.state.selectedNetwork} />} {selectedTab === "wifiSettings" && <WiFiSettings deselectNetwork={this.deselectNetwork} selectedNetwork={this.state.selectedNetwork} />}
</MenuAppBar> </MenuAppBar>

View File

@ -58,7 +58,7 @@ class WiFiStatus extends Component {
return status.dns_ip_1 + (status.dns_ip_2 ? ','+status.dns_ip_2 : ''); return status.dns_ip_1 + (status.dns_ip_2 ? ','+status.dns_ip_2 : '');
} }
createListItems(data, fullDetails, classes) { createListItems(data, classes) {
return ( return (
<Fragment> <Fragment>
<ListItem> <ListItem>
@ -69,7 +69,7 @@ class WiFiStatus extends Component {
</ListItem> </ListItem>
<Divider variant="inset" component="li" /> <Divider variant="inset" component="li" />
{ {
(fullDetails && isConnected(data)) && isConnected(data) &&
<Fragment> <Fragment>
<ListItem> <ListItem>
<Avatar> <Avatar>
@ -108,11 +108,11 @@ class WiFiStatus extends Component {
); );
} }
renderWiFiStatus(data, fullDetails, classes) { renderWiFiStatus(data, classes) {
return ( return (
<div> <div>
<List> <List>
{this.createListItems(data, fullDetails, classes)} {this.createListItems(data, classes)}
</List> </List>
<Button variant="contained" color="secondary" className={classes.button} onClick={this.props.loadData}> <Button variant="contained" color="secondary" className={classes.button} onClick={this.props.loadData}>
Refresh Refresh
@ -123,7 +123,7 @@ class WiFiStatus extends Component {
} }
render() { render() {
const { data, fetched, errorMessage, classes, fullDetails } = this.props; const { data, fetched, errorMessage, classes } = this.props;
return ( return (
<SectionContent title="WiFi Status"> <SectionContent title="WiFi Status">
@ -136,7 +136,7 @@ class WiFiStatus extends Component {
</Typography> </Typography>
</div> </div>
: :
data ? this.renderWiFiStatus(data, fullDetails, classes) data ? this.renderWiFiStatus(data, classes)
: :
<div> <div>
<Typography variant="display1" className={classes.fetching}> <Typography variant="display1" className={classes.fetching}>