'
'Optinons: | '
''
- ''
+ ''
''
' '
' Start typing options: '
@@ -212,12 +212,13 @@ print(''
' '
''
' '
- ''
+ ''
''
' Default params: inter 2000 rise 2 fall 5'
' '
''
- ' '
+ ' '
+ ' '
' '
' '
'Mode: | '
''
- ''
' | '
'Optinons: | '
''
- ''
+ ''
''
' '
' Start typing options: '
@@ -359,7 +360,7 @@ print(''
' '
'Mode: | '
''
- ''
+ ''
''
''
''
@@ -389,7 +390,7 @@ print(''
' | '
'Optinons: | '
''
- ''
+ ''
''
' '
' Start typing options: '
@@ -407,12 +408,12 @@ print(''
' '
''
' '
- ''
+ ''
''
' Default params: inter 2000 rise 2 fall 5'
' '
''
- ' '
+ ' '
' '
' '
''
diff --git a/cgi-bin/overview.py b/cgi-bin/overview.py
index 9078faec..e65e0350 100644
--- a/cgi-bin/overview.py
+++ b/cgi-bin/overview.py
@@ -3,6 +3,7 @@ import html
import cgi
import funct
import configparser
+import json
import listserv as listhap
funct.head("Overview")
@@ -12,11 +13,40 @@ funct.check_login()
path_config = "haproxy-webintarface.config"
config = configparser.ConfigParser()
config.read(path_config)
+USERS = '/var/www/haproxy-wi/cgi-bin/users'
+
+try:
+ with open(USERS, "r") as user:
+ pass
+except IOError:
+ print("Can't load users DB")
print('Quick Status ')
commands = [ "ps -Af |grep [h]aproxy |wc -l" ]
+print(''
+ 'User name | '
+ ''
+ 'Role'
+ ''
+ ''
+ 'Show all'
+ ''
+ ' | '
+ ' ')
+
+i = 0
+style = ""
+for f in open(USERS, 'r'):
+ i = i + 1
+ users = json.loads(f)
+ if i is 4:
+ style = 'style="display: none;" class="show-users"'
+ print('' + users['firstName'] + ' ' + users['lastName'] +' | ')
+ print(users['role'])
+ print(' | ')
+
print(''
'Server | '
''
@@ -49,5 +79,9 @@ for i in sorted(listhap.listhap):
funct.ssh_command(listhap.listhap.get(i), commands)
print(' | ')
-print(' ')
+print(''
+ ''
+ ''
+ ''
+ ' ')
funct.footer()
\ No newline at end of file
diff --git a/script.js b/script.js
index 271e1d8b..8b63b234 100644
--- a/script.js
+++ b/script.js
@@ -4,7 +4,14 @@ $( function() {
$( "#tabs" ).tabs( "option", "active", 2 );
} );
$( "select" ).selectmenu();
- //$( document ).tooltip();
+
+ var tooltips = $( "[title]" ).tooltip({
+ position: {
+ my: "left top",
+ at: "right+5 top-5",
+ collision: "none"
+ }
+ });
$( "input[type=submit], button" ).button();
$( "input[type=checkbox]" ).checkboxradio();
$( ".controlgroup" ).controlgroup();
@@ -13,11 +20,22 @@ $( function() {
heightStyle: "content",
icons: { "header": "ui-icon-plus", "activeHeader": "ui-icon-minus" }
});
- $( "dropdown_selector" ).change(function() {
+ /*$( "dropdown_selector" ).change(function() {
var $option = $(this).find('option:selected');
if ($option == "tcp") {
$("#https-listen").hide();
}
+ }); */
+ $ ( "#show-all-users" ).click( function() {
+ if($( "#show-all-users" ).text() == "Show all") {
+ $( ".show-users" ).show("fast");
+ $( "#show-all-users" ).text("Hide");
+ $( "show-all-users" ).attr("title") = "Hide all users";
+ } else {
+ $( ".show-users" ).hide("fast");
+ $( "#show-all-users" ).attr("title", "Show all users");
+ $( "#show-all-users" ).text("Show all");
+ }
});
$( "#listen-mode-select" ).on('selectmenuchange',function() {
if ($( "#listen-mode-select option:selected" ).val() == "tcp") {
@@ -92,31 +110,38 @@ $( function() {
$( "#options-backend-show-div" ).hide( "fast" );
}
});
- $( "#controlgroup-listen-show" ).click( function(){
+ $( "#controlgroup-listen-show" ).click( function(){
if ($('#controlgroup-listen-show').is(':checked')) {
$( "#controlgroup-listen" ).show( "fast" );
if ($('#check-servers-listen').is(':checked')) {
$( "#rise-listen" ).attr('required',true);
$( "#fall-listen" ).attr('required',true);
$( "#inter-listen" ).attr('required',true);
- }
+ $( "#inter-listen" ).attr('disable',false);
+ }
} else {
- $( "#controlgroup-listen" ).hide( "fast" );
+ $( "#controlgroup-listen" ).hide( "fast" );
}
- $( "#check-servers-listen" ).click( function(){
+ $( "#check-servers-listen" ).click( function(){
if ($('#check-servers-listen').is(':checked')) {
$( "#rise-listen" ).attr('required',true);
$( "#fall-listen" ).attr('required',true);
$( "#inter-listen" ).attr('required',true);
+ $( "#inter-listen" ).selectmenu( "option", "disabled", false );
+ $( "#fall-listen" ).selectmenu( "option", "disabled", false );
+ $( "#rise-listen" ).selectmenu( "option", "disabled", false );
} else {
$( "#rise-listen" ).attr('required',false);
$( "#fall-listen" ).attr('required',false);
$( "#inter-listen" ).attr('required',false);
+ $( "#inter-listen" ).selectmenu( "option", "disabled", true );
+ $( "#fall-listen" ).selectmenu( "option", "disabled", true );
+ $( "#rise-listen" ).selectmenu( "option", "disabled", true );
}
});
});
- $( "#controlgroup-backend-show" ).click( function(){
+ $( "#controlgroup-backend-show" ).click( function(){
if ($('#controlgroup-backend-show').is(':checked')) {
$( "#controlgroup-backend" ).show( "fast" );
if ($('#check-servers-backend').is(':checked')) {
@@ -133,10 +158,16 @@ $( function() {
$( "#rise-backend" ).attr('required',true);
$( "#fall-backend" ).attr('required',true);
$( "#inter-backend" ).attr('required',true);
+ $( "#inter-backend" ).selectmenu( "option", "disabled", false );
+ $( "#fall-backend" ).selectmenu( "option", "disabled", false );
+ $( "#rise-backend" ).selectmenu( "option", "disabled", false );
} else {
$( "#rise-backend" ).attr('required',false);
$( "#fall-backend" ).attr('required',false);
$( "#inter-backend" ).attr('required',false);
+ $( "#inter-backend" ).selectmenu( "option", "disabled", true );
+ $( "#fall-backend" ).selectmenu( "option", "disabled", true );
+ $( "#rise-backend" ).selectmenu( "option", "disabled", true );
}
});
diff --git a/style.css b/style.css
index 4f4af8bd..b9b7f618 100644
--- a/style.css
+++ b/style.css
@@ -268,6 +268,7 @@ iframe {
.menu li:hover li{
display: block;
}
+
@keyframes shadow {
from {box-shadow: 0px 0px 0px red inset;}
50% {text-shadow: 0 0 30px black;}
@@ -363,6 +364,7 @@ table {
border-spacing: 0;
border-collapse: collapse;
background-color: transparent;
+ width: 100%;
}
caption {
color: #777;
| | | | |