Welcome, Jinja2!
code is optimized
pull/19/head
Aidaho12 7 years ago
parent ef9ffe530c
commit b9a3a4fc4e

@ -1,4 +1,5 @@
$( function() { $( function() {
$( "input[type=submit], button" ).button();
$( ".configShow" ).accordion({ $( ".configShow" ).accordion({
collapsible: true, collapsible: true,
heightStyle: "content", heightStyle: "content",

@ -46,4 +46,5 @@ $( function() {
$( "#show-all-users" ).text("Show all"); $( "#show-all-users" ).text("Show all");
} }
}); });
$('#secIntervals').css('display', 'none');
}); });

@ -14,24 +14,21 @@ function autoRefreshStyle(autoRefresh) {
if ( autoRefresh == 60) { if ( autoRefresh == 60) {
timeRange = " minute" timeRange = " minute"
autoRefresh = autoRefresh / 60; autoRefresh = autoRefresh / 60;
margin = '-80px';
} else if ( autoRefresh > 60 && autoRefresh < 3600 ) { } else if ( autoRefresh > 60 && autoRefresh < 3600 ) {
timeRange = " minutes" timeRange = " minutes"
autoRefresh = autoRefresh / 60; autoRefresh = autoRefresh / 60;
margin = '-93px';
} else if ( autoRefresh >= 3600 && autoRefresh < 86401 ) { } else if ( autoRefresh >= 3600 && autoRefresh < 86401 ) {
timeRange = " hours" timeRange = " hours"
autoRefresh = autoRefresh / 3600; autoRefresh = autoRefresh / 3600;
margin = '-80px';
} else { } else {
timeRange = " seconds"; timeRange = " seconds";
margin = '-100px';
} }
$('#1').text(autoRefresh + timeRange); $('#1').text(autoRefresh + timeRange);
$('#0').text(autoRefresh + timeRange); $('#0').text(autoRefresh + timeRange);
$('.auto-refresh-pause').css('display', 'inline'); $('.auto-refresh-pause').css('display', 'inline');
$('.auto-refresh-resume').css('display', 'none'); $('.auto-refresh-resume').css('display', 'none');
$('.auto-refresh-pause').css('margin-left', margin); $('.auto-refresh-pause').css('margin-left', "-25px");
$('.auto-refresh-resume').css('margin-left', "-25px");
$('.auto-refresh img').remove(); $('.auto-refresh img').remove();
} }
@ -39,7 +36,7 @@ function setRefreshInterval(interval) {
if (interval == "0") { if (interval == "0") {
Cookies.remove('auto-refresh'); Cookies.remove('auto-refresh');
pauseAutoRefresh(); pauseAutoRefresh();
$('.auto-refresh').append('<img style="margin-top: 3px; margin-left: -110px; position: fixed;" src=/image/pic/update.png alt="restart" class="icon">'); $('.auto-refresh').prepend('<img src=/image/pic/update.png alt="restart" class="icon">');
$('#1').text('Auto-refresh'); $('#1').text('Auto-refresh');
$('#0').text('Auto-refresh'); $('#0').text('Auto-refresh');
$('.auto-refresh-pause').css('display', 'none'); $('.auto-refresh-pause').css('display', 'none');
@ -224,6 +221,23 @@ function showConfig() {
} }
} ); } );
} }
function showUploadConfig() {
$.ajax( {
url: "options.py",
data: {
serv: $("#serv").val(),
act: "configShow",
configver: $('#configver').val()
},
type: "GET",
success: function( data ) {
$("#ajax").html(data);
window.history.pushState("Show config", "Show config", cur_url[0]+"?serv="+$("#serv").val()+"&open=open&configver="+$('#configver').val());
var urlConfigShowJs = '/inc/configshow.js';
$.getScript(urlConfigShowJs);
}
} );
}
function viewLogs() { function viewLogs() {
$.ajax( { $.ajax( {
url: "options.py", url: "options.py",
@ -644,7 +658,7 @@ $( function() {
url: "options.py", url: "options.py",
data: { data: {
showif:1, showif:1,
serv: $("#master").val() serv: $("#master-add").val()
}, },
success: function( data ) { success: function( data ) {
data = data.replace(/\s+/g,' '); data = data.replace(/\s+/g,' ');

Loading…
Cancel
Save