2016-11-10 14:26:24 +01:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
import { List, ListItem, ListSubHeader, ListDivider } from 'react-toolbox/lib/list';
|
|
|
|
import Chip from 'react-toolbox/lib/chip';
|
|
|
|
|
|
|
|
class Metrics extends Component {
|
|
|
|
|
|
|
|
componentDidMount () {
|
|
|
|
this.props.fetchMetrics();
|
|
|
|
}
|
|
|
|
|
|
|
|
render () {
|
|
|
|
const { globalCount, clientList } = this.props;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<List>
|
2016-11-13 11:51:30 +01:00
|
|
|
<ListSubHeader caption={`Total of ${globalCount} toggles`} />
|
2016-11-10 14:26:24 +01:00
|
|
|
<ListDivider />
|
|
|
|
{clientList.map(({ name, count, ping, appName }, i) =>
|
|
|
|
<ListItem
|
|
|
|
leftActions={[<Chip>{count}</Chip>]}
|
|
|
|
key={name + i}
|
|
|
|
caption={appName}
|
|
|
|
legend={`${name} pinged ${ping}`} />
|
|
|
|
)}
|
|
|
|
</List>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export default Metrics;
|