|
@ -23,6 +23,7 @@ print('<center>'
|
|||
'<td class="padding10">Server</td>'
|
||||
'<td>Disable/Enable server or output any information</td>'
|
||||
'<td class="padding10">Command</td>'
|
||||
'<td></td>'
|
||||
'</tr>'
|
||||
'<tr>'
|
||||
'<td class="padding10" style="width: 35%;">'
|
||||
|
@ -61,9 +62,7 @@ print('<option value=3 %s>Show</option>' % selected3)
|
|||
print('</select></td>')
|
||||
print('<td><input type="text" name="servbackend" size=35 title="Frontend, backend/server, show: info, pools or help" required class="form-control">')
|
||||
|
||||
print('</td></tr>'
|
||||
'<tr style="border:none;">'
|
||||
'<td></td><td class="padding10" style="border:none; padding-left: 12%;">')
|
||||
print('</td><td>')
|
||||
funct.mode_admin("Enter")
|
||||
print('</td></form>'
|
||||
'</tr></table>')
|
||||
|
|
|
@ -152,26 +152,40 @@ def head(title):
|
|||
'</head>'
|
||||
'<body>'
|
||||
'<a name="top"></a>'
|
||||
'<div class="show_menu" style="display: none;">'
|
||||
'<a href="#" id="show_menu" title="Show menu" style="margin-top: 40px;position: absolute;">'
|
||||
'<span class="ui-state-default ui-corner-all">'
|
||||
'<span class="ui-icon ui-icon-arrowthick-1-e" id="arrow"></span>'
|
||||
'</span>'
|
||||
'</a>'
|
||||
'</div>'
|
||||
'<div class="top-menu">'
|
||||
'<span class="LogoText">HAproxy-WI</span>')
|
||||
'<div class="LogoText">'
|
||||
'<span style="padding-left: 20px;">HAproxy-WI</span>'
|
||||
'<a href="#" id="hide_menu" title="Hide menu" style="margin-left: 35%;margin-top: 40px;position: absolute;">'
|
||||
'<span class="ui-state-default ui-corner-all">'
|
||||
'<span class="ui-icon ui-icon-arrowthick-1-w" id="arrow"></span>'
|
||||
'</span>'
|
||||
'</a>'
|
||||
'</div>')
|
||||
if config.get('main', 'logo_enable') == "1":
|
||||
print('<img src="%s" title="Logo" class="logo">' % config.get('main', 'logo_path'))
|
||||
print('<div><img src="%s" title="Logo" class="logo"></div>' % config.get('main', 'logo_path'))
|
||||
print('<div class="top-link">')
|
||||
links()
|
||||
print('</div></div><div class="conteiner">')
|
||||
print('</div></div><div class="container">')
|
||||
|
||||
def footer():
|
||||
print('</center></div>'
|
||||
'<center>'
|
||||
'<center style="margin-left: 12%;">'
|
||||
'<h3>'
|
||||
'<a class="ui-button ui-widget ui-corner-all" href="#top" title="Move up">UP</a>'
|
||||
'</h3><br />'
|
||||
'</center>'
|
||||
'<div class="footer">'
|
||||
'<!--<div class="footer">'
|
||||
'<div class="footer-link">'
|
||||
'<span class="LogoText">HAproxy-WI</span>'
|
||||
'</div>'
|
||||
'</div></body></html>')
|
||||
'</div></body></html>-->')
|
||||
|
||||
def ssh_connect(serv):
|
||||
ssh = SSHClient()
|
||||
|
|
|
@ -93,6 +93,9 @@ for i in sorted(listhap):
|
|||
print('</table><table class="overview"><tr class="overviewHead">'
|
||||
'<td class="padding10">Server</td>'
|
||||
'<td class="padding10">'
|
||||
'HAproxy info'
|
||||
'</td>'
|
||||
'<td>'
|
||||
'Server status'
|
||||
'<span style="float: right; margin-left: 80&;">'
|
||||
'<a href="" title="Update status" id="update">'
|
||||
|
@ -105,13 +108,15 @@ print('</td></tr>')
|
|||
commands = [ "cat " + haproxy_config_path + " |grep -E '^listen|^backend|^frontend' |grep -v stats |wc -l",
|
||||
"uname -smor",
|
||||
"haproxy -v |head -1",
|
||||
status_command + "|grep Active | sed 's/^[ \t]*//'",
|
||||
"top -u haproxy -b -n 1" ]
|
||||
status_command + "|grep Active | sed 's/^[ \t]*//'" ]
|
||||
commands1 = [ "top -u haproxy -b -n 1" ]
|
||||
for i in sorted(listhap):
|
||||
print('<tr><td class="overviewTr"><a name="'+i+'"></a><h3 title="IP ' + listhap.get(i) + '">' + i + ':</h3></td>')
|
||||
print('<td class="overviewTd"><span style="margin-left: -10px;">Total listen/frontend/backend:</span><pre>')
|
||||
funct.ssh_command(listhap.get(i), commands)
|
||||
print('</pre></td><td class="overviewTd"><pre>')
|
||||
funct.ssh_command(listhap.get(i), commands1)
|
||||
print('</pre></td></tr>')
|
||||
|
||||
|
||||
print('<tr></table>')
|
||||
funct.footer()
|
|
@ -48,7 +48,7 @@ for i in listhap.listhap:
|
|||
if listhap.listhap.get(i) == serv:
|
||||
servname = i
|
||||
|
||||
print('<br /><br /><h3 style="padding-left: 20px; margin-top: 20px;">Choose server!</h3><br />'
|
||||
print('<div class="container"><h3 style="padding-left: 20px; margin-top: 20px;">Choose server!</h3><br />'
|
||||
'<form style="padding-left: 20px;" action="viewsttats.py" method="get">'
|
||||
'<select autofocus required name="serv">'
|
||||
'<option disabled>Choose server</option>')
|
||||
|
@ -61,4 +61,5 @@ data = response.content
|
|||
print('<a name="conf"></a>')
|
||||
print(data.decode('utf-8'))
|
||||
funct.head("Stats HAproxy configs")
|
||||
print('<style>.conteiner{display:none}</style>')
|
||||
print('</div>')
|
||||
#print('<style>.container{display:none}</style>')
|
||||
|
|
BIN
image/10.jpeg
Before Width: | Height: | Size: 260 KiB After Width: | Height: | Size: 268 KiB |
BIN
image/2.jpeg
Before Width: | Height: | Size: 874 KiB After Width: | Height: | Size: 841 KiB |
BIN
image/3.jpeg
Before Width: | Height: | Size: 415 KiB After Width: | Height: | Size: 332 KiB |
BIN
image/4.jpeg
Before Width: | Height: | Size: 403 KiB After Width: | Height: | Size: 416 KiB |
BIN
image/6.jpeg
Before Width: | Height: | Size: 348 KiB After Width: | Height: | Size: 382 KiB |
BIN
image/7.jpeg
Before Width: | Height: | Size: 397 KiB After Width: | Height: | Size: 590 KiB |
BIN
image/8.jpeg
Before Width: | Height: | Size: 272 KiB After Width: | Height: | Size: 294 KiB |
BIN
image/9.jpeg
Before Width: | Height: | Size: 255 KiB After Width: | Height: | Size: 276 KiB |
BIN
image/pic.rar
|
@ -24,7 +24,7 @@
|
|||
<a href="cgi-bin/configver.py" title="Upload old config">Upload old config</a> <br />
|
||||
<a href="cgi-bin/delver.py" title="Upload old config">Delete old config</a> <br />
|
||||
<div class="copyright">
|
||||
HAproxy Web Interface v1.8.1
|
||||
HAproxy Web Interface v1.9
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
14
script.js
|
@ -175,6 +175,20 @@ $( function() {
|
|||
$( "#rise-backend" ).selectmenu( "option", "disabled", true );
|
||||
}
|
||||
});
|
||||
$( "#hide_menu" ).click(function() {
|
||||
if ($(".top_menu").css("display", "block")) {
|
||||
$(".top-menu").hide( "drop", "slow" );
|
||||
$(".container").css("max-width", "98%");
|
||||
$(".container").css("margin-left", "1%");
|
||||
$(".show_menu").show();
|
||||
}
|
||||
});
|
||||
$( "#show_menu" ).click(function() {
|
||||
$(".top-menu").show( "drop", "slow" );
|
||||
$(".container").css("max-width", "88%");
|
||||
$(".container").css("margin-left", "12%");
|
||||
$(".show_menu").hide();
|
||||
});
|
||||
|
||||
var availableTags = [
|
||||
"acl", "http-request", "http-response", "set-uri", "set-url", "set-header", "add-header", "del-header", "replace-header", "path_beg", "url_beg()", "urlp_sub()", "tcpka", "tcplog", "forwardfor", "option"
|
||||
|
|
87
style.css
|
@ -13,7 +13,7 @@ body {
|
|||
h2 {
|
||||
background: #5D9CEB;
|
||||
border: 1px solid #5D9CEB;
|
||||
border-radius: 5px 5px 0px 0px;
|
||||
//border-radius: 5px 5px 0px 0px;
|
||||
padding: 10px;
|
||||
padding-left: 3%;
|
||||
color: #fff;
|
||||
|
@ -35,14 +35,18 @@ iframe {
|
|||
margin-left: 2px;
|
||||
}
|
||||
.top-menu {
|
||||
box-shadow: 1px 1px 5px grey;
|
||||
min-height: 50px;
|
||||
//border-radius: 5px;
|
||||
//box-shadow: 1px 1px 5px grey;
|
||||
position: fixed;
|
||||
height: 100%;
|
||||
width: 12%;
|
||||
float: left;
|
||||
margin-bottom: 20px;
|
||||
top: 0;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
display: block;
|
||||
}
|
||||
.top-menu, .footer {
|
||||
background-color: #33414E;
|
||||
|
@ -50,11 +54,10 @@ iframe {
|
|||
.logoText {
|
||||
color: #EBF1F1;
|
||||
font-size: 30px;
|
||||
float: left;
|
||||
margin-left: 50px;
|
||||
margin-top: 3px;
|
||||
font-style: italic;
|
||||
font-weight: bold;
|
||||
height: 52px;
|
||||
background-color: #f2ae72;
|
||||
}
|
||||
.top-menu img {
|
||||
max-width: 125px;
|
||||
|
@ -67,25 +70,25 @@ iframe {
|
|||
padding-left: 7px;
|
||||
padding-right: 7px;
|
||||
}
|
||||
.top-link {
|
||||
margin-top: 15px;
|
||||
/*.top-link {
|
||||
margin-top: 115px;
|
||||
}
|
||||
.top-link {
|
||||
margin-left: 28%;
|
||||
}
|
||||
}*/
|
||||
.footer-link {
|
||||
margin-left: 44%;
|
||||
}
|
||||
.conteiner {
|
||||
box-shadow: 1px 1px 5px grey;
|
||||
border-radius: 5px;
|
||||
clear: both;
|
||||
margin-top: 65px;
|
||||
.container {
|
||||
//box-shadow: 1px 1px 5px grey;
|
||||
//border-radius: 5px;
|
||||
|
||||
//margin-top: 65px;
|
||||
min-height: calc(100vh - 115px);
|
||||
max-width: 50%;
|
||||
max-width: 88%;
|
||||
min-width: 40%;
|
||||
background-color: #fff;
|
||||
margin-left: 25%;
|
||||
margin-left: 12%;
|
||||
}
|
||||
.configShow, .diff {
|
||||
margin-left: 16%;
|
||||
|
@ -207,7 +210,7 @@ iframe {
|
|||
}
|
||||
|
||||
.overviewTd {
|
||||
padding-left: 5%;
|
||||
padding-left: 35px;
|
||||
padding-top: 20px;
|
||||
border-color: #ddd;
|
||||
}
|
||||
|
@ -241,6 +244,7 @@ iframe {
|
|||
}
|
||||
.padding10 {
|
||||
padding: 10px;
|
||||
padding-left: 25px;
|
||||
border: none;
|
||||
}
|
||||
.ro {
|
||||
|
@ -260,26 +264,40 @@ iframe {
|
|||
margin-left: 13%;
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
margin-top: -10px;
|
||||
}
|
||||
.menu ul li{
|
||||
padding: 10px;
|
||||
padding: 10px;
|
||||
padding-left: 20px;
|
||||
}
|
||||
.menu ul > li:hover{
|
||||
/*.menu ul > li:hover{
|
||||
background-color: #3a4a4a;
|
||||
}
|
||||
}*/
|
||||
.menu ul ul > li:hover{
|
||||
background-color: #69e;
|
||||
}
|
||||
.menu ul li, .menu ul{
|
||||
display: inline-block;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.menu ul{
|
||||
position: relative;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: #33414E;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.menu ul a{
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
.menu ul a:hover {
|
||||
background-color: #69e;
|
||||
}
|
||||
.menu ul ul a{
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
/*
|
||||
.menu ul li, .menu ul{
|
||||
display: inline-block;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.menu ul ul{
|
||||
display: none;
|
||||
|
@ -288,21 +306,13 @@ iframe {
|
|||
margin-top: 10px;
|
||||
margin-left: -10px;
|
||||
}
|
||||
.menu ul a{
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
.menu ul ul a{
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
.menu li:hover ul{
|
||||
display: block;
|
||||
}
|
||||
.menu li:hover li{
|
||||
display: block;
|
||||
}
|
||||
|
||||
*/
|
||||
@keyframes shadow {
|
||||
from {box-shadow: 0px 0px 0px red inset;}
|
||||
50% {text-shadow: 0 0 30px black;}
|
||||
|
@ -439,12 +449,7 @@ a:focus {
|
|||
outline: 5px auto -webkit-focus-ring-color;
|
||||
outline-offset: -2px;
|
||||
}
|
||||
.container {
|
||||
padding-right: 15px;
|
||||
padding-left: 15px;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.container-fluid {
|
||||
padding-right: 15px;
|
||||
padding-left: 15px;
|
||||
|
|