Skip to content

Commit

Permalink
Monitor: No need to query last down time, since we don't show it in t…
Browse files Browse the repository at this point in the history
…he UI

The only reason we had this was to display the last downtime of the site.  However, we're not showing this anywhere in the UI.
  • Loading branch information
dereksmart committed Oct 17, 2016
1 parent e25ee04 commit cfe2523
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions _inc/client/at-a-glance/monitor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,18 @@ import includes from 'lodash/includes';
/**
* Internal dependencies
*/
import QueryLastDownTime from 'components/data/query-last-downtime';
import {
isModuleActivated as _isModuleActivated,
activateModule,
getModules
} from 'state/modules';
import { getLastDownTime as _getLastDownTime } from 'state/at-a-glance';
import { isDevMode } from 'state/connection';

const DashMonitor = React.createClass( {
getContent: function() {
const labelName = __( 'Downtime Monitoring' );

if ( this.props.isModuleActivated( 'monitor' ) ) {
const lastDowntime = this.props.lastDownTime;

if ( lastDowntime === 'N/A' ) {
return (
<DashItem
label={ labelName }
module="monitor"
status="is-working"
>
<QueryLastDownTime />
<p className="jp-dash-item__description">{ __( 'Loading…' ) }</p>
</DashItem>
);
}

return (
<DashItem
label={ labelName }
Expand Down Expand Up @@ -78,23 +61,20 @@ const DashMonitor = React.createClass( {

return (
<div>
<QueryLastDownTime />
{ this.getContent() }
</div>
);
}
} );

DashMonitor.propTypes = {
lastDownTime: React.PropTypes.any.isRequired,
isDevMode: React.PropTypes.bool.isRequired
};

export default connect(
( state ) => {
return {
isModuleActivated: ( module_name ) => _isModuleActivated( state, module_name ),
lastDownTime: _getLastDownTime( state ),
isDevMode: isDevMode( state ),
moduleList: getModules( state )
};
Expand Down

0 comments on commit cfe2523

Please sign in to comment.