o.moresis
2 years ago
5 changed files with 37 additions and 18 deletions
@ -1,22 +1,33 @@
@@ -1,22 +1,33 @@
|
||||
<section id="statistics-view" :class="isActiveTab(4) ? '' : 'is-hidden'" x-init=""> |
||||
<article class="panel is-info"> |
||||
<p class="panel-heading"> |
||||
General |
||||
</p> |
||||
<div id="stats-chart-1"> |
||||
</div> |
||||
<p>Total Raw data Rows in database: <span ></span></p> |
||||
<div id="grid" x-init="populateStatisticsGrid"></div> |
||||
</article> |
||||
<article class="panel is-info"> |
||||
<p class="panel-heading"> |
||||
Timeline |
||||
</p> |
||||
<div id="stats-chart-1"> |
||||
</div> |
||||
<div id="timeseries"></div> |
||||
</article> |
||||
</section> |
||||
<script> |
||||
function getStatistics() { |
||||
return { |
||||
totalRows: 0, |
||||
queryStats() { |
||||
const url = BASE_URL + '/statistics/'; |
||||
fetch(url) |
||||
.then(res => { |
||||
return res.json(); |
||||
}).then(data => { |
||||
}).then(d => { |
||||
}); |
||||
} |
||||
}; |
||||
|
||||
function populateStatisticsGrid() { |
||||
console.debug('statistsiscsc'); |
||||
const statsGrid = new gridjs.Grid({ |
||||
columns: ['stations', 'cruises', 'parameters', 'descriptors', 'criteria'], |
||||
server: { |
||||
url: BASE_URL + '/interface/stats/general', |
||||
then: data => data.map(stats => { |
||||
return [stats.total_stations, stats.total_cruises, stats.total_parameters, stats.total_criterias, stats.total_descriptors] |
||||
}) |
||||
} |
||||
}).render(grid); |
||||
} |
||||
</script> |
||||
|
Loading…
Reference in new issue