mirror of https://github.com/status-im/fathom.git
add countries table to interface
This commit is contained in:
parent
a2a54482ff
commit
cbd1020bbf
|
@ -23,7 +23,7 @@ class Table extends Component {
|
|||
}
|
||||
|
||||
fetchRecords(period) {
|
||||
return fetch('/api/languages?period=' + period, {
|
||||
return fetch('/api/'+this.props.endpoint+'?period=' + period, {
|
||||
credentials: 'include'
|
||||
}).then((r) => {
|
||||
if( r.ok ) {
|
||||
|
@ -40,7 +40,7 @@ class Table extends Component {
|
|||
const tableRows = this.state.records.map( (p, i) => (
|
||||
<tr>
|
||||
<td>{i+1}</td>
|
||||
<td>{p.Language}</td>
|
||||
<td>{p.Label}</td>
|
||||
<td>{p.Count}</td>
|
||||
<td>{Math.round(p.Percentage)}%</td>
|
||||
</tr>
|
||||
|
|
|
@ -35,7 +35,8 @@ class App extends Component {
|
|||
<div class="clear"><DatePicker period={this.state.period} onChoose={(p) => { this.setState({ period: p })}} /></div>
|
||||
<Graph period={this.state.period} />
|
||||
<Pageviews period={this.state.period} />
|
||||
<Table period={this.state.period} title="Languages" headers={["#", "Language", "Count", "%"]} />
|
||||
<Table period={this.state.period} endpoint="screen-resolutions" title="Languages" headers={["#", "Language", "Count", "%"]} />
|
||||
<Table period={this.state.period} endpoint="countries" title="Countries" headers={["#", "Country", "Count", "%"]} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue