Add stats to cache

This commit is contained in:
Fred Boniface 2023-05-23 23:52:55 +01:00
parent 256070eb50
commit c8d8dc5736
4 changed files with 8 additions and 5 deletions

View File

@ -1,6 +1,6 @@
/* eslint-disable no-unused-vars */ /* eslint-disable no-unused-vars */
/* All Page Init */ /* All Page Init */
const version = '2023.5.5' const version = '2023.5.6'
/* Feature Detectors */ /* Feature Detectors */

View File

@ -24,7 +24,7 @@ async function display(data) { // Parses and displays data from API
document.getElementById('corpus_api').textContent = dat.corpus_api || '0' document.getElementById('corpus_api').textContent = dat.corpus_api || '0'
document.getElementById('corpus').textContent = dat.corpus || '0' document.getElementById('corpus').textContent = dat.corpus || '0'
document.getElementById('stations').textContent = dat.stations || '0' document.getElementById('stations').textContent = dat.stations || '0'
document.getElementById('users').textContent = dat.user || '0' document.getElementById('users').textContent = dat.users || '0'
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'

View File

@ -41,7 +41,7 @@
<img class="titleimg" src="./images/logo/logo-full-250.png" alt="OwlBoard Logo"> <img class="titleimg" src="./images/logo/logo-full-250.png" alt="OwlBoard Logo">
</picture> </picture>
<h2>Statistics</h2> <h2>Statistics</h2>
<p class="stat_desc">Server hostname: <span class="stat_result" id="server_host"></span><br> <p class="stat_desc">API Server: <span class="stat_result" id="server_host"></span><br>
Runtime Mode: <span class="stat_result" id="server_mode"></span><br> Runtime Mode: <span class="stat_result" id="server_mode"></span><br>
Statistics Reset: <span class="stat_result" id="time"></span> Statistics Reset: <span class="stat_result" id="time"></span>
</p> </p>

7
sw.js
View File

@ -1,6 +1,6 @@
/* Service Worker */ /* Service Worker */
const swVersion = '2023.5.5-1' const swVersion = '2023.5.6-1'
const cacheName = `owlboard-${swVersion}` const cacheName = `owlboard-${swVersion}`
const cacheIDs = [cacheName] const cacheIDs = [cacheName]
let staticCache = [ let staticCache = [
@ -34,6 +34,7 @@ const dynamicCache = [
'/find-code.html', '/find-code.html',
'/settings.html', '/settings.html',
'/pis.html', '/pis.html',
'stats.html',
'/manifest.json', '/manifest.json',
'/styles/board.css', '/styles/board.css',
'/styles/find-code.css', '/styles/find-code.css',
@ -42,6 +43,7 @@ const dynamicCache = [
'/styles/main.css', '/styles/main.css',
'/styles/settings.css', '/styles/settings.css',
'/styles/pis.css', '/styles/pis.css',
'/styles/stats.css',
'/js/find-code.js', '/js/find-code.js',
'/js/index.js', '/js/index.js',
'/js/issue.js', '/js/issue.js',
@ -50,7 +52,8 @@ const dynamicCache = [
'/js/auth.js', '/js/auth.js',
'/js/settings.js', '/js/settings.js',
'/js/simple-board.js', '/js/simple-board.js',
'/js/pis.js' '/js/pis.js',
'/js/stats.js'
] ]
for(let i = 0; i < dynamicCache.length; i++) { for(let i = 0; i < dynamicCache.length; i++) {