mirror of
https://github.com/status-im/fathom.git
synced 2025-03-01 03:20:27 +00:00
add countries table to interface
This commit is contained in:
parent
a2a54482ff
commit
cbd1020bbf
@ -23,7 +23,7 @@ class Table extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fetchRecords(period) {
|
fetchRecords(period) {
|
||||||
return fetch('/api/languages?period=' + period, {
|
return fetch('/api/'+this.props.endpoint+'?period=' + period, {
|
||||||
credentials: 'include'
|
credentials: 'include'
|
||||||
}).then((r) => {
|
}).then((r) => {
|
||||||
if( r.ok ) {
|
if( r.ok ) {
|
||||||
@ -40,7 +40,7 @@ class Table extends Component {
|
|||||||
const tableRows = this.state.records.map( (p, i) => (
|
const tableRows = this.state.records.map( (p, i) => (
|
||||||
<tr>
|
<tr>
|
||||||
<td>{i+1}</td>
|
<td>{i+1}</td>
|
||||||
<td>{p.Language}</td>
|
<td>{p.Label}</td>
|
||||||
<td>{p.Count}</td>
|
<td>{p.Count}</td>
|
||||||
<td>{Math.round(p.Percentage)}%</td>
|
<td>{Math.round(p.Percentage)}%</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -35,7 +35,8 @@ class App extends Component {
|
|||||||
<div class="clear"><DatePicker period={this.state.period} onChoose={(p) => { this.setState({ period: p })}} /></div>
|
<div class="clear"><DatePicker period={this.state.period} onChoose={(p) => { this.setState({ period: p })}} /></div>
|
||||||
<Graph period={this.state.period} />
|
<Graph period={this.state.period} />
|
||||||
<Pageviews 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>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user