mirror of https://github.com/Aidaho12/haproxy-wi
parent
16cc10d862
commit
73d4c61bb3
73
app/add.py
73
app/add.py
|
@ -8,6 +8,7 @@ from jinja2 import Environment, FileSystemLoader
|
||||||
env = Environment(loader=FileSystemLoader('templates/'))
|
env = Environment(loader=FileSystemLoader('templates/'))
|
||||||
template = env.get_template('add.html')
|
template = env.get_template('add.html')
|
||||||
form = cgi.FieldStorage()
|
form = cgi.FieldStorage()
|
||||||
|
serv = form.getvalue('serv')
|
||||||
|
|
||||||
if form.getvalue('add'):
|
if form.getvalue('add'):
|
||||||
c = http.cookies.SimpleCookie(os.environ.get("HTTP_COOKIE"))
|
c = http.cookies.SimpleCookie(os.environ.get("HTTP_COOKIE"))
|
||||||
|
@ -43,10 +44,8 @@ template = template.render(title = "Add",
|
||||||
print(template)
|
print(template)
|
||||||
|
|
||||||
if form.getvalue('mode') is not None:
|
if form.getvalue('mode') is not None:
|
||||||
hap_configs_dir = funct.get_config_var('configs', 'haproxy_save_configs_dir')
|
|
||||||
cert_path = sql.get_setting('cert_path')
|
cert_path = sql.get_setting('cert_path')
|
||||||
haproxy_dir = sql.get_setting('haproxy_dir')
|
haproxy_dir = sql.get_setting('haproxy_dir')
|
||||||
serv = form.getvalue('serv')
|
|
||||||
port = form.getvalue('port')
|
port = form.getvalue('port')
|
||||||
bind = ""
|
bind = ""
|
||||||
ip = ""
|
ip = ""
|
||||||
|
@ -177,29 +176,61 @@ if form.getvalue('mode') is not None:
|
||||||
waf += " http-request deny if { var(txn.modsec.code) -m int gt 0 }\n"
|
waf += " http-request deny if { var(txn.modsec.code) -m int gt 0 }\n"
|
||||||
|
|
||||||
config_add = "\n" + name + "\n" + bind + mode + maxconn + balance + options_split + filter + compression_s + cache_s + waf + backend + servers_split + "\n" + cache_set
|
config_add = "\n" + name + "\n" + bind + mode + maxconn + balance + options_split + filter + compression_s + cache_s + waf + backend + servers_split + "\n" + cache_set
|
||||||
cfg = hap_configs_dir + serv + "-" + funct.get_data('config') + ".cfg"
|
|
||||||
|
|
||||||
funct.get_config(serv, cfg)
|
if form.getvalue('new_userlist') is not None:
|
||||||
try:
|
name = "userlist "+form.getvalue('new_userlist')+ "\n"
|
||||||
with open(cfg, "a") as conf:
|
|
||||||
conf.write(config_add)
|
|
||||||
except IOError:
|
|
||||||
print("Can't read import config file")
|
|
||||||
|
|
||||||
funct.logging(serv, "add.py add new %s" % name)
|
new_userlist_groups = ""
|
||||||
print('<div class="line3">')
|
if form.getvalue('userlist-group') is not None:
|
||||||
|
groups = form.getlist('userlist-group')
|
||||||
|
for group in groups:
|
||||||
|
new_userlist_groups += " group "+group+ "\n"
|
||||||
|
|
||||||
MASTERS = sql.is_master(serv)
|
new_users_list = ""
|
||||||
for master in MASTERS:
|
if form.getvalue('userlist-user') is not None:
|
||||||
if master[0] != None:
|
users = form.getlist('userlist-user')
|
||||||
funct.upload_and_restart(master[0], cfg)
|
passwords = form.getlist('userlist-password')
|
||||||
|
userlist_user_group = form.getlist('userlist-user-group')
|
||||||
|
i = 0
|
||||||
|
print(userlist_user_group)
|
||||||
|
for user in users:
|
||||||
|
try:
|
||||||
|
group = ' groups '+userlist_user_group[i]
|
||||||
|
except:
|
||||||
|
group = ''
|
||||||
|
new_users_list += " user "+user+" insecure-password " + passwords[i] +group+ "\n"
|
||||||
|
i += 1
|
||||||
|
|
||||||
stderr = funct.upload_and_restart(serv, cfg, just_save="save")
|
config_add = "\n" + name + new_userlist_groups + new_users_list
|
||||||
if stderr:
|
|
||||||
print('<div class="alert alert-danger">%s</div>' % stderr)
|
|
||||||
else:
|
|
||||||
print('<meta http-equiv="refresh" content="0; url=add.py?add=%s&conf=%s&serv=%s">' % (name, config_add, serv))
|
|
||||||
|
|
||||||
print('</div>')
|
try:
|
||||||
|
if config_add:
|
||||||
|
hap_configs_dir = funct.get_config_var('configs', 'haproxy_save_configs_dir')
|
||||||
|
cfg = hap_configs_dir + serv + "-" + funct.get_data('config') + ".cfg"
|
||||||
|
|
||||||
|
funct.get_config(serv, cfg)
|
||||||
|
try:
|
||||||
|
with open(cfg, "a") as conf:
|
||||||
|
conf.write(config_add)
|
||||||
|
except IOError:
|
||||||
|
print("Can't read import config file")
|
||||||
|
|
||||||
|
funct.logging(serv, "add.py add new %s" % name)
|
||||||
|
print('<div class="line3">')
|
||||||
|
|
||||||
|
MASTERS = sql.is_master(serv)
|
||||||
|
for master in MASTERS:
|
||||||
|
if master[0] != None:
|
||||||
|
funct.upload_and_restart(master[0], cfg)
|
||||||
|
|
||||||
|
stderr = funct.upload_and_restart(serv, cfg, just_save="save")
|
||||||
|
if stderr:
|
||||||
|
print('<div class="alert alert-danger">%s</div>' % stderr)
|
||||||
|
else:
|
||||||
|
print('<meta http-equiv="refresh" content="0; url=add.py?add=%s&conf=%s&serv=%s">' % (name, config_add, serv))
|
||||||
|
|
||||||
|
print('</div>')
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,55 +0,0 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
import os
|
|
||||||
import sql
|
|
||||||
import http, cgi
|
|
||||||
import funct
|
|
||||||
import sql
|
|
||||||
from jinja2 import Environment, FileSystemLoader
|
|
||||||
env = Environment(loader=FileSystemLoader('templates/'))
|
|
||||||
template = env.get_template('lists.html')
|
|
||||||
|
|
||||||
print('Content-type: text/html\n')
|
|
||||||
funct.check_login()
|
|
||||||
form = cgi.FieldStorage()
|
|
||||||
funct.page_for_admin(level = 2)
|
|
||||||
|
|
||||||
try:
|
|
||||||
cookie = http.cookies.SimpleCookie(os.environ.get("HTTP_COOKIE"))
|
|
||||||
user_id = cookie.get('uuid')
|
|
||||||
user = sql.get_user_name_by_uuid(user_id.value)
|
|
||||||
user_group = sql.get_user_group_by_uuid(user_id.value)
|
|
||||||
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:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
dir = os.path.dirname(os.getcwd())+"/"+sql.get_setting('lists_path')
|
|
||||||
white_dir = os.path.dirname(os.getcwd())+"/"+sql.get_setting('lists_path')+"/"+user_group+"/white"
|
|
||||||
black_dir = os.path.dirname(os.getcwd())+"/"+sql.get_setting('lists_path')+"/"+user_group+"/black"
|
|
||||||
if not os.path.exists(dir):
|
|
||||||
os.makedirs(dir)
|
|
||||||
if not os.path.exists(dir+"/"+user_group):
|
|
||||||
os.makedirs(dir+"/"+user_group)
|
|
||||||
if not os.path.exists(white_dir):
|
|
||||||
os.makedirs(white_dir)
|
|
||||||
if not os.path.exists(black_dir):
|
|
||||||
os.makedirs(black_dir)
|
|
||||||
|
|
||||||
white_lists = funct.get_files(dir=white_dir, format="lst")
|
|
||||||
black_lists = funct.get_files(dir=black_dir, format="lst")
|
|
||||||
|
|
||||||
template = template.render(h2 = 1,
|
|
||||||
title = "Lists",
|
|
||||||
role = sql.get_user_role_by_uuid(user_id.value),
|
|
||||||
user = user,
|
|
||||||
white_lists = white_lists,
|
|
||||||
black_lists = black_lists,
|
|
||||||
group = user_group,
|
|
||||||
versions = funct.versions(),
|
|
||||||
token = token)
|
|
||||||
print(template)
|
|
36
app/funct.py
36
app/funct.py
|
@ -244,9 +244,20 @@ def get_sections(config):
|
||||||
return_config = list()
|
return_config = list()
|
||||||
with open(config, 'r') as f:
|
with open(config, 'r') as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
if line.startswith('listen') or line.startswith('frontend') or line.startswith('backend') or line.startswith('cache') or line.startswith('defaults') or line.startswith('global'):
|
if (
|
||||||
line = line.strip()
|
line.startswith('listen') or
|
||||||
return_config.append(line)
|
line.startswith('frontend') or
|
||||||
|
line.startswith('backend') or
|
||||||
|
line.startswith('cache') or
|
||||||
|
line.startswith('defaults') or
|
||||||
|
line.startswith('global') or
|
||||||
|
line.startswith('#HideBlockEnd') or
|
||||||
|
line.startswith('#HideBlockStart') or
|
||||||
|
line.startswith('peers') or
|
||||||
|
line.startswith('userlist')
|
||||||
|
):
|
||||||
|
line = line.strip()
|
||||||
|
return_config.append(line)
|
||||||
|
|
||||||
return return_config
|
return return_config
|
||||||
|
|
||||||
|
@ -265,10 +276,21 @@ def get_section_from_config(config, section):
|
||||||
continue
|
continue
|
||||||
if record:
|
if record:
|
||||||
|
|
||||||
if line.startswith('listen') or line.startswith('frontend') or line.startswith('backend') or line.startswith('cache') or line.startswith('defaults') or line.startswith('global') or line.startswith('#HideBlockEnd') or line.startswith('#HideBlockStart'):
|
if (
|
||||||
record = False
|
line.startswith('listen') or
|
||||||
end_line = index
|
line.startswith('frontend') or
|
||||||
end_line = end_line - 1
|
line.startswith('backend') or
|
||||||
|
line.startswith('cache') or
|
||||||
|
line.startswith('defaults') or
|
||||||
|
line.startswith('global') or
|
||||||
|
line.startswith('#HideBlockEnd') or
|
||||||
|
line.startswith('#HideBlockStart') or
|
||||||
|
line.startswith('peers') or
|
||||||
|
line.startswith('userlist')
|
||||||
|
):
|
||||||
|
record = False
|
||||||
|
end_line = index
|
||||||
|
end_line = end_line - 1
|
||||||
else:
|
else:
|
||||||
return_config += line
|
return_config += line
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import funct, sql
|
import funct, sql
|
||||||
import create_db
|
|
||||||
import os, http.cookies
|
import os, http.cookies
|
||||||
from jinja2 import Environment, FileSystemLoader
|
from jinja2 import Environment, FileSystemLoader
|
||||||
env = Environment(loader=FileSystemLoader('templates/'))
|
env = Environment(loader=FileSystemLoader('templates/'))
|
||||||
|
@ -28,10 +27,8 @@ commands = [ "ls -l %s |awk '{ print $6\" \"$7\" \"$8}'" % haproxy_config_path ]
|
||||||
servers_with_status1 = []
|
servers_with_status1 = []
|
||||||
out1 = ""
|
out1 = ""
|
||||||
for s in servers:
|
for s in servers:
|
||||||
# print(s[2])
|
|
||||||
servers_with_status = list()
|
servers_with_status = list()
|
||||||
cmd = 'echo "show info" |nc %s %s -w 1 |grep -e "Ver\|Uptime:\|Process_num"' % (s[2], haproxy_sock_port)
|
cmd = 'echo "show info" |nc %s %s -w 1 |grep -e "Ver\|Uptime:\|Process_num"' % (s[2], haproxy_sock_port)
|
||||||
# print(cmd )
|
|
||||||
out = funct.subprocess_execute(cmd)
|
out = funct.subprocess_execute(cmd)
|
||||||
servers_with_status.append(s[0])
|
servers_with_status.append(s[0])
|
||||||
servers_with_status.append(s[1])
|
servers_with_status.append(s[1])
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
CONF=/etc/keepalived/keepalived.conf
|
CONF=/etc/keepalived/keepalived.conf
|
||||||
|
|
||||||
if [ -f $CONF ];then
|
if [ -f $CONF ];then
|
||||||
echo -e 'error: Keepalived already installed. You can edit config <a href="/app/keepalivedconfig.py" title="Edit Keepalived config">here</a><br /><br />'
|
echo -e 'info: Keepalived already installed. You can edit config <a href="/app/keepalivedconfig.py" title="Edit Keepalived config">here</a><br /><br />'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
for ARGUMENT in "$@"
|
for ARGUMENT in "$@"
|
||||||
do
|
do
|
||||||
|
|
||||||
KEY=$(echo $ARGUMENT | cut -f1 -d=)
|
KEY=$(echo $ARGUMENT | cut -f1 -d=)
|
||||||
VALUE=$(echo $ARGUMENT | cut -f2 -d=)
|
VALUE=$(echo $ARGUMENT | cut -f2 -d=)
|
||||||
|
|
||||||
|
@ -12,8 +11,6 @@ do
|
||||||
HAPROXY_PATH) HAPROXY_PATH=${VALUE} ;;
|
HAPROXY_PATH) HAPROXY_PATH=${VALUE} ;;
|
||||||
*)
|
*)
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
done
|
done
|
||||||
VERSION=$(echo $VERSION | awk -F"-" '{print $1}')
|
VERSION=$(echo $VERSION | awk -F"-" '{print $1}')
|
||||||
VERSION_MAJ=$(echo $VERSION | awk -F"." '{print $1"."$2}')
|
VERSION_MAJ=$(echo $VERSION | awk -F"." '{print $1"."$2}')
|
||||||
|
@ -94,7 +91,6 @@ if [ $? -eq 1 ]; then
|
||||||
fi
|
fi
|
||||||
wget -O /tmp/modsecurity.conf https://github.com/SpiderLabs/ModSecurity/raw/v2/master/modsecurity.conf-recommended
|
wget -O /tmp/modsecurity.conf https://github.com/SpiderLabs/ModSecurity/raw/v2/master/modsecurity.conf-recommended
|
||||||
|
|
||||||
|
|
||||||
sudo bash -c cat << EOF >> /tmp/modsecurity.conf
|
sudo bash -c cat << EOF >> /tmp/modsecurity.conf
|
||||||
Include $HAPROXY_PATH/waf/rules/modsecurity_crs_10_ignore_static.conf
|
Include $HAPROXY_PATH/waf/rules/modsecurity_crs_10_ignore_static.conf
|
||||||
Include $HAPROXY_PATH/waf/rules/modsecurity_crs_10_setup.conf
|
Include $HAPROXY_PATH/waf/rules/modsecurity_crs_10_setup.conf
|
||||||
|
|
|
@ -5,7 +5,7 @@ import http.cookies
|
||||||
import funct
|
import funct
|
||||||
import sql
|
import sql
|
||||||
from jinja2 import Environment, FileSystemLoader
|
from jinja2 import Environment, FileSystemLoader
|
||||||
env = Environment(loader=FileSystemLoader('templates/'), autoescape=True)
|
env = Environment(loader=FileSystemLoader('templates/'), autoescape=True,extensions=['jinja2.ext.loopcontrols'])
|
||||||
template = env.get_template('sections.html')
|
template = env.get_template('sections.html')
|
||||||
|
|
||||||
print('Content-type: text/html\n')
|
print('Content-type: text/html\n')
|
||||||
|
@ -81,11 +81,6 @@ if serv is not None and form.getvalue('config') is not None:
|
||||||
|
|
||||||
funct.diff_config(oldcfg, cfg)
|
funct.diff_config(oldcfg, cfg)
|
||||||
|
|
||||||
#if save:
|
|
||||||
# c = http.cookies.SimpleCookie(os.environ.get("HTTP_COOKIE"))
|
|
||||||
# c["restart"] = form.getvalue('serv')
|
|
||||||
# print(c)
|
|
||||||
|
|
||||||
os.system("/bin/rm -f " + hap_configs_dir + "*.old")
|
os.system("/bin/rm -f " + hap_configs_dir + "*.old")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ def out_error(e):
|
||||||
else:
|
else:
|
||||||
error = e.args[0]
|
error = e.args[0]
|
||||||
print('Content-type: text/html\n')
|
print('Content-type: text/html\n')
|
||||||
print('<span class="alert alert-danger" id="error">An error occurred: ' + error + ' <a title="Close" id="errorMess"><b>X</b></a></span>')
|
print('<span class="alert alert-danger" style="height: 20px;margin-bottom: 20px;" id="error">An error occurred: ' + error + ' <a title="Close" id="errorMess"><b>X</b></a></span>')
|
||||||
|
|
||||||
def add_user(user, email, password, role, group, activeuser):
|
def add_user(user, email, password, role, group, activeuser):
|
||||||
con, cur = create_db.get_cur()
|
con, cur = create_db.get_cur()
|
||||||
|
@ -1684,9 +1684,9 @@ if form.getvalue('newtoption'):
|
||||||
if form.getvalue('updateoption') is not None:
|
if form.getvalue('updateoption') is not None:
|
||||||
option = form.getvalue('updateoption')
|
option = form.getvalue('updateoption')
|
||||||
id = form.getvalue('id')
|
id = form.getvalue('id')
|
||||||
print('Content-type: text/html\n')
|
|
||||||
check_token()
|
check_token()
|
||||||
if option is None or id is None:
|
if option is None or id is None:
|
||||||
|
print('Content-type: text/html\n')
|
||||||
print(error_mess)
|
print(error_mess)
|
||||||
else:
|
else:
|
||||||
update_options(option, id)
|
update_options(option, id)
|
||||||
|
|
|
@ -18,6 +18,7 @@ h3 {
|
||||||
<li><a href="#ssl">SSL certificates</a></li>
|
<li><a href="#ssl">SSL certificates</a></li>
|
||||||
<li><a href="#option">Options</a></li>
|
<li><a href="#option">Options</a></li>
|
||||||
<li><a href="#add-servers">Servers</a></li>
|
<li><a href="#add-servers">Servers</a></li>
|
||||||
|
<li><a href="#userlist">Userlist</a></li>
|
||||||
{% if user %}
|
{% if user %}
|
||||||
<a href=/app/login.py?logout=logout title="Logout, user name: {{ user }}" class="login"> Logout</a>
|
<a href=/app/login.py?logout=logout title="Logout, user name: {{ user }}" class="login"> Logout</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
@ -308,7 +309,7 @@ h3 {
|
||||||
</span>
|
</span>
|
||||||
<div id="options-listen-show-div" style="display: none;">
|
<div id="options-listen-show-div" style="display: none;">
|
||||||
<div class="tooltip">
|
<div class="tooltip">
|
||||||
<span style="padding-right: 10px;" class="form-control">Start typing options: </span>
|
<span style="padding-right: 10px;">Start typing options: </span>
|
||||||
<input type="text" id="options" class="form-control">
|
<input type="text" id="options" class="form-control">
|
||||||
<span style="padding-left: 10px;">
|
<span style="padding-left: 10px;">
|
||||||
or press down. <a href="http://cbonte.github.io/haproxy-dconv/1.7/configuration.html" target="_blanck" style="color: #23527c" title="HAproxy docs">Read more about options</a>
|
or press down. <a href="http://cbonte.github.io/haproxy-dconv/1.7/configuration.html" target="_blanck" style="color: #23527c" title="HAproxy docs">Read more about options</a>
|
||||||
|
@ -790,8 +791,8 @@ h3 {
|
||||||
<td class="padding10 first-collumn">
|
<td class="padding10 first-collumn">
|
||||||
{{ option.0 }}
|
{{ option.0 }}
|
||||||
</td>
|
</td>
|
||||||
<td class="padding10 first-collumn" style="width: 100%;">
|
<td class="padding10 first-collumn" style="width: 77%;">
|
||||||
<input type="text" id="option-body-{{ option.0 }}" value="{{ option.1 }}" size="100" class="form-control">
|
<input type="text" id="option-body-{{ option.0 }}" value="{{ option.1 }}" size="60" class="form-control">
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a class="delete" onclick="confirmDeleteOption({{ option.0 }})" title="Delete option {{option.1}}" style="cursor: pointer;"></a>
|
<a class="delete" onclick="confirmDeleteOption({{ option.0 }})" title="Delete option {{option.1}}" style="cursor: pointer;"></a>
|
||||||
|
@ -812,8 +813,8 @@ h3 {
|
||||||
<td class="padding10 first-collumn">
|
<td class="padding10 first-collumn">
|
||||||
Enter option for save:
|
Enter option for save:
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td style="width: 77%;">
|
||||||
<input type="text" name="new-option" id="new-option" class="form-control" size="100">
|
<input type="text" name="new-option" id="new-option" class="form-control" size="60">
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a class="add-admin" id="add-option-new" title="Add new option" style="cursor: pointer;"></a>
|
<a class="add-admin" id="add-option-new" title="Add new option" style="cursor: pointer;"></a>
|
||||||
|
@ -845,8 +846,8 @@ h3 {
|
||||||
<td class="padding10 first-collumn">
|
<td class="padding10 first-collumn">
|
||||||
<input type="text" id="servers-ip-{{ s.0 }}" value="{{ s.1 }}" size="15" class="form-control">
|
<input type="text" id="servers-ip-{{ s.0 }}" value="{{ s.1 }}" size="15" class="form-control">
|
||||||
</td>
|
</td>
|
||||||
<td class="padding10 first-collumn" style="width: 100%;">
|
<td class="padding10 first-collumn" style="width: 77%;">
|
||||||
<input type="text" id="servers-desc-{{ s.0 }}" value="{{ s.2 }}" size="60" class="form-control">
|
<input type="text" id="servers-desc-{{ s.0 }}" value="{{ s.2 }}" size="50" class="form-control">
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a class="delete" onclick="confirmDeleteSavedServer({{ s.0 }})" title="Delete server {{s.1}}" style="cursor: pointer;"></a>
|
<a class="delete" onclick="confirmDeleteSavedServer({{ s.0 }})" title="Delete server {{s.1}}" style="cursor: pointer;"></a>
|
||||||
|
@ -867,8 +868,8 @@ h3 {
|
||||||
<td class="padding10 first-collumn">
|
<td class="padding10 first-collumn">
|
||||||
<input type="text" name="new-saved-servers" id="new-saved-servers" class="form-control" size="15">
|
<input type="text" name="new-saved-servers" id="new-saved-servers" class="form-control" size="15">
|
||||||
</td>
|
</td>
|
||||||
<td style="width: 100%;">
|
<td style="width: 77%;">
|
||||||
<input type="text" name="new-saved-servers-description" id="new-saved-servers-description" class="form-control" size="60">
|
<input type="text" name="new-saved-servers-description" id="new-saved-servers-description" class="form-control" size="50">
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a class="add-admin" id="add-saved-server-new" title="Add new server" style="cursor: pointer;"></a>
|
<a class="add-admin" id="add-saved-server-new" title="Add new server" style="cursor: pointer;"></a>
|
||||||
|
@ -886,6 +887,76 @@ h3 {
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="userlist">
|
||||||
|
<form name="add-userlist" action="/app/add.py">
|
||||||
|
<table>
|
||||||
|
<caption><h3>Add Userlist</h3></caption>
|
||||||
|
<tr>
|
||||||
|
<td class="addName">Select server: </td>
|
||||||
|
<td class="addOption">
|
||||||
|
<select required name="serv" id="serv3">
|
||||||
|
<option disabled selected>Choose server</option>
|
||||||
|
{% for select in selects %}
|
||||||
|
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="tooltip tooltipTop"><b>Note:</b> If you reconfigure Master server, Slave will reconfigured automatically</div>
|
||||||
|
</td>
|
||||||
|
<td rowspan="4" class="add-note addName alert-info">
|
||||||
|
It is possible to control access to frontend/backend/listen sections or to
|
||||||
|
http stats by allowing only authenticated and authorized users. To do this,
|
||||||
|
it is required to create at least one userlist and to define users.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="addName">Userlist name:</td>
|
||||||
|
<td class="addOption">
|
||||||
|
<input type="text" name="new_userlist" id="new_userlist" required title="Userlist name" placeholder="basic-auth-list" class="form-control">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="addName">Groups:</td>
|
||||||
|
<td class="addOption">
|
||||||
|
<span id="userlist-groups">
|
||||||
|
<input name="userlist-group" title="User`s group" placeholder="group_name" class="form-control">
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
<a class="add-server" id="add-userlist-group" title="Add extra group" style="cursor: pointer;"></a>
|
||||||
|
</span>
|
||||||
|
<div class="tooltip tooltipTop">It is also possible to attach users to this group by using a comma separated list of names preceded by "users" keyword.</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="addName">User:</td>
|
||||||
|
<td class="addOption">
|
||||||
|
<span id="userlist-users">
|
||||||
|
<input name="userlist-user" required title="User name" placeholder="user_name" class="form-control">
|
||||||
|
<input name="userlist-password" required title="User password. By default it insecure-password" placeholder="password" class="form-control">
|
||||||
|
<input name="userlist-user-group" title="User`s group" placeholder="user`s group" class="form-control">
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
<a class="add-server" id="add-userlist-user" title="Add extra user" style="cursor: pointer;"></a>
|
||||||
|
</span>
|
||||||
|
<div class="tooltip tooltipTop">It is also possible to attach groups to this user by using a comma separated list of groups.</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="addButton">
|
||||||
|
<button type="submit" value="" name="" class="btn btn-default">Add Userlist</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
<div class="add-note addName alert-info" style="width: inherit; margin-right: 15px;">
|
||||||
|
In this section you can create userlists. And after use them in the "Add" sections
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
How to use userlists you can read
|
||||||
|
<a href="https://haproxy-wi.org/description.py?description=userlist" title="How to use userlists" target="_blank">
|
||||||
|
<b>here</b>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="dialog-confirm-delete" title="Are you sure you want to delete?" style="display: none;">
|
<div id="dialog-confirm-delete" title="Are you sure you want to delete?" style="display: none;">
|
||||||
<p><span class="ui-icon ui-icon-alert" style="float:left; margin:3px 12px 20px 0;"></span>Deleting all data will be lost?</p>
|
<p><span class="ui-icon ui-icon-alert" style="float:left; margin:3px 12px 20px 0;"></span>Deleting all data will be lost?</p>
|
||||||
|
|
|
@ -105,6 +105,16 @@
|
||||||
</span><div>
|
</span><div>
|
||||||
{% continue %}
|
{% continue %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if line.startswith('userlist') %}
|
||||||
|
</div><span class="param"> {{ line }}
|
||||||
|
{% if role %}
|
||||||
|
<span class="accordion-link">
|
||||||
|
<a href="/app/sections.py?serv={{serv}}§ion={{ line }}">Edit</a>
|
||||||
|
</span>
|
||||||
|
{% endif %}
|
||||||
|
</span><div>
|
||||||
|
{% continue %}
|
||||||
|
{% endif %}
|
||||||
{% 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 and "#" not in line%}
|
{% if "timeout" not in line and "default-server" not in line and "#use_backend" not in line and "#" not in line%}
|
||||||
<span class="paramInSec">
|
<span class="paramInSec">
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
{% for option in options %}
|
{% for option in options %}
|
||||||
<tr style="width: 50%;" id="option-table-{{option.0}}" class="newoption update">
|
<tr style="width: 50%;" id="option-{{option.0}}" class="newoption update">
|
||||||
<td class="padding10 first-collumn">
|
<td class="padding10 first-collumn">
|
||||||
{{ option.0 }}
|
{{ option.0 }}
|
||||||
</td>
|
</td>
|
||||||
<td class="first-collumn" style="width: 100%;">
|
<td class="first-collumn" style="width: 77%;">
|
||||||
<input type="text" id="option-body-{{option.0}}" class="form-control" value="{{option.1}}" size="100">
|
<input type="text" id="option-body-{{option.0}}" class="form-control" value="{{option.1}}" size="60">
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
<td class="padding10 first-collumn">
|
<td class="padding10 first-collumn">
|
||||||
<input type="text" id="servers-ip-{{s.0}}" class="form-control" value="{{s.1}}" size="15">
|
<input type="text" id="servers-ip-{{s.0}}" class="form-control" value="{{s.1}}" size="15">
|
||||||
</td>
|
</td>
|
||||||
<td class="first-collumn" style="width: 100%;">
|
<td class="first-collumn" style="width: 77%;">
|
||||||
<input type="text" id="servers-desc-{{s.0}}" class="form-control" value="{{s.2}}" size="60">
|
<input type="text" id="servers-desc-{{s.0}}" class="form-control" value="{{s.2}}" size="50">
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a class="delete" onclick="confirmDeleteSavedServer({{s.0}})" style="cursor: pointer;"></a>
|
<a class="delete" onclick="confirmDeleteSavedServer({{s.0}})" style="cursor: pointer;"></a>
|
||||||
|
|
|
@ -66,14 +66,15 @@
|
||||||
<li><a href=/app/hapservers.py title="Working with Haproxy Configs" class="overview-link head-submenu">Overview</a> </li>
|
<li><a href=/app/hapservers.py title="Working with Haproxy Configs" class="overview-link head-submenu">Overview</a> </li>
|
||||||
<li><a href=/app/config.py title="Working with HAProxy configs" class="edit head-submenu">Configs</a></li>
|
<li><a href=/app/config.py title="Working with HAProxy configs" class="edit head-submenu">Configs</a></li>
|
||||||
{% if role <= 2 %}
|
{% if role <= 2 %}
|
||||||
<li><a href=/app/add.py#proxy title="Add proxy" class="add head-submenu" id="add1">Add proxy</a></li>
|
<li><a href="/app/add.py#proxy" title="Add proxy" class="add head-submenu" id="add1">Add proxy</a></li>
|
||||||
<li><a href=/app/versions.py title="Actions with configs versions" class="version head-submenu">Versions</a></li>
|
<li><a href="/app/versions.py" title="Actions with configs versions" class="version head-submenu">Versions</a></li>
|
||||||
<li><a href=/app/add.py#ssl title="Upload SSL cert" class="cert head-submenu" id="add4">SSL</a></li>
|
<li><a href="/app/add.py#ssl" title="Upload SSL cert" class="cert head-submenu" id="add4">SSL</a></li>
|
||||||
<li><a href=/app/add.py#option title="Save custom options" class="option head-submenu" id="add5">Options</a></li>
|
<li><a href="/app/add.py#option" title="Save custom options" class="option head-submenu" id="add5">Options</a></li>
|
||||||
<li><a href=/app/add.py#add-servers title="Save servers" class="runtime head-submenu" id="add6">Servers</a></li>
|
<li><a href="/app/add.py#add-servers" title="Save servers" class="runtime head-submenu" id="add6">Servers</a></li>
|
||||||
<li><a href=/app/lists.py title="Manage black and white lists" class="lists head-submenu">Lists</a> </li>
|
<li><a href="/app/add.py#userlist" title="Add userlist" class="add-userlist head-submenu" id="add7">User list</a></li>
|
||||||
<li><a href=/app/waf.py title="Web application firewall" class="waf head-submenu">WAF</a> </li>
|
<li><a href="/app/lists.py" title="Manage black and white lists" class="lists head-submenu">Lists</a> </li>
|
||||||
<li><a href=/app/ihap.py title="Installation HAProxy" class="hap head-submenu">Installation</a> </li>
|
<li><a href="/app/waf.py" title="Web application firewall" class="waf head-submenu">WAF</a> </li>
|
||||||
|
<li><a href="/app/ihap.py" title="Installation HAProxy" class="hap head-submenu">Installation</a> </li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
@ -102,7 +103,6 @@
|
||||||
<li><a href=/app/users.py#users title="Actions with users" class="users head-submenu">Users</a></li>
|
<li><a href=/app/users.py#users title="Actions with users" class="users head-submenu">Users</a></li>
|
||||||
<li><a href=/app/users.py#groups title="Actions with groups" class="group head-submenu">Groups</a></li>
|
<li><a href=/app/users.py#groups title="Actions with groups" class="group head-submenu">Groups</a></li>
|
||||||
<li><a href=/app/users.py#servers title="Actions with servers" class="runtime head-submenu">Servers</a></li>
|
<li><a href=/app/users.py#servers title="Actions with servers" class="runtime head-submenu">Servers</a></li>
|
||||||
<!-- <li><a href=/app/users.py#roles title="Users roles" class="role head-submenu">Roles</a></li> -->
|
|
||||||
<li><a href=/app/users.py#ssh title="Manage SSH credentials" class="admin head-submenu">SSH credentials</a></li>
|
<li><a href=/app/users.py#ssh title="Manage SSH credentials" class="admin head-submenu">SSH credentials</a></li>
|
||||||
<li><a href=/app/settings.py title="HAproxy-WI settings" class="settings head-submenu">Settings</a></li>
|
<li><a href=/app/settings.py title="HAproxy-WI settings" class="settings head-submenu">Settings</a></li>
|
||||||
<li><a href=/app/viewlogs.py title="View internal logs" class="logs head-submenu">Internal logs</a></li>
|
<li><a href=/app/viewlogs.py title="View internal logs" class="logs head-submenu">Internal logs</a></li>
|
||||||
|
|
|
@ -3,13 +3,13 @@
|
||||||
<script src="/inc/users.js"></script>
|
<script src="/inc/users.js"></script>
|
||||||
<table class="overview">
|
<table class="overview">
|
||||||
<tr class="overviewHead">
|
<tr class="overviewHead">
|
||||||
<td class="padding10 first-collumn" style="width: 350px;">Version</td>
|
<td class="padding10 first-collumn" style="width: 35%;">Version</td>
|
||||||
<td class="padding10 first-collumn">Server</td>
|
<td class="padding10 first-collumn" style="width: 35%;">Server</td>
|
||||||
<td style="width: 150px;">SYN flood protect</td>
|
<td>SYN flood protect</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="padding10 first-collumn" style="width: 350px;">
|
<td class="padding10 first-collumn" style="width: 20%;">
|
||||||
<select id="hapver" name="hapver" required>
|
<select id="hapver" name="hapver" required>
|
||||||
<option disabled>Choose HAProxy version</option>
|
<option disabled>Choose HAProxy version</option>
|
||||||
<option value="2.0.4-1">2.0.4-1</option>
|
<option value="2.0.4-1">2.0.4-1</option>
|
||||||
|
|
|
@ -64,11 +64,6 @@ if serv is not None and form.getvalue('config') is not None:
|
||||||
|
|
||||||
stderr = funct.upload_and_restart(serv, configver, just_save=save)
|
stderr = funct.upload_and_restart(serv, configver, just_save=save)
|
||||||
|
|
||||||
if save:
|
|
||||||
c = http.cookies.SimpleCookie(os.environ.get("HTTP_COOKIE"))
|
|
||||||
c["restart"] = form.getvalue('serv')
|
|
||||||
print(c)
|
|
||||||
|
|
||||||
|
|
||||||
output_from_parsed_template = template.render(h2 = 1, title = "Working with versions HAProxy configs",
|
output_from_parsed_template = template.render(h2 = 1, title = "Working with versions HAProxy configs",
|
||||||
role = sql.get_user_role_by_uuid(user_id.value),
|
role = sql.get_user_role_by_uuid(user_id.value),
|
||||||
|
|
28
inc/add.js
28
inc/add.js
|
@ -660,15 +660,6 @@ $( function() {
|
||||||
});
|
});
|
||||||
$( "#tabs" ).tabs( "option", "active", 0 );
|
$( "#tabs" ).tabs( "option", "active", 0 );
|
||||||
} );
|
} );
|
||||||
// $( "#add2" ).on( "click", function() {
|
|
||||||
// $('.menu li ul li').each(function () {
|
|
||||||
// $(this).find('a').css('padding-left', '20px')
|
|
||||||
// $(this).find('a').css('border-left', '0px solid #5D9CEB');
|
|
||||||
// $(this).children("#add2").css('padding-left', '30px');
|
|
||||||
// $(this).children("#add2").css('border-left', '4px solid #5D9CEB');
|
|
||||||
// });
|
|
||||||
// $( "#tabs" ).tabs( "option", "active", 1 );
|
|
||||||
// } );
|
|
||||||
$( "#add4" ).on( "click", function() {
|
$( "#add4" ).on( "click", function() {
|
||||||
$('.menu li ul li').each(function () {
|
$('.menu li ul li').each(function () {
|
||||||
$(this).find('a').css('padding-left', '20px')
|
$(this).find('a').css('padding-left', '20px')
|
||||||
|
@ -696,6 +687,15 @@ $( function() {
|
||||||
});
|
});
|
||||||
$( "#tabs" ).tabs( "option", "active", 6 );
|
$( "#tabs" ).tabs( "option", "active", 6 );
|
||||||
} );
|
} );
|
||||||
|
$( "#add7" ).on( "click", function() {
|
||||||
|
$('.menu li ul li').each(function () {
|
||||||
|
$(this).find('a').css('padding-left', '20px')
|
||||||
|
$(this).find('a').css('border-left', '0px solid #5D9CEB');
|
||||||
|
$(this).children("#add7").css('padding-left', '30px');
|
||||||
|
$(this).children("#add7").css('border-left', '4px solid #5D9CEB');
|
||||||
|
});
|
||||||
|
$( "#tabs" ).tabs( "option", "active", 7 );
|
||||||
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
$( "#path-cert-listen" ).autocomplete({
|
$( "#path-cert-listen" ).autocomplete({
|
||||||
|
@ -824,13 +824,21 @@ $( 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">'
|
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">'
|
||||||
$('#add-server-input').click(function() {
|
$('#add-server-input').click(function() {
|
||||||
$('#servers').append(add_server_var);
|
$('#servers').append(add_server_var);
|
||||||
});
|
});
|
||||||
$('#add-server-input2').click(function() {
|
$('#add-server-input2').click(function() {
|
||||||
$('#servers2').append(add_server_var);
|
$('#servers2').append(add_server_var);
|
||||||
});
|
});
|
||||||
|
var add_userlist_var = '<br /><input name="userlist-user" title="User name" placeholder="user_name" class="form-control"> <input name="userlist-password" required title="User password. By default it insecure-password" placeholder="password" class="form-control"> <input name="userlist-user-group" title="User`s group" placeholder="user`s group" class="form-control">'
|
||||||
|
$('#add-userlist-user').click(function() {
|
||||||
|
$('#userlist-users').append(add_userlist_var);
|
||||||
|
});
|
||||||
|
var add_userlist_group_var = '<br /><input name="userlist-group" title="User`s group" placeholder="group_name" class="form-control">'
|
||||||
|
$('#add-userlist-group').click(function() {
|
||||||
|
$('#userlist-groups').append(add_userlist_group_var);
|
||||||
|
});
|
||||||
$('.advance-show').click(function() {
|
$('.advance-show').click(function() {
|
||||||
$('.advance-show').fadeOut();
|
$('.advance-show').fadeOut();
|
||||||
$('.advance').fadeIn();
|
$('.advance').fadeIn();
|
||||||
|
|
|
@ -164,6 +164,11 @@
|
||||||
font-family: "Font Awesome 5 Solid";
|
font-family: "Font Awesome 5 Solid";
|
||||||
content: "\f00c";
|
content: "\f00c";
|
||||||
}
|
}
|
||||||
|
.add-userlist::before {
|
||||||
|
display: none;
|
||||||
|
font-family: "Font Awesome 5 Solid";
|
||||||
|
content: "\f0c0";
|
||||||
|
}
|
||||||
.add-server::before {
|
.add-server::before {
|
||||||
display: none;
|
display: none;
|
||||||
font-family: "Font Awesome 5 Solid";
|
font-family: "Font Awesome 5 Solid";
|
||||||
|
|
|
@ -556,8 +556,8 @@ $( function() {
|
||||||
|
|
||||||
$( "#hide_menu" ).click(function() {
|
$( "#hide_menu" ).click(function() {
|
||||||
$(".top-menu").hide( "drop", "fast" );
|
$(".top-menu").hide( "drop", "fast" );
|
||||||
$(".container").css("max-width", "98%");
|
$(".container").css("max-width", "100%");
|
||||||
$(".footer").css("max-width", "98%");
|
$(".footer").css("max-width", "97%");
|
||||||
$(".container").css("margin-left", "1%");
|
$(".container").css("margin-left", "1%");
|
||||||
$(".footer").css("margin-left", "1%");
|
$(".footer").css("margin-left", "1%");
|
||||||
$(".show_menu").show();
|
$(".show_menu").show();
|
||||||
|
@ -583,7 +583,7 @@ $( function() {
|
||||||
}
|
}
|
||||||
if (hideMenu == "hide") {
|
if (hideMenu == "hide") {
|
||||||
$(".top-menu").hide();
|
$(".top-menu").hide();
|
||||||
$(".container").css("max-width", "98%");
|
$(".container").css("max-width", "97%");
|
||||||
$(".container").css("margin-left", "1%");
|
$(".container").css("margin-left", "1%");
|
||||||
$(".show_menu").show();
|
$(".show_menu").show();
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,6 @@ h2 {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
margin-top: 0px;
|
margin-top: 0px;
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0px;
|
||||||
width: 98.9%;
|
|
||||||
}
|
}
|
||||||
h3 {
|
h3 {
|
||||||
margin-top: -0;
|
margin-top: -0;
|
||||||
|
@ -30,7 +29,6 @@ h3 {
|
||||||
padding: 0.3em;
|
padding: 0.3em;
|
||||||
font-size: 1.6em;
|
font-size: 1.6em;
|
||||||
border-bottom: 1px solid #ddd;
|
border-bottom: 1px solid #ddd;
|
||||||
width: 100.43%;
|
|
||||||
}
|
}
|
||||||
form {
|
form {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
@ -83,12 +81,10 @@ pre {
|
||||||
min-width: 40%;
|
min-width: 40%;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
margin-left: 207px;
|
margin-left: 207px;
|
||||||
margin-right: 20px;
|
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
}
|
}
|
||||||
.footer {
|
.footer {
|
||||||
min-height: 50px;
|
min-height: 50px;
|
||||||
/* top: calc(99vh - 40px); */
|
|
||||||
right: 0;
|
right: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
max-width: 91%;
|
max-width: 91%;
|
||||||
|
@ -98,7 +94,6 @@ pre {
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
border-top: 1px solid #ddd;
|
border-top: 1px solid #ddd;
|
||||||
clear: both;
|
clear: both;
|
||||||
/* position: fixed; */
|
|
||||||
}
|
}
|
||||||
#version {
|
#version {
|
||||||
float: left;
|
float: left;
|
||||||
|
@ -835,6 +830,9 @@ label {
|
||||||
.wrong-login {
|
.wrong-login {
|
||||||
margin-right: -150px;
|
margin-right: -150px;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@media (max-width: 1280px) {
|
||||||
|
|
||||||
}
|
}
|
||||||
@media (max-width: 1080px) {
|
@media (max-width: 1080px) {
|
||||||
#logo_span {
|
#logo_span {
|
||||||
|
@ -887,6 +885,12 @@ label {
|
||||||
.wrong-login {
|
.wrong-login {
|
||||||
margin-right: -260px;
|
margin-right: -260px;
|
||||||
}
|
}
|
||||||
|
.overview {
|
||||||
|
width: 90% !important;
|
||||||
|
}
|
||||||
|
.overview h3 {
|
||||||
|
width: 46.4% !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@media (max-width: 667px) {
|
@media (max-width: 667px) {
|
||||||
#logo_span {
|
#logo_span {
|
||||||
|
|
|
@ -50,6 +50,8 @@ $( function() {
|
||||||
data = data.replace(/\s+/g,' ');
|
data = data.replace(/\s+/g,' ');
|
||||||
if (data.indexOf('error') != '-1' || data.indexOf('alert') != '-1' || data.indexOf('Failed') != '-1') {
|
if (data.indexOf('error') != '-1' || data.indexOf('alert') != '-1' || data.indexOf('Failed') != '-1') {
|
||||||
$("#ajax").html('<div class="alert alert-danger">'+data+'</data>');
|
$("#ajax").html('<div class="alert alert-danger">'+data+'</data>');
|
||||||
|
} else if (data.indexOf('info') != '-1' ){
|
||||||
|
$("#ajax").html('<div class="alert alert-info">'+data+'</data>');
|
||||||
} else if (data.indexOf('success') != '-1' ){
|
} else if (data.indexOf('success') != '-1' ){
|
||||||
$('.alert-danger').remove();
|
$('.alert-danger').remove();
|
||||||
$("#ajax").html('<div class="alert alert-success">All is ready!</data>');
|
$("#ajax").html('<div class="alert alert-success">All is ready!</data>');
|
||||||
|
|
Loading…
Reference in New Issue