mirror of https://github.com/Aidaho12/haproxy-wi
parent
1e53c561ea
commit
541bfb2b2f
|
@ -5,6 +5,7 @@ import os
|
||||||
import funct
|
import funct
|
||||||
import paramiko
|
import paramiko
|
||||||
import configparser
|
import configparser
|
||||||
|
from datetime import datetime
|
||||||
from pytz import timezone
|
from pytz import timezone
|
||||||
|
|
||||||
form = cgi.FieldStorage()
|
form = cgi.FieldStorage()
|
||||||
|
|
|
@ -129,6 +129,7 @@ def head(title):
|
||||||
'<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>'
|
'<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>'
|
||||||
'<script src="/inc/js-cookie.js"></script>'
|
'<script src="/inc/js-cookie.js"></script>'
|
||||||
'<script src="/inc/script.js"></script>'
|
'<script src="/inc/script.js"></script>'
|
||||||
|
'<script src="/inc/configshow.js"></script>'
|
||||||
'<script src="/inc/nprogress.js"></script>'
|
'<script src="/inc/nprogress.js"></script>'
|
||||||
'<script src="/inc/vertical_scrol/custom_scrollbar.min.js"></script>'
|
'<script src="/inc/vertical_scrol/custom_scrollbar.min.js"></script>'
|
||||||
'</head>'
|
'</head>'
|
||||||
|
|
|
@ -153,7 +153,6 @@ if serv is not None and form.getvalue('right') is not None:
|
||||||
|
|
||||||
if serv is not None and form.getvalue('act') == "configShow":
|
if serv is not None and form.getvalue('act') == "configShow":
|
||||||
import os
|
import os
|
||||||
from paramiko import SSHClient
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from pytz import timezone
|
from pytz import timezone
|
||||||
|
|
||||||
|
@ -165,11 +164,7 @@ if serv is not None and form.getvalue('act') == "configShow":
|
||||||
|
|
||||||
funct.get_config(serv, cfg)
|
funct.get_config(serv, cfg)
|
||||||
|
|
||||||
print('<script>$( ".configShow" ).accordion({'
|
print('<script src="/inc/configshow.js"></script>')
|
||||||
'collapsible: true,'
|
|
||||||
'heightStyle: "content",'
|
|
||||||
'icons: { "header": "ui-icon-plus", "activeHeader": "ui-icon-minus" }'
|
|
||||||
'});</script>')
|
|
||||||
print("<center><h3>Config from %s</h3>" % serv)
|
print("<center><h3>Config from %s</h3>" % serv)
|
||||||
print('<p class="accordion-expand-holder">'
|
print('<p class="accordion-expand-holder">'
|
||||||
'<a class="accordion-expand-all ui-button ui-widget ui-corner-all" href="#">Expand all</a>'
|
'<a class="accordion-expand-all ui-button ui-widget ui-corner-all" href="#">Expand all</a>'
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
$( function() {
|
||||||
|
$( ".configShow" ).accordion({
|
||||||
|
collapsible: true,
|
||||||
|
heightStyle: "content",
|
||||||
|
icons: { "header": "ui-icon-plus", "activeHeader": "ui-icon-minus" }
|
||||||
|
});
|
||||||
|
var headers = $('.configShow .accordion-header');
|
||||||
|
var contentAreas = $('.configShow .ui-accordion-content ').hide()
|
||||||
|
.first().show().end();
|
||||||
|
var expandLink = $('.accordion-expand-all');
|
||||||
|
headers.click(function() {
|
||||||
|
// close all panels
|
||||||
|
contentAreas.slideUp();
|
||||||
|
// open the appropriate panel
|
||||||
|
$(this).next().slideDown();
|
||||||
|
// reset Expand all button
|
||||||
|
expandLink.text('Expand all')
|
||||||
|
.data('isAllOpen', false);
|
||||||
|
// stop page scroll
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
// hook up the expand/collapse all
|
||||||
|
expandLink.click(function(){
|
||||||
|
var isAllOpen = !$(this).data('isAllOpen');
|
||||||
|
console.log({isAllOpen: isAllOpen, contentAreas: contentAreas})
|
||||||
|
contentAreas[isAllOpen? 'slideDown': 'slideUp']();
|
||||||
|
|
||||||
|
expandLink.text(isAllOpen? 'Collapse All': 'Expand all')
|
||||||
|
.data('isAllOpen', isAllOpen);
|
||||||
|
});
|
||||||
|
|
||||||
|
})
|
|
@ -248,38 +248,6 @@ $( function() {
|
||||||
$( "input[type=checkbox]" ).checkboxradio();
|
$( "input[type=checkbox]" ).checkboxradio();
|
||||||
$( "#number" ).spinner();
|
$( "#number" ).spinner();
|
||||||
$( ".controlgroup" ).controlgroup();
|
$( ".controlgroup" ).controlgroup();
|
||||||
$( ".configShow" ).accordion({
|
|
||||||
collapsible: true,
|
|
||||||
heightStyle: "content",
|
|
||||||
icons: { "header": "ui-icon-plus", "activeHeader": "ui-icon-minus" }
|
|
||||||
});
|
|
||||||
var headers = $('.configShow .accordion-header');
|
|
||||||
var contentAreas = $('.configShow .ui-accordion-content ').hide()
|
|
||||||
.first().show().end();
|
|
||||||
var expandLink = $('.accordion-expand-all');
|
|
||||||
|
|
||||||
// add the accordion functionality
|
|
||||||
headers.click(function() {
|
|
||||||
// close all panels
|
|
||||||
contentAreas.slideUp();
|
|
||||||
// open the appropriate panel
|
|
||||||
$(this).next().slideDown();
|
|
||||||
// reset Expand all button
|
|
||||||
expandLink.text('Expand all')
|
|
||||||
.data('isAllOpen', false);
|
|
||||||
// stop page scroll
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
// hook up the expand/collapse all
|
|
||||||
expandLink.click(function(){
|
|
||||||
var isAllOpen = !$(this).data('isAllOpen');
|
|
||||||
console.log({isAllOpen: isAllOpen, contentAreas: contentAreas})
|
|
||||||
contentAreas[isAllOpen? 'slideDown': 'slideUp']();
|
|
||||||
|
|
||||||
expandLink.text(isAllOpen? 'Collapse All': 'Expand all')
|
|
||||||
.data('isAllOpen', isAllOpen);
|
|
||||||
});
|
|
||||||
|
|
||||||
function ajaxActionServers(action, id) {
|
function ajaxActionServers(action, id) {
|
||||||
var bad_ans = 'Bad config, check please';
|
var bad_ans = 'Bad config, check please';
|
||||||
|
|
Loading…
Reference in New Issue