image/w/logs.html

Wed, 10 Jun 2020 09:43:51 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 10 Jun 2020 09:43:51 +0200
changeset 87
47253f294a9f
parent 84
d01de33231cb
permissions
-rw-r--r--

SDK settings to reduce bin size. Some log messages to debug level. Added KWH usage registration. Added equipment power usage for HLT and MLT. Equipment database upgraded to version 2, expandable. Fixed some screen errors during temperature mash steps.

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Brew Logfiles</title>
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> 
  <script src="js/jquery-1.12.4.min.js"></script>
  <link rel="stylesheet" href="css/web.css">
</head>
<body>

 <div id="tmap"></div>
 <table class="directory">
  <thead>
   <tr class="directory">
    <th align="left">Bestand</th>
    <th align="left">Grootte</th>
    <th align="left">Datum</th>
    <th align="left">Actie</th>
    <th align="left">Actie</th>
   </tr>
  </thead>
  <tbody id="tbody">
  </tbody>
 </table>


 <br>
 <div class="menu">
  <form action="index.html"><input type="submit" class="button" value="Hoofdmenu"></form>
 </div>

 <script>

function getFileExtension(filename) {
  return filename.substring(filename.lastIndexOf('.')+1, filename.length) || filename;
}

$.getJSON("/logfiles.json", function(data) {
  var folder = data.Dir.map(function(item) {
    return item.Folder;
  });

  $('#tmap').append([folder]);

  $.each(data.Dir[0].Files, function(idx, obj) {
    var ct = new Date();
    ct.setTime(obj.Date * 1000);
    var str = "";

    if (ct.getDate() < 10)
      str += "0";
    str += ct.getDate() + "-";
    if (ct.getMonth() < 9)
      str += "0";
    str += (ct.getMonth() + 1) + "-" + ct.getFullYear() + " ";
    if (ct.getHours() < 10)
      str += "0";
    str += ct.getHours() + ":";
    if (ct.getMinutes() < 10)
      str += "0";
    str += ct.getMinutes();

    var eachrow = "<tr class=\"directory\">"
    + "<td>" + obj.File + "</td>"
    + "<td>" + obj.Size + " bytes</td>"
    + "<td>" + str + "</td>"
    + "<td><a href=\"/log/" + obj.File + "\">Download</a></td>";
    if (getFileExtension(obj.File) == 'json') {
      eachrow += "<td><a href=\"/chart.html?show=/log/" + obj.File + "\">Grafiek</a></td>";
    } else {
      eachrow += "<td> </td>";
    }
    eachrow += "</tr>";
    $('#tbody').append(eachrow);
  });
});

 </script>

</body>
</html>

mercurial