pull/42/head
Aidaho12 2018-09-14 20:15:17 +06:00
parent 6effdca461
commit c5fb798a37
3 changed files with 50 additions and 27 deletions

View File

@ -1,10 +1,28 @@
$( function() { $( function() {
$( "input[type=submit], button" ).button(); $( "input[type=submit], button" ).button();
$( ".configShow" ).accordion({ $( ".configShow" ).accordion({
collapsible: true, collapsible: true,
heightStyle: "content", heightStyle: "content",
icons: { "header": "ui-icon-plus", "activeHeader": "ui-icon-minus" } icons: { "header": "ui-icon-plus", "activeHeader": "ui-icon-minus" }
}); });
$('#raw').click(function() {
$(".configShow").accordion("destroy");
$('#raw').css('display', 'none');
$('.numRow').css('display', 'none');
$('#according').css('display', 'inline-block');
$('.accordion-expand-all').css('display', 'none');
});
$('#according').click(function() {
$( ".configShow" ).accordion({
collapsible: true,
heightStyle: "content",
icons: { "header": "ui-icon-plus", "activeHeader": "ui-icon-minus" }
});
$('#raw').css('display', 'inline-block');
$('.numRow').css('display', 'inline-block');
$('#according').css('display', 'none');
$('.accordion-expand-all').css('display', 'inline-block');
});
var headers = $('.configShow .accordion-header'); var headers = $('.configShow .accordion-header');
var contentAreas = $('.configShow .ui-accordion-content ').hide() var contentAreas = $('.configShow .ui-accordion-content ').hide()
.first().show().end(); .first().show().end();

View File

@ -80,7 +80,9 @@ $( function() {
$( "#show-all-users" ).text("Show all"); $( "#show-all-users" ).text("Show all");
} }
}); });
$('#secIntervals').css('display', 'none'); if (cur_url[0] == "overview.py" || cur_url[0] == "waf.py" || cur_url[0] == "metrics.py") {
$('#secIntervals').css('display', 'none');
}
$('#apply_close').click( function() { $('#apply_close').click( function() {
$("#apply").css('display', 'none'); $("#apply").css('display', 'none');
Cookies.remove('restart', { path: '' }); Cookies.remove('restart', { path: '' });

View File

@ -757,30 +757,33 @@ function updateServer(id) {
} }
function uploadSsh() { function uploadSsh() {
$('.alert-danger').remove(); $('.alert-danger').remove();
$.ajax( { if ($( "#ssh-key-name option:selected" ).val() == "Choose server" || $('#ssh_cert').val() == '') {
url: "options.py", $("#ajax-ssh").html('<div class="alert alert-danger" style="margin: 10px;">All fields must be completed</div>');
data: { } else {
ssh_cert: $('#ssh_cert').val(), $.ajax( {
name: $('#ssh-key-name').val(), url: "options.py",
token: $('#token').val() data: {
}, ssh_cert: $('#ssh_cert').val(),
type: "GET", name: $('#ssh-key-name').val(),
success: function( data ) { token: $('#token').val()
data = data.replace(/\s+/g,' '); },
if (data.indexOf('danger') != '-1') { type: "GET",
$("#ajax-ssh").html(data); success: function( data ) {
} else if (data.indexOf('success') != '-1') { data = data.replace(/\s+/g,' ');
$('.alert-danger').remove(); if (data.indexOf('danger') != '-1') {
$("#ajax-ssh").html(data); $("#ajax-ssh").html(data);
setTimeout(function() { } else if (data.indexOf('success') != '-1') {
$( "#ajax-ssh").html( "" ); $('.alert-danger').remove();
}, 2500 ); $("#ajax-ssh").html(data);
setTimeout(function() {
} else { $( "#ajax-ssh").html( "" );
$("#ajax-ssh").html('<div class="alert alert-danger">Something wrong, check and try again</div>'); }, 2500 );
} } else {
} $("#ajax-ssh").html('<div class="alert alert-danger">Something wrong, check and try again</div>');
} ); }
}
} );
}
} }
function updateSSH(id) { function updateSSH(id) {
$('#error').remove(); $('#error').remove();