Changeset 374 for trunk/nagios-velvice/velvice.cgi
- Timestamp:
- Nov 4, 2018, 11:18:18 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nagios-velvice/velvice.cgi
r373 r374 17 17 use strict; 18 18 use warnings; 19 use version; our $VERSION = version->declare('0.10. 2');19 use version; our $VERSION = version->declare('0.10.3'); 20 20 21 21 use CGI; … … 166 166 $mon++; 167 167 my $date_sec = nosbreak(sprintf '%04i-%02i-%02i %02i:%02i:%02i', $year, $mon, $mday, $hour, $min, $sec); 168 my $date = nosbreak(sprintf '%04i-%02i-%02i %02i:%02i',$year, $mon, $mday, $hour, $min);168 my $date_min = nosbreak(sprintf '%04i-%02i-%02i %02i:%02i', $year, $mon, $mday, $hour, $min); 169 169 170 170 my $htmlpage; … … 192 192 <link rel="shortcut icon" type="image/ico" href="$config->{'nagios-server'}{'image'}/favicon.ico"> 193 193 <script type="text/javascript"> 194 // var first_loop = 0;195 194 var refresh_sec = 900; // 15 min = 900 s 196 195 var refresh_interval; 197 196 function refresh() { 198 // if (first_loop == 0) {199 // first_loop++;200 // console.log("Jump First Loop");201 // return;202 // }203 197 var req = new XMLHttpRequest(); 204 198 console.log("Grabbing Value"); 205 // req.onreadystatechange = function () {206 // if (req.readyState == 4 && req.status == 200) {207 // document.getElementById('master-body').innerText = req.responseXML.getElementById('master-body').innerText;208 // }209 // }210 // req.overrideMimeType('text/xml');211 199 req.open("GET", '$cgi_script_name?only=body', true); // Grabs whatever you've written in this file 212 200 req.onload = function () { 213 201 if (req.status == 200) { 214 202 document.getElementById('master-body').innerHTML = req.responseXML.getElementById('master-body').innerHTML; 215 // document.getElementById('master-body').outerHTML = req.responseXML.getElementById('master-body').outerHTML;216 203 console.log("Update Page: ", $date_sec); 217 // console.log("Update Page ", req.responseXML.getElementById('master-body').outerHTML);218 204 219 205 refresh_next = req.responseXML.getElementById('master-body').getAttribute("refresh"); … … 234 220 235 221 function init() { // This is the function the browser first runs when it's loaded. 236 // refresh() // Then runs the refresh function for the first time.237 222 refresh_sec = document.getElementById('master-body').getAttribute("refresh"); 238 223 if (refresh_sec < 60 && refresh_sec != 0) { … … 252 237 <ul> 253 238 <li>Nagios Velvice Alert Panel : <a href="$config->{'nagios-server'}{'portal-url'}">Core Server</a></li> 254 <li><small><a id="refresh" href="$cgi_script_name">$date </a></small></li>239 <li><small><a id="refresh" href="$cgi_script_name">$date_min</a></small></li> 255 240 </ul> 256 241 </h1>
Note: See TracChangeset
for help on using the changeset viewer.