diff --git a/cgi-bin/configshow.py b/cgi-bin/configshow.py index f0a5da08..5a46679a 100644 --- a/cgi-bin/configshow.py +++ b/cgi-bin/configshow.py @@ -39,7 +39,9 @@ if form.getvalue('serv') is not None and form.getvalue('open') is not None : print('') print("

Config from %s

" % serv) - + print('

' + 'Expand all' + '

') funct.show_config(cfg) os.system("/bin/rm -f " + cfg) diff --git a/cgi-bin/funct.py b/cgi-bin/funct.py index 4f6b8634..5174bc25 100644 --- a/cgi-bin/funct.py +++ b/cgi-bin/funct.py @@ -147,7 +147,6 @@ def links(): '' diff --git a/cgi-bin/overview.py b/cgi-bin/overview.py index f8a4e866..c0f683b7 100644 --- a/cgi-bin/overview.py +++ b/cgi-bin/overview.py @@ -49,7 +49,7 @@ if funct.is_admin(): users = json.loads(f) if i is 4: style = 'style="display: none;" class="show-users"' - print('' + users['login'] +'') + print('' + users['login'] +'') print(users['group']+'') print(users['role']) print('') @@ -79,7 +79,7 @@ commands = [ "ps -Af |grep [h]aproxy |wc -l" ] commands1 = [ "ls -l %s |awk '{ print $6\" \"$7\" \"$8}'" % haproxy_config_path ] for i in sorted(listhap): - print('%s' % (i, i, i)) + print('%s' % (i, i, i)) funct.ssh_command(listhap.get(i), commands, server_status="1") print('') print('show' % listhap.get(i)) @@ -89,7 +89,7 @@ for i in sorted(listhap): print('') funct.ssh_command(listhap.get(i), commands1) print('') - + print('' '' '') - print('') + print('
Server' @@ -111,8 +111,8 @@ commands = [ "cat " + haproxy_config_path + " |grep -E '^listen|^backend|^fronte status_command + "|grep Active | sed 's/^[ \t]*//'" ] commands1 = [ "top -u haproxy -b -n 1" ] for i in sorted(listhap): - print('

' + i + ':

Total listen/frontend/backend:
')
+	print('

' + i + ':

Total listen/frontend/backend:
')
 	funct.ssh_command(listhap.get(i), commands)
 	print('
')
 	funct.ssh_command(listhap.get(i), commands1)
diff --git a/inc/script.js b/inc/script.js
index e410694e..04e37745 100644
--- a/inc/script.js
+++ b/inc/script.js
@@ -21,6 +21,34 @@ $( function() {
 	  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);    
+	});
+	
 	$('#select_all').click(function(){
         var checkboxes = $(this).closest('form').find(':checkbox');
         if($(this).prop('checked')) {
diff --git a/inc/style.css b/inc/style.css
index e41eca30..5a822405 100644
--- a/inc/style.css
+++ b/inc/style.css
@@ -30,6 +30,10 @@ form {
 iframe {
 	width: 33%;
 }
+pre {
+	padding-left: 25px;
+	padding-top: 20px;
+}
 .icon {
 	max-width: 20px;
 	margin-left: 2px;
@@ -55,7 +59,7 @@ iframe {
 	font-style: italic;
 	font-weight: bold;
 	height: 52px;
-	background-color: #f2ae72;
+	background-color: #f4ab76;
 }
 .top-menu img {
 	max-width: 125px;
@@ -204,17 +208,18 @@ iframe {
 	border-radius: 5px;
 }
 
-.overviewTd {
-	padding-left: 35px;
+/*.overviewTd {	
 	padding-top: 20px;
-	border-color: #ddd;
-}
+}*/
 .overviewTr {
 	margin: 0;
 	background-color: #f6f6f6;
 	padding-left: 15px;
 	font-size: 15px;
 }
+.first-collumn {
+	width: 200px;
+}
 .serverUp, .serverDown {
 	padding: 3px; 
 	border-radius: 3px;