From c5fb798a37548bc5d8b2045438f59d994586a0f8 Mon Sep 17 00:00:00 2001 From: Aidaho12 Date: Fri, 14 Sep 2018 20:15:17 +0600 Subject: [PATCH] v3.2.6 --- inc/configshow.js | 22 ++++++++++++++++++-- inc/overview.js | 4 +++- inc/users.js | 51 +++++++++++++++++++++++++---------------------- 3 files changed, 50 insertions(+), 27 deletions(-) diff --git a/inc/configshow.js b/inc/configshow.js index 7e452d87..34ba59f3 100644 --- a/inc/configshow.js +++ b/inc/configshow.js @@ -1,10 +1,28 @@ $( function() { $( "input[type=submit], button" ).button(); $( ".configShow" ).accordion({ - collapsible: true, - heightStyle: "content", + collapsible: true, + heightStyle: "content", 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 contentAreas = $('.configShow .ui-accordion-content ').hide() .first().show().end(); diff --git a/inc/overview.js b/inc/overview.js index bb59b1a5..52e13396 100644 --- a/inc/overview.js +++ b/inc/overview.js @@ -80,7 +80,9 @@ $( function() { $( "#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").css('display', 'none'); Cookies.remove('restart', { path: '' }); diff --git a/inc/users.js b/inc/users.js index 4c9f1b70..6ffe041e 100644 --- a/inc/users.js +++ b/inc/users.js @@ -757,30 +757,33 @@ function updateServer(id) { } function uploadSsh() { $('.alert-danger').remove(); - $.ajax( { - url: "options.py", - data: { - ssh_cert: $('#ssh_cert').val(), - name: $('#ssh-key-name').val(), - token: $('#token').val() - }, - type: "GET", - success: function( data ) { - data = data.replace(/\s+/g,' '); - if (data.indexOf('danger') != '-1') { - $("#ajax-ssh").html(data); - } else if (data.indexOf('success') != '-1') { - $('.alert-danger').remove(); - $("#ajax-ssh").html(data); - setTimeout(function() { - $( "#ajax-ssh").html( "" ); - }, 2500 ); - - } else { - $("#ajax-ssh").html('
Something wrong, check and try again
'); - } - } - } ); + if ($( "#ssh-key-name option:selected" ).val() == "Choose server" || $('#ssh_cert').val() == '') { + $("#ajax-ssh").html('
All fields must be completed
'); + } else { + $.ajax( { + url: "options.py", + data: { + ssh_cert: $('#ssh_cert').val(), + name: $('#ssh-key-name').val(), + token: $('#token').val() + }, + type: "GET", + success: function( data ) { + data = data.replace(/\s+/g,' '); + if (data.indexOf('danger') != '-1') { + $("#ajax-ssh").html(data); + } else if (data.indexOf('success') != '-1') { + $('.alert-danger').remove(); + $("#ajax-ssh").html(data); + setTimeout(function() { + $( "#ajax-ssh").html( "" ); + }, 2500 ); + } else { + $("#ajax-ssh").html('
Something wrong, check and try again
'); + } + } + } ); + } } function updateSSH(id) { $('#error').remove();