mirror of https://github.com/Aidaho12/haproxy-wi
parent
96bbb90f2f
commit
100d02c305
46
app/add.py
46
app/add.py
|
@ -71,26 +71,30 @@ if form.getvalue('mode') is not None:
|
|||
options_split = ""
|
||||
ssl = ""
|
||||
ssl_check = ""
|
||||
backend = ""
|
||||
|
||||
if form.getvalue('balance') is not None:
|
||||
balance = " balance " + form.getvalue('balance') + "\n"
|
||||
|
||||
if form.getvalue('health_check') is not None:
|
||||
balance += " " + form.getvalue('health_check') + "\n"
|
||||
|
||||
if form.getvalue('ip') is not None:
|
||||
ip = form.getvalue('ip')
|
||||
|
||||
if form.getvalue('listner') is not None:
|
||||
name = "listen " + form.getvalue('listner')
|
||||
backend = ""
|
||||
end_name = form.getvalue('listner')
|
||||
if form.getvalue('listener') is not None:
|
||||
name = "listen " + form.getvalue('listener')
|
||||
end_name = form.getvalue('listener')
|
||||
elif form.getvalue('frontend') is not None:
|
||||
name = "frontend " + form.getvalue('frontend')
|
||||
backend = " default_backend " + form.getvalue('backends') + "\n"
|
||||
end_name = form.getvalue('frontend')
|
||||
elif form.getvalue('new_backend') is not None:
|
||||
name = "backend " + form.getvalue('new_backend')
|
||||
backend = ""
|
||||
end_name = form.getvalue('new_backend')
|
||||
|
||||
if form.getvalue('backends') is not None:
|
||||
backend = " default_backend " + form.getvalue('backends') + "\n"
|
||||
|
||||
if form.getvalue('maxconn'):
|
||||
maxconn = " maxconn " + form.getvalue('maxconn') + "\n"
|
||||
|
||||
|
@ -166,12 +170,36 @@ if form.getvalue('mode') is not None:
|
|||
if form.getvalue('servers') is not None:
|
||||
servers = form.getlist('servers')
|
||||
server_port = form.getlist('server_port')
|
||||
send_proxy = form.getlist('send_proxy')
|
||||
backup = form.getlist('backup')
|
||||
i = 0
|
||||
for server in servers:
|
||||
if form.getvalue('template') is None:
|
||||
servers_split += " server "+server+" " + server +":"+server_port[i]+ check + "\n"
|
||||
try:
|
||||
if send_proxy[i] == '1':
|
||||
send_proxy_param = 'send-proxy'
|
||||
else:
|
||||
servers_split += " server-template "+form.getvalue('prefix')+" "+form.getvalue('template-number')+" "+ server +":"+server_port[i]+ check + "\n"
|
||||
send_proxy_param = ''
|
||||
except:
|
||||
send_proxy_param = ''
|
||||
try:
|
||||
if backup[i] == '1':
|
||||
backup_param = 'backup'
|
||||
else:
|
||||
backup_param = ''
|
||||
except:
|
||||
backup_param = ''
|
||||
servers_split += " server {0} {0}:{1}{2} {3} {4} \n".format(server,
|
||||
server_port[i],
|
||||
check,
|
||||
send_proxy_param,
|
||||
backup_param)
|
||||
else:
|
||||
servers_split += " server-template {0} {1} {2}:{3} {4} \n".format(form.getvalue('prefix'),
|
||||
form.getvalue('template-number'),
|
||||
server,
|
||||
server_port[i],
|
||||
check)
|
||||
i += 1
|
||||
|
||||
compression = form.getvalue("compression")
|
||||
|
@ -239,7 +267,7 @@ try:
|
|||
|
||||
MASTERS = sql.is_master(serv)
|
||||
for master in MASTERS:
|
||||
if master[0] != None:
|
||||
if master[0] is not None:
|
||||
funct.upload_and_restart(master[0], cfg)
|
||||
|
||||
stderr = funct.upload_and_restart(serv, cfg, just_save="save")
|
||||
|
|
|
@ -14,6 +14,7 @@ else:
|
|||
db = "haproxy-wi.db"
|
||||
import sqlite3 as sqltool
|
||||
|
||||
|
||||
def check_db():
|
||||
if mysql_enable == '0':
|
||||
import os
|
||||
|
@ -47,6 +48,7 @@ def check_db():
|
|||
return False
|
||||
con.close()
|
||||
|
||||
|
||||
def get_cur():
|
||||
try:
|
||||
if mysql_enable == '0':
|
||||
|
@ -57,10 +59,11 @@ def get_cur():
|
|||
database=mysql_db)
|
||||
cur = con.cursor()
|
||||
except sqltool.Error as e:
|
||||
funct.logging('DB ', ' '+e, haproxywi=1, login=1)
|
||||
funct.logging('DB ', ' '+str(e), haproxywi=1, login=1)
|
||||
else:
|
||||
return con, cur
|
||||
|
||||
|
||||
def create_table(**kwargs):
|
||||
con, cur = get_cur()
|
||||
if mysql_enable == '0':
|
||||
|
@ -76,7 +79,8 @@ def create_table(**kwargs):
|
|||
activeuser INTEGER NOT NULL DEFAULT 1,
|
||||
PRIMARY KEY(`id`)
|
||||
);
|
||||
INSERT INTO user (username, email, password, role, groups) VALUES ('admin','admin@localhost','21232f297a57a5a743894a0e4a801fc3','admin','1'),
|
||||
INSERT INTO user (username, email, password, role, groups) VALUES
|
||||
('admin','admin@localhost','21232f297a57a5a743894a0e4a801fc3','admin','1'),
|
||||
('editor','editor@localhost','5aee9dbd2a188839105073571bee1b1f','editor','1'),
|
||||
('guest','guest@localhost','084e0343a0486ff05530df6c705c8bb4','guest','1');
|
||||
CREATE TABLE IF NOT EXISTS `servers` (
|
||||
|
@ -624,12 +628,14 @@ def update_db_v_4_4_2_1(**kwargs):
|
|||
print('Updating... go to version 4.4.2')
|
||||
else:
|
||||
print("An error occurred:", e)
|
||||
cur.close()
|
||||
con.close()
|
||||
return False
|
||||
else:
|
||||
print("DB was update to 4.4.2")
|
||||
return True
|
||||
cur.close()
|
||||
con.close()
|
||||
return True
|
||||
|
||||
|
||||
def update_db_v_4_3_2_1(**kwargs):
|
||||
|
@ -724,7 +730,7 @@ def update_db_v_4_5_1(**kwargs):
|
|||
|
||||
def update_ver(**kwargs):
|
||||
con, cur = get_cur()
|
||||
sql = """update version set version = '4.5.1.0'; """
|
||||
sql = """update version set version = '4.5.2.0'; """
|
||||
try:
|
||||
cur.execute(sql)
|
||||
con.commit()
|
||||
|
|
|
@ -1,14 +1,17 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
{% from 'include/input_macros.html' import input, checkbox, select %}
|
||||
<style>
|
||||
.container {
|
||||
margin-right: 0;
|
||||
}
|
||||
h3 {
|
||||
width: 98.8%
|
||||
}
|
||||
</style>
|
||||
{% set balance_params = dict() %}
|
||||
{% set balance_params = {'roundrobin':'roundrobin','source':'source','leastconn':'leastconn','first':'first',
|
||||
'rdp-cookie':'rdp-cookie', 'uri':'uri', 'uri whole':'uri whole', 'static-rr': 'static-rr',
|
||||
'url_param userid':'url_param userid'} %}
|
||||
{% set checks = dict() %}
|
||||
{% set checks = {'':'Choose custom health check','option tcp-check':'Check a TCP Port',
|
||||
'option ssl-hello-chk':'Check an SSL Port','option httpchk':'Check an HTTP service',
|
||||
'option ldap-check':'Check an LDAP service', 'option mysql-check':'Check a MySql Service',
|
||||
'option pgsql-check':'Check a PgSQL Service', 'option redis-check': 'Check a Redis Service',
|
||||
'option smtpchk':'Check an SMTP service'} %}
|
||||
|
||||
<script src="/inc/add.js"></script>
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
|
@ -26,7 +29,7 @@ h3 {
|
|||
<ul id='browse_histroy'></ul>
|
||||
{% include 'include/add_proxy.html' %}
|
||||
<div id="listen">
|
||||
<form name="add-listner" action="/app/add.py" method="post">
|
||||
<form name="add-listener" action="/app/add.py" method="post">
|
||||
<table class="add-table">
|
||||
<caption><h3>Add listen</h3></caption>
|
||||
<tr>
|
||||
|
@ -43,21 +46,18 @@ h3 {
|
|||
<td rowspan="5" class="add-note addName alert-info">
|
||||
A "listen" section defines a complete proxy with its frontend and backend parts combined in one section. It is generally useful for TCP-only traffic.
|
||||
<br /><br />
|
||||
All proxy names must be formed from upper and lower case letters, digits,
|
||||
'-' (dash), '_' (underscore) , '.' (dot) and ':' (colon). ACL names are
|
||||
All proxy names must be formed from upper and lower case letters, digits, '-' (dash), '_' (underscore) , '.' (dot) and ':' (colon). ACL names are
|
||||
case-sensitive, which means that "www" and "WWW" are two different proxies.
|
||||
<br /><br />
|
||||
Historically, all proxy names could overlap, it just caused troubles in the
|
||||
logs. Since the introduction of content switching, it is mandatory that two
|
||||
proxies with overlapping capabilities (frontend/backend) have different names.
|
||||
However, it is still permitted that a frontend and a backend share the same
|
||||
Historically, all proxy names could overlap, it just caused troubles in the logs. Since the introduction of content switching, it is mandatory that two
|
||||
proxies with overlapping capabilities (frontend/backend) have different names. However, it is still permitted that a frontend and a backend share the same
|
||||
name, as this configuration seems to be commonly encountered.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="addName">Name:</td>
|
||||
<td class="addOption">
|
||||
{{ input('name', name='listner', title="Name Listner", placeholder="web_80", required='required') }}
|
||||
{{ input('name', name='listener', title="Name Listener", placeholder="web_80", required='required') }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -98,9 +98,14 @@ h3 {
|
|||
<tr class="advance">
|
||||
<td class="addName">Balance: </td>
|
||||
<td class="addOption">
|
||||
{% set values = dict() %}
|
||||
{% set values = {'roundrobin':'roundrobin','source':'source','leastconn':'leastconn', 'first':'first', 'rdp-cookie':'rdp-cookie'} %}
|
||||
{{ select('balance', values=values, selected='roundrobin', required='required', class='force_close') }}
|
||||
{{ select('balance', values=balance_params, selected='roundrobin', required='required', class='force_close') }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="advance">
|
||||
<td class="addName">Health check: </td>
|
||||
<td class="addOption">
|
||||
{{ select('listener_checks', name='health_check', values=checks, selected='', class='force_close') }}
|
||||
<span id="listener_checks_note" class="tooltip tooltipTop"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="advance">
|
||||
|
@ -117,8 +122,8 @@ h3 {
|
|||
<td class="addName"><span title="Web application firewall">WAF(?):</span></td>
|
||||
<td class="addOption">
|
||||
<span class="controlgroup">
|
||||
{{ checkbox('slow_atack', title='Slow atack protect', desc='Slow atack') }}
|
||||
{{ checkbox('ddos', title='DDOS atack protect', desc='DDOS') }}
|
||||
{{ checkbox('slow_atack', title='Slow attack protect', desc='Slow attack') }}
|
||||
{{ checkbox('ddos', title='DDOS attack protect', desc='DDOS') }}
|
||||
{{ checkbox('blacklist_checkbox', title='Use blacklist', desc='Blacklist') }}
|
||||
{{ checkbox('waf', title='Web application firewall', desc='WAF', value='1') }}
|
||||
{{ checkbox('antibot', title='Antibot Protection', desc='Antibot', value='1') }}
|
||||
|
@ -139,7 +144,7 @@ h3 {
|
|||
{% set values = {'Off':'Off','Server only':'Server only','Force close':'Force close','Pretend keep alive':'Pretend keep alive'} %}
|
||||
{{ select('force_close', values=values, first='Force HTTP close', class='force_close') }}
|
||||
{{ checkbox('cookie', title='Set cookie', desc='Set cookie', value='1') }}
|
||||
{{ checkbox('options-listen-show', title='Set options manualy', desc='Set options') }}
|
||||
{{ checkbox('options-listen-show', title='Set options manually', desc='Set options') }}
|
||||
</span>
|
||||
<br>
|
||||
<span id="cookie_div" style="display: none;">
|
||||
|
@ -208,15 +213,15 @@ h3 {
|
|||
</tr>
|
||||
<tr class="advance-show">
|
||||
<td class="addName">Advanced:</td>
|
||||
<td class="addOption"><span title="Show Advanced settings" style="cursor: pointer">Show Advanced settings</span></td>
|
||||
<td class="addOption"><span title="Show Advanced settings" class="link">Show Advanced settings</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="addButton">
|
||||
<button type="submit" value="submit">Add Listen</button>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Second tabs -->
|
||||
|
@ -239,14 +244,11 @@ h3 {
|
|||
<td rowspan="5" class="add-note addName alert-info">
|
||||
A "frontend" section describes a set of listening sockets accepting client connections.
|
||||
<br /><br />
|
||||
All proxy names must be formed from upper and lower case letters, digits,
|
||||
'-' (dash), '_' (underscore) , '.' (dot) and ':' (colon). ACL names are
|
||||
All proxy names must be formed from upper and lower case letters, digits, '-' (dash), '_' (underscore) , '.' (dot) and ':' (colon). ACL names are
|
||||
case-sensitive, which means that "www" and "WWW" are two different proxies.
|
||||
<br /><br />
|
||||
Historically, all proxy names could overlap, it just caused troubles in the
|
||||
logs. Since the introduction of content switching, it is mandatory that two
|
||||
proxies with overlapping capabilities (frontend/backend) have different names.
|
||||
However, it is still permitted that a frontend and a backend share the same
|
||||
Historically, all proxy names could overlap, it just caused troubles in the logs. Since the introduction of content switching, it is mandatory that two
|
||||
proxies with overlapping capabilities (frontend/backend) have different names. However, it is still permitted that a frontend and a backend share the same
|
||||
name, as this configuration seems to be commonly encountered.
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -304,8 +306,8 @@ h3 {
|
|||
<td class="addName"><span title="Web application firewall">WAF(?):</span></td>
|
||||
<td class="addOption">
|
||||
<span class="controlgroup">
|
||||
{{ checkbox('slow_atack1', title='Slow atack protect', desc='Slow atack') }}
|
||||
{{ checkbox('ddos1', title='DDOS atack protect', desc='DDOS') }}
|
||||
{{ checkbox('slow_atack1', title='Slow attack protect', desc='Slow attack') }}
|
||||
{{ checkbox('ddos1', title='DDOS attack protect', desc='DDOS') }}
|
||||
{{ checkbox('blacklist_checkbox1', title='Use blacklist', desc='Blacklist') }}
|
||||
{{ checkbox('waf2', name='waf', title='Web application firewall', desc='WAF', value='1') }}
|
||||
{{ checkbox('antibot1', title='Antibot Protection', desc='Antibot', value='1') }}
|
||||
|
@ -324,7 +326,7 @@ h3 {
|
|||
{% set values = dict() %}
|
||||
{% set values = {'Off':'Off','Server only':'Server only','Force close':'Force close','Pretend keep alive':'Pretend keep alive'} %}
|
||||
{{ select('force_close', values=values, first='Force HTTP close', class='force_close') }}
|
||||
{{ checkbox('options-frontend-show', title='Set options manualy', desc='Set options') }}
|
||||
{{ checkbox('options-frontend-show', title='Set options manually', desc='Set options') }}
|
||||
</span>
|
||||
<div id="options-frontend-show-div" style="display: none;">
|
||||
<div style="font-size: 12px; padding-bottom: 10px;">
|
||||
|
@ -347,21 +349,20 @@ h3 {
|
|||
<td class="addOption">
|
||||
<div style="font-size: 12px; padding-bottom: 10px;">Start typing backend, or press down</div>
|
||||
{{ input('backends', name='backends', placeholder="some_backend", size='30') }}
|
||||
<span style="font-size: 12px; padding-left: 10px;"> .</span>
|
||||
<p style="font-size: 12px"><b>Note:</b> If backend doesn't exist, you must first <a href="#" style="color: #23527c" title="Create backend" class="redirectBackend">create a new backend</a>.</p>
|
||||
<p style="font-size: 12px"><b>Note:</b> If you want to use a default backend, you must <span title="Create backend" id="redirectBackend" class="link">create a new backend</span> first.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="advance-show">
|
||||
<td class="addName">Advanced:</td>
|
||||
<td class="addOption"><span title="Show Advanced settings" style="cursor: pointer">Show Advanced settings</span></td>
|
||||
<td class="addOption"><span title="Show Advanced settings" class="link">Show Advanced settings</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="addButton">
|
||||
<button type="submit">Add Frontend</button>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Third tabs -->
|
||||
|
@ -384,14 +385,11 @@ h3 {
|
|||
<td rowspan="4" class="add-note addName alert-info">
|
||||
A "backend" section describes a set of servers to which the proxy will connect to forward incoming connections.
|
||||
<br /><br />
|
||||
All proxy names must be formed from upper and lower case letters, digits,
|
||||
'-' (dash), '_' (underscore) , '.' (dot) and ':' (colon). ACL names are
|
||||
All proxy names must be formed from upper and lower case letters, digits, '-' (dash), '_' (underscore) , '.' (dot) and ':' (colon). ACL names are
|
||||
case-sensitive, which means that "www" and "WWW" are two different proxies.
|
||||
<br /><br />
|
||||
Historically, all proxy names could overlap, it just caused troubles in the
|
||||
logs. Since the introduction of content switching, it is mandatory that two
|
||||
proxies with overlapping capabilities (frontend/backend) have different names.
|
||||
However, it is still permitted that a frontend and a backend share the same
|
||||
Historically, all proxy names could overlap, it just caused troubles in the logs. Since the introduction of content switching, it is mandatory that two
|
||||
proxies with overlapping capabilities (frontend/backend) have different names. However, it is still permitted that a frontend and a backend share the same
|
||||
name, as this configuration seems to be commonly encountered.
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -408,20 +406,25 @@ h3 {
|
|||
{% set values = {'http':'http','tcp':'tcp'} %}
|
||||
{{ select('backend-mode-select', name='mode', values=values, selected='http', required='required', class='force_close') }}
|
||||
<span id="https-backend-span">
|
||||
<label for="https-backend" style="margin-top: 5px;">SSL enabled on frontend?</label>
|
||||
<label for="https-backend" style="margin-top: 5px;">Is SSL enabled on frontend?</label>
|
||||
<input type="checkbox" id="https-backend" name="ssl" value="https">
|
||||
</span>
|
||||
<div id="https-hide-backend" style="display: none;">
|
||||
<label for="ssl-check" style="margin-top: 5px;">Disable SSL verify on servers?</label><input type="checkbox" id="ssl-check" name="ssl-check" value="ssl-check" checked>
|
||||
<label for="ssl-check" style="margin-top: 5px;">Disable SSL verify on servers</label><input type="checkbox" id="ssl-check" name="ssl-check" value="ssl-check" checked>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="advance">
|
||||
<td class="addName">Balance: </td>
|
||||
<td class="addOption">
|
||||
{% set values = dict() %}
|
||||
{% set values = {'roundrobin':'roundrobin','source':'source','leastconn':'leastconn', 'first':'first', 'rdp-cookie':'rdp-cookie'} %}
|
||||
{{ select('balance', values=values, selected='roundrobin', required='required', class='force_close') }}
|
||||
{{ select('balance', values=balance_params, selected='roundrobin', required='required', class='force_close') }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="advance">
|
||||
<td class="addName">Health check: </td>
|
||||
<td class="addOption">
|
||||
{{ select('backend_checks', name='health_check', values=checks, selected='', class='force_close') }}
|
||||
<span id="backend_checks_note" class="tooltip tooltipTop"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="advance">
|
||||
|
@ -444,7 +447,7 @@ h3 {
|
|||
{% set values = {'Off':'Off','Server only':'Server only','Force close':'Force close','Pretend keep alive':'Pretend keep alive'} %}
|
||||
{{ select('force_close', values=values, first='Force HTTP close', class='force_close') }}
|
||||
{{ checkbox('cookie2', title='Set cookie', desc='Set cookie', value='1') }}
|
||||
{{ checkbox('options-backend-show', title='Set options manualy', desc='Set options') }}
|
||||
{{ checkbox('options-backend-show', title='Set options manually', desc='Set options') }}
|
||||
</span>
|
||||
<br>
|
||||
<span id="cookie_div2" style="display: none;">
|
||||
|
@ -513,15 +516,15 @@ h3 {
|
|||
</tr>
|
||||
<tr class="advance-show">
|
||||
<td class="addName">Advanced:</td>
|
||||
<td class="addOption"><span title="Show Advanced settings" style="cursor: pointer">Show Advanced settings</span></td>
|
||||
<td class="addOption"><span title="Show Advanced settings" class="link">Show Advanced settings</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="addButton">
|
||||
<button type="submit" value="" name="" class="btn btn-default">Add Backend</button>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="ssl">
|
||||
|
@ -726,7 +729,7 @@ h3 {
|
|||
<tr>
|
||||
<td class="addName">Select server: </td>
|
||||
<td class="addOption">
|
||||
<select required name="serv" id="serv3">
|
||||
<select required name="serv" id="userlist_serv">
|
||||
<option disabled selected>Choose server</option>
|
||||
{% for select in selects %}
|
||||
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
||||
|
@ -873,5 +876,23 @@ $( function() {
|
|||
});
|
||||
}
|
||||
});
|
||||
function makeid(length) {
|
||||
var result = '';
|
||||
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
var charactersLength = characters.length;
|
||||
for ( var i = 0; i < length; i++ ) {
|
||||
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
var serv_ports = $('.send_proxy');
|
||||
console.log(serv_ports)
|
||||
|
||||
for (var i = 0; i <= serv_ports.length; i++) {
|
||||
var uniqId = makeid(3);
|
||||
$(serv_ports[i]).append('<label for="' + uniqId + '" class="send_proxy_label" title="Set send-proxy for this server">send-proxy</label><input type="checkbox" name="send_proxy" value="1" id="' + uniqId + '">');
|
||||
var uniqId = makeid(3);
|
||||
$(serv_ports[i]).append('<label for="' + uniqId + '" class="send_proxy_label" title="Set this server as backup server">backup</label><input type="checkbox" name="backup" value="1" id="' + uniqId + '">');
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,14 +1,22 @@
|
|||
<style>
|
||||
.send_proxy_label {
|
||||
padding: 3px !important;
|
||||
}
|
||||
</style>
|
||||
<span name="add_servers">
|
||||
<input name="prefix" class="prefix form-control" title="servers prefix" size="3" placeholder="web" style="display: none;">
|
||||
<input name="template-number" class="prefix form-control" title="servers num" value="3" type="number" style="width: 35px; display: none;">
|
||||
<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">
|
||||
<input name="server_port" required title="Backend IP" size=3 placeholder="yyy" class="form-control">
|
||||
<span class="send_proxy"></span>
|
||||
<br />
|
||||
<input name="servers" title="Backend port" size=14 placeholder="xxx.xxx.xxx.xxx" class="form-control second-server"><span class="second-server">:</span>
|
||||
<input name="server_port" title="Backend port" size=1 placeholder="yyy" class="form-control second-server">
|
||||
<input name="server_port" title="Backend port" size=3 placeholder="yyy" class="form-control second-server">
|
||||
<span class="send_proxy"></span>
|
||||
<br />
|
||||
<input name="servers" title="Backend port" size=14 placeholder="xxx.xxx.xxx.xxx" class="form-control second-server"><span class="second-server">:</span>
|
||||
<input name="server_port" title="Backend port" size=1 placeholder="yyy" class="form-control second-server">
|
||||
<input name="server_port" title="Backend port" size=3 placeholder="yyy" class="form-control second-server">
|
||||
<span class="send_proxy"></span>
|
||||
</span>
|
||||
<span>
|
||||
<a class="add-server" name="add-server-input" title="Add backend server" style="cursor: pointer;"></a>
|
||||
|
|
77
inc/add.js
77
inc/add.js
|
@ -886,7 +886,7 @@ $( function() {
|
|||
toastr.error('Wrong e-mail format');
|
||||
}
|
||||
});
|
||||
var add_server_var = '<br /><input name="servers" title="Backend IP" size=14 placeholder="xxx.xxx.xxx.xxx" class="form-control">: <input name="server_port" title="Backend port" size=1 placeholder="yyy" class="form-control">'
|
||||
var add_server_var = '<br /><input name="servers" title="Backend IP" size=14 placeholder="xxx.xxx.xxx.xxx" class="form-control">: <input name="server_port" title="Backend port" size=3 placeholder="yyy" class="form-control">'
|
||||
$('[name=add-server-input]').click(function() {
|
||||
$("[name=add_servers]").append(add_server_var);
|
||||
});
|
||||
|
@ -933,9 +933,10 @@ $( function() {
|
|||
resetProxySettings()
|
||||
$( "#tabs" ).tabs( "option", "active", 2 );
|
||||
} );
|
||||
$( ".redirectBackend" ).on( "click", function() {
|
||||
$( "#redirectBackend" ).on( "click", function() {
|
||||
resetProxySettings()
|
||||
$( "#tabs" ).tabs( "option", "active", 3 );
|
||||
history.pushState('Add backend', 'Add backend', 'add.py#backend')
|
||||
} );
|
||||
$( ".redirectSsl" ).on( "click", function() {
|
||||
$( "#tabs" ).tabs( "option", "active", 4 );
|
||||
|
@ -986,6 +987,78 @@ $( function() {
|
|||
resetProxySettings();
|
||||
createHttps(3, 'backend');
|
||||
});
|
||||
var tcp_note = 'The check is valid when the server answers with a <b>SYN/ACK</b> packet'
|
||||
var ssl_note = 'The check is valid if the server answers with a valid SSL server <b>hello</b> message'
|
||||
var httpchk_note = 'The check is valid if the server answers with a status code of <b>2xx</b> or <b>3xx</b>'
|
||||
var ldap_note = 'The check is valid if the server response contains a successful <b>resultCode</b>.\n' +
|
||||
'<p>You must configure the LDAP servers according to this check to allow anonymous binding. ' +
|
||||
'You can do this with an IP alias on the server side that allows only HAProxy IP addresses to bind to it.</p>'
|
||||
var mysql_note = 'The check is valid if the server response contains a successful <b>Authentication</b> request'
|
||||
var pgsql_note = 'The check is valid if the server response contains a successful <b>Authentication</b> request'
|
||||
var redis_note = 'The check is valid if the server response contains the string <b>+PONG</b>'
|
||||
var smtpchk_note = 'The check is valid if the server response code starts with <b>\'2\'</b>'
|
||||
$( "#listener_checks" ).on('selectmenuchange',function() {
|
||||
if ($( "#listener_checks option:selected" ).val() == "option tcp-check") {
|
||||
$("#listener_checks_note").html(tcp_note)
|
||||
}
|
||||
if ($( "#listener_checks option:selected" ).val() == "option ssl-hello-chk") {
|
||||
$("#listener_checks_note").html(ssl_note)
|
||||
}
|
||||
if ($( "#listener_checks option:selected" ).val() == "option httpchk") {
|
||||
$("#listener_checks_note").html(httpchk_note)
|
||||
}
|
||||
if ($( "#listener_checks option:selected" ).val() == "option ldap-check") {
|
||||
$("#listener_checks_note").html(ldap_note)
|
||||
}
|
||||
if ($( "#listener_checks option:selected" ).val() == "option mysql-check") {
|
||||
$("#listener_checks_note").html(mysql_note)
|
||||
}
|
||||
if ($( "#listener_checks option:selected" ).val() == "option pgsql-check") {
|
||||
$("#listener_checks_note").html(pgsql_note)
|
||||
}
|
||||
if ($( "#listener_checks option:selected" ).val() == "option redis-check") {
|
||||
$("#listener_checks_note").html(redis_note)
|
||||
}
|
||||
if ($( "#listener_checks option:selected" ).val() == "option smtpchk") {
|
||||
$("#listener_checks_note").html(smtpchk_note)
|
||||
}
|
||||
if ($( "#listener_checks option:selected" ).val() == "") {
|
||||
$("#listener_checks_note").html('')
|
||||
}
|
||||
});
|
||||
$( "#backend_checks" ).on('selectmenuchange',function() {
|
||||
|
||||
if ($( "#backend_checks option:selected" ).val() == "") {
|
||||
$("#backend_checks_note").html('')
|
||||
}
|
||||
if ($( "#backend_checks option:selected" ).val() == "option tcp-check") {
|
||||
$("#backend_checks_note").html(tcp_note)
|
||||
}
|
||||
if ($( "#backend_checks option:selected" ).val() == "option ssl-hello-chk") {
|
||||
$("#backend_checks_note").html(ssl_note)
|
||||
}
|
||||
if ($( "#backend_checks option:selected" ).val() == "option httpchk") {
|
||||
$("#backend_checks_note").html(httpchk_note)
|
||||
}
|
||||
if ($( "#backend_checks option:selected" ).val() == "option ldap-check") {
|
||||
$("#backend_checks_note").html(ldap_note)
|
||||
}
|
||||
if ($( "#backend_checks option:selected" ).val() == "option mysql-check") {
|
||||
$("#backend_checks_note").html(mysql_note)
|
||||
}
|
||||
if ($( "#backend_checks option:selected" ).val() == "option pgsql-check") {
|
||||
$("#backend_checks_note").html(pgsql_note)
|
||||
}
|
||||
if ($( "#backend_checks option:selected" ).val() == "option redis-check") {
|
||||
$("#backend_checks_note").html(redis_note)
|
||||
}
|
||||
if ($( "#backend_checks option:selected" ).val() == "option smtpchk") {
|
||||
$("#backend_checks_note").html(smtpchk_note)
|
||||
}
|
||||
if ($( "#backend_checks option:selected" ).val() == "") {
|
||||
$("#backend_checks_note").html('')
|
||||
}
|
||||
});
|
||||
});
|
||||
function resetProxySettings() {
|
||||
$('[name=port]').val('');
|
||||
|
|
|
@ -15,15 +15,14 @@ body {
|
|||
h2 {
|
||||
background: #5D9CEB;
|
||||
border: 1px solid #5D9CEB;
|
||||
padding: 3px;
|
||||
padding-left: 2%;
|
||||
padding: 3px 3px 3px 2%;
|
||||
color: #fff;
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
h3 {
|
||||
margin-top: -0;
|
||||
margin-bottom: 0px;
|
||||
margin-bottom: 0;
|
||||
background: #d1ecf1;
|
||||
padding: 0.3em;
|
||||
font-size: 1.6em;
|
||||
|
@ -74,7 +73,7 @@ pre {
|
|||
cursor: pointer;
|
||||
}
|
||||
.icon-hapservs {
|
||||
margin-bottom: 0px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.top-menu {
|
||||
position: absolute;
|
||||
|
@ -133,8 +132,7 @@ pre {
|
|||
}
|
||||
#version {
|
||||
float: left;
|
||||
padding: 20px;
|
||||
padding-top: 10px;
|
||||
padding: 10px 20px 20px;
|
||||
font-size: 14.5px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
@ -153,11 +151,9 @@ pre {
|
|||
margin-right: 20px;
|
||||
}
|
||||
.footer-link, .footer-copyright {
|
||||
padding: 20px;
|
||||
color: #5d9ceb;
|
||||
font-size: 0.9em;
|
||||
padding-top: 12px;
|
||||
padding-right: 5px;
|
||||
padding: 12px 5px 20px 20px;
|
||||
}
|
||||
.footer-copyright {
|
||||
color: #586069 ;
|
||||
|
@ -204,7 +200,7 @@ pre {
|
|||
}
|
||||
.auto-refresh-interval {
|
||||
float: right;
|
||||
padding: 0px 15px;
|
||||
padding: 0 15px;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 10px;
|
||||
margin-left: 60%;
|
||||
|
@ -217,8 +213,7 @@ pre {
|
|||
}
|
||||
.auto-refresh-ul ul li {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
padding-left: 15px;
|
||||
padding: 0 0 0 15px;
|
||||
border: 0;
|
||||
font-family: inherit;
|
||||
vertical-align: baseline;
|
||||
|
@ -230,7 +225,7 @@ pre {
|
|||
position: fixed;
|
||||
color: #000;
|
||||
font-size: 12px;
|
||||
height: 15;
|
||||
height: 15px;
|
||||
}
|
||||
.auto-refresh-reload-icon {
|
||||
margin-top: 3px;
|
||||
|
@ -277,27 +272,14 @@ pre {
|
|||
.paramInSec {
|
||||
font-weight: bold;
|
||||
}
|
||||
/*.donate-menu {
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
font-size: 15px;
|
||||
color: #fff;
|
||||
margin-left: 30px;
|
||||
position: fixed;
|
||||
margin-left: 65px;
|
||||
margin-top: 15px;
|
||||
}*/
|
||||
.line {
|
||||
background-color: #f3f8fb;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
.line, .line3 {
|
||||
padding-top:5px;
|
||||
padding-bottom: 5px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
padding: 5px 10px;
|
||||
}
|
||||
.line:hover, {
|
||||
.line:hover {
|
||||
background-color: #f6f8fa;
|
||||
}
|
||||
.line3:hover {
|
||||
|
@ -365,8 +347,7 @@ pre {
|
|||
max-width: 50%;
|
||||
min-height: 160px;
|
||||
float: left;
|
||||
margin: 20px;
|
||||
margin-top: 0;
|
||||
margin: 0 20px 20px;
|
||||
}
|
||||
.overviewHead {
|
||||
border-radius: 5px;
|
||||
|
@ -422,9 +403,7 @@ pre {
|
|||
background-color: #5CB85C;
|
||||
border-radius: 5px;
|
||||
color: #fff;
|
||||
padding: 5px;
|
||||
padding-right: 10px;
|
||||
padding-left: 10px;
|
||||
padding: 5px 10px;
|
||||
float: right;
|
||||
margin-right: 1px;
|
||||
cursor: pointer;
|
||||
|
@ -445,8 +424,7 @@ pre {
|
|||
background-color: red;
|
||||
}
|
||||
.padding10 {
|
||||
padding: 10px;
|
||||
padding-left: 0px;
|
||||
padding: 10px 10px 10px 0;
|
||||
border: none;
|
||||
width: 15%;
|
||||
}
|
||||
|
@ -510,7 +488,6 @@ ul{
|
|||
background: #48505A;
|
||||
padding: 10px 0 10px 20px;
|
||||
color: #fff;
|
||||
border-left-color: #5D9CEB;
|
||||
border-left: 4px solid #5D9CEB;
|
||||
}
|
||||
.menu li:first-child a, .menu li .v_menu li:first-child a{
|
||||
|
@ -557,12 +534,12 @@ ul{
|
|||
margin-left: 20px;
|
||||
}
|
||||
@keyframes shadow {
|
||||
from {box-shadow: 0px 0px 0px red inset;}
|
||||
from {box-shadow: 0 0 0 red inset;}
|
||||
50% {text-shadow: 0 0 30px black;}
|
||||
to {box-shadow: 0 -5px 5px -5px rgb(38, 137, 60) inset}
|
||||
}
|
||||
@keyframes shadow-red {
|
||||
from {box-shadow: 0px 0px 0px red inset;}
|
||||
from {box-shadow: 0 0 0 red inset;}
|
||||
50% {text-shadow: 0 0 30px black;}
|
||||
to {box-shadow: 0 -5px 5px -5px #5D9CEB inset}
|
||||
}
|
||||
|
@ -597,8 +574,7 @@ ul{
|
|||
}
|
||||
.ui-state-active {
|
||||
background-color: #4A89D8 !important;
|
||||
border: none !important;
|
||||
border-color: #5D9CEB !important;
|
||||
border: none #5D9CEB !important;
|
||||
}
|
||||
.ui-tabs-nav {
|
||||
border-radius: 0 !important;
|
||||
|
@ -648,14 +624,15 @@ a {
|
|||
}
|
||||
a:hover, a:focus {
|
||||
color: #23527c;
|
||||
text-decoration: derline;
|
||||
text-decoration: underline;
|
||||
}
|
||||
a:focus {
|
||||
outline: 5px auto -webkit-focus-ring-color;
|
||||
outline-offset: -2px;
|
||||
}
|
||||
.logs_link, .accordion-link {
|
||||
.logs_link, .accordion-link, .link {
|
||||
color: #23527c !important;
|
||||
cursor: pointer;
|
||||
}
|
||||
table {
|
||||
border-spacing: 0;
|
||||
|
@ -729,8 +706,7 @@ td,th {
|
|||
}
|
||||
.validateTips {
|
||||
width: 540px;
|
||||
margin: 0;
|
||||
margin-bottom: 10px;
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
#errorMess {
|
||||
float: right;
|
||||
|
@ -761,14 +737,8 @@ label {
|
|||
border: 1px solid #A4C7F5;
|
||||
height: 165px;
|
||||
width: 375px;
|
||||
padding: 20px;
|
||||
padding-top: 10px;
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
margin: 20px;
|
||||
margin-right: 5px;
|
||||
margin-bottom: 20px ;
|
||||
margin-top: 0px;
|
||||
padding: 10px 15px 20px;
|
||||
margin: 0 5px 20px 20px;
|
||||
display: block;
|
||||
float: left;
|
||||
}
|
||||
|
@ -814,19 +784,11 @@ label {
|
|||
float: left;
|
||||
}
|
||||
.ajax-server {
|
||||
margin: 25px;
|
||||
margin-left: 757px;
|
||||
margin-bottom: 0;
|
||||
margin: 25px 25px 0 757px;
|
||||
width: 778px;
|
||||
display: none;
|
||||
margin-top: px;
|
||||
margin-bottom: 0px;
|
||||
margin-top: 0px;
|
||||
height: 185px;
|
||||
padding-bottom: 0px;
|
||||
padding-top: 10px;
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
padding: 10px 15px 0;
|
||||
}
|
||||
.haproxy-info {
|
||||
display: inline-block;
|
||||
|
@ -890,10 +852,7 @@ label {
|
|||
}
|
||||
.group_name {
|
||||
font-size: 18px;
|
||||
padding: 20px;
|
||||
padding-left:15px;
|
||||
padding-bottom: 0px;
|
||||
padding-top: 10px;
|
||||
padding: 10px 20px 0 15px;
|
||||
}
|
||||
.smon_services {
|
||||
width: 192px;
|
||||
|
@ -1148,11 +1107,9 @@ label {
|
|||
}
|
||||
#stats_filter_text {
|
||||
float: left;
|
||||
padding: 5px;
|
||||
font-size: 20px;
|
||||
padding-top: 0;
|
||||
margin-top: -2px;
|
||||
padding-right: 10px;
|
||||
padding: 0 10px 5px 5px;
|
||||
}
|
||||
.stats_active, .stats_drain, .stats_maintain, .stats_down, .stats_not_checked, .stats_backup, .stats_frontends, .stats_backends {
|
||||
color: #000 ;
|
||||
|
|
Loading…
Reference in New Issue