mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-09 04:56:53 +03:00
Create /docs + installer
This commit is contained in:
62
docs/sd-card/html/graph.html
Normal file
62
docs/sd-card/html/graph.html
Normal file
@@ -0,0 +1,62 @@
|
||||
<html>
|
||||
<head>
|
||||
<script src='https://cdn.plot.ly/plotly-2.14.0.min.js'></script>
|
||||
<style>
|
||||
textarea {
|
||||
width: 600px;
|
||||
height: 300px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
function run() {
|
||||
var el = document.getElementById('cnsl');
|
||||
el && eval(el.value);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id='chart'></div>
|
||||
<button onclick="document.getElementById('editor').hidden = false; this.hidden = true;" >Editor</button>
|
||||
<div id='editor' hidden='true'>
|
||||
<textarea id="cnsl">
|
||||
const d = new Date();
|
||||
var date = d.getFullYear() + "-" + (d.getMonth()+1) + "-" + d.getDate();
|
||||
fetch('/fileserver/log/message/log_'+date+'.txt')
|
||||
.then(response => {
|
||||
// handle the response
|
||||
response.text()
|
||||
.then( result => {
|
||||
var lines = result.split("\n");
|
||||
var trace = {
|
||||
x: [],
|
||||
y: [],
|
||||
type: 'scatter'
|
||||
};
|
||||
|
||||
var timex = 1;
|
||||
for (let line of lines) {
|
||||
if (line.includes("PostProcessing - Raw")) {
|
||||
console.log(line);
|
||||
var value = line.split(" ")[6];
|
||||
var time = line.split(" ")[0];
|
||||
console.log("> "+time+" "+value+"\n");
|
||||
trace.x.push(timex);
|
||||
timex += 1;
|
||||
trace.y.push(value);
|
||||
}
|
||||
}
|
||||
console.log(trace);
|
||||
var data = [trace];
|
||||
Plotly.newPlot('chart', data);
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
// handle the error
|
||||
out.value = "error";
|
||||
});
|
||||
</textarea><br />
|
||||
<button onclick="run();">run</button>
|
||||
</div>
|
||||
<script>run();</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user