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