/site contains static start of frontend.

Started a frontend for displaying the information collected.
 - Need dynamic data.
 - Needs a webserver to serve page.
This commit is contained in:
2020-06-01 23:16:50 +02:00
committed by KevinMidboe
parent 61d98cd420
commit 06b01e5a3a
5 changed files with 353 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
const createEvent = () => {
const event = document.createElement('div')
event.className = 'event';
const tooltip = document.createElement('span');
tooltip.className = 'tooltip';
const tooltipContent = new Date().toLocaleString()
tooltip.innerText = tooltipContent;
event.appendChild(tooltip);
return event;
}
function fetchUptimeAndGenerateBarGraph(instances=10) {
const graph = document.getElementById('bar-graph');
const event = createEvent()
for (var i = instances; i >= 0; i--) {
const clone = event.cloneNode(true)
Math.random() > 0.95 ? clone.className += ' error' : null;
graph.appendChild(clone)
}
}
// fetchUptimeAndGenerateBarGraph(20)
fetchUptimeAndGenerateBarGraph(60)