1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00
unleash.unleash/frontend/src/component/metrics/metrics-component.js

36 lines
1014 B
JavaScript
Raw Normal View History

2016-11-10 14:26:24 +01:00
import React, { Component } from 'react';
2016-12-04 11:56:41 +01:00
import { DataTable, TableHeader } from 'react-mdl';
2016-11-10 14:26:24 +01:00
class Metrics extends Component {
componentDidMount () {
this.props.fetchMetrics();
}
render () {
const { globalCount, clientList } = this.props;
return (
2016-12-04 11:56:41 +01:00
<div>
<h4>{`Total of ${globalCount} toggles`}</h4>
<DataTable
style={{ width: '100%' }}
rows={clientList}
selectable={false}
>
<TableHeader name="name">Instance</TableHeader>
<TableHeader name="appName">Application name</TableHeader>
<TableHeader numeric name="ping" cellFormatter={
(v) => (v.toString())
2016-12-04 11:56:41 +01:00
}>Last seen</TableHeader>
<TableHeader numeric name="count">Counted</TableHeader>
2016-12-04 11:56:41 +01:00
</DataTable>
</div>
2016-11-10 14:26:24 +01:00
);
}
}
export default Metrics;