diff --git a/cgi-bin/edit.py b/cgi-bin/edit.py index 442b6426..3376b8cf 100644 --- a/cgi-bin/edit.py +++ b/cgi-bin/edit.py @@ -15,12 +15,21 @@ head("Edit & show HAproxy settings") funct.check_login() -print('
') -print('Choose server') - +print('' + 'Edit & show HAproxy settings' + '' + '' + '' + 'Server' + 'Disable/Enable server or output any information' + 'Command' + '' + '' + '' + '' + '' + 'Choose server') + funct.choose_server_with_vip(serv) action = form.getvalue('servaction') @@ -43,17 +52,21 @@ else: selected2 = '' selected3 = '' -print('') -print('') +print('') +print('') print('Choose action') print('Disable server' % selected1) print('Enable server' % selected2) print('Show' % selected3) -print('') -print('') -print('') +print('') +print('') + +print('' + '' + '') funct.mode_admin("Enter") -print('') +print('' + '') if form.getvalue('servaction') is not None: action = form.getvalue('servaction') @@ -71,10 +84,8 @@ if form.getvalue('servaction') is not None: stdout, stderr = p.communicate() output = stdout.splitlines() - print('You %s %s on HAproxy %s. Look it or Edit something else' % (enable, backend, serv, serv)) - print('') - - print('\n'.join(map(str, output))) + print('You %s %s on HAproxy %s. Look it or Edit something else' % (enable, backend, serv, serv)) + print(''.join(map(str, output))) action = 'edit.py ' + enable + ' ' + backend funct.logging(serv, action) diff --git a/cgi-bin/logs.py b/cgi-bin/logs.py index 14e6718d..5eb4a91c 100644 --- a/cgi-bin/logs.py +++ b/cgi-bin/logs.py @@ -18,11 +18,20 @@ path_config = "haproxy-webintarface.config" config = configparser.ConfigParser() config.read(path_config) -print('HAproxy Logs') -print('Choose server & number rows') -print('') -print('') -print('Choose server') +print('' + 'HAproxy Logs' + '' + '' + '' + 'Server' + 'Number rows' + 'Ex for grep' + '' + '' + '' + '' + '' + 'Choose server') for i in sorted(listhap.listhap): if listhap.listhap.get(i) == serv: @@ -47,10 +56,16 @@ if form.getvalue('grep') is not None: else: grep = 'value=' -print('' % rows) -print('|grep') -print('' % grep) -print('Show') +print('' % rows) +print('' % grep) +print('' + '' + '' + '' + 'Show' + '' + '' + '') if form.getvalue('serv') is not None: rows = form.getvalue('rows') diff --git a/image/3.jpeg b/image/3.jpeg index ec28472d..e385ee0e 100644 Binary files a/image/3.jpeg and b/image/3.jpeg differ diff --git a/image/4.jpeg b/image/4.jpeg index be7678ea..d6de5727 100644 Binary files a/image/4.jpeg and b/image/4.jpeg differ diff --git a/style.css b/style.css index 803b5a79..88fa965e 100644 --- a/style.css +++ b/style.css @@ -13,7 +13,7 @@ body { h2 { border: 1px solid #5D9CEB; padding: 10px; - border-radius: 5px; + border-radius: 5px 5px 0px 0px; background: #5D9CEB; padding-left: 3%; color: #fff; @@ -23,6 +23,9 @@ h3 { margin-top: 10px; margin-bottom: 0px; } +form { + margin: 0; +} .top-menu { background-color: #222; min-height: 50px;
') +print('
'.join(map(str, output))) + print('
') -print('Choose server') +print('' + 'HAproxy Logs' + '' + '' + '' + 'Server' + 'Number rows' + 'Ex for grep' + '' + '' + '' + '' + '' + 'Choose server') for i in sorted(listhap.listhap): if listhap.listhap.get(i) == serv: @@ -47,10 +56,16 @@ if form.getvalue('grep') is not None: else: grep = 'value=' -print('' % rows) -print('|grep') -print('' % grep) -print('Show') +print('' % rows) +print('' % grep) +print('' + '' + '' + '' + 'Show' + '' + '' + '') if form.getvalue('serv') is not None: rows = form.getvalue('rows') diff --git a/image/3.jpeg b/image/3.jpeg index ec28472d..e385ee0e 100644 Binary files a/image/3.jpeg and b/image/3.jpeg differ diff --git a/image/4.jpeg b/image/4.jpeg index be7678ea..d6de5727 100644 Binary files a/image/4.jpeg and b/image/4.jpeg differ diff --git a/style.css b/style.css index 803b5a79..88fa965e 100644 --- a/style.css +++ b/style.css @@ -13,7 +13,7 @@ body { h2 { border: 1px solid #5D9CEB; padding: 10px; - border-radius: 5px; + border-radius: 5px 5px 0px 0px; background: #5D9CEB; padding-left: 3%; color: #fff; @@ -23,6 +23,9 @@ h3 { margin-top: 10px; margin-bottom: 0px; } +form { + margin: 0; +} .top-menu { background-color: #222; min-height: 50px;
Show