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>
</nav>
<div class="copyright-menu">
HAproxy-WI v2.7.2
HAproxy-WI v2.7.2.1
<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>
</div>

View File

@ -15,6 +15,21 @@ jQuery.expr[':'].regex = function(elem, index, match) {
regex = new RegExp(matchParams.join('').replace(/^\s+|\s+$/g,''), regexFlags);
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) {
var margin;
@ -109,7 +124,7 @@ $( document ).ajaxComplete(function( event, request, settings ) {
NProgress.done();
});
function showOverview() {
function showOverview() {
showOverviewServers();
$.ajax( {
url: "options.py",
@ -124,7 +139,6 @@ function showOverview() {
}
} );
}
function showOverviewServers() {
$.ajax( {
url: "options.py",
@ -139,7 +153,6 @@ function showOverviewServers() {
}
} );
}
function showStats() {
$.ajax( {
url: "options.py",
@ -155,6 +168,7 @@ function showStats() {
wait();
}
} );
}
function showLog() {
$.ajax( {
@ -302,8 +316,7 @@ function viewLogs() {
minut: $('#time_range_out_minut').val(),
hour1: $('#time_range_out_hour1').val(),
minut1: $('#time_range_out_minut1').val(),
token: $('#token').val(),
token: $('#token').val(),
},
type: "GET",
success: function( data ) {
@ -313,7 +326,6 @@ function viewLogs() {
} );
}
}
$( function() {
$( "#serv" ).on('selectmenuchange',function() {
$("#show").css("pointer-events", "inherit");