Browse Source

Add update block

Rorist 5 years ago
parent
commit
5f840eee10
3 changed files with 4 additions and 1 deletions
  1. 2 1
      main.js
  2. 1 0
      style.css
  3. 1 0
      trigger.html

+ 2 - 1
main.js

@@ -61,7 +61,8 @@ function updateSpaceInformation() {
             closeBlock.hide();
             document.hoursform.hours.focus();
         }
-
+        var date = new Date(data.state.lastchange * 1000);
+        updateBlock.html('Last update: ' + date.toDateString());
         msgBlock.html(data.state.message);
         msgBlock.show();
         loadBlock.hide();

+ 1 - 0
style.css

@@ -155,6 +155,7 @@ all the button
     min-height: 220px;
 }
 
+#update-block,
 #open-block,
 #close-block,
 #msg-block {

+ 1 - 0
trigger.html

@@ -18,6 +18,7 @@
     <div class="col-md-5 block-status">
         <h2>Trigger status</h2>
         <div id="msg-block" class="lead"></div>
+        <div id="update-block" class="lead"></div>
         <div id="open-block">
             <form name="hoursform" id="hoursform">
                 <span id="btn-minus" class="glyphicon glyphicon-minus-sign"></span>