mirror of https://github.com/Aidaho12/haproxy-wi
parent
5c5b21a56a
commit
c6c5ca2193
17
app/add.py
17
app/add.py
|
@ -142,16 +142,15 @@ if form.getvalue('mode') is not None:
|
|||
options_split += cookie
|
||||
if form.getvalue('dynamic'):
|
||||
options_split += " dynamic-cookie-key " + form.getvalue('dynamic-cookie-key')+"\n"
|
||||
|
||||
|
||||
servers_split = ""
|
||||
if form.getvalue('servers') is not None:
|
||||
servers = form.getvalue('servers')
|
||||
i = servers.split("\n")
|
||||
servers_split = ""
|
||||
for j in i:
|
||||
j = j.strip('\t\n\r')
|
||||
servers_split += " server " + j + check + "\n"
|
||||
else:
|
||||
servers_split = ""
|
||||
servers = form.getlist('servers')
|
||||
server_port = form.getlist('server_port')
|
||||
i = 0
|
||||
for server in servers:
|
||||
servers_split += " server test " + server +":"+server_port[i]+ check + "\n"
|
||||
i += 1
|
||||
|
||||
compression = form.getvalue("compression")
|
||||
cache = form.getvalue("cache")
|
||||
|
|
|
@ -456,7 +456,9 @@ def ssh_command(serv, commands, **kwargs):
|
|||
else:
|
||||
return stdout.read().decode(encoding='UTF-8')
|
||||
|
||||
print("<div class='alert alert-warning'>"+stderr.read().decode(encoding='UTF-8')+"</div>")
|
||||
for line in stderr.read().decode(encoding='UTF-8'):
|
||||
if line:
|
||||
print("<div class='alert alert-warning'>"+line+"</div>")
|
||||
try:
|
||||
ssh.close()
|
||||
except:
|
||||
|
|
|
@ -42,7 +42,11 @@
|
|||
<div class="tooltip tooltipTop">IP for bind listner, <b>if empty will be assignet on all IPs</b>. Start typing ip, or press down.<br>If you use <b>VRRP keep in blank</b>. If you assign an IP, the slave will not start</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="advance-show">
|
||||
<td class="addName">Advanced:</td>
|
||||
<td class="addOption"><a href="#" title="Show Advanced settings">Show Advanced settings</a></td>
|
||||
</tr>
|
||||
<tr class="advance">
|
||||
<td class="addName">Mode: </td>
|
||||
<td class="addOption">
|
||||
<select required name="mode" id="listen-mode-select">
|
||||
|
@ -60,7 +64,7 @@
|
|||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="advance">
|
||||
<td class="addName">Balance: </td>
|
||||
<td class="addOption">
|
||||
<select required name="balance">
|
||||
|
@ -72,7 +76,7 @@
|
|||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="advance">
|
||||
<td class="addName"><span title="Cache support start 1.8 and latter">Web acceleration(?):</span></td>
|
||||
<td class="addOption">
|
||||
<span class="controlgroup">
|
||||
|
@ -82,7 +86,7 @@
|
|||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="advance">
|
||||
<td class="addName"><span title="Web application firewall">WAF(?):</span></td>
|
||||
<td class="addOption">
|
||||
<span class="controlgroup">
|
||||
|
@ -97,7 +101,7 @@
|
|||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="advance">
|
||||
<td class="addName">Optinons:</td>
|
||||
<td class="addOption">
|
||||
<span class="controlgroup">
|
||||
|
@ -153,7 +157,19 @@
|
|||
<tr>
|
||||
<td class="addName">Servers:</td>
|
||||
<td class="addOption">
|
||||
<textarea name="servers" required title="Backend servers" cols=80 rows=3 placeholder="hostname ip:port"></textarea>
|
||||
<span id="servers">
|
||||
<input name="servers" required title="Backend IP" size=14 placeholder="xxx.xxx.xxx.xxx" class="form-control">:
|
||||
<input name="server_port" required title="Backend IP" size=1 placeholder="yyy" class="form-control">
|
||||
<br />
|
||||
<input name="servers" title="Backend port" size=14 placeholder="xxx.xxx.xxx.xxx" class="form-control">:
|
||||
<input name="server_port" title="Backend port" size=1 placeholder="yyy" class="form-control">
|
||||
<br />
|
||||
<input name="servers" title="Backend port" size=14 placeholder="xxx.xxx.xxx.xxx" class="form-control">:
|
||||
<input name="server_port" title="Backend port" size=1 placeholder="yyy" class="form-control">
|
||||
</span>
|
||||
<span>
|
||||
<a class="add-server" id="add-server" title="Add backend server" style="cursor: pointer;"></a>
|
||||
</span>
|
||||
<div>
|
||||
<label for="controlgroup-listen-show" style="margin-top: 5px;" title="Change default check">Cusmot check params</label>
|
||||
<input type="checkbox" id="controlgroup-listen-show" name="default-check" value="1">
|
||||
|
@ -223,7 +239,11 @@
|
|||
<div class="tooltip tooltipTop">IP for bind listner, <b>if empty will be assignet on all IPs</b>. Start typing ip, or press down.<br>If you use <b>VRRP keep in blank</b>. If you assign an IP, the slave will not start</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="advance-show">
|
||||
<td class="addName">Advanced:</td>
|
||||
<td class="addOption"><a href="#" title="Show Advanced settings">Show Advanced settings</a></td>
|
||||
</tr>
|
||||
<tr class="advance">
|
||||
<td class="addName">Mode: </td>
|
||||
<td class="addOption">
|
||||
<select required name="mode" id="frontend-mode-select">
|
||||
|
@ -240,7 +260,7 @@
|
|||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="advance">
|
||||
<td class="addName"><span title="Cache support start 1.8 and latter">Web acceleration(?):</span></td>
|
||||
<td class="addOption">
|
||||
<span class="controlgroup">
|
||||
|
@ -250,7 +270,7 @@
|
|||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="advance">
|
||||
<td class="addName"><span title="Web application firewall">WAF(?):</span></td>
|
||||
<td class="addOption">
|
||||
<span class="controlgroup">
|
||||
|
@ -264,7 +284,7 @@
|
|||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="advance">
|
||||
<td class="addName">Optinons:</td>
|
||||
<td class="addOption">
|
||||
<span class="controlgroup">
|
||||
|
@ -332,7 +352,11 @@
|
|||
<input type="text" name="new_backend" id="new_backend" required title="Name backend" placeholder="web_80" class="form-control">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="advance-show">
|
||||
<td class="addName">Advanced:</td>
|
||||
<td class="addOption"><a href="#" title="Show Advanced settings">Show Advanced settings</a></td>
|
||||
</tr>
|
||||
<tr class="advance">
|
||||
<td class="addName">Mode: </td>
|
||||
<td class="addOption">
|
||||
<select required name="mode" id="backend-mode-select">
|
||||
|
@ -350,7 +374,7 @@
|
|||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="advance">
|
||||
<td class="addName">Balance: </td>
|
||||
<td class="addOption">
|
||||
<select required name="balance">
|
||||
|
@ -362,7 +386,7 @@
|
|||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="advance">
|
||||
<td class="addName"><span title="Cache support start 1.8 and latter">Web acceleration(?):</span></td>
|
||||
<td class="addOption">
|
||||
<span class="controlgroup">
|
||||
|
@ -372,7 +396,7 @@
|
|||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="advance">
|
||||
<td class="addName">Optinons:</td>
|
||||
<td class="addOption">
|
||||
<span class="controlgroup">
|
||||
|
@ -387,8 +411,8 @@
|
|||
</select>
|
||||
<label for="cookie2" title="Enable Redispatch">Set cookie</label><input type="checkbox" id="cookie2" name="cookie" value="1">
|
||||
<label for="options-backend-show" title="Set options manualy">Set options</label><input type="checkbox" id="options-backend-show">
|
||||
<br>
|
||||
</span>
|
||||
<br>
|
||||
<span id="cookie_div2" style="display: none;">
|
||||
<input type="text" placeholder="name" name="cookie_name" id="cookie_name2" class="form-control"><br><br>
|
||||
<input type="text" placeholder="domain" name="cookie_domain" class="form-control"><br><br>
|
||||
|
@ -428,7 +452,19 @@
|
|||
<tr>
|
||||
<td class="addName">Servers:</td>
|
||||
<td class="addOption">
|
||||
<textarea name="servers" title="Backend servers" required cols=80 rows=3 placeholder="hostname ip:port"></textarea>
|
||||
<span id="servers2">
|
||||
<input name="servers" required title="Backend IP" size=14 placeholder="xxx.xxx.xxx.xxx" class="form-control">:
|
||||
<input name="server_port" required title="Backend IP" size=1 placeholder="yyy" class="form-control">
|
||||
<br />
|
||||
<input name="servers" title="Backend port" size=14 placeholder="xxx.xxx.xxx.xxx" class="form-control">:
|
||||
<input name="server_port" title="Backend port" size=1 placeholder="yyy" class="form-control">
|
||||
<br />
|
||||
<input name="servers" title="Backend port" size=14 placeholder="xxx.xxx.xxx.xxx" class="form-control">:
|
||||
<input name="server_port" title="Backend port" size=1 placeholder="yyy" class="form-control">
|
||||
</span>
|
||||
<span>
|
||||
<a class="add-server" id="add-server2" title="Add backend server" style="cursor: pointer;"></a>
|
||||
</span>
|
||||
<div>
|
||||
<label for="controlgroup-backend-show" style="margin-top: 5px;" title="Change default check" >Cusmot check params</label>
|
||||
<input type="checkbox" id="controlgroup-backend-show" name="default-check">
|
||||
|
|
|
@ -102,7 +102,7 @@
|
|||
</ul>
|
||||
</nav>
|
||||
<div class="copyright-menu">
|
||||
HAproxy-WI v3.2
|
||||
HAproxy-WI v3.2.2
|
||||
<br>
|
||||
<a href="https://www.patreon.com/haproxy_wi" title="Donate" target="_blank" style="color: #fff; margin-left: 30px; color: red;" class="patreon"> Patreon</a>
|
||||
</div>
|
||||
|
|
|
@ -158,3 +158,9 @@
|
|||
font-family: "Font Awesome 5 Solid";
|
||||
content: "\f00c";
|
||||
}
|
||||
.add-server::before {
|
||||
display: none;
|
||||
font-family: "Font Awesome 5 Solid";
|
||||
content: "\f067";
|
||||
width:3px;
|
||||
}
|
|
@ -1198,7 +1198,17 @@ $( function() {
|
|||
}
|
||||
} );
|
||||
});
|
||||
|
||||
var add_server_var = '<br /><input name="servers" title="Backend port" size=14 placeholder="xxx.xxx.xxx.xxx" class="form-control">: <input name="server_port" title="Backend port" size=1 placeholder="yyy" class="form-control">'
|
||||
$('#add-server').click(function() {
|
||||
$('#servers').append(add_server_var);
|
||||
});
|
||||
$('#add-server2').click(function() {
|
||||
$('#servers2').append(add_server_var);
|
||||
});
|
||||
$('.advance-show').click(function() {
|
||||
$('.advance-show').fadeOut();
|
||||
$('.advance').fadeIn();
|
||||
});
|
||||
$('#auth').submit(function() {
|
||||
$('.alert-danger').remove();
|
||||
let searchParams = new URLSearchParams(window.location.search)
|
||||
|
@ -1216,18 +1226,18 @@ $( function() {
|
|||
type: "GET",
|
||||
success: function( data ) {
|
||||
if (data.indexOf('ok') != '-1') {
|
||||
$( "#dialog-confirm" ).dialog({
|
||||
resizable: false,
|
||||
height: "auto",
|
||||
width: 400,
|
||||
modal: true,
|
||||
title: "Support the project!",
|
||||
buttons: {
|
||||
"Ok": function() {
|
||||
$( "#dialog-confirm" ).dialog({
|
||||
resizable: false,
|
||||
height: "auto",
|
||||
width: 400,
|
||||
modal: true,
|
||||
title: "Support the project!",
|
||||
buttons: {
|
||||
"Ok": function() {
|
||||
window.location.replace(ref);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
$('.alert-danger').remove();
|
||||
$("#ajax").html(data);
|
||||
|
|
|
@ -247,6 +247,12 @@ pre {
|
|||
border-bottom: 1px solid #ddd;
|
||||
padding: 15px;
|
||||
}
|
||||
.advance {
|
||||
display: none;
|
||||
}
|
||||
.advance-show a{
|
||||
color: #9d9d9d !important;
|
||||
}
|
||||
.addButton {
|
||||
padding-top: 15px;
|
||||
padding-left: 15px;
|
||||
|
|
Loading…
Reference in New Issue