summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJannik Schönartz2019-01-31 19:40:30 +0100
committerJannik Schönartz2019-01-31 19:40:30 +0100
commit66b3c085701e67c06cdc90804b4d09fc8cbc68e3 (patch)
treefd4598373e9dbe3eafb3493119171e3ec7af403c
parentAdd horizontal / vertical param (diff)
downloadbwlp-monitoring-66b3c085701e67c06cdc90804b4d09fc8cbc68e3.tar.gz
bwlp-monitoring-66b3c085701e67c06cdc90804b4d09fc8cbc68e3.tar.xz
bwlp-monitoring-66b3c085701e67c06cdc90804b4d09fc8cbc68e3.zip
Previous commit: Log show limit
Forgot to mention in the last commit: Log only shows the latest 500 entries Added params to the readme
-rw-r--r--README.txt15
-rw-r--r--bwlpMonitor_template.html7
2 files changed, 18 insertions, 4 deletions
diff --git a/README.txt b/README.txt
index 911335a..32e30e9 100644
--- a/README.txt
+++ b/README.txt
@@ -5,4 +5,19 @@ pip3 install tftpy
bwlp.thrift needed:
wget http://git.openslx.org/bwlp/master-sync-shared.git/plain/src/main/thrift/bwlp.thrift
+Parameters:
+horizontal
+-> Forces horizontal mode
+vertical
+-> Forces vertical mode
+
+borderless
+-> A more compact borderless mode
+
+noheader
+-> Removes the header
+
+autorefresh=<seconds>
+-> Time in seconds when the site autorefreshs itself
+-> Should be the same time the python script is fetching the new data \ No newline at end of file
diff --git a/bwlpMonitor_template.html b/bwlpMonitor_template.html
index ec61c48..f05c233 100644
--- a/bwlpMonitor_template.html
+++ b/bwlpMonitor_template.html
@@ -44,9 +44,11 @@
const urlParams = new URLSearchParams(window.location.search)
const horizontal = urlParams.get('horizontal')
const vertical = urlParams.get('vertical')
+ const noheader = urlParams.get('noheader')
+ var autorefresh = urlParams.get('autorefresh')
+ var autorefresh = parseInt(autorefresh)
// No header removes the header from the site.
- const noheader = urlParams.get('noheader')
if (noheader != null) {
document.getElementById('header').style.visibility = 'hidden'
document.getElementById('body').style.marginTop = '0px'
@@ -99,8 +101,6 @@
}
// Autorefresh the site.
- var autorefresh = urlParams.get('autorefresh')
- var autorefresh = parseInt(autorefresh)
if (Number.isInteger(autorefresh)) {
setTimeout(function() {
location.reload();
@@ -124,7 +124,6 @@
var mediaMinWidth = window.matchMedia("(min-width: 1500px)")
minWidth(mediaMinWidth)
mediaMinWidth.addListener(minWidth)
-
function minWidth(media) {
const body = document.getElementById('body')
const logWrapper = document.getElementsByClassName('log_wrapper')[0]