release 0.8.0.3
[psensor.git] / www / details.html
index 01297cb..3dabb65 100644 (file)
@@ -1,7 +1,7 @@
 <html>
   <head>
     <meta charset="utf-8">
-    <title>Sensor </title>
+    <title id="title">Sensor </title>
 
     <link type="text/css"
          rel="stylesheet"
@@ -20,22 +20,33 @@ href="http://fonts.googleapis.com/css?family=Ubuntu:regular,bold&subset=Latin">
 
     <script>
       $(document).ready(function() {
-          var url_id;
+               var url_id;
 
-         url_id = get_url_params()["id"];
+               url_id = get_url_params()["id"];
+
+               update_menu();
+               $.getJSON(url_id, function(data) {
+                               update_chart("chart", type_to_str(data["type"]), data);
+               });
+
+               setInterval(function() {
+                       $.getJSON(url_id, function(data) {
+                               update_chart("chart", type_to_str(data["type"]), data);
+                       });
+               }, 5000);
+
+               // reload page in order to workaround memory-leak in JQPlot
+               setInterval(function() {
+                       location.reload();
+               }, 60000);
 
-      update_menu();
-      
-          $.getJSON(url_id, function(data) {
-               update_chart("chart", type_to_str(data["type"]), data);
-         });
       });
     </script>
   </head>
   <body>
       <div id="menu">
        <ul id="menu-list">
-         <li><em><a href="monitor.html">All</a><em></li>
+         <li><em><a href="monitor.html">All</a></em></li>
        </ul>
       </div>