mirror of https://github.com/Aidaho12/haproxy-wi
commit
a7f43aefd6
|
@ -102,3 +102,12 @@ ENV/
|
||||||
|
|
||||||
# mypy
|
# mypy
|
||||||
.mypy_cache/
|
.mypy_cache/
|
||||||
|
|
||||||
|
#data user
|
||||||
|
app/certs
|
||||||
|
map*.png
|
||||||
|
app/haproxy-wi.db
|
||||||
|
keys
|
||||||
|
lists
|
||||||
|
log
|
||||||
|
configs
|
||||||
|
|
|
@ -7,7 +7,7 @@ import http.cookies
|
||||||
from jinja2 import Environment, FileSystemLoader
|
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 = funct.form
|
||||||
serv = form.getvalue('serv')
|
serv = form.getvalue('serv')
|
||||||
|
|
||||||
if form.getvalue('add'):
|
if form.getvalue('add'):
|
||||||
|
|
|
@ -11,7 +11,7 @@ template = env.get_template('config.html')
|
||||||
print('Content-type: text/html\n')
|
print('Content-type: text/html\n')
|
||||||
funct.check_login()
|
funct.check_login()
|
||||||
|
|
||||||
form = cgi.FieldStorage()
|
form = funct.form
|
||||||
serv = form.getvalue('serv')
|
serv = form.getvalue('serv')
|
||||||
config_read = ""
|
config_read = ""
|
||||||
cfg = ""
|
cfg = ""
|
||||||
|
@ -90,4 +90,4 @@ template = template.render(h2 = 1, title = "Working with HAProxy configs",
|
||||||
note = 1,
|
note = 1,
|
||||||
versions = funct.versions(),
|
versions = funct.versions(),
|
||||||
token = token)
|
token = token)
|
||||||
print(template)
|
print(template)
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import os
|
import os
|
||||||
import sql
|
|
||||||
import http, cgi
|
import http, cgi
|
||||||
import funct
|
import funct
|
||||||
import sql
|
import sql
|
||||||
|
@ -10,7 +9,7 @@ template = env.get_template('runtimeapi.html')
|
||||||
|
|
||||||
print('Content-type: text/html\n')
|
print('Content-type: text/html\n')
|
||||||
funct.check_login()
|
funct.check_login()
|
||||||
form = cgi.FieldStorage()
|
form = funct.form
|
||||||
|
|
||||||
try:
|
try:
|
||||||
cookie = http.cookies.SimpleCookie(os.environ.get("HTTP_COOKIE"))
|
cookie = http.cookies.SimpleCookie(os.environ.get("HTTP_COOKIE"))
|
||||||
|
@ -37,4 +36,4 @@ output_from_parsed_template = template.render(h2 = 1,
|
||||||
serv = serv,
|
serv = serv,
|
||||||
versions = funct.versions(),
|
versions = funct.versions(),
|
||||||
servbackend = servbackend)
|
servbackend = servbackend)
|
||||||
print(output_from_parsed_template)
|
print(output_from_parsed_template)
|
||||||
|
|
19
app/funct.py
19
app/funct.py
|
@ -431,7 +431,6 @@ def check_haproxy_version(serv):
|
||||||
def upload(serv, path, file, **kwargs):
|
def upload(serv, path, file, **kwargs):
|
||||||
error = ""
|
error = ""
|
||||||
full_path = path + file
|
full_path = path + file
|
||||||
|
|
||||||
if kwargs.get('dir') == "fullpath":
|
if kwargs.get('dir') == "fullpath":
|
||||||
full_path = path
|
full_path = path
|
||||||
|
|
||||||
|
@ -453,14 +452,14 @@ def upload(serv, path, file, **kwargs):
|
||||||
logging('localhost', ' Cannot upload '+file+' to '+full_path+'. Error: '+str(e.args), haproxywi=1)
|
logging('localhost', ' Cannot upload '+file+' to '+full_path+'. Error: '+str(e.args), haproxywi=1)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
sftp.close()
|
sftp.close()
|
||||||
ssh.close()
|
ssh.close()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
error = e.args
|
error = e.args
|
||||||
logging('localhost', str(error[0]), haproxywi=1)
|
logging('localhost', str(error[0]), haproxywi=1)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return str(error)
|
return str(error)
|
||||||
|
|
||||||
|
|
||||||
|
@ -468,7 +467,7 @@ def upload_and_restart(serv, cfg, **kwargs):
|
||||||
import sql
|
import sql
|
||||||
tmp_file = sql.get_setting('tmp_config_path') + "/" + get_data('config') + ".cfg"
|
tmp_file = sql.get_setting('tmp_config_path') + "/" + get_data('config') + ".cfg"
|
||||||
error = ""
|
error = ""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
os.system("dos2unix "+cfg)
|
os.system("dos2unix "+cfg)
|
||||||
except OSError:
|
except OSError:
|
||||||
|
@ -491,7 +490,6 @@ def upload_and_restart(serv, cfg, **kwargs):
|
||||||
commands = [ "sudo haproxy -q -c -f " + tmp_file + "&& sudo mv -f " + tmp_file + " " + sql.get_setting('haproxy_config_path') + " && sudo " + sql.get_setting('restart_command') ]
|
commands = [ "sudo haproxy -q -c -f " + tmp_file + "&& sudo mv -f " + tmp_file + " " + sql.get_setting('haproxy_config_path') + " && sudo " + sql.get_setting('restart_command') ]
|
||||||
if sql.get_setting('firewall_enable') == "1":
|
if sql.get_setting('firewall_enable') == "1":
|
||||||
commands.extend(open_port_firewalld(cfg))
|
commands.extend(open_port_firewalld(cfg))
|
||||||
|
|
||||||
error += str(upload(serv, tmp_file, cfg, dir='fullpath'))
|
error += str(upload(serv, tmp_file, cfg, dir='fullpath'))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -500,17 +498,20 @@ def upload_and_restart(serv, cfg, **kwargs):
|
||||||
error += e
|
error += e
|
||||||
if error:
|
if error:
|
||||||
logging('localhost', error, haproxywi=1)
|
logging('localhost', error, haproxywi=1)
|
||||||
return error
|
|
||||||
|
return error
|
||||||
|
|
||||||
|
|
||||||
def master_slave_upload_and_restart(serv, cfg, just_save):
|
def master_slave_upload_and_restart(serv, cfg, just_save):
|
||||||
import sql
|
import sql
|
||||||
MASTERS = sql.is_master(serv)
|
MASTERS = sql.is_master(serv)
|
||||||
|
error = ""
|
||||||
for master in MASTERS:
|
for master in MASTERS:
|
||||||
if master[0] != None:
|
if master[0] != None:
|
||||||
upload_and_restart(master[0], cfg, just_save=just_save)
|
error += upload_and_restart(master[0], cfg, just_save=just_save)
|
||||||
|
|
||||||
return upload_and_restart(serv, cfg, just_save=just_save)
|
error += upload_and_restart(serv, cfg, just_save=just_save)
|
||||||
|
return error
|
||||||
|
|
||||||
|
|
||||||
def open_port_firewalld(cfg):
|
def open_port_firewalld(cfg):
|
||||||
|
@ -778,4 +779,4 @@ def get_hash(value):
|
||||||
import hashlib
|
import hashlib
|
||||||
h = hashlib.md5(value.encode('utf-8'))
|
h = hashlib.md5(value.encode('utf-8'))
|
||||||
p = h.hexdigest()
|
p = h.hexdigest()
|
||||||
return p
|
return p
|
||||||
|
|
|
@ -11,7 +11,7 @@ print('Content-type: text/html\n')
|
||||||
funct.check_login()
|
funct.check_login()
|
||||||
funct.page_for_admin(level = 2)
|
funct.page_for_admin(level = 2)
|
||||||
|
|
||||||
form = cgi.FieldStorage()
|
form = funct.form
|
||||||
serv = form.getvalue('serv')
|
serv = form.getvalue('serv')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -31,4 +31,4 @@ output_from_parsed_template = template.render(h2 = 1, title = "Configure HA",
|
||||||
selects = servers,
|
selects = servers,
|
||||||
versions = funct.versions(),
|
versions = funct.versions(),
|
||||||
token = token)
|
token = token)
|
||||||
print(output_from_parsed_template)
|
print(output_from_parsed_template)
|
||||||
|
|
|
@ -21,7 +21,7 @@ try:
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
form = cgi.FieldStorage()
|
form = funct.form
|
||||||
serv = form.getvalue('serv')
|
serv = form.getvalue('serv')
|
||||||
|
|
||||||
if serv:
|
if serv:
|
||||||
|
|
|
@ -13,7 +13,7 @@ print('Content-type: text/html\n')
|
||||||
funct.check_login()
|
funct.check_login()
|
||||||
funct.page_for_admin(level = 2)
|
funct.page_for_admin(level = 2)
|
||||||
|
|
||||||
form = cgi.FieldStorage()
|
form = funct.form
|
||||||
serv = form.getvalue('serv')
|
serv = form.getvalue('serv')
|
||||||
log_path = funct.get_config_var('main', 'log_path')
|
log_path = funct.get_config_var('main', 'log_path')
|
||||||
kp_save_configs_dir = funct.get_config_var('configs', 'kp_save_configs_dir')
|
kp_save_configs_dir = funct.get_config_var('configs', 'kp_save_configs_dir')
|
||||||
|
@ -90,4 +90,4 @@ output_from_parsed_template = template.render(h2 = 1, title = "Edit Runnig Keepa
|
||||||
keepalived = 1,
|
keepalived = 1,
|
||||||
versions = funct.versions(),
|
versions = funct.versions(),
|
||||||
token = token)
|
token = token)
|
||||||
print(output_from_parsed_template)
|
print(output_from_parsed_template)
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import os
|
import os
|
||||||
import sql
|
|
||||||
import http, cgi
|
import http, cgi
|
||||||
import funct
|
import funct
|
||||||
import sql
|
import sql
|
||||||
|
@ -10,7 +9,7 @@ template = env.get_template('lists.html')
|
||||||
|
|
||||||
print('Content-type: text/html\n')
|
print('Content-type: text/html\n')
|
||||||
funct.check_login()
|
funct.check_login()
|
||||||
form = cgi.FieldStorage()
|
form = funct.form
|
||||||
funct.page_for_admin(level = 2)
|
funct.page_for_admin(level = 2)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -52,4 +51,4 @@ template = template.render(h2 = 1,
|
||||||
group = user_group,
|
group = user_group,
|
||||||
versions = funct.versions(),
|
versions = funct.versions(),
|
||||||
token = token)
|
token = token)
|
||||||
print(template)
|
print(template)
|
||||||
|
|
20
app/login.py
20
app/login.py
|
@ -13,7 +13,7 @@ import uuid
|
||||||
from jinja2 import Environment, FileSystemLoader
|
from jinja2 import Environment, FileSystemLoader
|
||||||
env = Environment(loader=FileSystemLoader('templates/'))
|
env = Environment(loader=FileSystemLoader('templates/'))
|
||||||
template = env.get_template('login.html')
|
template = env.get_template('login.html')
|
||||||
form = cgi.FieldStorage()
|
form = funct.form
|
||||||
|
|
||||||
cookie = http.cookies.SimpleCookie(os.environ.get("HTTP_COOKIE"))
|
cookie = http.cookies.SimpleCookie(os.environ.get("HTTP_COOKIE"))
|
||||||
user_id = cookie.get('uuid')
|
user_id = cookie.get('uuid')
|
||||||
|
@ -69,13 +69,25 @@ def check_in_ldap(user, password):
|
||||||
server = sql.get_setting('ldap_server')
|
server = sql.get_setting('ldap_server')
|
||||||
port = sql.get_setting('ldap_port')
|
port = sql.get_setting('ldap_port')
|
||||||
ldap_class_search = sql.get_setting('ldap_class_search')
|
ldap_class_search = sql.get_setting('ldap_class_search')
|
||||||
|
root_user = sql.get_setting('ldap_user')
|
||||||
|
root_password = sql.get_setting('ldap_password')
|
||||||
|
ldap_base = sql.get_setting('ldap_base')
|
||||||
|
domain = sql.get_setting('ldap_domain')
|
||||||
|
ldap_search_field = sql.get_setting('ldap_search_field')
|
||||||
|
ldap_user_attribute = sql.get_setting('ldap_user_attribute')
|
||||||
|
|
||||||
l = ldap.initialize("ldap://"+server+':'+port)
|
l = ldap.initialize(server+':'+port)
|
||||||
try:
|
try:
|
||||||
l.protocol_version = ldap.VERSION3
|
l.protocol_version = ldap.VERSION3
|
||||||
l.set_option(ldap.OPT_REFERRALS, 0)
|
l.set_option(ldap.OPT_REFERRALS, 0)
|
||||||
|
|
||||||
bind = l.simple_bind_s(ldap_class_search+'='+user, password)
|
bind = l.simple_bind_s(root_user, root_password)
|
||||||
|
|
||||||
|
criteria = "(&(objectClass="+ldap_class_search+")("+ldap_user_attribute+"="+user+"))"
|
||||||
|
attributes = [ldap_search_field]
|
||||||
|
result = l.search_s(ldap_base, ldap.SCOPE_SUBTREE, criteria, attributes)
|
||||||
|
|
||||||
|
bind = l.simple_bind_s(result[0][0], password)
|
||||||
except ldap.INVALID_CREDENTIALS:
|
except ldap.INVALID_CREDENTIALS:
|
||||||
print("Content-type: text/html\n")
|
print("Content-type: text/html\n")
|
||||||
print('<center><div class="alert alert-danger">Invalid credentials</div><br /><br />')
|
print('<center><div class="alert alert-danger">Invalid credentials</div><br /><br />')
|
||||||
|
@ -170,4 +182,4 @@ output_from_parsed_template = template.render(h2 = 0, title = "Login page",
|
||||||
ref = ref,
|
ref = ref,
|
||||||
versions = funct.versions(),
|
versions = funct.versions(),
|
||||||
db_create = db_create)
|
db_create = db_create)
|
||||||
print(output_from_parsed_template)
|
print(output_from_parsed_template)
|
||||||
|
|
|
@ -7,7 +7,7 @@ import os, http
|
||||||
from jinja2 import Environment, FileSystemLoader
|
from jinja2 import Environment, FileSystemLoader
|
||||||
env = Environment(loader=FileSystemLoader('templates/'))
|
env = Environment(loader=FileSystemLoader('templates/'))
|
||||||
template = env.get_template('logs.html')
|
template = env.get_template('logs.html')
|
||||||
form = cgi.FieldStorage()
|
form = funct.form
|
||||||
|
|
||||||
if form.getvalue('grep') is None:
|
if form.getvalue('grep') is None:
|
||||||
grep = ""
|
grep = ""
|
||||||
|
|
|
@ -5,7 +5,7 @@ import os, sys
|
||||||
import funct
|
import funct
|
||||||
import sql
|
import sql
|
||||||
|
|
||||||
form = cgi.FieldStorage()
|
form = funct.form
|
||||||
serv = form.getvalue('serv')
|
serv = form.getvalue('serv')
|
||||||
act = form.getvalue('act')
|
act = form.getvalue('act')
|
||||||
|
|
||||||
|
@ -893,7 +893,7 @@ if form.getvalue('get_ldap_email'):
|
||||||
ldap_class_search = sql.get_setting('ldap_class_search')
|
ldap_class_search = sql.get_setting('ldap_class_search')
|
||||||
ldap_user_attribute = sql.get_setting('ldap_user_attribute')
|
ldap_user_attribute = sql.get_setting('ldap_user_attribute')
|
||||||
|
|
||||||
l = ldap.initialize("ldap://"+server+':'+port)
|
l = ldap.initialize(server+':'+port)
|
||||||
try:
|
try:
|
||||||
l.protocol_version = ldap.VERSION3
|
l.protocol_version = ldap.VERSION3
|
||||||
l.set_option(ldap.OPT_REFERRALS, 0)
|
l.set_option(ldap.OPT_REFERRALS, 0)
|
||||||
|
|
|
@ -11,7 +11,7 @@ template = env.get_template('sections.html')
|
||||||
print('Content-type: text/html\n')
|
print('Content-type: text/html\n')
|
||||||
funct.check_login()
|
funct.check_login()
|
||||||
|
|
||||||
form = cgi.FieldStorage()
|
form = funct.form
|
||||||
serv = form.getvalue('serv')
|
serv = form.getvalue('serv')
|
||||||
section = form.getvalue('section')
|
section = form.getvalue('section')
|
||||||
sections = ""
|
sections = ""
|
||||||
|
@ -98,4 +98,4 @@ template = template.render(h2 = 1, title = "Working with HAProxy configs",
|
||||||
note = 1,
|
note = 1,
|
||||||
versions = funct.versions(),
|
versions = funct.versions(),
|
||||||
token = token)
|
token = token)
|
||||||
print(template)
|
print(template)
|
||||||
|
|
|
@ -8,7 +8,7 @@ import sql
|
||||||
from jinja2 import Environment, FileSystemLoader
|
from jinja2 import Environment, FileSystemLoader
|
||||||
env = Environment(extensions=["jinja2.ext.do"],loader=FileSystemLoader('templates/'))
|
env = Environment(extensions=["jinja2.ext.do"],loader=FileSystemLoader('templates/'))
|
||||||
template = env.get_template('servers.html')
|
template = env.get_template('servers.html')
|
||||||
form = cgi.FieldStorage()
|
form = funct.form
|
||||||
|
|
||||||
print('Content-type: text/html\n')
|
print('Content-type: text/html\n')
|
||||||
funct.check_login()
|
funct.check_login()
|
||||||
|
@ -38,4 +38,4 @@ output_from_parsed_template = template.render(title = "Servers manage",
|
||||||
token = token,
|
token = token,
|
||||||
versions = funct.versions(),
|
versions = funct.versions(),
|
||||||
ldap_enable = ldap_enable)
|
ldap_enable = ldap_enable)
|
||||||
print(output_from_parsed_template)
|
print(output_from_parsed_template)
|
||||||
|
|
|
@ -1415,8 +1415,8 @@ def check_token_exists(token):
|
||||||
funct.logging('localhost', ' Cannot check token', haproxywi=1)
|
funct.logging('localhost', ' Cannot check token', haproxywi=1)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
form = cgi.FieldStorage()
|
form = funct.form
|
||||||
error_mess = '<span class="alert alert-danger" id="error">All fields must be completed <a title="Close" id="errorMess"><b>X</b></a></span>'
|
error_mess = '<span class="alert alert-danger" id="error">All fields must be completed <a title="Close" id="errorMess"><b>X</b></a></span>'
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ h3 {
|
||||||
</ul>
|
</ul>
|
||||||
{% include 'include/add_proxy.html' %}
|
{% include 'include/add_proxy.html' %}
|
||||||
<div id="listen">
|
<div id="listen">
|
||||||
<form name="add-listner" action="/app/add.py">
|
<form name="add-listner" action="/app/add.py" method="post">
|
||||||
<table class="add-table">
|
<table class="add-table">
|
||||||
<caption><h3>Add listen</h3></caption>
|
<caption><h3>Add listen</h3></caption>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -213,7 +213,7 @@ h3 {
|
||||||
<!-- Second tabs -->
|
<!-- Second tabs -->
|
||||||
|
|
||||||
<div id="frontend">
|
<div id="frontend">
|
||||||
<form name="add-frontend" action="/app/add.py" method="get">
|
<form name="add-frontend" action="/app/add.py" method="post">
|
||||||
<table>
|
<table>
|
||||||
<caption><h3>Add frontend</h3></caption>
|
<caption><h3>Add frontend</h3></caption>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -354,7 +354,7 @@ h3 {
|
||||||
<!-- Third tabs -->
|
<!-- Third tabs -->
|
||||||
|
|
||||||
<div id="backend">
|
<div id="backend">
|
||||||
<form name="add-backend" action="/app/add.py">
|
<form name="add-backend" action="/app/add.py" method="post">
|
||||||
<table>
|
<table>
|
||||||
<caption><h3>Add backend</h3></caption>
|
<caption><h3>Add backend</h3></caption>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -670,7 +670,7 @@ h3 {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="userlist">
|
<div id="userlist">
|
||||||
<form name="add-userlist" action="/app/add.py">
|
<form name="add-userlist" action="/app/add.py" method="post">
|
||||||
<table>
|
<table>
|
||||||
<caption><h3>Add Userlist</h3></caption>
|
<caption><h3>Add Userlist</h3></caption>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -753,4 +753,4 @@ $( function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -161,7 +161,7 @@
|
||||||
{% if configver %}
|
{% if configver %}
|
||||||
<br>
|
<br>
|
||||||
<center>
|
<center>
|
||||||
<form action="versions.py#conf" method="get">
|
<form action="versions.py#conf" method="post">
|
||||||
<input type="hidden" value="{{serv}}" name="serv">
|
<input type="hidden" value="{{serv}}" name="serv">
|
||||||
<input type="hidden" value="{{configver}}" name="configver">
|
<input type="hidden" value="{{configver}}" name="configver">
|
||||||
<input type="hidden" value="1" name="config">
|
<input type="hidden" value="1" name="config">
|
||||||
|
|
|
@ -23,4 +23,4 @@
|
||||||
</td>
|
</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% from 'include/input_macros.html' import input %}
|
{% from 'include/input_macros.html' import input %}
|
||||||
<form action="diff.py#diff" method="get">
|
<form action="diff.py#diff" method="post">
|
||||||
<center>
|
<center>
|
||||||
<h4>
|
<h4>
|
||||||
<span style="padding: 20px;">Choose left</span>
|
<span style="padding: 20px;">Choose left</span>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<center>
|
<center>
|
||||||
<h3>Choose server</h3>
|
<h3>Choose server</h3>
|
||||||
<p>
|
<p>
|
||||||
<form action="{{ action }}" method="get">
|
<form action="{{ action }}" method="post">
|
||||||
<a class="ui-button ui-widget ui-corner-all" title="Return back" id="back" onclick="history.go(-2)">Back</a>
|
<a class="ui-button ui-widget ui-corner-all" title="Return back" id="back" onclick="history.go(-2)">Back</a>
|
||||||
<select autofocus required name="serv" id="{{ select_id }}">
|
<select autofocus required name="serv" id="{{ select_id }}">
|
||||||
<option disabled>Choose server</option>
|
<option disabled>Choose server</option>
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
{% if role <= 2 %}
|
{% if role <= 2 %}
|
||||||
<div id="config">
|
<div id="config">
|
||||||
<h4>Config from {{ serv }}</h4>
|
<h4>Config from {{ serv }}</h4>
|
||||||
<form action="{{ action }}" name="saveconfig" method="get">
|
<form action="{{ action }}" name="saveconfig" method="post">
|
||||||
<input type="hidden" value="{{ serv }}" name="serv">
|
<input type="hidden" value="{{ serv }}" name="serv">
|
||||||
<input type="hidden" value="{{ cfg }}.old" name="oldconfig">
|
<input type="hidden" value="{{ cfg }}.old" name="oldconfig">
|
||||||
<textarea name="config" class="config" rows="35" cols="100">{{ config }}</textarea>
|
<textarea name="config" class="config" rows="35" cols="100">{{ config }}</textarea>
|
||||||
|
@ -97,4 +97,4 @@
|
||||||
}
|
}
|
||||||
$('textarea').linenumbers({col_width: '25px'});
|
$('textarea').linenumbers({col_width: '25px'});
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<center>
|
<center>
|
||||||
<h3>Choose server</h3>
|
<h3>Choose server</h3>
|
||||||
<p>
|
<p>
|
||||||
<form action="{{ action }}" method="get">
|
<form action="{{ action }}" method="post">
|
||||||
<a class="ui-button ui-widget ui-corner-all" title="Return back" onclick="history.back()">Back</a>
|
<a class="ui-button ui-widget ui-corner-all" title="Return back" onclick="history.back()">Back</a>
|
||||||
{% include 'include/select.html' %}
|
{% include 'include/select.html' %}
|
||||||
<button type="submit" value="open" name="open" class="btn btn-default">Open</button>
|
<button type="submit" value="open" name="open" class="btn btn-default">Open</button>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<center>
|
<center>
|
||||||
<h3>Choose server</h3>
|
<h3>Choose server</h3>
|
||||||
<p>
|
<p>
|
||||||
<form action="{{ action }}" method="get">
|
<form action="{{ action }}" method="post">
|
||||||
<a class="ui-button ui-widget ui-corner-all" title="Return back" onclick="history.back()">Back</a>
|
<a class="ui-button ui-widget ui-corner-all" title="Return back" onclick="history.back()">Back</a>
|
||||||
{% include 'include/select.html' %}
|
{% include 'include/select.html' %}
|
||||||
<button type="submit" value="open" name="open" class="btn btn-default">Open</button>
|
<button type="submit" value="open" name="open" class="btn btn-default">Open</button>
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
{% if open %}
|
{% if open %}
|
||||||
<center>
|
<center>
|
||||||
<h4>Choose old version</h4>
|
<h4>Choose old version</h4>
|
||||||
<form action="versions.py#conf" method="get">
|
<form action="versions.py#conf" method="post">
|
||||||
<label for="select_all" id="label_select_all"><b>Select all</b></label>
|
<label for="select_all" id="label_select_all"><b>Select all</b></label>
|
||||||
<input type="checkbox" id="select_all"><br />
|
<input type="checkbox" id="select_all"><br />
|
||||||
{% for file in return_files %}
|
{% for file in return_files %}
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="padding10 first-collumn" style="width: 10%;">
|
<td class="padding10 first-collumn" style="width: 10%;">
|
||||||
<form action="" method="get">
|
<form action="" method="post">
|
||||||
{% if onclick == 'viewLogs()' %}
|
{% if onclick == 'viewLogs()' %}
|
||||||
<select autofocus required name="serv" id="{{ select_id }}">
|
<select autofocus required name="serv" id="{{ select_id }}">
|
||||||
<option disabled selected>Choose log</option>
|
<option disabled selected>Choose log</option>
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="padding10 first-collumn" style="width: 25%;">
|
<td class="padding10 first-collumn" style="width: 25%;">
|
||||||
<form action="{{ action }}" method="get" id="runtimeapiform">
|
<form action="{{ action }}" method="post" id="runtimeapiform">
|
||||||
{% include 'include/select.html' %}
|
{% include 'include/select.html' %}
|
||||||
</td>
|
</td>
|
||||||
<td style="width: 30%;">
|
<td style="width: 30%;">
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<center>
|
<center>
|
||||||
<h3>Choose a section</h3>
|
<h3>Choose a section</h3>
|
||||||
<p>
|
<p>
|
||||||
<form action="{{ action }}" method="get">
|
<form action="{{ action }}" method="post">
|
||||||
{% if aftersave %}
|
{% if aftersave %}
|
||||||
<a class="ui-button ui-widget ui-corner-all" title="Return back" onclick="history.go(-3)">Back</a>
|
<a class="ui-button ui-widget ui-corner-all" title="Return back" onclick="history.go(-3)">Back</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
{% if role <= 2 %}
|
{% if role <= 2 %}
|
||||||
<div id="config">
|
<div id="config">
|
||||||
<h4>You are editting "{{section}}" from server {{ serv }}</h4>
|
<h4>You are editting "{{section}}" from server {{ serv }}</h4>
|
||||||
<form action="{{ action }}" name="saveconfig" method="get">
|
<form action="{{ action }}" name="saveconfig" method="post">
|
||||||
<input type="hidden" value="{{ serv }}" name="serv">
|
<input type="hidden" value="{{ serv }}" name="serv">
|
||||||
<input type="hidden" value="{{ start_line }}" name="start_line">
|
<input type="hidden" value="{{ start_line }}" name="start_line">
|
||||||
<input type="hidden" value="{{ end_line }}" name="end_line">
|
<input type="hidden" value="{{ end_line }}" name="end_line">
|
||||||
|
|
|
@ -332,7 +332,7 @@
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div id="server-add-table" style="display: none;">
|
<div id="server-add-table" style="display: none;">
|
||||||
<form id="server-add-form">
|
<form id="server-add-form" method="post">
|
||||||
<table class="overview">
|
<table class="overview">
|
||||||
{% include 'include/admin_add_server.html' %}
|
{% include 'include/admin_add_server.html' %}
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -403,4 +403,4 @@
|
||||||
width: 90px;
|
width: 90px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<br />
|
<br />
|
||||||
<form style="padding-left: 5px;" action="viewsttats.py" method="get">
|
<form style="padding-left: 5px;" action="viewsttats.py" method="post">
|
||||||
<select autofocus required name="serv" id="serv">
|
<select autofocus required name="serv" id="serv">
|
||||||
<option disabled>Choose server</option>
|
<option disabled>Choose server</option>
|
||||||
{% for select in selects %}
|
{% for select in selects %}
|
||||||
|
|
|
@ -10,7 +10,7 @@ import sql
|
||||||
from jinja2 import Environment, FileSystemLoader
|
from jinja2 import Environment, FileSystemLoader
|
||||||
env = Environment(loader=FileSystemLoader('templates/'))
|
env = Environment(loader=FileSystemLoader('templates/'))
|
||||||
template = env.get_template('admin.html')
|
template = env.get_template('admin.html')
|
||||||
form = cgi.FieldStorage()
|
form = funct.form
|
||||||
|
|
||||||
print('Content-type: text/html\n')
|
print('Content-type: text/html\n')
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ print('Content-type: text/html\n')
|
||||||
funct.check_login()
|
funct.check_login()
|
||||||
funct.page_for_admin(level = 2)
|
funct.page_for_admin(level = 2)
|
||||||
|
|
||||||
form = cgi.FieldStorage()
|
form = funct.form
|
||||||
serv = form.getvalue('serv')
|
serv = form.getvalue('serv')
|
||||||
Select = form.getvalue('del')
|
Select = form.getvalue('del')
|
||||||
configver = form.getvalue('configver')
|
configver = form.getvalue('configver')
|
||||||
|
@ -76,4 +76,4 @@ output_from_parsed_template = template.render(h2 = 1, title = "Working with vers
|
||||||
versions = funct.versions(),
|
versions = funct.versions(),
|
||||||
configver = configver,
|
configver = configver,
|
||||||
token = token)
|
token = token)
|
||||||
print(output_from_parsed_template)
|
print(output_from_parsed_template)
|
||||||
|
|
|
@ -8,7 +8,7 @@ import sql
|
||||||
from jinja2 import Environment, FileSystemLoader
|
from jinja2 import Environment, FileSystemLoader
|
||||||
env = Environment(loader=FileSystemLoader('templates/'))
|
env = Environment(loader=FileSystemLoader('templates/'))
|
||||||
template = env.get_template('logs.html')
|
template = env.get_template('logs.html')
|
||||||
form = cgi.FieldStorage()
|
form = funct.form
|
||||||
|
|
||||||
if form.getvalue('grep') is None:
|
if form.getvalue('grep') is None:
|
||||||
grep = ""
|
grep = ""
|
||||||
|
|
|
@ -6,7 +6,7 @@ import sql
|
||||||
from jinja2 import Environment, FileSystemLoader
|
from jinja2 import Environment, FileSystemLoader
|
||||||
env = Environment(loader=FileSystemLoader('templates/'))
|
env = Environment(loader=FileSystemLoader('templates/'))
|
||||||
template = env.get_template('viewstats.html')
|
template = env.get_template('viewstats.html')
|
||||||
form = cgi.FieldStorage()
|
form = funct.form
|
||||||
serv = form.getvalue('serv')
|
serv = form.getvalue('serv')
|
||||||
|
|
||||||
print('Content-type: text/html\n')
|
print('Content-type: text/html\n')
|
||||||
|
|
22
inc/add.js
22
inc/add.js
|
@ -419,7 +419,7 @@ $( function() {
|
||||||
newoptiongroup: $('#group').val(),
|
newoptiongroup: $('#group').val(),
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
if (data.indexOf('error') != '-1') {
|
if (data.indexOf('error') != '-1') {
|
||||||
$("#ajax-option").append(data);
|
$("#ajax-option").append(data);
|
||||||
|
@ -473,7 +473,7 @@ $( function() {
|
||||||
newsavedserverdesc: $('#new-saved-servers-description').val(),
|
newsavedserverdesc: $('#new-saved-servers-description').val(),
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
if (data.indexOf('error') != '-1') {
|
if (data.indexOf('error') != '-1') {
|
||||||
$("#ajax-option").append(data);
|
$("#ajax-option").append(data);
|
||||||
|
@ -747,7 +747,7 @@ $( function() {
|
||||||
ssl_name: $('#ssl_name').val(),
|
ssl_name: $('#ssl_name').val(),
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
data = data.replace(/\s+/g,' ');
|
data = data.replace(/\s+/g,' ');
|
||||||
if (data.indexOf('danger') != '-1') {
|
if (data.indexOf('danger') != '-1') {
|
||||||
|
@ -769,7 +769,7 @@ $( function() {
|
||||||
getcerts: "viewcert",
|
getcerts: "viewcert",
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
if (data.indexOf('danger') != '-1') {
|
if (data.indexOf('danger') != '-1') {
|
||||||
$("#ajax-show-ssl").html(data);
|
$("#ajax-show-ssl").html(data);
|
||||||
|
@ -957,7 +957,7 @@ function removeOption(id) {
|
||||||
optiondel: id,
|
optiondel: id,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
data = data.replace(/\s+/g,' ');
|
data = data.replace(/\s+/g,' ');
|
||||||
if(data == "Ok ") {
|
if(data == "Ok ") {
|
||||||
|
@ -975,7 +975,7 @@ function updateOptions(id) {
|
||||||
id: id,
|
id: id,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
data = data.replace(/\s+/g,' ');
|
data = data.replace(/\s+/g,' ');
|
||||||
if (data.indexOf('error') != '-1') {
|
if (data.indexOf('error') != '-1') {
|
||||||
|
@ -1020,7 +1020,7 @@ function removeSavedServer(id) {
|
||||||
savedserverdel: id,
|
savedserverdel: id,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
data = data.replace(/\s+/g,' ');
|
data = data.replace(/\s+/g,' ');
|
||||||
if(data == "Ok ") {
|
if(data == "Ok ") {
|
||||||
|
@ -1039,7 +1039,7 @@ function updateSavedServer(id) {
|
||||||
id: id,
|
id: id,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
data = data.replace(/\s+/g,' ');
|
data = data.replace(/\s+/g,' ');
|
||||||
if (data.indexOf('error') != '-1') {
|
if (data.indexOf('error') != '-1') {
|
||||||
|
@ -1066,7 +1066,7 @@ function view_ssl(id) {
|
||||||
getcert: id,
|
getcert: id,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
if (data.indexOf('danger') != '-1') {
|
if (data.indexOf('danger') != '-1') {
|
||||||
$("#ajax-show-ssl").html(data);
|
$("#ajax-show-ssl").html(data);
|
||||||
|
@ -1097,7 +1097,7 @@ function change_select_acceleration(id) {
|
||||||
serv: $('#serv'+id+' option:selected').val(),
|
serv: $('#serv'+id+' option:selected').val(),
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
if(parseFloat(data) < parseFloat('1.8')) {
|
if(parseFloat(data) < parseFloat('1.8')) {
|
||||||
$("#cache"+id).checkboxradio( "disable" );
|
$("#cache"+id).checkboxradio( "disable" );
|
||||||
|
@ -1115,7 +1115,7 @@ function change_select_waf(id) {
|
||||||
serv: $('#serv'+id+' option:selected').val(),
|
serv: $('#serv'+id+' option:selected').val(),
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
if(parseFloat(data) < parseFloat('1.8')) {
|
if(parseFloat(data) < parseFloat('1.8')) {
|
||||||
$("#waf"+id).checkboxradio( "disable" );
|
$("#waf"+id).checkboxradio( "disable" );
|
||||||
|
|
|
@ -6,7 +6,7 @@ function getChartData(server) {
|
||||||
server: server,
|
server: server,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
var data = [];
|
var data = [];
|
||||||
data.push(result.chartData.curr_con);
|
data.push(result.chartData.curr_con);
|
||||||
|
@ -81,7 +81,7 @@ function getWafChartData(server) {
|
||||||
server: server,
|
server: server,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
var data = [];
|
var data = [];
|
||||||
data.push(result.chartData.curr_con);
|
data.push(result.chartData.curr_con);
|
||||||
|
@ -145,7 +145,7 @@ function loadMetrics() {
|
||||||
beforeSend: function() {
|
beforeSend: function() {
|
||||||
$('#table_metrics').html('<img class="loading_full_page" src="/inc/images/loading.gif" />')
|
$('#table_metrics').html('<img class="loading_full_page" src="/inc/images/loading.gif" />')
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
$( "#table_metrics" ).html( data );
|
$( "#table_metrics" ).html( data );
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ if(Cookies.get('restart')) {
|
||||||
serv: ip,
|
serv: ip,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
if(data.indexOf('ok') != '-1') {
|
if(data.indexOf('ok') != '-1') {
|
||||||
$("#apply").css('display', 'block');
|
$("#apply").css('display', 'block');
|
||||||
|
@ -203,7 +203,7 @@ function showOverview() {
|
||||||
beforeSend: function() {
|
beforeSend: function() {
|
||||||
$('#ajaxstatus').html('<img class="loading" src="/inc/images/loading.gif" />')
|
$('#ajaxstatus').html('<img class="loading" src="/inc/images/loading.gif" />')
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
$("#ajaxstatus").empty();
|
$("#ajaxstatus").empty();
|
||||||
$("#ajaxstatus").html(data);
|
$("#ajaxstatus").html(data);
|
||||||
|
@ -222,7 +222,7 @@ function showOverviewServer(name,ip,id) {
|
||||||
page: 'hapservers.py',
|
page: 'hapservers.py',
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
$("#ajax-server-"+id).empty();
|
$("#ajax-server-"+id).empty();
|
||||||
$("#ajax-server-"+id).css('display', 'block');
|
$("#ajax-server-"+id).css('display', 'block');
|
||||||
|
@ -259,7 +259,7 @@ function showOverviewWaf() {
|
||||||
}
|
}
|
||||||
$('#ajaxwafstatus').html('<img class="'+load_class+'" src="/inc/images/loading.gif" />')
|
$('#ajaxwafstatus').html('<img class="'+load_class+'" src="/inc/images/loading.gif" />')
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
$("#ajaxwafstatus").empty();
|
$("#ajaxwafstatus").empty();
|
||||||
$("#ajaxwafstatus").html(data);
|
$("#ajaxwafstatus").html(data);
|
||||||
|
@ -284,7 +284,7 @@ function showOverviewHapWI() {
|
||||||
beforeSend: function() {
|
beforeSend: function() {
|
||||||
$('#ajaxHapwi').html('<img class="loading_hapwi_overview" src="/inc/images/loading.gif" />')
|
$('#ajaxHapwi').html('<img class="loading_hapwi_overview" src="/inc/images/loading.gif" />')
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
$("#ajaxHapwi").html(data);
|
$("#ajaxHapwi").html(data);
|
||||||
}
|
}
|
||||||
|
@ -298,7 +298,7 @@ function showStats() {
|
||||||
serv: $("#serv").val(),
|
serv: $("#serv").val(),
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
$("#ajax").html(data);
|
$("#ajax").html(data);
|
||||||
window.history.pushState("Stats", "Stats", cur_url[0]+"?serv="+$("#serv").val());
|
window.history.pushState("Stats", "Stats", cur_url[0]+"?serv="+$("#serv").val());
|
||||||
|
@ -342,7 +342,7 @@ function showLog() {
|
||||||
minut1: minut1,
|
minut1: minut1,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
$("#ajax").html(data);
|
$("#ajax").html(data);
|
||||||
window.history.pushState("Logs", "Logs", cur_url[0]+"?serv="+$("#serv").val()+
|
window.history.pushState("Logs", "Logs", cur_url[0]+"?serv="+$("#serv").val()+
|
||||||
|
@ -369,7 +369,7 @@ function showMap() {
|
||||||
act: "showMap",
|
act: "showMap",
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
$("#ajax").html(data);
|
$("#ajax").html(data);
|
||||||
window.history.pushState("Show map", "Show map", cur_url[0]+'?serv='+$("#serv").val()+'&showMap');
|
window.history.pushState("Show map", "Show map", cur_url[0]+'?serv='+$("#serv").val()+'&showMap');
|
||||||
|
@ -391,7 +391,7 @@ function showRuntime() {
|
||||||
save: saveCheck,
|
save: saveCheck,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
$("#ajaxruntime").html(data);
|
$("#ajaxruntime").html(data);
|
||||||
}
|
}
|
||||||
|
@ -406,7 +406,7 @@ function showCompare() {
|
||||||
right: $("#right").val(),
|
right: $("#right").val(),
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
$("#ajax").html(data);
|
$("#ajax").html(data);
|
||||||
}
|
}
|
||||||
|
@ -424,7 +424,7 @@ function showCompareConfigs() {
|
||||||
open: "open",
|
open: "open",
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
$("#ajax-compare").html(data);
|
$("#ajax-compare").html(data);
|
||||||
$( "input[type=submit], button" ).button();
|
$( "input[type=submit], button" ).button();
|
||||||
|
@ -445,7 +445,7 @@ function showConfig() {
|
||||||
act: "configShow",
|
act: "configShow",
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
$("#ajax").html(data);
|
$("#ajax").html(data);
|
||||||
$.getScript('/inc/configshow.js');
|
$.getScript('/inc/configshow.js');
|
||||||
|
@ -467,7 +467,7 @@ function showUploadConfig() {
|
||||||
token: $('#token').val(),
|
token: $('#token').val(),
|
||||||
view: view
|
view: view
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
$("#ajax").html(data);
|
$("#ajax").html(data);
|
||||||
if(view == "1") {
|
if(view == "1") {
|
||||||
|
@ -501,7 +501,7 @@ function viewLogs() {
|
||||||
minut1: minut1,
|
minut1: minut1,
|
||||||
token: $('#token').val(),
|
token: $('#token').val(),
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
$("#ajax").html(data);
|
$("#ajax").html(data);
|
||||||
window.history.pushState("View logs", "View logs", cur_url[0]+"?viewlogs="+$("#viewlogs").val()+
|
window.history.pushState("View logs", "View logs", cur_url[0]+"?viewlogs="+$("#viewlogs").val()+
|
||||||
|
@ -694,7 +694,7 @@ $( function() {
|
||||||
login: $('#login').val(),
|
login: $('#login').val(),
|
||||||
pass: $('#pass').val()
|
pass: $('#pass').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
if (data.indexOf('ok') != '-1') {
|
if (data.indexOf('ok') != '-1') {
|
||||||
window.location.replace(ref);
|
window.location.replace(ref);
|
||||||
|
@ -829,7 +829,7 @@ $( function() {
|
||||||
serv: $('#haproxyaddserv option:selected').val(),
|
serv: $('#haproxyaddserv option:selected').val(),
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
data = data.replace(/^\s+|\s+$/g,'');
|
data = data.replace(/^\s+|\s+$/g,'');
|
||||||
if(data != '') {
|
if(data != '') {
|
||||||
|
@ -898,7 +898,7 @@ function createList(color) {
|
||||||
group: $('#group').val(),
|
group: $('#group').val(),
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
$("#ajax").html(data);
|
$("#ajax").html(data);
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
@ -916,7 +916,7 @@ function editList(list, color) {
|
||||||
group: $('#group').val(),
|
group: $('#group').val(),
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
if (data.indexOf('danger') != '-1') {
|
if (data.indexOf('danger') != '-1') {
|
||||||
$("#ajax").html(data);
|
$("#ajax").html(data);
|
||||||
|
@ -958,7 +958,7 @@ function saveList(action, list, color) {
|
||||||
bwlists_restart: action,
|
bwlists_restart: action,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
$("#ajax").html(data);
|
$("#ajax").html(data);
|
||||||
}
|
}
|
||||||
|
|
50
inc/users.js
50
inc/users.js
|
@ -81,7 +81,7 @@ $( function() {
|
||||||
syn_flood: syn_flood,
|
syn_flood: syn_flood,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
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') {
|
||||||
|
@ -125,7 +125,7 @@ $( function() {
|
||||||
kp: kp,
|
kp: kp,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
data = data.replace(/\s+/g,' ');
|
data = data.replace(/\s+/g,' ');
|
||||||
if (data.indexOf('error') != '-1') {
|
if (data.indexOf('error') != '-1') {
|
||||||
|
@ -157,7 +157,7 @@ $( function() {
|
||||||
hapver: $('#hapver option:selected' ).val(),
|
hapver: $('#hapver option:selected' ).val(),
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
data = data.replace(/\s+/g,' ');
|
data = data.replace(/\s+/g,' ');
|
||||||
if (data.indexOf('error') != '-1' || data.indexOf('FAILED') != '-1') {
|
if (data.indexOf('error') != '-1' || data.indexOf('FAILED') != '-1') {
|
||||||
|
@ -187,7 +187,7 @@ $( function() {
|
||||||
update_haproxy_wi: 1,
|
update_haproxy_wi: 1,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
data = data.replace(/\s+/g,' ');
|
data = data.replace(/\s+/g,' ');
|
||||||
if (data.indexOf('error') != '-1' || data.indexOf('Failed') != '-1') {
|
if (data.indexOf('error') != '-1' || data.indexOf('Failed') != '-1') {
|
||||||
|
@ -247,7 +247,7 @@ $( function() {
|
||||||
newdesc: $('#new-desc').val(),
|
newdesc: $('#new-desc').val(),
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
if (data.indexOf('error') != '-1') {
|
if (data.indexOf('error') != '-1') {
|
||||||
$("#ajax-group").append(data);
|
$("#ajax-group").append(data);
|
||||||
|
@ -284,7 +284,7 @@ $( function() {
|
||||||
page: cur_url[0],
|
page: cur_url[0],
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
if (data.indexOf('error') != '-1') {
|
if (data.indexOf('error') != '-1') {
|
||||||
$("#ajax-ssh").append(data);
|
$("#ajax-ssh").append(data);
|
||||||
|
@ -323,7 +323,7 @@ $( function() {
|
||||||
page: cur_url[0],
|
page: cur_url[0],
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
if (data.indexOf('error') != '-1') {
|
if (data.indexOf('error') != '-1') {
|
||||||
$("#ajax-telegram").append(data);
|
$("#ajax-telegram").append(data);
|
||||||
|
@ -492,7 +492,7 @@ $( function() {
|
||||||
get_ldap_email: $('#new-username').val(),
|
get_ldap_email: $('#new-username').val(),
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
data = data.replace(/\s+/g,' ');
|
data = data.replace(/\s+/g,' ');
|
||||||
if (data.indexOf('error') != '-1') {
|
if (data.indexOf('error') != '-1') {
|
||||||
|
@ -560,7 +560,7 @@ function addUser() {
|
||||||
newgroupuser: $('#new-group').val(),
|
newgroupuser: $('#new-group').val(),
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
data = data.replace(/\s+/g,' ');
|
data = data.replace(/\s+/g,' ');
|
||||||
if (data.indexOf('error') != '-1') {
|
if (data.indexOf('error') != '-1') {
|
||||||
|
@ -632,7 +632,7 @@ function addServer() {
|
||||||
active: active,
|
active: active,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
data = data.replace(/\s+/g,' ');
|
data = data.replace(/\s+/g,' ');
|
||||||
if (data.indexOf('error') != '-1') {
|
if (data.indexOf('error') != '-1') {
|
||||||
|
@ -669,7 +669,7 @@ function updateSettings(param, val) {
|
||||||
val: val,
|
val: val,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
data = data.replace(/\s+/g,' ');
|
data = data.replace(/\s+/g,' ');
|
||||||
if (data.indexOf('error') != '-1') {
|
if (data.indexOf('error') != '-1') {
|
||||||
|
@ -867,7 +867,7 @@ function removeUser(id) {
|
||||||
userdel: id,
|
userdel: id,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
data = data.replace(/\s+/g,' ');
|
data = data.replace(/\s+/g,' ');
|
||||||
if(data == "Ok ") {
|
if(data == "Ok ") {
|
||||||
|
@ -884,7 +884,7 @@ function removeServer(id) {
|
||||||
serverdel: id,
|
serverdel: id,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
data = data.replace(/\s+/g,' ');
|
data = data.replace(/\s+/g,' ');
|
||||||
if(data == "Ok ") {
|
if(data == "Ok ") {
|
||||||
|
@ -901,7 +901,7 @@ function removeGroup(id) {
|
||||||
groupdel: id,
|
groupdel: id,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
data = data.replace(/\s+/g,' ');
|
data = data.replace(/\s+/g,' ');
|
||||||
if(data == "Ok ") {
|
if(data == "Ok ") {
|
||||||
|
@ -920,7 +920,7 @@ function removeSsh(id) {
|
||||||
sshdel: id,
|
sshdel: id,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
data = data.replace(/\s+/g,' ');
|
data = data.replace(/\s+/g,' ');
|
||||||
if(data == "Ok ") {
|
if(data == "Ok ") {
|
||||||
|
@ -939,7 +939,7 @@ function removeTelegram(id) {
|
||||||
telegramdel: id,
|
telegramdel: id,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
data = data.replace(/\s+/g,' ');
|
data = data.replace(/\s+/g,' ');
|
||||||
if(data == "Ok ") {
|
if(data == "Ok ") {
|
||||||
|
@ -972,7 +972,7 @@ function updateUser(id) {
|
||||||
id: id,
|
id: id,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
data = data.replace(/\s+/g,' ');
|
data = data.replace(/\s+/g,' ');
|
||||||
if (data.indexOf('error') != '-1') {
|
if (data.indexOf('error') != '-1') {
|
||||||
|
@ -1001,7 +1001,7 @@ function updateGroup(id) {
|
||||||
id: id,
|
id: id,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
data = data.replace(/\s+/g,' ');
|
data = data.replace(/\s+/g,' ');
|
||||||
if (data.indexOf('error') != '-1') {
|
if (data.indexOf('error') != '-1') {
|
||||||
|
@ -1066,7 +1066,7 @@ function updateServer(id) {
|
||||||
active: active,
|
active: active,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
data = data.replace(/\s+/g,' ');
|
data = data.replace(/\s+/g,' ');
|
||||||
if (data.indexOf('error') != '-1') {
|
if (data.indexOf('error') != '-1') {
|
||||||
|
@ -1097,7 +1097,7 @@ function uploadSsh() {
|
||||||
name: $('#ssh-key-name').val(),
|
name: $('#ssh-key-name').val(),
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
data = data.replace(/\s+/g,' ');
|
data = data.replace(/\s+/g,' ');
|
||||||
if (data.indexOf('danger') != '-1') {
|
if (data.indexOf('danger') != '-1') {
|
||||||
|
@ -1130,7 +1130,7 @@ function updateSSH(id) {
|
||||||
id: id,
|
id: id,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
data = data.replace(/\s+/g,' ');
|
data = data.replace(/\s+/g,' ');
|
||||||
if (data.indexOf('error') != '-1') {
|
if (data.indexOf('error') != '-1') {
|
||||||
|
@ -1164,7 +1164,7 @@ function updateTelegram(id) {
|
||||||
id: id,
|
id: id,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
data = data.replace(/\s+/g,' ');
|
data = data.replace(/\s+/g,' ');
|
||||||
if (data.indexOf('error') != '-1') {
|
if (data.indexOf('error') != '-1') {
|
||||||
|
@ -1202,7 +1202,7 @@ function showApacheLog(serv) {
|
||||||
minut1: minut1,
|
minut1: minut1,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
$("#ajax").html(data);
|
$("#ajax").html(data);
|
||||||
window.history.pushState("Logs", "Logs", cur_url[0]+"?serv="+serv+"&rows1="+rows+"&grep="+grep+
|
window.history.pushState("Logs", "Logs", cur_url[0]+"?serv="+serv+"&rows1="+rows+"&grep="+grep+
|
||||||
|
@ -1221,7 +1221,7 @@ function checkSshConnect(ip) {
|
||||||
serv: ip,
|
serv: ip,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
if (data.indexOf('danger') != '-1') {
|
if (data.indexOf('danger') != '-1') {
|
||||||
$("#ajax").html(data);
|
$("#ajax").html(data);
|
||||||
|
@ -1281,7 +1281,7 @@ function changeUserPassword(id, d) {
|
||||||
id: id,
|
id: id,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
data = data.replace(/\s+/g,' ');
|
data = data.replace(/\s+/g,' ');
|
||||||
if (data.indexOf('error') != '-1') {
|
if (data.indexOf('error') != '-1') {
|
||||||
|
|
|
@ -16,7 +16,7 @@ function metrics_waf(name) {
|
||||||
enable: enable,
|
enable: enable,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
showOverviewWaf();
|
showOverviewWaf();
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
@ -34,7 +34,7 @@ function installWaf(ip) {
|
||||||
installwaf: ip,
|
installwaf: ip,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
data = data.replace(/\s+/g,' ');
|
data = data.replace(/\s+/g,' ');
|
||||||
if (data.indexOf('error') != '-1' || data.indexOf('Failed') != '-1') {
|
if (data.indexOf('error') != '-1' || data.indexOf('Failed') != '-1') {
|
||||||
|
@ -62,7 +62,7 @@ function changeWafMode(id) {
|
||||||
server_hostname: server_hostname,
|
server_hostname: server_hostname,
|
||||||
token: $('#token').val()
|
token: $('#token').val()
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "POST",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
alert('Do not forget restart WAF server: '+server_hostname)
|
alert('Do not forget restart WAF server: '+server_hostname)
|
||||||
$( '#'+server_hostname+'-select-line' ).addClass( "update", 1000 );
|
$( '#'+server_hostname+'-select-line' ).addClass( "update", 1000 );
|
||||||
|
|
Loading…
Reference in New Issue