Compare commits
9 Commits
7fe3991303
...
master
Author | SHA1 | Date | |
---|---|---|---|
7587c896b9 | |||
8f85844161 | |||
119dbe9d94 | |||
4dd6184743 | |||
888670cf43 | |||
2c5adc30e2 | |||
f794f5049d | |||
19a955525e | |||
dc0e4d5c57 |
9
days.csv
9
days.csv
@@ -1,9 +0,0 @@
|
||||
2021/09/23,04.50
|
||||
2021/09/24,05.71
|
||||
2021/09/25,08.86
|
||||
2021/09/26,07.53
|
||||
2021/09/27,08.63
|
||||
2021/09/28,08.31
|
||||
2021/09/29,12.0
|
||||
2021/09/30,11.65
|
||||
2021/10/01,06.41
|
|
BIN
favicon.ico
Normal file
BIN
favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 27 KiB |
@@ -1,6 +1,5 @@
|
||||
{
|
||||
"background_color": "#242424",
|
||||
"description": "",
|
||||
"dir": "ltr",
|
||||
"display": "standalone",
|
||||
"name": "Generator Status",
|
||||
@@ -8,8 +7,5 @@
|
||||
"scope": "/",
|
||||
"short_name": "Generator Status",
|
||||
"start_url": "/",
|
||||
"theme_color": "#242424",
|
||||
"categories": [],
|
||||
"screenshots": [],
|
||||
"shortcuts": []
|
||||
"theme_color": "#242424"
|
||||
}
|
||||
|
6
off.html
6
off.html
@@ -1,8 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<!-- <script type="module">
|
||||
import 'https://cdn.jsdelivr.net/npm/@pwabuilder/pwaupdate';
|
||||
const el = document.createElement('pwa-update');
|
||||
document.body.appendChild(el);
|
||||
</script> -->
|
||||
<title>Generator Status...</title>
|
||||
<style>
|
||||
* {
|
||||
|
@@ -1,8 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<!-- <script type="module">
|
||||
import 'https://cdn.jsdelivr.net/npm/@pwabuilder/pwaupdate';
|
||||
const el = document.createElement('pwa-update');
|
||||
document.body.appendChild(el);
|
||||
</script> -->
|
||||
<title>Generator Status...</title>
|
||||
<style>
|
||||
* {
|
||||
@@ -60,65 +66,16 @@
|
||||
|
||||
<div class="title-bg">
|
||||
<div class="title-text">
|
||||
<p>Generator Stats</p>
|
||||
<p>You're Offline</p>
|
||||
</div>
|
||||
<div class="date-time-updated">
|
||||
<p>last updated on: <b>Oct 04, 2021 at 10:33</b></p>
|
||||
<p>please check your internet connection</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="chart_last_week_class">
|
||||
<canvas id="chart_last_week"></canvas>
|
||||
</div>
|
||||
<div class="credits">
|
||||
<p>Made with ❤️ | Source Code: <a href="https://git.sandcastle.eu.org/thebiblelover7/generator-status">Gitea</a>
|
||||
<br>
|
||||
Thanks to <a href="https://matrix.to/#/@junyong_chung:tchncs.de">Junyong Chung</a> for the hardware and <a href="https://meu.edu.lb">MEU</a> for providing the domain.</p>
|
||||
</div>
|
||||
</body>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<script>
|
||||
const labels = [
|
||||
'',
|
||||
'2021/09/28',
|
||||
'2021/09/29',
|
||||
'2021/09/30',
|
||||
'2021/10/01',
|
||||
'2021/10/02',
|
||||
'2021/10/03',
|
||||
];
|
||||
const data = {
|
||||
labels: labels,
|
||||
datasets: [
|
||||
{
|
||||
label: 'Hours we had electricity from government',
|
||||
backgroundColor: 'rgb(255, 99, 132)',
|
||||
borderColor: 'rgb(255, 99, 132)',
|
||||
data: [, 10#08.31, 10#12.0, 10#11.65, 10#13.78, 10#03.23, 10#09.73],
|
||||
fill: true,
|
||||
// fill: {
|
||||
// target: 'origin',
|
||||
// above: 'rgb(255, 0, 0)', // Area will be red above the origin
|
||||
// below: 'rgb(0, 0, 255)' // And blue below the origin
|
||||
//
|
||||
// },
|
||||
},
|
||||
]
|
||||
};
|
||||
const config = {
|
||||
type: 'line',
|
||||
data: data,
|
||||
options: {
|
||||
scales: {
|
||||
y: {
|
||||
beginAtZero: true,
|
||||
max: 24,
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
var chart_last_week = new Chart(
|
||||
document.getElementById('chart_last_week'),
|
||||
config
|
||||
);
|
||||
</script>
|
||||
</html>
|
6
on.html
6
on.html
@@ -1,8 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<!-- <script type="module">
|
||||
import 'https://cdn.jsdelivr.net/npm/@pwabuilder/pwaupdate';
|
||||
const el = document.createElement('pwa-update');
|
||||
document.body.appendChild(el);
|
||||
</script> -->
|
||||
<title>Generator Status...</title>
|
||||
<style>
|
||||
* {
|
||||
|
67
pwabuilder-sw.js
Normal file
67
pwabuilder-sw.js
Normal file
@@ -0,0 +1,67 @@
|
||||
// This is the "Offline page" service worker
|
||||
|
||||
importScripts('https://storage.googleapis.com/workbox-cdn/releases/5.1.2/workbox-sw.js');
|
||||
|
||||
const CACHE = "pwabuilder-page";
|
||||
|
||||
// TODO: replace the following with the correct offline fallback page i.e.: const offlineFallbackPage = "offline.html";
|
||||
const offlineFallbackPage = "offline.html";
|
||||
|
||||
self.addEventListener("message", (event) => {
|
||||
if (event.data && event.data.type === "SKIP_WAITING") {
|
||||
self.skipWaiting();
|
||||
}
|
||||
});
|
||||
|
||||
self.addEventListener('install', async (event) => {
|
||||
event.waitUntil(
|
||||
caches.open(CACHE)
|
||||
.then((cache) => cache.add(offlineFallbackPage))
|
||||
);
|
||||
});
|
||||
|
||||
if (workbox.navigationPreload.isSupported()) {
|
||||
workbox.navigationPreload.enable();
|
||||
}
|
||||
|
||||
self.addEventListener('fetch', (event) => {
|
||||
if (event.request.mode === 'navigate') {
|
||||
event.respondWith((async () => {
|
||||
try {
|
||||
const preloadResp = await event.preloadResponse;
|
||||
|
||||
if (preloadResp) {
|
||||
return preloadResp;
|
||||
}
|
||||
|
||||
const networkResp = await fetch(event.request);
|
||||
return networkResp;
|
||||
} catch (error) {
|
||||
|
||||
const cache = await caches.open(CACHE);
|
||||
const cachedResp = await cache.match(offlineFallbackPage);
|
||||
return cachedResp;
|
||||
}
|
||||
})());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// This is the service worker with the Cache-first network
|
||||
|
||||
const CACHE = "pwabuilder-precache";
|
||||
|
||||
importScripts('https://storage.googleapis.com/workbox-cdn/releases/5.1.2/workbox-sw.js');
|
||||
|
||||
self.addEventListener("message", (event) => {
|
||||
if (event.data && event.data.type === "SKIP_WAITING") {
|
||||
self.skipWaiting();
|
||||
}
|
||||
});
|
||||
|
||||
workbox.routing.registerRoute(
|
||||
new RegExp('/*'),
|
||||
new workbox.strategies.CacheFirst({
|
||||
cacheName: CACHE
|
||||
})
|
||||
);
|
62
stats.csv
62
stats.csv
@@ -1,62 +0,0 @@
|
||||
ON, 2021/09/23, 06:58
|
||||
ON, 2021/09/23, 07:13
|
||||
OFF, 2021/09/23, 00:23
|
||||
ON, 2021/09/23, 03:30
|
||||
OFF, 2021/09/23, 03:01
|
||||
ON, 2021/09/23, 01:49
|
||||
OFF, 2021/09/23, 01:06
|
||||
OFF, 2021/09/24, 00:22
|
||||
ON, 2021/09/24, 03:51
|
||||
OFF, 2021/09/24, 03:26
|
||||
ON, 2021/09/24, 08:39
|
||||
OFF, 2021/09/24, 00:49
|
||||
ON, 2021/09/24, 00:55
|
||||
OFF, 2021/09/24, 01:06
|
||||
ON, 2021/09/24, 04:52
|
||||
ON, 2021/09/25, 03:36
|
||||
OFF, 2021/09/25, 02:40
|
||||
ON, 2021/09/25, 05:45
|
||||
OFF, 2021/09/25, 02:04
|
||||
ON, 2021/09/25, 03:21
|
||||
OFF, 2021/09/25, 01:04
|
||||
ON, 2021/09/25, 02:26
|
||||
OFF, 2021/09/25, 03:04
|
||||
OFF, 2021/09/26, 00:02
|
||||
ON, 2021/09/26, 03:30
|
||||
OFF, 2021/09/26, 04:36
|
||||
ON, 2021/09/26, 05:36
|
||||
OFF, 2021/09/26, 01:20
|
||||
ON, 2021/09/26, 02:17
|
||||
OFF, 2021/09/26, 01:34
|
||||
ON, 2021/09/26, 05:05
|
||||
ON, 2021/09/27, 00:02
|
||||
OFF, 2021/09/27, 06:07
|
||||
ON, 2021/09/27, 04:53
|
||||
OFF, 2021/09/27, 01:00
|
||||
ON, 2021/09/27, 07:31
|
||||
OFF, 2021/09/27, 01:31
|
||||
ON, 2021/09/27, 02:56
|
||||
ON, 2021/09/28, 05:59
|
||||
OFF, 2021/09/28, 03:49
|
||||
ON, 2021/09/28, 05:36
|
||||
OFF, 2021/09/28, 00:57
|
||||
ON, 2021/09/28, 00:02
|
||||
OFF, 2021/09/28, 02:33
|
||||
ON, 2021/09/28, 04:04
|
||||
OFF, 2021/09/28, 01:00
|
||||
OFF, 2021/09/29, 06:30
|
||||
ON, 2021/09/29, 05:35
|
||||
OFF, 2021/09/29, 01:57
|
||||
ON, 2021/09/29, 06:25
|
||||
OFF, 2021/09/29, 03:33
|
||||
OFF, 2021/09/30, 00:05
|
||||
ON, 2021/09/30, 03:39
|
||||
OFF, 2021/09/30, 04:41
|
||||
ON, 2021/09/30, 00:56
|
||||
OFF, 2021/09/30, 02:38
|
||||
ON, 2021/09/30, 02:06
|
||||
OFF, 2021/09/30, 04:13
|
||||
ON, 2021/09/30, 05:40
|
||||
OFF, 2021/09/30, 00:02
|
||||
OFF, 2021/10/01, 06:25
|
||||
OFF, 2021/10/01, 00:00
|
|
@@ -1,8 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<!-- <script type="module">
|
||||
import 'https://cdn.jsdelivr.net/npm/@pwabuilder/pwaupdate';
|
||||
const el = document.createElement('pwa-update');
|
||||
document.body.appendChild(el);
|
||||
</script> -->
|
||||
<title>Generator Status...</title>
|
||||
<style>
|
||||
* {
|
||||
|
14
stats.sh
14
stats.sh
@@ -90,13 +90,13 @@ do
|
||||
then
|
||||
# echo "LINE IS GREATER"
|
||||
day_num=$(( $day_num + 1 ))
|
||||
if [[ $day_num = 1 ]]; then day_1=$(echo $hours); day_date_1=$(echo $date_var | sed 's/\//\\\//g'); fi
|
||||
if [[ $day_num = 2 ]]; then day_2=$(echo $hours); day_date_2=$(echo $date_var | sed 's/\//\\\//g'); fi
|
||||
if [[ $day_num = 3 ]]; then day_3=$(echo $hours); day_date_3=$(echo $date_var | sed 's/\//\\\//g'); fi
|
||||
if [[ $day_num = 4 ]]; then day_4=$(echo $hours); day_date_4=$(echo $date_var | sed 's/\//\\\//g'); fi
|
||||
if [[ $day_num = 5 ]]; then day_5=$(echo $hours); day_date_5=$(echo $date_var | sed 's/\//\\\//g'); fi
|
||||
if [[ $day_num = 6 ]]; then day_6=$(echo $hours); day_date_6=$(echo $date_var | sed 's/\//\\\//g'); fi
|
||||
if [[ $day_num = 7 ]]; then day_7=$(echo $hours); day_date_7=$(echo $date_var | sed 's/\//\\\//g'); fi
|
||||
if [[ $day_num = 1 ]]; then day_1=$(echo $hours | sed -n -e 's/0\([0-9]\)/\1/g' -e p); day_date_1=$(echo $date_var | sed 's/\//\\\//g'); fi
|
||||
if [[ $day_num = 2 ]]; then day_2=$(echo $hours | sed -n -e 's/0\([0-9]\)/\1/g' -e p); day_date_2=$(echo $date_var | sed 's/\//\\\//g'); fi
|
||||
if [[ $day_num = 3 ]]; then day_3=$(echo $hours | sed -n -e 's/0\([0-9]\)/\1/g' -e p); day_date_3=$(echo $date_var | sed 's/\//\\\//g'); fi
|
||||
if [[ $day_num = 4 ]]; then day_4=$(echo $hours | sed -n -e 's/0\([0-9]\)/\1/g' -e p); day_date_4=$(echo $date_var | sed 's/\//\\\//g'); fi
|
||||
if [[ $day_num = 5 ]]; then day_5=$(echo $hours | sed -n -e 's/0\([0-9]\)/\1/g' -e p); day_date_5=$(echo $date_var | sed 's/\//\\\//g'); fi
|
||||
if [[ $day_num = 6 ]]; then day_6=$(echo $hours | sed -n -e 's/0\([0-9]\)/\1/g' -e p); day_date_6=$(echo $date_var | sed 's/\//\\\//g'); fi
|
||||
if [[ $day_num = 7 ]]; then day_7=$(echo $hours | sed -n -e 's/0\([0-9]\)/\1/g' -e p); day_date_7=$(echo $date_var | sed 's/\//\\\//g'); fi
|
||||
fi
|
||||
done < days.csv
|
||||
|
||||
|
Reference in New Issue
Block a user