Ignore:
Timestamp:
Nov 4, 2018, 11:14:28 AM (6 years ago)
Author:
g7moreau
Message:
  • Remove first loop
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/nagios-velvice/velvice.cgi

    r372 r373  
    165165$year += 1900;
    166166$mon++;
    167 #my $date = nosbreak(sprintf '%04i-%02i-%02i %02i:%02i:%02i', $year, $mon, $mday, $hour, $min, $sec);
     167my $date_sec = nosbreak(sprintf '%04i-%02i-%02i %02i:%02i:%02i', $year, $mon, $mday, $hour, $min, $sec);
    168168my $date = nosbreak(sprintf '%04i-%02i-%02i %02i:%02i', $year, $mon, $mday, $hour, $min);
    169169
     
    192192 <link rel="shortcut icon" type="image/ico" href="$config->{'nagios-server'}{'image'}/favicon.ico">
    193193 <script type="text/javascript">
    194    var first_loop  = 0;
     194   // var first_loop  = 0;
    195195   var refresh_sec = 900; // 15 min = 900 s
    196196   var refresh_interval;
    197197   function refresh() {
    198       if (first_loop == 0) {
    199          first_loop++;
    200          return;
    201          }
     198      // if (first_loop == 0) {
     199      //    first_loop++;
     200      //    console.log("Jump First Loop");
     201      //    return;
     202      //    }
    202203      var req = new XMLHttpRequest();
    203204      console.log("Grabbing Value");
     
    213214            document.getElementById('master-body').innerHTML = req.responseXML.getElementById('master-body').innerHTML;
    214215            // document.getElementById('master-body').outerHTML = req.responseXML.getElementById('master-body').outerHTML;
    215             console.log("Update Value");
    216             // console.log("Update Value", req.responseXML.getElementById('master-body').outerHTML);
     216            console.log("Update Page: ", $date_sec);
     217            // console.log("Update Page ", req.responseXML.getElementById('master-body').outerHTML);
    217218
    218219            refresh_next = req.responseXML.getElementById('master-body').getAttribute("refresh");
     
    224225               clearInterval(refresh_interval);
    225226               refresh_interval = setInterval(refresh, refresh_sec * 1000);
    226                console.log("Refresh Interval ", refresh_sec);
     227               console.log("Refresh Interval: ", refresh_sec);
    227228               document.getElementById('master-body').setAttribute("refresh", refresh_sec);
    228229               }
     
    238239         refresh_sec = 60;
    239240         }
    240       refresh_interval = setInterval(refresh, refresh_sec * 1000); // Set the refresh() function to run every 900 seconds. 1 second would be 1000
     241      // Set the refresh() function to run every 900 seconds. 1 second would be 1000
     242      refresh_interval = setInterval(refresh, refresh_sec * 1000);
    241243      }
    242244</script>
Note: See TracChangeset for help on using the changeset viewer.