Imptoved auto refresh
pull/26/head
Aidaho12 2018-07-27 09:45:49 +06:00
parent 008fdde04c
commit 32be16a69d
2 changed files with 19 additions and 7 deletions

View File

@ -96,7 +96,7 @@
</ul> </ul>
</nav> </nav>
<div class="copyright-menu"> <div class="copyright-menu">
HAproxy-WI v2.7.2 HAproxy-WI v2.7.2.1
<br> <br>
<a href="https://www.patreon.com/haproxy_wi" title="Donate" target="_blank" style="color: #fff; margin-left: 30px; color: red;" class="patreon"> Patreon</a> <a href="https://www.patreon.com/haproxy_wi" title="Donate" target="_blank" style="color: #fff; margin-left: 30px; color: red;" class="patreon"> Patreon</a>
</div> </div>

View File

@ -15,6 +15,21 @@ jQuery.expr[':'].regex = function(elem, index, match) {
regex = new RegExp(matchParams.join('').replace(/^\s+|\s+$/g,''), regexFlags); regex = new RegExp(matchParams.join('').replace(/^\s+|\s+$/g,''), regexFlags);
return regex.test(jQuery(elem)[attr.method](attr.property)); return regex.test(jQuery(elem)[attr.method](attr.property));
} }
window.onblur= function() {
window.onfocus= function () {
if($('.auto-refresh-pause').attr('style') == "display: inline; margin-top: 4px; margin-left: -25px;" && Cookies.get('auto-refresh') > 5000) {
if (cur_url[0] == "logs.py") {
showLog();
} else if (cur_url[0] == "viewsttats.py") {
showStats()
} else if (cur_url[0] == "overview.py") {
showOverview();
} else if (cur_url[0] == "viewlogs.py") {
viewLogs();
}
}
}
};
function autoRefreshStyle(autoRefresh) { function autoRefreshStyle(autoRefresh) {
var margin; var margin;
@ -124,7 +139,6 @@ function showOverview() {
} }
} ); } );
} }
function showOverviewServers() { function showOverviewServers() {
$.ajax( { $.ajax( {
url: "options.py", url: "options.py",
@ -139,7 +153,6 @@ function showOverviewServers() {
} }
} ); } );
} }
function showStats() { function showStats() {
$.ajax( { $.ajax( {
url: "options.py", url: "options.py",
@ -155,6 +168,7 @@ function showStats() {
wait(); wait();
} }
} ); } );
} }
function showLog() { function showLog() {
$.ajax( { $.ajax( {
@ -303,7 +317,6 @@ function viewLogs() {
hour1: $('#time_range_out_hour1').val(), hour1: $('#time_range_out_hour1').val(),
minut1: $('#time_range_out_minut1').val(), minut1: $('#time_range_out_minut1').val(),
token: $('#token').val(), token: $('#token').val(),
}, },
type: "GET", type: "GET",
success: function( data ) { success: function( data ) {
@ -313,7 +326,6 @@ function viewLogs() {
} ); } );
} }
} }
$( function() { $( function() {
$( "#serv" ).on('selectmenuchange',function() { $( "#serv" ).on('selectmenuchange',function() {
$("#show").css("pointer-events", "inherit"); $("#show").css("pointer-events", "inherit");