Changelog: https://roxy-wi.org/changelog#6_2_0
pull/343/head v6.2.0.0
Pavel Loginov 2022-09-28 17:18:53 +03:00
parent 24229750b7
commit 1bb5221a07
2 changed files with 30 additions and 30 deletions

View File

@ -429,7 +429,7 @@ def diff_config(oldcfg, cfg, **kwargs):
log_file = f"{log_path}/config_edit-{get_data('logs')}" log_file = f"{log_path}/config_edit-{get_data('logs')}"
try: try:
with open(log_file, 'a') as log: with open(log_file, 'a') as log:
log.write(mess) log.write(diff)
except IOError: except IOError:
print(f'<center><div class="alert alert-danger">Can\'t read write change to log. {stderr}</div></center>') print(f'<center><div class="alert alert-danger">Can\'t read write change to log. {stderr}</div></center>')
pass pass

View File

@ -375,7 +375,7 @@ function showLog() {
'&file=' + file + '&file=' + file +
'&waf=' + waf); '&waf=' + waf);
} }
} ); } );
} }
function showRemoteLogFiles() { function showRemoteLogFiles() {
@ -458,7 +458,7 @@ function showMap() {
$("#ajax").html(data); $("#ajax").html(data);
window.history.pushState("Show map", "Show map", cur_url[0] + '?service=haproxy&serv=' + $("#serv").val() + '&showMap'); window.history.pushState("Show map", "Show map", cur_url[0] + '?service=haproxy&serv=' + $("#serv").val() + '&showMap');
} }
} }
} ); } );
} }
function showCompare() { function showCompare() {
@ -479,7 +479,7 @@ function showCompare() {
toastr.clear(); toastr.clear();
$("#ajax").html(data); $("#ajax").html(data);
} }
} }
} ); } );
} }
function showCompareConfigs() { function showCompareConfigs() {
@ -537,7 +537,7 @@ function showConfig() {
$.getScript('/inc/configshow.js'); $.getScript('/inc/configshow.js');
window.history.pushState("Show config", "Show config", cur_url[0] + "?service=" + service + "&serv=" + $("#serv").val() + "&showConfig"); window.history.pushState("Show config", "Show config", cur_url[0] + "?service=" + service + "&serv=" + $("#serv").val() + "&showConfig");
} }
} }
} ); } );
} }
function showConfigFiles() { function showConfigFiles() {
@ -614,7 +614,7 @@ function showUploadConfig() {
window.history.pushState("Show config", "Show config", cur_url[0] + "?service=" + service + "&serv=" + serv + "&open=open&configver=" + configver); window.history.pushState("Show config", "Show config", cur_url[0] + "?service=" + service + "&serv=" + serv + "&open=open&configver=" + configver);
$.getScript('/inc/configshow.js'); $.getScript('/inc/configshow.js');
} }
} }
} ); } );
} }
function showListOfVersion(for_delver) { function showListOfVersion(for_delver) {
@ -683,7 +683,7 @@ function viewLogs() {
var type = findGetParameter('type') var type = findGetParameter('type')
if (viewlogs == null){ if (viewlogs == null){
viewlogs = findGetParameter('viewlogs') viewlogs = findGetParameter('viewlogs')
} }
$.ajax( { $.ajax( {
url: "options.py", url: "options.py",
data: { data: {
@ -695,7 +695,7 @@ function viewLogs() {
minut: minut, minut: minut,
hour1: hour1, hour1: hour1,
minut1: minut1, minut1: minut1,
token: $('#token').val(), token: $('#token').val(),
}, },
type: "POST", type: "POST",
success: function( data ) { success: function( data ) {
@ -709,7 +709,7 @@ function viewLogs() {
'&minut=' + minut + '&minut=' + minut +
'&hour1=' + hour1 + '&hour1=' + hour1 +
'&minut1=' + minut1); '&minut1=' + minut1);
} }
} ); } );
} }
} }
@ -745,10 +745,10 @@ $( function() {
$("#show").css("pointer-events", "none"); $("#show").css("pointer-events", "none");
$("#show").css("cursor", "not-allowed"); $("#show").css("cursor", "not-allowed");
} }
var pause = '<a onclick="pauseAutoRefresh()" title="Pause auto-refresh" class="auto-refresh-pause"></a>' var pause = '<a onclick="pauseAutoRefresh()" title="Pause auto-refresh" class="auto-refresh-pause"></a>'
var autoRefresh = sessionStorage.getItem('auto-refresh'); var autoRefresh = sessionStorage.getItem('auto-refresh');
if ($('.auto-refresh')) { if ($('.auto-refresh')) {
if(autoRefresh) { if(autoRefresh) {
startSetInterval(autoRefresh); startSetInterval(autoRefresh);
@ -757,12 +757,12 @@ $( function() {
} }
$( "#tabs" ).tabs(); $( "#tabs" ).tabs();
$( "select" ).selectmenu(); $( "select" ).selectmenu();
//$( "[title]" ).tooltip(); //$( "[title]" ).tooltip();
$( "input[type=submit], button" ).button(); $( "input[type=submit], button" ).button();
$( "input[type=checkbox]" ).checkboxradio(); $( "input[type=checkbox]" ).checkboxradio();
$( ".controlgroup" ).controlgroup(); $( ".controlgroup" ).controlgroup();
$( "#hide_menu" ).click(function() { $( "#hide_menu" ).click(function() {
$(".top-menu").hide( "drop", "fast" ); $(".top-menu").hide( "drop", "fast" );
$(".container").css("max-width", "100%"); $(".container").css("max-width", "100%");
@ -801,8 +801,8 @@ $( function() {
$(".footer").css("max-width", "97%"); $(".footer").css("max-width", "97%");
$(".show_menu").show(); $(".show_menu").show();
$("#hide_menu").hide(); $("#hide_menu").hide();
} }
var now = new Date(Date.now()); var now = new Date(Date.now());
if($('#time_range_out_hour').val() != '' && $('#time_range_out_hour').val() != 'None') { if($('#time_range_out_hour').val() != '' && $('#time_range_out_hour').val() != 'None') {
var date1 = parseInt($('#time_range_out_hour').val(), 10) * 60 + parseInt($('#time_range_out_minut').val(), 10) var date1 = parseInt($('#time_range_out_hour').val(), 10) * 60 + parseInt($('#time_range_out_minut').val(), 10)
@ -814,7 +814,7 @@ $( function() {
} else { } else {
var date2 = now.getHours() * 60 + now.getMinutes(); var date2 = now.getHours() * 60 + now.getMinutes();
} }
$("#time-range").slider({ $("#time-range").slider({
range: true, range: true,
min: 0, min: 0,
max: 1440, max: 1440,
@ -826,7 +826,7 @@ $( function() {
if(hours.toString().length == 1) hours = '0' + hours; if(hours.toString().length == 1) hours = '0' + hours;
if(minutes.toString().length == 1) minutes = '0' + minutes; if(minutes.toString().length == 1) minutes = '0' + minutes;
var hours1 = Math.floor(ui.values[1] / 60); var hours1 = Math.floor(ui.values[1] / 60);
var minutes1 = ui.values[1] - (hours1 * 60); var minutes1 = ui.values[1] - (hours1 * 60);
@ -872,17 +872,17 @@ $( function() {
} else { } else {
$('#time_range_out_minut1').val(date2_minute); $('#time_range_out_minut1').val(date2_minute);
} }
$('#0').click(function() { $('#0').click(function() {
$('.auto-refresh-div').show("blind", "fast"); $('.auto-refresh-div').show("blind", "fast");
$('#0').css("display", "none"); $('#0').css("display", "none");
$('#1').css("display", "inline"); $('#1').css("display", "inline");
}); });
$('#1').click(function() { $('#1').click(function() {
$('.auto-refresh-div').hide("blind", "fast"); $('.auto-refresh-div').hide("blind", "fast");
$('#1').css("display", "none"); $('#1').css("display", "none");
$('#0').css("display", "inline"); $('#0').css("display", "inline");
}); });
$('#auth').submit(function() { $('#auth').submit(function() {
let searchParams = new URLSearchParams(window.location.search) let searchParams = new URLSearchParams(window.location.search)
@ -905,8 +905,8 @@ $( function() {
$('.alert').show(); $('.alert').show();
$('.alert').html(data); $('.alert').html(data);
} else if (data.indexOf('ban') != '-1') { } else if (data.indexOf('ban') != '-1') {
ban(); ban();
} }
} }
} ); } );
return false; return false;
@ -1055,7 +1055,7 @@ $( function() {
$(this).children(".runtime").css('border-left', '4px solid var(--right-menu-blue-rolor)'); $(this).children(".runtime").css('border-left', '4px solid var(--right-menu-blue-rolor)');
}); });
$( "#tabs" ).tabs( "option", "active", 1 ); $( "#tabs" ).tabs( "option", "active", 1 );
} ); } );
$( ".admin" ).on( "click", function() { $( ".admin" ).on( "click", function() {
$('.menu li ul li').each(function () { $('.menu li ul li').each(function () {
$(this).find('a').css('border-left', '0px solid var(--right-menu-blue-rolor)'); $(this).find('a').css('border-left', '0px solid var(--right-menu-blue-rolor)');
@ -1149,19 +1149,19 @@ async function ban() {
$('.alert').show(); $('.alert').show();
$('#ban_10').show(); $('#ban_10').show();
$( '#ban_timer').text(10); $( '#ban_timer').text(10);
let i = 10; let i = 10;
while (i > 0) { while (i > 0) {
i--; i--;
await sleep(1000); await sleep(1000);
$( '#ban_timer').text(i); $( '#ban_timer').text(i);
} }
$( '#login').removeAttr('disabled'); $( '#login').removeAttr('disabled');
$( '#pass').removeAttr('disabled'); $( '#pass').removeAttr('disabled');
$( "input[type=submit], button" ).button('enable'); $( "input[type=submit], button" ).button('enable');
$('#ban_10').hide(); $('#ban_10').hide();
} }
function replace_text(id_textarea, text_var) { function replace_text(id_textarea, text_var) {
var str = $(id_textarea).val(); var str = $(id_textarea).val();
var len = str.length; var len = str.length;
@ -1177,7 +1177,7 @@ function createHistroy() {
localStorage.setItem('history', JSON.stringify(get_history_array)); localStorage.setItem('history', JSON.stringify(get_history_array));
} }
} }
function listHistroy() { function listHistroy() {
var browse_history = JSON.parse(localStorage.getItem('history')); var browse_history = JSON.parse(localStorage.getItem('history'));
var history_link = ''; var history_link = '';
var title = [] var title = []