Upgrade stats page (!3)

Add additional stats to the page

Reviewed-on: #3
This commit is contained in:
Fred Boniface 2023-05-07 21:18:04 +01:00
parent d8b32c25c0
commit c463ffbb1e
4 changed files with 33 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/* All Page Init */ /* All Page Init */
const version = '2.0.0' const version = '2.0.1'
/* Feature Detectors */ /* Feature Detectors */

View File

@ -27,4 +27,9 @@ async function display(data) { // Parses and displays data from API
document.getElementById('meta').textContent = dat.meta || '0' document.getElementById('meta').textContent = dat.meta || '0'
document.getElementById('pis').textContent = dat.pis document.getElementById('pis').textContent = dat.pis
document.getElementById('ver-dbman').textContent = ver.dbmanager || 'Unknown' document.getElementById('ver-dbman').textContent = ver.dbmanager || 'Unknown'
document.getElementById('user_count').textContent = data.count.users || 'Unknown'
document.getElementById('reg_count').textContent = data.count.reg || '0'
document.getElementById('pis_count').textContent = data.count.pis || 'Unknown'
document.getElementById('corpus_count').textContent = data.count.corpus || 'Unknown'
document.getElementById('stations_count').textContent = data.count.stations || 'Unknown'
} }

View File

@ -50,6 +50,32 @@
<td id="pis"></td> <td id="pis"></td>
</tr> </tr>
</table> </table>
<table style="margin:auto;text-align:center;">
<tr>
<th>Database</th>
<th>Entry Count</th>
</tr>
<tr>
<td>Users</td>
<td id="user_count"></td>
</tr>
<tr>
<td>Pending Registrations</td>
<td id="reg_count"></td>
</tr>
<tr>
<td>PIS Codes</td>
<td id="pis_count"></td>
</tr>
<tr>
<td>CORPUS Entries</td>
<td id="corpus_count"></td>
</tr>
<tr>
<td>Station Codes</td>
<td id="stations_count"></td>
</tr>
</table>
<br><br> <br><br>
<table style="margin:auto;text-align:center;"> <table style="margin:auto;text-align:center;">
<tr> <tr>

2
sw.js
View File

@ -1,6 +1,6 @@
/* Service Worker */ /* Service Worker */
const swVersion = '2.0.0-20230506' const swVersion = '2.0.1-20230507'
const cacheName = `owlboard-${swVersion}` const cacheName = `owlboard-${swVersion}`
const cacheIDs = [cacheName] const cacheIDs = [cacheName]
let staticCache = [ let staticCache = [