notification on webpage on filesystem full

This commit is contained in:
Nic Limper
2023-07-29 11:14:52 +02:00
parent 26af93dd67
commit 6b6eda401f
2 changed files with 10 additions and 1 deletions

View File

@@ -250,6 +250,11 @@ select {
float: right;
}
.blink-red {
animation: tagflash 1s infinite;
color: red;
}
.taglist {
display: flex;
flex-wrap: wrap;

View File

@@ -129,7 +129,11 @@ function connect() {
processTags(msg.tags);
}
if (msg.sys) {
$('#sysinfo').innerHTML = 'free heap: ' + convertSize(msg.sys.heap) + ' ┇ db size: ' + convertSize(msg.sys.dbsize) + ' ┇ db record count: ' + msg.sys.recordcount + ' ┇ filesystem free: ' + convertSize(msg.sys.littlefsfree);
let filesystem = 'filesystem free: ' + convertSize(msg.sys.littlefsfree);
if (msg.sys.littlefsfree < 31000) {
filesystem = 'filesystem <span class="blink-red" title="Generating content is paused">FULL! ' + convertSize(msg.sys.littlefsfree) + '</span>';
}
$('#sysinfo').innerHTML = 'free heap: ' + convertSize(msg.sys.heap) + ' &#x2507; db size: ' + convertSize(msg.sys.dbsize) + ' &#x2507; db record count: ' + msg.sys.recordcount + ' &#x2507; ' + filesystem;
if (msg.sys.apstate) {
$("#apstatecolor").style.color = apstate[msg.sys.apstate].color;
$("#apstate").innerHTML = apstate[msg.sys.apstate].state;