mirror of https://github.com/Aidaho12/haproxy-wi
parent
650b22e55c
commit
4eec98d284
|
@ -19,6 +19,7 @@ try:
|
|||
servers = sql.get_dick_permit(virt=1)
|
||||
token = sql.get_token(user_id.value)
|
||||
servbackend = form.getvalue('servbackend')
|
||||
serv = form.getvalue('serv')
|
||||
if servbackend is None:
|
||||
servbackend = ""
|
||||
except:
|
||||
|
|
|
@ -253,6 +253,9 @@ def show_config(cfg):
|
|||
if not line.find("backend"):
|
||||
print('</div><span class="param">' + line + '</span><div>')
|
||||
continue
|
||||
if not line.find("cache"):
|
||||
print('</div><span class="param">' + line + '</span><div>')
|
||||
continue
|
||||
if "acl" in line or "option" in line or "server" in line:
|
||||
if "timeout" not in line and "default-server" not in line and "#use_backend" not in line:
|
||||
print('<span class="paramInSec"><span class="numRow">')
|
||||
|
|
|
@ -681,7 +681,7 @@ def select_metrics(serv, **kwargs):
|
|||
|
||||
def select_servers_metrics_for_master():
|
||||
con, cur = create_db.get_cur()
|
||||
sql = """select ip from servers where enable = 1 """
|
||||
sql = """select ip from servers where metrics = 1 """
|
||||
try:
|
||||
cur.execute(sql)
|
||||
except sqltool.Error as e:
|
||||
|
|
|
@ -73,25 +73,34 @@
|
|||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="addName">Web acceleration: </td>
|
||||
<td class="addName"><span title="Cache support start 1.8 and latter">Web acceleration(?):</span></td>
|
||||
<td class="addOption">
|
||||
<select name="acceleration" id="acceleration">
|
||||
<option value="0" selected>Off</option>
|
||||
<option value="1">Compression</option>
|
||||
<option value="2">Cache</option>
|
||||
<option value="3">Compression + Cache</option>
|
||||
</select>
|
||||
<span class="controlgroup">
|
||||
<select name="acceleration" id="acceleration">
|
||||
<option value="0" selected>Off</option>
|
||||
<option value="1">Compression</option>
|
||||
<option value="2">Cache</option>
|
||||
<option value="3">Compression + Cache</option>
|
||||
</select>
|
||||
<label for="ssl_offloading" title="Enable SSL Offloading">SSL Offloading</label><input type="checkbox" id="ssl_offloading">
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="addName"><span title="Web application firewall">WAF(?):</span></td>
|
||||
<td class="addOption">
|
||||
<span class="controlgroup">
|
||||
<label for="slow_atack" title="Slow atack protect">Slow atack</label><input type="checkbox" id="slow_atack">
|
||||
<label for="ddos" title="DDOS atack protect">DDOS</label><input type="checkbox" id="ddos">
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="addName">Optinons:</td>
|
||||
<td class="addOption">
|
||||
<span class="controlgroup">
|
||||
<label for="ssl_offloading" title="Enable SSL Offloading">SSL Offloading</label><input type="checkbox" id="ssl_offloading">
|
||||
<span class="controlgroup">
|
||||
<label for="forward_for" title="Option Forward for if none">Forward for</label><input type="checkbox" id="forward_for">
|
||||
<label for="redispatch" title="Enable Redispatch">Redispatch</label><input type="checkbox" id="redispatch">
|
||||
<label for="slow_atack" title="Slow atack protect">Slow atack</label><input type="checkbox" id="slow_atack">
|
||||
<label for="ddos" title="DDOS atack protect">DDOS</label><input type="checkbox" id="ddos">
|
||||
<label for="redispatch" title="Enable Redispatch">Redispatch</label><input type="checkbox" id="redispatch">
|
||||
<select name="force_close" class="force_close">
|
||||
<option disabled selected>Force HTTP close</option>
|
||||
<option>Off</option>
|
||||
|
@ -230,24 +239,33 @@
|
|||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="addName">Web acceleration: </td>
|
||||
<td class="addName"><span title="Cache support start 1.8 and latter">Web acceleration(?):</span></td>
|
||||
<td class="addOption">
|
||||
<select name="acceleration" id="acceleration2">
|
||||
<option value="0" selected>Off</option>
|
||||
<option value="1">Compression</option>
|
||||
<option value="2">Cache</option>
|
||||
<option value="3">Compression + Cache</option>
|
||||
</select>
|
||||
<span class="controlgroup">
|
||||
<select name="acceleration" id="acceleration2">
|
||||
<option value="0" selected>Off</option>
|
||||
<option value="1">Compression</option>
|
||||
<option value="2">Cache</option>
|
||||
<option value="3">Compression + Cache</option>
|
||||
</select>
|
||||
<label for="ssl_offloading1" title="Enable SSL Offloading">SSL Offloading</label><input type="checkbox" id="ssl_offloading1">
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="addName"><span title="Web application firewall">WAF(?):</span></td>
|
||||
<td class="addOption">
|
||||
<span class="controlgroup">
|
||||
<label for="slow_atack1" title="Slow atack protect">Slow atack</label><input type="checkbox" id="slow_atack1">
|
||||
<label for="ddos1" title="DDOS atack protect">DDOS</label><input type="checkbox" id="ddos1">
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="addName">Optinons:</td>
|
||||
<td class="addOption">
|
||||
<span class="controlgroup">
|
||||
<label for="ssl_offloading1" title="Enable SSL Offloading">SSL Offloading</label><input type="checkbox" id="ssl_offloading1">
|
||||
<label for="forward_for1" title="Option Forward for if none">Forward for</label><input type="checkbox" id="forward_for1">
|
||||
<label for="slow_atack1" title="Slow atack protect">Slow atack</label><input type="checkbox" id="slow_atack1">
|
||||
<label for="ddos1" title="DDOS atack protect">DDOS</label><input type="checkbox" id="ddos1">
|
||||
<label for="forward_for1" title="Option Forward for if none">Forward for</label><input type="checkbox" id="forward_for1">
|
||||
<select name="force_close" class="force_close">
|
||||
<option disabled selected>Force HTTP close</option>
|
||||
<option>Off</option>
|
||||
|
@ -344,22 +362,31 @@
|
|||
<tr>
|
||||
<td class="addName"><span title="Cache support start 1.8 and latter">Web acceleration(?):</span></td>
|
||||
<td class="addOption">
|
||||
<select name="acceleration" id="acceleration3">
|
||||
<option value="0" selected>Off</option>
|
||||
<option value="1">Compression</option>
|
||||
<option value="2">Cache</option>
|
||||
<option value="3">Compression + Cache</option>
|
||||
</select>
|
||||
<span class="controlgroup">
|
||||
<select name="acceleration" id="acceleration3">
|
||||
<option value="0" selected>Off</option>
|
||||
<option value="1">Compression</option>
|
||||
<option value="2">Cache</option>
|
||||
<option value="3">Compression + Cache</option>
|
||||
</select>
|
||||
<label for="ssl_offloading2" title="Enable SSL Offloading">SSL Offloading</label><input type="checkbox" id="ssl_offloading2">
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="addName"><span title="Web application firewall">WAF(?):</span></td>
|
||||
<td class="addOption">
|
||||
<span class="controlgroup">
|
||||
<label for="ddos2" title="DDOS atack protect">DDOS</label><input type="checkbox" id="ddos2">
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="addName">Optinons:</td>
|
||||
<td class="addOption">
|
||||
<span class="controlgroup">
|
||||
<label for="ssl_offloading2" title="Enable SSL Offloading">SSL Offloading</label><input type="checkbox" id="ssl_offloading2">
|
||||
<span class="controlgroup">
|
||||
<label for="forward_for2" title="Option Forward for if none">Forward for</label><input type="checkbox" id="forward_for2">
|
||||
<label for="redispatch2" title="Enable Redispatch">Redispatch</label><input type="checkbox" id="redispatch2">
|
||||
<label for="ddos2" title="DDOS atack protect">DDOS</label><input type="checkbox" id="ddos2">
|
||||
<label for="redispatch2" title="Enable Redispatch">Redispatch</label><input type="checkbox" id="redispatch2">
|
||||
<select name="force_close" class="force_close">
|
||||
<option disabled selected>Force HTTP close</option>
|
||||
<option>Off</option>
|
||||
|
@ -509,7 +536,7 @@
|
|||
{% endif %}
|
||||
|
||||
<div id="dialog-confirm" title="View certificate " style="display: none;">
|
||||
<p id="dialog-confirm-body"></span></p>
|
||||
<center><pre id="dialog-confirm-body"></pre></center>
|
||||
</div>
|
||||
<script>
|
||||
$( ".force_close" ).selectmenu({
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre style="font-size: 12px; padding-left: 0px;">
|
||||
<pre style="font-size: 12px; padding-left: 0px; margin-top: -20px;">
|
||||
{{ service.3 }}
|
||||
</pre>
|
||||
</td>
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
<select autofocus required id="{{ select_id }}" name="{{ select_id }}">
|
||||
<option disabled>Choose server</option>
|
||||
{% for select in selects %}
|
||||
[% if serv == select.2 %]
|
||||
<option value="{{ select.2 }}" selected>{{ select.1 }}</option>
|
||||
{% else %}
|
||||
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
|
|
@ -939,23 +939,27 @@ $( function() {
|
|||
replace_text("#optionsInput2", ddos_var);
|
||||
}
|
||||
});
|
||||
$("#acceleration").selectmenu( "disable" );
|
||||
$( "#serv" ).on('selectmenuchange',function() {
|
||||
$("#acceleration").selectmenu( "enable" );
|
||||
change_select_acceleration("");
|
||||
});
|
||||
|
||||
$("#acceleration2").selectmenu( "disable" );
|
||||
$( "#serv2" ).on('selectmenuchange',function() {
|
||||
$("#acceleration2").selectmenu( "enable" );
|
||||
change_select_acceleration(2);
|
||||
});
|
||||
cur_url = cur_url[0].split('#');
|
||||
console.log(cur_url[0])
|
||||
if (cur_url[0] == "/app/add.py") {
|
||||
$("#acceleration").selectmenu( "disable" );
|
||||
$( "#serv" ).on('selectmenuchange',function() {
|
||||
$("#acceleration").selectmenu( "enable" );
|
||||
change_select_acceleration("");
|
||||
});
|
||||
|
||||
$("#acceleration3").selectmenu( "disable" );
|
||||
$( "#serv3" ).on('selectmenuchange',function() {
|
||||
$("#acceleration3").selectmenu( "enable" );
|
||||
change_select_acceleration("3");
|
||||
});
|
||||
$("#acceleration2").selectmenu( "disable" );
|
||||
$( "#serv2" ).on('selectmenuchange',function() {
|
||||
$("#acceleration2").selectmenu( "enable" );
|
||||
change_select_acceleration(2);
|
||||
});
|
||||
|
||||
$("#acceleration3").selectmenu( "disable" );
|
||||
$( "#serv3" ).on('selectmenuchange',function() {
|
||||
$("#acceleration3").selectmenu( "enable" );
|
||||
change_select_acceleration("3");
|
||||
});
|
||||
}
|
||||
$( "#path-cert-listen" ).autocomplete({
|
||||
source: function( request, response ) {
|
||||
$.ajax( {
|
||||
|
|
|
@ -13,7 +13,7 @@ body {
|
|||
h2 {
|
||||
background: #5D9CEB;
|
||||
border: 1px solid #5D9CEB;
|
||||
padding: 5px;
|
||||
padding: 3px;
|
||||
padding-left: 2%;
|
||||
color: #fff;
|
||||
margin-top: 0px;
|
||||
|
@ -59,7 +59,7 @@ pre {
|
|||
font-size: 25px;
|
||||
font-style: italic;
|
||||
font-weight: bold;
|
||||
height: 37px;
|
||||
height: 32px;
|
||||
background-color: #f4ab76;
|
||||
padding-left: 20px;
|
||||
padding-top: 2px;
|
||||
|
|
Loading…
Reference in New Issue