overview.html 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <!DOCTYPE html>
  2. <!--
  3. vim: expandtab shiftwidth=4:
  4. -->
  5. <html>
  6. <head>
  7. <link rel="stylesheet" type="text/css" href="/css/default.css">
  8. <script type="text/javascript" src="/js/Chart.bundle.min.js"></script>
  9. <script type="text/javascript" src="/js/overview.js"></script>
  10. <script type="text/javascript">
  11. window.onload = function () {
  12. let now = new Date();
  13. endDateElement = document.getElementById('endDate');
  14. endDateElement.value = now.toISOString().substring(0, 10);
  15. fromdate = document.getElementById('startDate').value;
  16. untildate = endDateElement.value;
  17. render_graph('/cgi-bin/output?from=' + fromdate
  18. + '&until=' + untildate, 'chart');
  19. document.getElementById("reload").onclick = function () {
  20. fromdate = document.getElementById('startDate').value;
  21. untildate = document.getElementById('endDate').value;
  22. render_graph('/cgi-bin/output?from=' + fromdate
  23. + '&until=' + untildate, 'chart');
  24. }
  25. }
  26. </script>
  27. </head>
  28. <body>
  29. <div id="dateSelectContainer">
  30. <label for="startDate">Start:</label><input id="startDate" type="date" value="1970-01-01">
  31. <label for="endDate">End:</label><input id="endDate" type="date">
  32. <input id="reload" type="button" value="reload">
  33. </div>
  34. <div id="chartContainer" style="height: 100%; width: 100%;">
  35. <canvas id="chart"></canvas>
  36. </div>
  37. </body>
  38. </html>