mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-08 04:26:58 +03:00
* enhance data pages * add checkbox to show relative values * remove static entries, they get overwritten by dynamic oes --------- Co-authored-by: CaCO3 <caco@ruinelli.ch>
88 lines
2.9 KiB
HTML
88 lines
2.9 KiB
HTML
<html>
|
|
<head>
|
|
<style>
|
|
html,
|
|
body {
|
|
height: 100%;
|
|
margin: 2px;
|
|
font-family: Arial, Helvetica, sans-serif;
|
|
}
|
|
|
|
.box {
|
|
display: flex;
|
|
flex-flow: column;
|
|
height: 100%;
|
|
}
|
|
|
|
.box .row.header {
|
|
flex: 0 1 auto;
|
|
}
|
|
|
|
.box .row.content {
|
|
flex: 1 1 auto;
|
|
}
|
|
|
|
.box .row.footer {
|
|
flex: 0 1 auto;
|
|
}
|
|
|
|
#data {
|
|
font-family: 'Courier New', Courier, monospace;
|
|
font-size: small;
|
|
}
|
|
</style>
|
|
<script type="text/javascript" src="common.js?v=$COMMIT_HASH"></script>
|
|
</head>
|
|
<body>
|
|
<h3>Todays Data</h3>
|
|
<h4>Last part of Todays Data</h4>
|
|
<div class="box">
|
|
<div class="row header">
|
|
<button onClick="reload();">Refresh</button>
|
|
<button onClick="window.open(getDomainname() + '/datafileact');">Show Full File</button>
|
|
<button onClick="window.location.href = getDomainname() + '/fileserver/log/data/'">Show Data Files</button>
|
|
<button onClick="window.location.href = 'graph.html?v=$COMMIT_HASH'">Show Graph</button>
|
|
</div>
|
|
<div class="row content" id="data"><br><br><br><b>Loading Data file, please wait...</b></div>
|
|
<div class="row footer">
|
|
<button onClick="reload();">Refresh</button>
|
|
<button onClick="window.open(getDomainname() + '/datafileact');">Show Full File</button>
|
|
<button onClick="window.location.href = getDomainname() + '/fileserver/log/data/'">Show Data Files</button>
|
|
<button onClick="window.location.href = 'graph.html?v=$COMMIT_HASH'">Show Graph</button>
|
|
<p></p>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
|
|
<script>
|
|
function reload() {
|
|
document.getElementById('data').innerHTML += "<br><b>Reloading...<b><br><br>";
|
|
window.scrollBy(0,document.body.scrollHeight);
|
|
funcRequest(getDomainname() + '/data');
|
|
}
|
|
|
|
async function funcRequest(url){
|
|
await fetch(url)
|
|
.then((res) => {
|
|
if (!res.ok) {
|
|
document.getElementById("data").innerHTML = "HTTP error " + res.status;
|
|
}
|
|
|
|
return res.text();
|
|
})
|
|
.then((data) => {
|
|
document.getElementById('data').innerHTML = "<br>" + data.split("\n").join("\n<br>") + " ";
|
|
|
|
window.scrollBy(0,document.body.scrollHeight);
|
|
|
|
})
|
|
.catch((err) => {
|
|
document.getElementById("data").innerHTML = err;
|
|
});
|
|
}
|
|
|
|
funcRequest(getDomainname() + '/data');
|
|
|
|
</script>
|
|
</html>
|