Changelog: https://roxy-wi.org/changelog#6_3_9
pull/364/head
Aidaho 2023-04-02 19:58:55 +03:00
parent fd009361ca
commit ab93673f2a
57 changed files with 863 additions and 620 deletions

View File

@ -62,9 +62,10 @@ if all(v is None for v in [
black_lists = roxywi_common.get_files(folder=black_dir, file_format="lst")
template = template.render(
role=user_params['role'], user=user_params['user'], selects=user_params['servers'], add=form.getvalue('add'), conf_add=form.getvalue('conf'),
group=user_group, options=sql.select_options(), saved_servers=sql.select_saved_servers(), white_lists=white_lists,
black_lists=black_lists, user_services=user_params['user_services'], token=user_params['token'], lang=user_params['lang']
h2=1, role=user_params['role'], user=user_params['user'], selects=user_params['servers'], add=form.getvalue('add'),
conf_add=form.getvalue('conf'), group=user_group, options=sql.select_options(), saved_servers=sql.select_saved_servers(),
white_lists=white_lists, black_lists=black_lists, user_services=user_params['user_services'], token=user_params['token'],
lang=user_params['lang']
)
print(template)

View File

@ -797,7 +797,7 @@ def update_db_v_6_3_8():
def update_ver():
try:
Version.update(version='6.3.8.0').execute()
Version.update(version='6.3.9.0').execute()
except Exception:
print('Cannot update version')

View File

@ -318,20 +318,30 @@ def update_hapwi_server(server_id, alert, metrics, active, service_name):
out_error(e)
def update_server(
hostname, group, typeip, enable, master, server_id, cred, port, desc, haproxy, nginx, apache, firewall, protected
):
def update_server(hostname, group, typeip, enable, master, server_id, cred, port, desc, firewall, protected):
try:
server_update = Server.update(
hostname=hostname, groups=group, type_ip=typeip, enable=enable, master=master, cred=cred,
port=port, desc=desc, haproxy=haproxy, nginx=nginx, apache=apache, firewall_enable=firewall,
protected=protected
port=port, desc=desc, firewall_enable=firewall, protected=protected
).where(Server.server_id == server_id)
server_update.execute()
except Exception as e:
out_error(e)
def update_server_services(server_id: str, haproxy: int, nginx: int, apache: int, keepalived: int) -> bool:
try:
server_update = Server.update(
haproxy=haproxy, nginx=nginx, apache=apache, keepalived=keepalived
).where(Server.server_id == server_id)
server_update.execute()
except Exception as e:
out_error(e)
return False
else:
return True
def update_server_master(master, slave):
try:
master_id = Server.get(Server.ip == master).server_id
@ -1443,20 +1453,17 @@ def insert_nginx_waf_rules(serv):
{'serv': serv, 'rule_name': 'Nextcloud exclusion rules', 'rule_file': 'REQUEST-903.9003-NEXTCLOUD-EXCLUSION-RULES.conf',
'desc': 'These exclusions remedy false positives in a default NextCloud install. They will likely work with OwnCloud '
'too, but you may have to modify them. The exclusions are only active if crs_exclusions_nextcloud=1 is set. '
'See rule 900130 in crs-setup.conf for instructions.',
'service': 'nginx'},
'See rule 900130 in crs-setup.conf for instructions.', 'service': 'nginx'},
{'serv': serv, 'rule_name': 'Dokuwiki exclusion rules', 'rule_file': 'REQUEST-903.9004-DOKUWIKI-EXCLUSION-RULES.conf',
'desc': 'These exclusions remedy false positives in a default Dokuwiki install. The exclusions are only active '
'if crs_exclusions_dokuwiki=1 is set. See rule 900130 in crs-setup.conf for instructions.',
'service': 'nginx'},
'if crs_exclusions_dokuwiki=1 is set. See rule 900130 in crs-setup.conf for instructions.', 'service': 'nginx'},
{'serv': serv, 'rule_name': 'CPanel exclusion rules', 'rule_file': 'REQUEST-903.9005-CPANEL-EXCLUSION-RULES.conf',
'desc': 'These exclusions remedy false positives in a default CPanel install. The exclusions are only active '
'if crs_exclusions_cpanel=1 is set. See rule 900130 in crs-setup.conf for instructions.',
'service': 'nginx'},
{'serv': serv, 'rule_name': 'XenForo exclusion rules', 'rule_file': 'REQUEST-903.9006-XENFORO-EXCLUSION-RULES.conf',
'desc': 'These exclusions remedy false positives in a default XenForo install. The exclusions are only active '
'if crs_exclusions_xenforo=1 is set. See rule 900130 in crs-setup.conf for instructions.',
'service': 'nginx'},
'if crs_exclusions_xenforo=1 is set. See rule 900130 in crs-setup.conf for instructions.', 'service': 'nginx'},
{'serv': serv, 'rule_name': 'Common exceptions', 'rule_file': 'REQUEST-905-COMMON-EXCEPTIONS.conf',
'desc': 'This file is used as an exception mechanism to remove common false positives that may be encountered.',
'service': 'nginx'},
@ -1469,8 +1476,7 @@ def insert_nginx_waf_rules(serv):
{'serv': serv, 'rule_name': 'Protocol enforcement', 'rule_file': 'REQUEST-920-PROTOCOL-ENFORCEMENT.conf',
'desc': 'Some protocol violations are common in application layer attacks. Validating HTTP requests eliminates '
'a large number of application layer attacks. The purpose of this rules file is to enforce HTTP RFC '
'requirements that state how the client is supposed to interact with the server.',
'service': 'nginx'},
'requirements that state how the client is supposed to interact with the server.', 'service': 'nginx'},
{'serv': serv, 'rule_name': 'Protocol attack', 'rule_file': 'REQUEST-921-PROTOCOL-ATTACK.conf',
'desc': 'Protocol attack rule.', 'service': 'nginx'},
{'serv': serv, 'rule_name': 'Application attack LFI', 'rule_file': 'REQUEST-930-APPLICATION-ATTACK-LFI.conf',

View File

@ -107,22 +107,24 @@ def show_overview(serv) -> None:
return server_status
async def get_runner_overview():
env = Environment(loader=FileSystemLoader('templates/ajax'), autoescape=True,
env = Environment(loader=FileSystemLoader('templates/'), autoescape=True,
extensions=['jinja2.ext.loopcontrols', 'jinja2.ext.do'])
servers = []
template = env.get_template('overview.html')
template = env.get_template('ajax/overview.html')
cookie = http.cookies.SimpleCookie(os.environ.get("HTTP_COOKIE"))
user_uuid = cookie.get('uuid')
group_id = cookie.get('group')
group_id = int(group_id.value)
lang = roxywi_common.get_user_lang()
role = sql.get_user_role_by_uuid(user_uuid.value, group_id)
futures = [async_get_overview(server[1], server[2], user_uuid.value, server[0]) for server in
sql.select_servers(server=serv)]
for i, future in enumerate(asyncio.as_completed(futures)):
result = await future
servers.append(result)
servers_sorted = sorted(servers, key=common.get_key)
template = template.render(service_status=servers_sorted, role=sql.get_user_role_by_uuid(user_uuid.value, group_id))
template = template.render(service_status=servers_sorted, role=role, lang=lang)
print(template)
ioloop = asyncio.get_event_loop()
@ -216,6 +218,7 @@ def show_services_overview() -> None:
servers_group = []
host = os.environ.get('HTTP_HOST', '')
user_group = roxywi_common.get_user_group(id=1)
lang = roxywi_common.get_user_lang()
if (user_params['role'] == 2 or user_params['role'] == 3) and int(user_group) != 1:
for s in user_params['servers']:
@ -271,7 +274,7 @@ def show_services_overview() -> None:
metrics_log_id=roxy_logs.roxy_wi_log(log_id=1, file="metrics"),
checker_log_id=roxy_logs.roxy_wi_log(log_id=1, file="checker"),
keep_alive_log_id=roxy_logs.roxy_wi_log(log_id=1, file="keep_alive"),
socket_log_id=roxy_logs.roxy_wi_log(log_id=1, file="socket"), error=stderr
socket_log_id=roxy_logs.roxy_wi_log(log_id=1, file="socket"), error=stderr, lang=lang
)
print(rendered_template)

View File

@ -1,5 +1,7 @@
import json
from jinja2 import Environment, FileSystemLoader
import modules.db.sql as sql
import modules.server.ssh as mod_ssh
import modules.common.common as common
@ -345,8 +347,6 @@ def get_system_info(server_ip: str) -> str:
def show_system_info() -> None:
from jinja2 import Environment, FileSystemLoader
server_ip = form.getvalue('server_ip')
server_ip = common.is_ip_or_dns(server_ip)
server_id = form.getvalue('server_id')
@ -376,8 +376,6 @@ def show_system_info() -> None:
def update_system_info() -> None:
from jinja2 import Environment, FileSystemLoader
server_ip = form.getvalue('server_ip')
server_ip = common.is_ip_or_dns(server_ip)
server_id = form.getvalue('server_id')
@ -404,8 +402,6 @@ def update_system_info() -> None:
def show_firewalld_rules() -> None:
from jinja2 import Environment, FileSystemLoader
serv = common.checkAjaxInput(form.getvalue('viewFirewallRules'))
cmd = ["sudo iptables -L INPUT -n --line-numbers|sed 's/ */ /g'|grep -v -E 'Chain|target'"]
@ -431,59 +427,61 @@ def show_firewalld_rules() -> None:
print(template)
def create_server(hostname, ip, group, typeip, enable, master, cred, port, desc, haproxy, nginx, apache, firewall, scan_server, **kwargs) -> bool:
def create_server(hostname, ip, group, typeip, enable, master, cred, port, desc, haproxy, nginx, apache, firewall, **kwargs) -> bool:
if not roxywi_auth.is_admin(level=2, role_id=kwargs.get('role_id')):
raise Exception('not enough permission')
raise Exception('error: not enough permission')
if sql.add_server(hostname, ip, group, typeip, enable, master, cred, port, desc, haproxy, nginx, apache, firewall):
try:
try:
sql.insert_new_checker_setting_for_server(ip)
except Exception as e:
roxywi_common.logging(f'Cannot insert Checker settings for {hostname}', str(e), roxywi=1)
raise Exception(f'error: Cannot insert Checker settings for {hostname} {e}')
if scan_server == '1':
nginx_config_path = sql.get_setting('nginx_config_path')
haproxy_config_path = sql.get_setting('haproxy_config_path')
haproxy_dir = sql.get_setting('haproxy_dir')
apache_config_path = sql.get_setting('apache_config_path')
keepalived_config_path = sql.get_setting('keepalived_config_path')
if is_file_exists(ip, nginx_config_path):
sql.update_nginx(ip)
if is_file_exists(ip, haproxy_config_path):
sql.update_haproxy(ip)
if is_file_exists(ip, keepalived_config_path):
sql.update_keepalived(ip)
if is_file_exists(ip, apache_config_path):
sql.update_apache(ip)
if is_file_exists(ip, haproxy_dir + '/waf/bin/modsecurity'):
sql.insert_waf_metrics_enable(ip, "0")
sql.insert_waf_rules(ip)
if is_service_active(ip, 'firewalld'):
sql.update_firewall(ip)
except Exception as e:
roxywi_common.logging(f'Cannot scan a new server {hostname}', str(e), roxywi=1)
raise Exception(f'error: Cannot scan a new server {hostname} {e}')
try:
get_system_info(ip)
except Exception as e:
roxywi_common.logging(f'Cannot get information from {hostname}', str(e), roxywi=1, login=1)
raise Exception(f'error: Cannot get information from {hostname} {e}')
return True
else:
return False
def update_server_after_creating(hostname: str, ip: str, scan_server: int) -> None:
try:
try:
sql.insert_new_checker_setting_for_server(ip)
except Exception as e:
roxywi_common.logging(f'Cannot insert Checker settings for {hostname}', str(e), roxywi=1)
raise Exception(f'error: Cannot insert Checker settings for {hostname} {e}')
if scan_server == '1':
nginx_config_path = sql.get_setting('nginx_config_path')
haproxy_config_path = sql.get_setting('haproxy_config_path')
haproxy_dir = sql.get_setting('haproxy_dir')
apache_config_path = sql.get_setting('apache_config_path')
keepalived_config_path = sql.get_setting('keepalived_config_path')
if is_file_exists(ip, nginx_config_path):
sql.update_nginx(ip)
if is_file_exists(ip, haproxy_config_path):
sql.update_haproxy(ip)
if is_file_exists(ip, keepalived_config_path):
sql.update_keepalived(ip)
if is_file_exists(ip, apache_config_path):
sql.update_apache(ip)
if is_file_exists(ip, haproxy_dir + '/waf/bin/modsecurity'):
sql.insert_waf_metrics_enable(ip, "0")
sql.insert_waf_rules(ip)
if is_service_active(ip, 'firewalld'):
sql.update_firewall(ip)
except Exception as e:
roxywi_common.logging(f'Cannot scan a new server {hostname}', str(e), roxywi=1)
raise Exception(f'error: Cannot scan a new server {hostname} {e}')
try:
get_system_info(ip)
except Exception as e:
roxywi_common.logging(f'Cannot get information from {hostname}', str(e), roxywi=1, login=1)
raise Exception(f'error: Cannot get information from {hostname} {e}')
def delete_server(server_id: int) -> None:
server = sql.select_servers(id=server_id)
server_ip = ''
@ -514,3 +512,34 @@ def server_is_up(server_ip: str) -> None:
cmd = [f'if ping -c 1 -W 1 {server_ip} >> /dev/null; then echo up; else echo down; fi']
server_status, stderr = subprocess_execute(cmd)
print(server_status)
def show_server_services() -> None:
server_id = common.checkAjaxInput(form.getvalue('server_id'))
server = sql.select_servers(id=server_id)
env = Environment(loader=FileSystemLoader('templates'))
template = env.get_template('ajax/show_server_services.html')
lang = roxywi_common.get_user_lang()
template = template.render(server=server, lang=lang)
print(template)
def change_server_services() -> None:
import json
server_id = common.checkAjaxInput(form.getvalue('changeServerServicesId'))
server_name = common.checkAjaxInput(form.getvalue('changeServerServicesServer'))
services = sql.select_services()
services_status = {}
server_services = json.loads(form.getvalue('jsonDatas'))
for k, v in server_services.items():
for service in services:
if service.service_id == int(k):
services_status[service.service_id] = v
try:
if sql.update_server_services(server_id, services_status[1], services_status[2], services_status[4], services_status[3]):
roxywi_common.logging('Roxy-WI server', f'Active services have been updated for {server_name}', roxywi=1, login=1)
except Exception as e:
print(e)

View File

@ -713,7 +713,6 @@ if form.getvalue('newserver') is not None:
hostname = common.checkAjaxInput(form.getvalue('servername'))
ip = common.is_ip_or_dns(form.getvalue('newip'))
group = common.checkAjaxInput(form.getvalue('newservergroup'))
scan_server = common.checkAjaxInput(form.getvalue('scan_server'))
typeip = common.checkAjaxInput(form.getvalue('typeip'))
haproxy = common.checkAjaxInput(form.getvalue('haproxy'))
nginx = common.checkAjaxInput(form.getvalue('nginx'))
@ -732,7 +731,7 @@ if form.getvalue('newserver') is not None:
print('error: IP or DNS name is not valid')
sys.exit()
try:
if server_mod.create_server(hostname, ip, group, typeip, enable, master, cred, port, desc, haproxy, nginx, apache, firewall, scan_server):
if server_mod.create_server(hostname, ip, group, typeip, enable, master, cred, port, desc, haproxy, nginx, apache, firewall):
try:
user_subscription = roxywi_common.return_user_status()
except Exception as e:
@ -741,19 +740,24 @@ if form.getvalue('newserver') is not None:
env = Environment(loader=FileSystemLoader('templates/'), autoescape=True)
template = env.get_template('ajax/new_server.html')
template = template.render(groups=sql.select_groups(),
servers=sql.select_servers(server=ip),
masters=sql.select_servers(get_master_servers=1),
sshs=sql.select_ssh(group=group),
page=page,
user_status=user_subscription['user_status'],
user_plan=user_subscription['user_plan'],
adding=1,
lang=lang)
template = template.render(groups=sql.select_groups(), servers=sql.select_servers(server=ip),
masters=sql.select_servers(get_master_servers=1), sshs=sql.select_ssh(group=group),
page=page, user_status=user_subscription['user_status'], user_plan=user_subscription['user_plan'],
adding=1,lang=lang)
print(template)
roxywi_common.logging(ip, f'A new server {hostname} has been created', roxywi=1, login=1,
keep_history=1, service='server')
roxywi_common.logging(ip, f'A new server {hostname} has been created', roxywi=1, login=1, keep_history=1, service='server')
except Exception as e:
print(f'error: {e}')
if act == 'after_adding':
hostname = common.checkAjaxInput(form.getvalue('servername'))
ip = common.is_ip_or_dns(form.getvalue('newip'))
group = common.checkAjaxInput(form.getvalue('newservergroup'))
scan_server = common.checkAjaxInput(form.getvalue('scan_server'))
try:
server_mod.update_server_after_creating(hostname, ip, scan_server)
except Exception as e:
print(e)
@ -773,9 +777,6 @@ if form.getvalue('updateserver') is not None:
name = form.getvalue('updateserver')
group = form.getvalue('servergroup')
typeip = form.getvalue('typeip')
haproxy = form.getvalue('haproxy')
nginx = form.getvalue('nginx')
apache = form.getvalue('apache')
firewall = form.getvalue('firewall')
enable = form.getvalue('enable')
master = form.getvalue('slave')
@ -788,8 +789,7 @@ if form.getvalue('updateserver') is not None:
if name is None or port is None:
print(error_mess)
else:
sql.update_server(name, group, typeip, enable, master, serv_id, cred, port, desc, haproxy, nginx, apache,
firewall, protected)
sql.update_server(name, group, typeip, enable, master, serv_id, cred, port, desc, firewall, protected)
roxywi_common.logging(f'the server {name}', ' has been updated ', roxywi=1, login=1)
server_ip = sql.select_server_ip_by_id(serv_id)
roxywi_common.logging(server_ip, f'The server {name} has been update', roxywi=1, login=1,
@ -2367,3 +2367,9 @@ if form.getvalue('updateServiceCheckerSettings'):
print('ok')
else:
print('error: Cannot update Checker settings')
if act == 'show_server_services':
server_mod.show_server_services()
if form.getvalue('changeServerServicesId') is not None:
server_mod.change_server_services()

View File

@ -26,7 +26,7 @@ if servbackend is None:
servbackend = ""
rendered_template = template.render(
h2=0, title="RunTime API", role=user_params['role'], user=user_params['user'], select_id="serv",
h2=1, title="RunTime API", role=user_params['role'], user=user_params['user'], select_id="serv",
selects=user_params['servers'], token=user_params['token'], user_services=user_params['user_services'],
servbackend=servbackend, lang=user_params['lang']
)

View File

@ -49,7 +49,7 @@ else:
title = "Servers: "
rendered_template = template.render(
title=title, role=user_params['role'], user=user_params['user'], users=sql.select_users(group=user_group),
h2=1, title=title, role=user_params['role'], user=user_params['user'], users=sql.select_users(group=user_group),
groups=sql.select_groups(), servers=servers, roles=sql.select_roles(), sshs=sql.select_ssh(group=user_group),
masters=masters, group=user_group, services=services, timezones=pytz.all_timezones, guide_me=1,
token=user_params['token'], settings=settings, backups=sql.select_backups(), page="servers.py",

View File

@ -29,14 +29,14 @@
<script defer src="/inc/fa-solid.min.js"></script>
<script defer src="/inc/fontawesome.min.js"></script>
<script defer src="/inc/ion.sound.min.js"></script>
<link href="/inc/css/awesome.css" rel="stylesheet">
<link href="/inc/css/style.css" rel="stylesheet">
<link href="/inc/css/awesome-6.3.9.css" rel="stylesheet">
<link href="/inc/css/style-6.3.9.css" rel="stylesheet">
<link href="/inc/css/nprogress.css" rel="stylesheet">
<link href="/inc/css/jquery-ui.css" rel="stylesheet">
<script src="/inc/jquery-1.12.4.js"></script>
<script src="/inc/jquery-ui.js"></script>
<script src="/inc/js.cookie.min.js"></script>
<script src="/inc/script.js"></script>
<script src="/inc/script-6.3.9.js"></script>
<script src="/inc/nprogress.js"></script>
<link href="/inc/css/toastr.css" rel="stylesheet"/>
<script src="/inc/toastr.js"></script>

View File

@ -29,16 +29,16 @@
<script defer src="/inc/fa-solid.min.js"></script>
<script defer src="/inc/fontawesome.min.js"></script>
<script defer src="/inc/ion.sound.min.js"></script>
<link href="/inc/css/awesome.css" rel="stylesheet">
<link href="/inc/css/style.css" rel="stylesheet">
<link href="/inc/css/awesome-6.3.9.css" rel="stylesheet">
<link href="/inc/css/style-6.3.9.css" rel="stylesheet">
<link href="/inc/css/nprogress.css" rel="stylesheet">
<link href="/inc/css/jquery-ui.css" rel="stylesheet">
<script src="/inc/jquery-1.12.4.js"></script>
<script src="/inc/jquery-ui.js"></script>
<script src="/inc/js.cookie.min.js"></script>
<script src="/inc/script.js"></script>
<script src="/inc/script-6.3.9.js"></script>
<script src="/inc/nprogress.js"></script>
<link href="/inc/css/toastr.css" rel="stylesheet"/>
<link href="/inc/css/toastr-6.3.9.css" rel="stylesheet"/>
<script src="/inc/toastr.js"></script>
</head>
<body>

View File

@ -33,7 +33,6 @@
<li><a href="#userlist" title="{{lang.words.add|title()}} {{lang.words.proxy}}: {{lang.words.create|title()}} {{lang.words.userlists|title()}} - Roxy-WI">{{lang.words.userlists|title()}}</a></li>
<li><a href="#peers" title="{{lang.words.add|title()}} {{lang.words.proxy}}: {{lang.words.create|title()}} peers - Roxy-WI">Peers</a></li>
<li><a href="#lists" title="{{lang.words.add|title()}} {{lang.words.proxy}}: {{lang.words.create|title()}} {{lang.words.and}} {{lang.words.upload}} {{lang.words.whitelists}} {{lang.words.or}} {{lang.words.blacklists}} - Roxy-WI">{{lang.words.lists|title()}}</a></li>
{% include 'include/login.html' %}
</ul>
<ul id='browse_histroy'></ul>
{% include 'include/add_proxy.html' %}

View File

@ -10,7 +10,6 @@
<ul>
<li><a href="#create" title="{{lang.words.add|title()}} {{lang.words.proxy}}: {{lang.words.add|title()}} {{lang.words.proxy}} - Roxy-WI">{{lang.words.add|title()}} {{lang.words.proxy}}</a></li>
<li><a href="#upstream" title="{{lang.words.add|title()}} {{lang.words.proxy}}: {{lang.words.create|title()}} {{lang.words.upstream|title()}} - Roxy-WI">{{lang.words.upstream|title()}}</a></li>
{% include 'include/login.html' %}
</ul>
<ul id='browse_histroy'></ul>
{% include 'include/add_nginx_proxy.html' %}

View File

@ -17,12 +17,9 @@
<li><a href="#settings" title="{{lang.words.admin_area|title()}}: {{lang.words.manage|title()}} Roxy-WI {{lang.words.settings}} - Roxy-WI">{{lang.words.settings|title()}}</a></li>
<li><a href="#services" title="{{lang.words.admin_area|title()}}: {{lang.words.manage|title()}} Roxy-WI {{lang.words.services}} - Roxy-WI">{{lang.words.services|title()}}</a></li>
<li><a href="#updatehapwi" title="{{lang.words.admin_area|title()}}: {{lang.words.w_update|title()}} Roxy-WI - Roxy-WI">{{lang.words.w_update|title()}}</a></li>
<li><a href="#backup" title="{{lang.words.admin_area|title()}}: {{lang.words.manage|title()}} {{lang.words.backup|title()}} configs - Roxy-WI" id="admin-tabs-backup">{{lang.words.backup|title()}}</a></li>
<li><a href="#installmon" title="{{lang.words.servers|title()}}: {{lang.words.monitoring|title()}} service installation - Roxy-WI" id="admin-tabs-mon">{{lang.words.monitoring|title()}} {{lang.words.installation}}</a></li>
{% include 'include/login.html' %}
<li><a href="#installmon" title="{{lang.words.servers|title()}}: {{lang.words.monitoring|title()}} {{lang.words.service}} {{lang.words.installation}} - Roxy-WI" id="admin-tabs-mon">{{lang.words.monitoring|title()}} {{lang.words.installation}}</a></li>
<li><a href="#backup" title="{{lang.words.admin_area|title()}}: {{lang.words.manage|title()}} {{lang.words.backup|title()}} {{lang.words.configs}} - Roxy-WI" id="admin-tabs-backup">{{lang.words.backup|title()}}</a></li>
</ul>
<ul id='browse_histroy'></ul>
<div id="users">
{% include 'include/admin_users.html' %}
</div>
@ -135,13 +132,12 @@
<div id="ajax-update"></div>
</div>
<div id="backup">
{% include 'include/admin_backup.html' %}
</div>
<div id="installmon">
{% include 'include/mon_installation.html' %}
</div>
<div id="backup">
{% include 'include/admin_backup.html' %}
</div>
</div>
{% include 'include/admins_dialogs.html' %}
<script>

View File

@ -1,5 +1,5 @@
{% import 'languages/'+lang|default('en')+'.html' as lang %}
<div class="out">
<div class="out left-space">
<div class="diff">
{% set plus = [] %}
{% set minus = [] %}

View File

@ -1,5 +1,5 @@
{% import 'languages/'+lang|default('en')+'.html' as lang %}
<div style="text-align: center;">
<div class="left-space">
<h4>{{lang.words.config|title()}} {% if config_file_name != 'undefined' %}{{config_file_name.replace('92', '/')}}{%endif%} {{lang.words.from}} {{serv}} ({{hostname}})</h4>
<p class="accordion-expand-holder">
{% if role <= 3 %}
@ -18,7 +18,7 @@
</p>
</div>
<div style="margin-left: 16%" class="configShow">
<div class="configShow left-space">
{% set i = 0 -%}
{% set section_name = {} %}
{% for line in conf -%}

View File

@ -14,15 +14,27 @@
}
%}
{% for s in services %}
{% set is_service_started_class = '' %}
{% set is_service_stopped_class = '' %}
{% set onclick_start_action = "confirmAjaxServiceAction('start', '"+s.0+"')" %}
{% set onclick_stop_action = "confirmAjaxServiceAction('stop', '"+s.0+"')" %}
{% set is_service_started_title = lang.words.start|title()+" "+lang.words.and+" "+lang.words.enable+" "+services_name[s.0]['name']+" "+lang.words.service %}
{% set is_service_stopped_title = lang.words.stop|title()+" "+lang.words.and+" "+lang.words.disable+" "+services_name[s.0]['name']+" "+lang.words.service %}
<tr class="{{ loop.cycle('odd', 'even') }}" id="{{s.0}}">
<td class="padding10 first-collumn">
{% if s.1.0 == 'active' or s.1.0 == 'RUNNING' %}
<span title="{{s.0}} is started"><span class="serverUp server-status"></span></span>
<span title="{{lang.words.service|title()}} {{services_name[s.0]['name']}} {{lang.words.started}}"><span class="serverUp server-status"></span></span>
{% set is_service_started_class = 'disabled-button' %}
{% set onclick_start_action = "" %}
{% set is_service_started_title = lang.words.service|title()+" "+services_name[s.0]['name']+" "+lang.words.already+" "+lang.words.started %}
{% else %}
{% if (s.1.0 == 'inactive' or s.1.0 == 'failed' or s.1.0 == 'activating' or s.1.0 == 'STOPPED') and 'is not installed' not in s.3 %}
<span title="{{s.0}} is stopped"><span class="serverDown server-status"></span></span>
<span title="{{lang.words.service|title()}} {{services_name[s.0]['name']}} {{lang.words.stopped}}"><span class="serverDown server-status"></span></span>
{% set is_service_stopped_class = 'disabled-button' %}
{% set onclick_stop_action = "" %}
{% set is_service_stopped_title = lang.words.service|title()+" "+services_name[s.0]['name']+" "+lang.words.already+" "+lang.words.stopped %}
{% else %}
<span title="{{s.0}} is not installed"><span class="serverNone server-status"></span></span>
<span title="{{lang.words.service|title()}} {{services_name[s.0]['name']}} {{lang.words.not}} {{lang.words.installed}}"><span class="serverNone server-status"></span></span>
{% endif %}
{% endif %}
{{services_name[s.0]['name']}}
@ -32,19 +44,19 @@
{% if s.0 in ('prometheus', 'grafana-server') %}
<a class="ui-button ui-widget ui-corner-all" onclick="openTab(10)" title="{{lang.words.install|title()}} {{service_name}}">{{lang.words.install|title()}}</a>
{% elif s.0 in ('rabbitmq-server', 'fail2ban') %}
<a class="ui-button ui-widget ui-corner-all" href="https://roxy-wi/services/{{s.0.split('-')[0]}}" title="{{lang.words.install|title()}} {{s.0|title()}}" target="_blank">{{lang.words.install|title()}}</a>
<a class="ui-button ui-widget ui-corner-all" href="https://roxy-wi/services/{{s.0.split('-')[0]}}" title="{{lang.words.install|title()}} {{services_name[s.0]['name']}}" target="_blank">{{lang.words.install|title()}}</a>
{% else %}
<a class="ui-button ui-widget ui-corner-all" onclick="updateService('{{s.0}}', 'install')" title="{{lang.words.install|title()}} {{service_name}}">{{lang.words.install|title()}}</a>
{% endif %}
{% else %}
<a id="start-{{ s.0 }}" class="start" title="{{lang.words.start|title()}} {{lang.words.and}} {{lang.words.enable}} {{s.0}} {{lang.words.service}}">
<span class="service-start" onclick="confirmAjaxServiceAction('start', '{{s.0}}')"></span>
<a id="start-{{ s.0 }}" class="start" title="{{is_service_started_title}}">
<span class="service-start {{is_service_started_class}}" onclick="{{onclick_start_action}}"></span>
</a>
<a id="restart-{{ s.2 }}" class="restart" title="{{lang.words.restart|title()}} {{s.0}} {{lang.words.service}}">
<a id="restart-{{ s.2 }}" class="restart" title="{{lang.words.restart|title()}} {{services_name[s.0]['name']}} {{lang.words.service}}">
<span class="service-reload service-restart" onclick="confirmAjaxServiceAction('restart', '{{s.0}}')"></span>
</a>
<a id="stop-{{ s.0 }}" class="stop" title="{{lang.words.stop|title()}} {{lang.words.and}} {{lang.words.disable}} {{s.0}} {{lang.words.service}}">
<span class="service-stop" onclick="confirmAjaxServiceAction('stop', '{{s.0}}')"></span>
<a id="stop-{{ s.0 }}" class="stop" title="{{is_service_stopped_title}}">
<span class="service-stop {{is_service_stopped_class}}" onclick="{{onclick_stop_action}}"></span>
</a>
{% endif %}
</td>

View File

@ -31,7 +31,7 @@ li { margin-top: 0.25em; margin-right: 2em;}
a.px:link {color: #ffff40; text-decoration: none;}a.px:visited {color: #ffff40; text-decoration: none;}a.px:hover {color: #ffffff; text-decoration: none;}a.lfsb:link {color: #000000; text-decoration: none;}a.lfsb:visited {color: #000000; text-decoration: none;}a.lfsb:hover {color: #505050; text-decoration: none;}
table.tbl { border-collapse: collapse; border-style: none;}
table.tbl td { text-align: right; border-width: 1px 1px 1px 1px; border-style: solid solid solid solid; padding: 2px 3px; border-color: gray; white-space: nowrap;}
table.tbl td { text-align: left; border-width: 1px 1px 1px 1px; border-style: solid solid solid solid; padding: 2px 3px; border-color: gray; white-space: nowrap;}
table.tbl td.ac { text-align: center;}
table.tbl th { border-width: 1px; border-style: solid solid solid solid; border-color: gray; padding-left: 10px; font-size: 12px;}
table.tbl th.pxname { background: #b00040; color: #ffff40; font-weight: bold; border-style: solid solid none solid; padding: 2px 3px; white-space: nowrap; font-size: 1em;}
@ -43,7 +43,7 @@ table.lgd td { border-width: 1px; border-style: solid solid solid solid; border-
table.lgd td.noborder { border-style: none; padding: 2px; white-space: nowrap;}
table.det { border-collapse: collapse; border-style: none; }
table.det th { text-align: left; border-width: 0px; padding: 0px 1px 0px 0px; font-style:normal;font-size:11px;font-weight:bold;font-family: sans-serif;}
table.det td { text-align: right; border-width: 0px; padding: 0px 0px 0px 4px; white-space: nowrap; font-style:normal;font-size:11px;font-weight:normal;}
table.det td { text-align: left; border-width: 0px; padding: 0px 0px 0px 4px; white-space: nowrap; font-style:normal;font-size:11px;font-weight:normal;}
u {text-decoration:none; border-bottom: 1px dotted black;}
div.tips {
display:block;

View File

@ -1,3 +1,4 @@
{% import 'languages/'+lang|default('en')+'.html' as lang %}
{% for service in service_status %}
<td class="padding10 first-collumn">
<a href="/app/history.py?service=server&serv={{ service.1 }}" title="{{service.0 }} history" class="logs_link">
@ -6,56 +7,56 @@
</td>
<td>
{% if service.2|int() == 0 %}
<span class="serverNone server-status" title="HAProxy is not installed"
<span class="serverNone server-status" title="HAProxy {{lang.phrases.is_not_installed}}"
{% else %}
{% if service.3|int() >= 1 %}
<span class="serverUp server-status" title="running {{ service.3 }} processes"
<span class="serverUp server-status" title="{{lang.words.running2|title()}} {{ service.3 }} {{lang.words.processes}}"
{% else %}
<span class="serverDown server-status" title="HAProxy is down"
<span class="serverDown server-status" title="HAProxy {{lang.words.stopped}}"
{% endif %}
{% endif %}
style="margin-left: 25px !important;" id="haproxy_{{service.10}}"></span>
</td>
<td class="padding10 first-collumn">
<td class="padding10 first-collumn" style="padding-left: 20px">
{% if service.8|int() == 0 %}
<span class="serverNone server-status" title="NGINX is not installed"
<span class="serverNone server-status" title="NGINX {{lang.phrases.is_not_installed}}"
{% else %}
{% if service.9|int() >= 1 %}
<span class="serverUp server-status" title="NGINX is running"
<span class="serverUp server-status" title="NGINX {{lang.words.running}}"
{% else %}
<span class="serverDown server-status" title="NGINX is down"
<span class="serverDown server-status" title="NGINX {{lang.words.stopped}}"
{% endif %}
{% endif %}
style="margin-left: 4px !important;" id="nginx_{{service.10}}"></span>
</td>
<td class="padding10 first-collumn">
<td class="padding10 first-collumn" style="padding-left: 20px">
{% if service.11|int() == 0 %}
<span class="serverNone server-status" title="Apache is not installed"
<span class="serverNone server-status" title="Apache {{lang.phrases.is_not_installed}}"
{% else %}
{% if service.12|int() >= 1 %}
<span class="serverUp server-status" title="Apache is running"
<span class="serverUp server-status" title="Apache {{lang.words.running}}"
{% else %}
<span class="serverDown server-status" title="Apache is down"
<span class="serverDown server-status" title="Apache {{lang.words.stopped}}"
{% endif %}
{% endif %}
style="margin-left: 4px !important;" id="apache_{{service.10}}"></span>
</td>
<td class="padding10 first-collumn">
<td class="padding10 first-collumn" style="padding-left: 35px">
{% if service.6|int() == 0 %}
<span class="serverNone server-status" title="Keepalived is not installed" style="margin-left: 4px !important;"></span>
<span class="serverNone server-status" title="Keepalived {{lang.phrases.is_not_installed}}" style="margin-left: 4px !important;"></span>
{% else %}
{% if service.7|int() >= 1 %}
<span class="serverUp server-status" title="running {{service.7 }} processes" style="margin-left: 4px !important;"></span>
{% else %}
<span class="serverDown server-status" title="Keepalived is down" style="margin-left: 4px !important;"></span>
<span class="serverDown server-status" title="Keepalived {{lang.words.stopped}}" style="margin-left: 4px !important;"></span>
{% endif %}
{% endif %}
</td>
<td class="third-collumn-wi">
<td class="third-collumn-wi" style="padding-left: 15px">
{% if service.5.0|length() == 0 %}
<span class="serverNone server-status" title="WAF is not installed" style="margin-left: 4px !important;"></span>
<span class="serverNone server-status" title="WAF {{lang.phrases.is_not_installed}}" style="margin-left: 4px !important;"></span>
{% elif service.5.0 != '' and service.4|int() == 0 %}
<span class="serverDown server-status" title="WAF is down" style="margin-left: 4px !important;"></span>
<span class="serverDown server-status" title="WAF {{lang.words.stopped}}" style="margin-left: 4px !important;"></span>
{% elif service.5.0 != '' and service.4|int() >= 1 %}
<span class="serverUp server-status" title="running {{ service.4 }} processes" style="margin-left: 4px !important;"></span>
{% endif %}

View File

@ -1,7 +1,7 @@
{% from 'include/input_macros.html' import input %}
{% import 'languages/'+lang|default('en')+'.html' as lang %}
<form action="" method="post">
<div style="text-align: center;margin-top: 20px;">
<form action="" method="post" class="left-space">
<div>
<h4>{{ lang.phrases.comparing_config }}</h4>
<p>
<select autofocus required name="left" id="left">

View File

@ -1,6 +1,6 @@
{% import 'languages/'+lang|default('en')+'.html' as lang %}
{% from 'include/input_macros.html' import input %}
<div style="text-align: center;margin-top: 20px;">
<div style="margin-top: 20px; margin-left: 15px;">
{% if 'cannot access' not in return_files %}
{% if config_file_name == '' %}
<h4>Config files from {{serv}}</h4>

View File

@ -25,7 +25,7 @@
$("form input[type='checkbox']").attr("checked",false).change();
}
});
$.getScript('/inc/script.js');
$.getScript('/inc/script-6.3.9.js');
function show_diff(id) {
if ($('#show_diff_'+id).css('display') == 'none') {
$('#show_diff_'+id).show();

View File

@ -14,8 +14,3 @@
$('#log_files').select2();
});
</script>
<style>
.select2-container .select2-selection--single {
height: 33px;
}
</style>

View File

@ -0,0 +1,63 @@
{% import 'languages/'+lang|default('en')+'.html' as lang %}
<table id="all_services" style="width: 300px;float: left;margin-right: 50px;">
<caption class="user_group_caption">{{lang.words.all|title()}} {{lang.words.services}}</caption>
<tbody>
{% for s in server %}
{% if s.15|int() == 0 %}
<tr class="{{ loop.cycle('odd', 'even') }}" id="add_service-1" data-service_name="HAProxy">
<td class="padding20" style="width: 100%">HAProxy</td>
<td><span class="add_user_group" title="{{lang.words.add|title()}} {{lang.words.service}}" onclick="addServiceToServer(1)">+</span></td>
</tr>
{% endif %}
{% if s.14|int() == 0 %}
<tr class="{{ loop.cycle('odd', 'even') }}" id="add_service-2" data-service_name="NGINX">
<td class="padding20" style="width: 100%">NGINX</td>
<td><span class="add_user_group" title="{{lang.words.add|title()}} {{lang.words.service}}" onclick="addServiceToServer(2)">+</span></td>
</tr>
{% endif %}
{% if s.24|int() == 0 %}
<tr class="{{ loop.cycle('odd', 'even') }}" id="add_service-4" data-service_name="Apache">
<td class="padding20" style="width: 100%">Apache</td>
<td><span class="add_user_group" title="{{lang.words.add|title()}} {{lang.words.service}}" onclick="addServiceToServer(4)">+</span></td>
</tr>
{% endif %}
{% if s.13|int() == 0 %}
<tr class="{{ loop.cycle('odd', 'even') }}" id="add_service-3" data-service_name="Keepalived">
<td class="padding20" style="width: 100%">Keepalived</td>
<td><span class="add_user_group" title="{{lang.words.add|title()}} {{lang.words.service}}" onclick="addServiceToServer(3)">+</span></td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
<table id="checked_services" style="width: 300px;">
<caption class="user_group_caption">{{lang.words.actives|title()}} {{lang.words.services}}</caption>
<tbody>
{% for s in server %}
{% if s.15|int() == 1 %}
<tr class="{{ loop.cycle('odd', 'even') }}" id="remove_service-1" data-service_name="HAProxy">
<td class="padding20" style="width: 100%;">HAProxy</td>
<td><span class="remove_user_group" onclick="removeServiceFromServer(1)" title="{{lang.words.delete|title()}} {{lang.words.service}}">-</span></td>
</tr>
{% endif %}
{% if s.14|int() == 1 %}
<tr class="{{ loop.cycle('odd', 'even') }}" id="remove_service-2" data-service_name="NGINX">
<td class="padding20" style="width: 100%;">NGINX</td>
<td><span class="remove_user_group" onclick="removeServiceFromServer(2)" title="{{lang.words.delete|title()}} {{lang.words.service}}">-</span></td>
</tr>
{% endif %}
{% if s.24|int() == 1 %}
<tr class="{{ loop.cycle('odd', 'even') }}" id="remove_service-4" data-service_name="Apache">
<td class="padding20" style="width: 100%;">Apache</td>
<td><span class="remove_user_group" onclick="removeServiceFromServer(4)" title="{{lang.words.delete|title()}} {{lang.words.service}}">-</span></td>
</tr>
{% endif %}
{% if s.13|int() == 1 %}
<tr class="{{ loop.cycle('odd', 'even') }}" id="remove_service-3" data-service_name="Keepalived">
<td class="padding20" style="width: 100%;">Keepalived</td>
<td><span class="remove_user_group" onclick="removeServiceFromServer(3)" title="{{lang.words.delete|title()}} {{lang.words.service}}">-</span></td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>

View File

@ -1,9 +1,10 @@
{% import 'languages/'+lang|default('en')+'.html' as lang %}
<tr class="odd">
<td class="padding10 first-collumn-wi">
{% if metrics_master == 'active' %}
<span class="serverUp server-status-small" title="running {{ metrics_master }} master processes"></span>
<span class="serverUp server-status-small" title="Metrics master {{lang.words.started}}"></span>
{% if role <= 1 %}
<a href="/app/viewlogs.py?viewlogs={{metrics_log_id}}&rows=10&grep=&hour=00&minut=00&hour1=24&minut1=00" title="View metrics master's logs" class="logs_link">
<a href="/app/viewlogs.py?viewlogs={{metrics_log_id}}&rows=10&grep=&hour=00&minut=00&hour1=24&minut1=00" title="{{lang.words.view|title()}} {{lang.words.logs2}}" class="logs_link">
Metrics master
</a>
{% else %}
@ -11,16 +12,16 @@
{% endif %}
{% else %}
{% if metrics_master == 'inactive' or metrics_master == 'failed' %}
<span class="serverDown server-status-small" title="Metrics is stopped"></span>
<span class="serverDown server-status-small" title="Metrics {{lang.words.stopped}}"></span>
{% if role <= 1 %}
<a href="/app/users.py#services" title="Start Metrics - Roxy-WI service" class="logs_link">
<a href="/app/users.py#services" title="{{lang.words.start|title()}} Metrics" class="logs_link">
Metrics master
</a>
{% else %}
Metrics master
{% endif %}
{% else %}
<span class="serverNone server-status-small" title="Metrics is not installed"></span>
<span class="serverNone server-status-small" title="{{lang.phrases.metrics_not_installed}}"></span>
<a href="https://roxy-wi.org/services.py?service=metrics#installation" title="Metrics installation" target="_blank" class="logs_link">
Metrics master
</a>
@ -29,9 +30,9 @@
</td>
<td class="third-collumn-wi">
{% if checker_master == 'active' %}
<span class="serverUp server-status-small" title="running {{ checker_master }} master processes"></span>
<span class="serverUp server-status-small" title="Checker master {{lang.words.started}}"></span>
{% if role <= 1 %}
<a href="/app/viewlogs.py?viewlogs={{checker_log_id}}&rows=10&grep=&hour=00&minut=00&hour1=24&minut1=00" title="View checker master's logs" class="logs_link">
<a href="/app/viewlogs.py?viewlogs={{checker_log_id}}&rows=10&grep=&hour=00&minut=00&hour1=24&minut1=00" title="{{lang.words.view|title()}} {{lang.words.logs2}}" class="logs_link">
Checker master
</a>
{% else %}
@ -39,17 +40,17 @@
{% endif %}
{% else %}
{% if checker_master == 'inactive' or checker_master == 'failed' %}
<span class="serverDown server-status-small" title="Checker is stopped"></span>
<span class="serverDown server-status-small" title="Checker {{lang.words.stopped}}"></span>
{% if role <= 1 %}
<a href="/app/users.py#services" title="Start Checker - Roxy-WI service" class="logs_link">
<a href="/app/users.py#services" title="{{lang.words.start|title()}} Checker" class="logs_link">
Checker master
</a>
{% else %}
Checker master
{% endif %}
{% else %}
<span class="serverNone server-status-small" title="Backends checker is not installed"></span>
<a href="https://roxy-wi.org/services.py?service=checker#installation" title="Backends checker installation" target="_blank" class="logs_link">
<span class="serverNone server-status-small" title="{{lang.phrases.checker_not_installed}}"></span>
<a href="https://roxy-wi.org/services.py?service=checker#installation" title="Checker installation" target="_blank" class="logs_link">
Checker master
</a>
{% endif %}
@ -57,9 +58,9 @@
</td>
<td class="third-collumn-wi">
{% if keep_alive == 'active' %}
<span class="serverUp server-status-small" title="running {{ keep_alive }} processe"></span>
<span class="serverUp server-status-small" title="Auto start {{lang.words.started}}"></span>
{% if role <= 1 %}
<a href="/app/viewlogs.py?viewlogs={{keep_alive_log_id}}&rows=10&grep=&hour=00&minut=00&hour1=24&minut1=00" title="View Auto start logs" class="logs_link">
<a href="/app/viewlogs.py?viewlogs={{keep_alive_log_id}}&rows=10&grep=&hour=00&minut=00&hour1=24&minut1=00" title="{{lang.words.view|title()}} {{lang.words.logs2}}" class="logs_link">
Auto start
</a>
{% else %}
@ -67,16 +68,16 @@
{% endif %}
{% else %}
{% if keep_alive == 'inactive' or keep_alive == 'failed' %}
<span class="serverDown server-status-small" title="Auto start is stopped"></span>
<span class="serverDown server-status-small" title="Auto start {{lang.words.stopped}}"></span>
{% if role <= 1 %}
<a href="/app/users.py#services" title="Start Auto star - Roxy-WI service" class="logs_link">
<a href="/app/users.py#services" title="{{lang.words.start|title()}} Auto star {{lang.words.service}}" class="logs_link">
Auto start
</a>
{% else %}
Auto start
{% endif %}
{% else %}
<span class="serverNone server-status-small" title="Auto start is not installed"></span>
<span class="serverNone server-status-small" title="{{lang.phrases.auto_start_not_installed}}"></span>
<a href="https://roxy-wi.org/services.py?service=auto_start#installation" title="Auto start installation" target="_blank" class="logs_link">
Auto start
</a>
@ -87,16 +88,16 @@
<tr class="even">
<td class="padding10 first-collumn-wi">
{% if metrics_worker|int() >= 1 %}
<span class="serverUp server-status-small" title="running {{metrics_worker}} worker processes"></span>
<span class="serverUp server-status-small" title="{{lang.words.running2|title()}} {{metrics_worker}} {{lang.words.worker2}} {{lang.words.processes}}"></span>
{% else %}
{% if is_metrics_worker|int() == 0 %}
<span class="serverNone server-status-small" title="There is not job for metrics"></span>
{% else %}
<span class="serverDown server-status-small" title="running {{is_checker_worker}} worker processes"></span>
<span class="serverDown server-status-small" title="{{lang.words.running2|title()}} {{is_checker_worker}} {{lang.words.worker2}} {{lang.words.processes}}"></span>
{% endif %}
{% endif %}
{% if role <= 1 %}
<a href="/app/viewlogs.py?viewlogs={{metrics_log_id}}&rows=10&grep=&hour=00&minut=00&hour1=24&minut1=00" title="View worker's logs" class="logs_link">
<a href="/app/viewlogs.py?viewlogs={{metrics_log_id}}&rows=10&grep=&hour=00&minut=00&hour1=24&minut1=00" title="{{lang.words.view|title()}} {{lang.words.logs2}}" class="logs_link">
Metrics workers
</a>
{% else %}
@ -105,16 +106,16 @@
</td>
<td>
{% if checker_worker|int() >= 1 %}
<span class="serverUp server-status-small" title="running {{ checker_worker }} worker processes"></span>
<span class="serverUp server-status-small" title="{{lang.words.running2|title()}} {{ checker_worker }} {{lang.words.worker2}} {{lang.words.processes}}"></span>
{% else %}
{% if is_checker_worker|int() == 0 %}
<span class="serverNone server-status-small" title="There is not job for checker"></span>
{% else %}
<span class="serverDown server-status-small" title="running {{ checker_worker }} worker processes"></span>
<span class="serverDown server-status-small" title="{{lang.words.running2|title()}} {{ checker_worker }} {{lang.words.worker2}} {{lang.words.processes}}"></span>
{% endif %}
{% endif %}
{% if role <= 1 %}
<a href="/app/viewlogs.py?viewlogs={{checker_log_id}}&rows=10&grep=&hour=00&minut=00&hour1=24&minut1=00" title="View checker's logs" class="logs_link">
<a href="/app/viewlogs.py?viewlogs={{checker_log_id}}&rows=10&grep=&hour=00&minut=00&hour1=24&minut1=00" title="{{lang.words.view|title()}} {{lang.words.logs2}}" class="logs_link">
Checker workers
</a>
{% else %}
@ -123,14 +124,14 @@
</td>
<td>
{% if smon == 'active' %}
<span class="serverUp server-status-small" title="SMON is started"></span>
<span class="serverUp server-status-small" title="SMON {{lang.words.started}}"></span>
<a href="/app/smon.py?action=view" title="SMON Dashboard" class="logs_link">
SMON
</a>
{% else %}
{% if smon == 'inactive' or smon == 'failed' %}
<span class="serverDown server-status-small" title="SMON is stopped"></span>
<a href="/app/users.py#services" title="Start SMON - Roxy-WI service" class="logs_link">
<span class="serverDown server-status-small" title="SMON {{lang.words.stopped}}"></span>
<a href="/app/users.py#services" title="{{lang.words.start|title()}} SMON" class="logs_link">
SMON
</a>
{% else %}
@ -146,19 +147,19 @@
{% if role == 1 %}
<td class="padding10 first-collumn-wi">
{% if grafana|int() >= 1 %}
<span class="serverUp server-status-small" title="running {{grafana}} process"></span>
<a href="http://{{host}}:3000" target="_blank" title="Open Grafana" class="logs_link" rel="noopener noreferrer">Grafana</a>
<span class="serverUp server-status-small" title="Grafana {{lang.words.running2}}"></span>
<a href="http://{{host}}:3000" target="_blank" title="{{lang.words.open|title()}} Grafana" class="logs_link" rel="noopener noreferrer">Grafana</a>
{% else %}
<span class="serverNone server-status-small" title="The service is not installed or not running"></span>
<span class="serverNone server-status-small" title="The service is not installed or not running2"></span>
<span>Grafana</span>
{% endif %}
{% endif %}
</td>
<td {% if role != 1 %}class="padding10 first-collumn-wi"{%endif%}>
{% if socket == 'active' %}
<span class="serverUp server-status-small" title="Socket service is started"></span>
<span class="serverUp server-status-small" title="Socket {{lang.words.started}}"></span>
{% if role <= 1 %}
<a href="/app/viewlogs.py?viewlogs={{socket_log_id}}&rows=10&grep=&hour=00&minut=00&hour1=24&minut1=00" title="View Socket's logs" class="logs_link">
<a href="/app/viewlogs.py?viewlogs={{socket_log_id}}&rows=10&grep=&hour=00&minut=00&hour1=24&minut1=00" title="{{lang.words.view|title()}} {{lang.words.logs2}}" class="logs_link">
Socket service
</a>
{% else %}
@ -166,8 +167,8 @@
{% endif %}
{% else %}
{% if socket == 'inactive' or socket == 'failed' %}
<span class="serverDown server-status-small" title="Socket service scanner is stopped"></span>
<a href="/app/users.py#services" title="Socket service - Roxy-WI service" class="logs_link">
<span class="serverDown server-status-small" title="Socket {{lang.words.stopped}}"></span>
<a href="/app/users.py#services" title="{{lang.words.start|title()}} Socket" class="logs_link">
Socket service
</a>
{% else %}
@ -180,14 +181,14 @@
</td>
<td>
{% if port_scanner == 'active' %}
<span class="serverUp server-status-small" title="Port scanner is started"></span>
<span class="serverUp server-status-small" title="Port scanner {{lang.words.started}}"></span>
<a href="/app/portscanner.py" title="Port scanner Dashboard" class="logs_link">
Port scanner
</a>
{% else %}
{% if port_scanner == 'inactive' or port_scanner == 'failed' %}
<span class="serverDown server-status-small" title="Port scanner is stopped"></span>
<a href="/app/users.py#services" title="Start Port scanner - Roxy-WI service" class="logs_link">
<span class="serverDown server-status-small" title="Port scanner {{lang.words.stopped}}"></span>
<a href="/app/users.py#services" title="{{lang.words.start|title()}} Port scanner" class="logs_link">
Port scanner
</a>
{% else %}

View File

@ -2,10 +2,7 @@
{% import 'languages/'+lang|default('en')+'.html' as lang %}
{% endif %}
<div class="sort_menu">
<a href="#" title="{{lang.smon_page.desc.do_not_sort_by_status}}" onclick="showSmon('not_sort')">{{lang.smon_page.desc.do_not_sort}}</a> |
<a href="#" id="sort_by_status" title="{{lang.smon_page.desc.sort_status}}" onclick="sort_by_status()">{{lang.smon_page.desc.sort_status}}</a> |
<a href="#" title="SMOM: {{lang.words.dashboard|title()}} - Roxy-WI" onclick="showSmon('refresh');">{{lang.words.refresh|title()}}</a>
<span style="padding-left: 20px;">
<div style="margin-bottom: 15px">
{% set down = [] %}
{% set up = [] %}
{% set dis = [] %}
@ -21,7 +18,10 @@
{% endif %}
{% endfor %}
<b>{{lang.smon_page.desc.status_summary}}: {{lang.smon_page.desc.UP}}: {{up|length}}, {{lang.smon_page.desc.DOWN}}: {{down|length}}, {{lang.words.disabled|title()}}: {{dis|length}}</b>
<span>
</div>
<a href="#" title="{{lang.smon_page.desc.do_not_sort_by_status}}" onclick="showSmon('not_sort')">{{lang.smon_page.desc.do_not_sort}}</a> |
<a href="#" id="sort_by_status" title="{{lang.smon_page.desc.sort_status}}" onclick="sort_by_status()">{{lang.smon_page.desc.sort_status}}</a> |
<a href="#" title="SMOM: {{lang.words.dashboard|title()}} - Roxy-WI" onclick="showSmon('refresh');">{{lang.words.refresh|title()}}</a>
</div>
{% set group = [] %}
{% set group_prev = [] %}
@ -148,7 +148,7 @@
{% else %}
<div class="disable">
<center>
{{lang.words.disabled|title()}}
{{lang.smon_page.desc.DISABLED}}
</center>
</div>
{% endif %}

View File

@ -1,6 +1,6 @@
{% import 'languages/'+lang|default('en')+'.html' as lang %}
{% from 'languages/languages.html' import languages %}
{% from 'include/input_macros.html' import select %}
{% from 'include/input_macros.html' import select, checkbox %}
<html lang="en">
<head>
<title>{% block title %}{% endblock %}</title>
@ -18,7 +18,8 @@
data-empty_name="{{lang.errors.empty_name}}" data-edit="{{lang.words.edit|title()}}" data-close="{{lang.words.close|title()}}" data-server_info="{{lang.phrases.server_info}}"
data-generated_config="{{lang.words.generated|title()}} {{lang.words.config}}" data-restart="{{lang.words.restart|title()}}" data-start="{{lang.words.start|title()}}"
data-stop="{{lang.words.stop|title()}}" data-reload="{{lang.words.reload|title()}}" data-user_groups="{{lang.phrases.user_groups}}" data-settings="{{lang.words.settings|title()}}"
data-for="{{lang.words.for}}" />
data-for="{{lang.words.for}}" data-show="{{lang.words.show|title()}}" data-hide="{{lang.words.hide|title()}}" data-logs="{{lang.words.logs}}"
data-autorefresh="{{lang.words.auto|title()}}-{{lang.words.refresh}}" />
{% if title == 'Login page' %}
<meta name="viewport" content="width=device-width, user-scalable=1">
{% endif %}
@ -48,8 +49,8 @@
<script defer src="/inc/intro/introjs.min.js"></script>
<link href="/inc/intro/introjs.min.css" rel="stylesheet">
<link href="/inc/intro/introjs-modern.css" rel="stylesheet">
<link href="/inc/css/awesome-6.3.8.css" rel="stylesheet">
<link href="/inc/css/style.css" rel="stylesheet">
<link href="/inc/css/awesome-6.3.9.css" rel="stylesheet">
<link href="/inc/css/style-6.3.9.css" rel="stylesheet">
<link href="/inc/css/nprogress.css" rel="stylesheet">
<link href="/inc/css/jquery-ui.min.css" rel="stylesheet">
<link href="/inc/css/jquery-ui.structure.min.css" rel="stylesheet">
@ -60,9 +61,9 @@
<script src="/inc/hotkeys.js"></script>
<link href="/inc/css/select2.css" rel="stylesheet" />
<script src="/inc/select2.js"></script>
<script src="/inc/script.js"></script>
<script src="/inc/script-6.3.9.js"></script>
<script src="/inc/nprogress.js"></script>
<link href="/inc/css/toastr.css" rel="stylesheet"/>
<link href="/inc/css/toastr-6.3.9.css" rel="stylesheet"/>
<script src="/inc/toastr.js"></script>
</head>
<body>
@ -207,8 +208,8 @@
{% include 'include/login.html' %}
{% if autorefresh %}
<span class="auto-refresh">
<a onclick="pauseAutoRefresh()" class="auto-refresh-pause" style="display: none; margin-top: 4px;"></a>
<a onclick="pauseAutoResume()" class="auto-refresh-resume" style="display: none; margin-top: 4px;"></a>
<a onclick="pauseAutoRefresh()" class="auto-refresh-pause" style="display: none; margin-top: 3px; position: absolute;"></a>
<a onclick="pauseAutoResume()" class="auto-refresh-resume" style="display: none; margin-top: 4px; position: absolute;"></a>
<span id="0" class="auto-refresh-span">
<span class="auto-refresh-reload auto-refresh-reload-icon"></span>
{{lang.words.auto|title()}}-{{lang.words.refresh}}
@ -315,10 +316,7 @@
<tr>
<td class="padding20" style="width: 70%">{{lang.words.alerts|title()}}</td>
<td>
<select id="disable_alerting">
<option value="0" title="{{lang.phrases.all_alerts_enabled}}">{{lang.phrases.all_alerts_enabled}}</option>
<option value="1">{{lang.phrases.disable_alerts}}</option>
</select>
{{ checkbox('disable_alerting') }}
</td>
</tr>
<tr class="padding20">

View File

@ -28,12 +28,11 @@
{% if is_serv_protected and role > 2 %}
<meta http-equiv="refresh" content="0; url=/app/hapservers.py?service={{service}}">
{% else %}
<center>
{% if selects|length == 0 %}
{% include 'include/getstarted.html' %}
{% else %}
<p>
<form action="{{ action }}" method="post">
<form action="{{ action }}" method="post" class="left-space">
<input type="hidden" id="service" value="{{service|default('haproxy', true)}}" />
{% include 'include/select.html' %}
{% if service == 'nginx' or service == 'apache' %}
@ -65,38 +64,34 @@
{% if config %}
{% if role <= 3 %}
<h4>{{lang.words.config|title()}} {% if config_file_name != 'undefined' %}{{config_file_name.replace('92', '/')}}{%endif%} {{lang.words.from}} {{ serv }}</h4>
</center>
<form action="config.py" name="saveconfig" id="saveconfig" method="post">
<h4 class="left-space">{{lang.words.config|title()}} {% if config_file_name != 'undefined' %}{{config_file_name.replace('92', '/')}}{%endif%} {{lang.words.from}} {{ serv }}</h4>
<form action="config.py" name="saveconfig" id="saveconfig" method="post" class="left-space">
<input type="hidden" value="{{ serv }}" name="serv">
<input type="hidden" value="{{ cfg }}.old" name="oldconfig">
<input type="hidden" value="{{ token }}" name="token">
<input type="hidden" value="{{ service }}" name="service">
<input type="hidden" value="{{ config_file_name }}" name="config_file_name">
<div style="margin-left: 23%;width: 60%;">
<div>
<textarea name="config" id="config_text_area" class="config" rows="35" cols="100">{{ config }}</textarea>
</div>
<p>
<center>
<a href="config.py?service={{service}}&serv={{serv}}&showConfig" class="ui-button ui-widget ui-corner-all" title="{{lang.phrases.return_to_config}}">{{lang.words.back|title()}}</a>
{% if service != 'keepalived' %}
<button type="submit" value="test" name="save" class="btn btn-default" title="{{lang.words.check|title()}} {{lang.words.config}} {{lang.words.without}} {{lang.words.saving}}">{{lang.phrases.check_config}}</button>
{% endif %}
<button type="submit" value="save" name="save" class="btn btn-default" title="{{lang.phrases.save_title}}">{{lang.words.save|title()}}</button>
{% if is_restart|int == 0 %}
<button type="submit" value="" name="" class="btn btn-default">{{lang.phrases.save_and_restart}}</button>
{% endif %}
<button type="submit" value="reload" name="save" class="btn btn-default">{{lang.phrases.save_and_reload}}</button>
{% if service != 'keepalived' %}
<div class="alert alert-info alert-two-rows"><b>{{lang.words.note|title()}}:</b> {{lang.phrases.master_slave}}</div>
{% endif %}
</center>
<a href="config.py?service={{service}}&serv={{serv}}&showConfig" class="ui-button ui-widget ui-corner-all" title="{{lang.phrases.return_to_config}}">{{lang.words.back|title()}}</a>
{% if service != 'keepalived' %}
<button type="submit" value="test" name="save" class="btn btn-default" title="{{lang.words.check|title()}} {{lang.words.config}} {{lang.words.without}} {{lang.words.saving}}">{{lang.phrases.check_config}}</button>
{% endif %}
<button type="submit" value="save" name="save" class="btn btn-default" title="{{lang.phrases.save_title}}">{{lang.words.save|title()}}</button>
{% if is_restart|int == 0 %}
<button type="submit" value="" name="" class="btn btn-default">{{lang.phrases.save_and_restart}}</button>
{% endif %}
<button type="submit" value="reload" name="save" class="btn btn-default">{{lang.phrases.save_and_reload}}</button>
{% if service != 'keepalived' %}
<div class="alert alert-info" style="margin-left: -0px;"><b>{{lang.words.note|title()}}:</b> {{lang.phrases.master_slave}}</div>
{% endif %}
</p>
</form>
{% endif %}
{% endif %}
</center>
<script>
<script>
if (cur_url[1].split('&')[2] == 'showMap') {
showMap();
}

View File

@ -2,9 +2,8 @@
{% block title %}{{ lang.menu_links.versions.h2 }} {{ lang.words[service] }}{% endblock %}
{% block h2 %}{{ lang.menu_links.versions.h2 }} {{ lang.words[service] }}{% endblock %}
{% block content %}
<center>
<p>
<form action="{{ action }}" method="post">
<p>
<form action="{{ action }}" method="post" class="left-space">
<input type="hidden" id="service" value="{{service}}">
{% include 'include/select.html' %}
<button type="submit" value="open" name="open" class="btn btn-default">{{lang.words.open|title()}}</button>
@ -27,5 +26,4 @@
<div class="alert alert-success">{{lang.words.config|title()}} {{lang.words.is}} {{lang.words.valid}}</div>
{% endif %}
{% endif %}
</center>
{% endblock %}

View File

@ -7,9 +7,8 @@
{% else %}
<link href="/inc/css/table.css" rel="stylesheet" type="text/css">
<script type="text/javascript" charset="utf8" src="/inc/dataTables.min.js"></script>
<center>
<p>
<form action="{{ action }}" method="post">
<form action="{{ action }}" method="post" class="left-space">
<input type="hidden" value="{{service}}" name="service" id="service">
{% include 'include/select.html' %}
<a class="ui-button ui-widget ui-corner-all" title="Open versions" onclick="showListOfVersion(1)">{{lang.words.open|title()}}</a>
@ -45,6 +44,5 @@
{% endif %}
{% endfor %}
{% endif %}
</center>
{% endif %}
{% endblock %}

View File

@ -3,7 +3,7 @@
{% block h2 %}{{ lang.menu_links.hapservers.h2 }} {{ service_desc.service }}{% endblock %}
{% block content %}
{% from 'include/input_macros.html' import input, checkbox, select, copy_to_clipboard %}
<script src="/inc/overview.js"></script>
<script src="/inc/overview-6.3.9.js"></script>
<link href="/inc/css/chart.min.css" rel="stylesheet">
<script src="/inc/metrics.js"></script>
<script src="/inc/chart.min.js"></script>
@ -34,6 +34,7 @@
$( ".sortable" ).disableSelection();
$( ".sortable" ).sortable({
handle: ".portlet-header",
stop: function(event, ui) {
var itemOrder = $('.sortable').sortable("toArray");
for (var i = 0; i < itemOrder.length; i++) {
@ -56,7 +57,7 @@
{% endfor %}
});
</script>
<div id="up-pannel" {%if not serv%} class="sortable"{%endif%}>
<div id="up-pannel" class="sortable">
{%- for s in servers %}
{%- if serv %}
{% set config_id = 'id=config_link' %}
@ -196,26 +197,26 @@
{% set additional_status_class = 'div-server-head-down' %}
{% endif %}
{% endif %}
<div id="div-server-{{s.0}}" class="div-server-hapwi {{additional_status_class}}" {% if not serv %}style="cursor: move;"{%endif%}>
<div id="div-server-{{s.0}}" class="div-server-hapwi {{additional_status_class}}">
<div class="server-name">
<input type="hidden" id="server-name-{{s.0}}" value="{{s.1}}" />
<input type="hidden" id="service" value="{{service}}" />
{% if not serv %}
<a href="/app/hapservers.py?service={{service}}&serv={{s.2}}" title="More about {{s.1}}" style="color: #5d9ceb">{{s.1}}</a>
<a href="/app/hapservers.py?service={{service}}&serv={{s.2}}" title="{{lang.words.more|title()}} {{lang.words.about}} {{s.1}}" style="color: #5d9ceb">{{s.1}}</a>
{% else %}
{{s.1}}
{% endif %}
{% if s.6|int() >= 1 %}
<span
{% if keep_alive|int() >= 1 %}
class="shield green" title="Autostart is enabled">
class="shield green" title="Autostart {{lang.words.is}} {{lang.words.enabled2}}">
{% else %}
class="shield red" title="Autostart is enabled, but Keep alive service is not running">
class="shield red" title="Autostart {{lang.words.is}} {{lang.words.enabled2}}, Auto start {{lang.words.service}} {{lang.words.is}} {{lang.words.not}} {{lang.words.running}}">
{% endif %}
</span>
{% endif %}
{% if s.8.0.20 == 1 %}
<span class="lock" title="This server is inaccessible for editing by everyone except the admin role"></span>
<span class="lock" title="{{lang.phrases.server_is_inaccessible_for_editing}}"></span>
{% endif %}
{% for set in docker_settings %}
{% if set.server_id == s.0 and set.setting == 'dockerized' and set.value == '1' %}
@ -247,10 +248,15 @@
<a id="stop-{{ s.2 }}" class="stop" title="{{lang.words.stop|title()}} {{service}} {{lang.words.service}}">
<span class="service-stop" onclick="confirmAjaxAction('stop', '{{service}}', '{{s.2}}')"></span>
</a>
<a href="history.py?service={{service}}&serv={{s.2}}" title="View history for this service" class="history" style="margin: 0 5px 0 10px;"></a>
<a href="history.py?service={{service}}&serv={{s.2}}" title="{{lang.words.view|title()}} {{lang.words.history3}} {{s.1}}" class="history" style="margin: 0 5px 0 10px;"></a>
{% if service != 'keepalived' %}
<span class="menu-bar" onclick="serverSettings('{{s.0}}', '{{s.1}}')" title="Edit settings for {{s.1}} service"></span>
<span class="menu-bar" onclick="serverSettings('{{s.0}}', '{{s.1}}')" title="{{lang.words.edit|title()}} {{lang.words.settings}} {{s.1}}"></span>
{% endif %}
{%if not serv%}
<span class="portlet-header" style="cursor: move;" title="{{lang.words.change2|title()}} {{lang.words.position}} {{s.1}}">
<i class="fas fa-grip-vertical" style="margin-right: -10px;margin-left: 10px;display: inline-flex;"></i>
</span>
{%endif%}
</span>
{% endif %}
</div>

View File

@ -6,7 +6,7 @@
{% if user_status == 0 or user_plan == 'user' %}
{% include 'include/no_sub.html' %}
{% else %}
<link href="/inc/css/table.css" rel="stylesheet" type="text/css">
<link href="/inc/css/table-6.3.9.css" rel="stylesheet" type="text/css">
<script type="text/javascript" charset="utf8" src="/inc/dataTables.min.js"></script>
<script>
$(document).ready(function() {

View File

@ -1,6 +1,6 @@
{% from 'include/input_macros.html' import input, checkbox, copy_to_clipboard %}
{% if not adding %}
<table class="overview" id="ajax-servers">
<table class="overview overview-overflow" id="ajax-servers">
<thead>
<tr class="overviewHead">
<th class="padding10 first-collumn" id="server-name-th">{{lang.words.name|title()}}</th>
@ -10,16 +10,14 @@
<th style="width: 10%">{{lang.words.group|title()}}</th>
{% endif %}
<th class="checkbox-head" style="min-width: 70px;">{{lang.words.enabled|title()}}</th>
<th style="min-width: 50px; padding-left: 5px;" class="help_cursor">
<th style="min-width: 60px; padding-left: 17px;" class="help_cursor">
<span title="{{lang.words.virtual|title()}} IP, something like VRRP">{{lang.words.virt|title()}}</span>
</th>
<th class="checkbox-head" style="min-width: 75px" id="server-haproxy-th">HAProxy</th>
<th class="checkbox-head" style="min-width: 65px;" id="server-nginx-th">Nginx</th>
<th class="checkbox-head" style="min-width: 65px;" id="server-apache-th">Apache</th>
<th style="min-width: 100px;" class="help_cursor" id="server-firewalld-th">
<th class="checkbox-head" style="min-width: 75px" id="server-haproxy-th">{{lang.words.services|title()}}</th>
<th style="min-width: 120px;" class="help_cursor" id="server-firewalld-th">
<span title="If the server has a firewall enabled, enable this option">Firewalld</span>
</th>
<th class="checkbox-head help_cursor" style="min-width: 80px;" class="help_cursor" id="server-protected-th">
<th class="checkbox-head help_cursor" style="min-width: 120px;" class="help_cursor" id="server-protected-th">
<span title="{{lang.phrases.protected_title}}">{{lang.words.protected|title()}}</span>
</th>
<th style="width: 10%" class="help_cursor" id="server-slave-th">
@ -38,9 +36,9 @@
{% for server in servers %}
<tr id="server-{{server.0}}" class="{{ loop.cycle('odd', 'even') }} {% if adding %}newserver{% endif %}">
<td class="padding10 first-collumn">
<span class="serverNone server-status-small" title="{{lang.phrases.server_unknown}}" style="margin-left: -10px" id="server_status-{{server.0}}"></span>
<span class="serverNone server-status-small" title="{{lang.phrases.server_unknown}}" id="server_status-{{server.0}}"></span>
{% set id = 'hostname-' + server.0|string() %}
{{ input(id, value=server.1, size='15') }}
{{ input(id, value=server.1, size='20') }}
</td>
<td>
{% set id = 'ip-' + server.0|string() %}
@ -74,7 +72,7 @@
{{ checkbox(id) }}
{% endif %}
</td>
<td class="checkbox" style="padding-left: 0px;">
<td class="checkbox" style="padding-left: 15px;">
{% set id = 'typeip-' + server.0|string() %}
{% if server.4 == 1 %}
{{ checkbox(id, checked='checked') }}
@ -82,29 +80,8 @@
{{ checkbox(id) }}
{% endif %}
</td>
<td class="checkbox">
{% set id = 'haproxy-' + server.0|string() %}
{% if server.15 == 1 %}
{{ checkbox(id, checked='checked') }}
{% else %}
{{ checkbox(id) }}
{% endif %}
</td>
<td class="checkbox" style="padding-left: 5px;">
{% set id = 'nginx-' + server.0|string() %}
{% if server.14 == 1 %}
{{ checkbox(id, checked='checked') }}
{% else %}
{{ checkbox(id) }}
{% endif %}
</td>
<td class="checkbox" style="padding-left: 5px;">
{% set id = 'apache-' + server.0|string() %}
{% if server.24 == 1 %}
{{ checkbox(id, checked='checked') }}
{% else %}
{{ checkbox(id) }}
{% endif %}
<td>
<span title="{{lang.words.change2|title()}} {{lang.words.active}} {{lang.words.services}}" style="cursor: pointer; margin-left: 15px;" class="div-pic" onclick="openChangeServerServiceDialog('{{server.0}}')"></span>
</td>
<td class="checkbox" style="padding-left: 0">
<div class="controlgroup">

View File

@ -11,6 +11,7 @@
'ldap': 'LDAP',
}
%}
<script defer src="/inc/admin_settings.js"></script>
<table id="settings">
<tbody>
{% set section = namespace(section='') %}
@ -20,7 +21,7 @@
{% else %}
{% if section.section|string() != set.section|string() %}
<th colspan="3" title="Show {{ set.section }} section" id="{{set.section}}-section-head" style="cursor: pointer; padding-top: 10px; color: #5b5a5a;">
<h3 class="plus-after" id="{{set.section}}-section-h3" style="font-size: 1em; padding-left: 15px;">
<h3 class="plus-after" id="{{set.section}}-section-h3" style="font-size: 1em; padding-left: 20px;">
{{sections_name[set.section]}}
</h3>
</th>

View File

@ -103,7 +103,7 @@
});
return intro;
}
setTimeout(() => { var intro_temp = Intro(); startIntro(intro_temp); }, 3000);
// setTimeout(() => { var intro_temp = Intro(); startIntro(intro_temp); }, 3000);
if (!localStorage.getItem('introHintAdminRoles')) {
setTimeout(() => {
var intro_temp = introHints();

View File

@ -89,5 +89,5 @@
return intro;
}
setTimeout(() => { var intro_temp = Intro(); startIntro(intro_temp); }, 3000);
// setTimeout(() => { var intro_temp = Intro(); startIntro(intro_temp); }, 3000);
</script>

View File

@ -100,5 +100,5 @@
return intro;
}
setTimeout(() => { var intro_temp = Intro(); startIntro(intro_temp); }, 3000);
// setTimeout(() => { var intro_temp = Intro(); startIntro(intro_temp); }, 3000);
</script>

View File

@ -1,35 +1,25 @@
{% if user %}
<span id="show-user-settings-button" class="user-circle login" title="User settings" style="margin-top: 5px;">{{user}}</span>
<span id="show-user-settings-button" class="user-circle login" title="{{lang.words.user3|title()}} {{lang.words.settings}}" style="margin-top: 5px;">{{user}}</span>
{% else %}
<a href=/app/login.py title="Login" class="login"> Login</a>
{% endif %}
{% if guide_me %}
{% if page %}
<style>
.guid_me {
float: right;
position: absolute;
color: #fff !important;
cursor: pointer;
top: 13px;
right: 11px;
font-size: 15px;
margin-right: 10px
}
</style>
{% else %}
<style>
.guid_me {
float: right;
position: absolute;
color: #fff !important;
cursor: pointer;
top: 8px;
right: 7px;
font-size: 17px;
margin-right: 10px
}
</style>
{% endif %}
<style>
.guid_me {
float: right;
position: absolute;
color: #fff !important;
cursor: pointer;
top: 9px;
right: -3px;
font-size: 17px;
margin-right: 10px
}
</style>
<span class="info guid_me" title="Guide me" onclick="startIntroAgain()"></span>
{% endif %}
{% endif %}
<a href="/app/login.py?logout" title="{{lang.words.logout|title()}}" style="float: right;
right: 27px;
position: absolute;
top: 10px;
color: #fff;"><i class="fas fa-sign-out-alt"></i></a>

View File

@ -28,18 +28,54 @@ body, .container {
background-color: #239dee;
}
}
.fontuser {
position: relative;
}
.fontuser i {
position: absolute;
left: 9px;
top: 10px;
color: #036bb0;
}
.fontpassword {
position: relative;
margin-bottom: 15px;
}
.fontpassword i {
position: absolute;
left: 9px;
top: 10px;
color: #036bb0;
}
.fontpassword span i {
position: absolute;
left: 193px;
top: 10px;
color: #036bb0;
font-size: 17px;
cursor: pointer;
}
</style>
<div id="main_div">
<div id="login-form" style="padding-top: 40px; padding-bottom: 50px; height: 250px; color: #000;">
<span id="logo_span">
<img src="/inc/images/logo_login.png">
</span>
<form name="auth" id="auth" action="login.py" class="form-horizontal" method="post" style="margin-top: 40px;left: 0;float: left;margin-left: 93px;">
<form name="auth" id="auth" action="login.py" class="form-horizontal" method="post" style="margin-top: 60px;left: 0;float: left;margin-left: 93px;">
<div class="fontuser">
{{ input('login', class='form-login', placeholder=lang.words.login|title(), required='required', autofocus='autofocus') }}
<i class="fa fa-user fa-lg"></i>
</div>
<br>
{{ input('login', class='form-login', placeholder='Login', required='required', autofocus='autofocus') }}<br /><br />
{{ input('pass', type='password', class='form-login', placeholder='Password', required='required') }}<br /><br />
{{ input('ref', type='hidden', value=ref) }}
<button type="submit" name="Login" value="Enter" id="enter">Login</button>
<div class="fontpassword">
{{ input('pass', type='password', class='form-login', placeholder=lang.words.password|title(), required='required') }}
{{ input('ref', type='hidden', value=ref) }}
<i class="fa fa-key fa-lg"></i>
<span onclick="showPassword('pass')" title="{{lang.words.show|title()}} {{lang.words.password}}">
<i class="far fa-eye"></i>
</span>
</div>
<button type="submit" name="Login" value="Enter" id="enter">{{lang.words.login2|title()}}</button>
</form>
{% if error_log or error %}
<div class="alert alert-danger wrong-login alert-one-row" style="display: block">
@ -48,11 +84,10 @@ body, .container {
</div>
{% endif %}
<div class="alert alert-danger wrong-login alert-one-row" id="wrong-login">
Your login or password is incorrect
{{lang.phrases.login_or_pass_incorrect}}
<br />
<span id="ban_10">
<br />
You can try again in <span id="ban_timer">10</span> seconds
{{lang.phrases.can_try_again}} <span id="ban_timer">10</span> {{lang.words.seconds2}}
</span>
</div>
<br /><br />

View File

@ -5,7 +5,7 @@
<link href="/inc/css/chart.min.css" rel="stylesheet">
<script src="/inc/metrics.js"></script>
<script src="/inc/chart.min.js"></script>
<script src="/inc/overview.js"></script>
<script src="/inc/overview-6.3.9.js"></script>
<script>
$("#secIntervals").css("display", "none");
var ip = []
@ -130,8 +130,11 @@
<td>{{lang.words.role|title()}}</td>
<td>
<span class="add-button-wi" id="show_all_users" style="display: none;">
<span title="{{lang.words.show_all|title()}} {{lang.words.users}}" id="show-all-users" style="color: #fff">
{{lang.words.show_all|title()}}
<span id="show-all-users">
{{lang.words.show_all}}
</span>
<span id="hide-all-users" style="display: none;">
{{lang.words.hide|title()}}
</span>
</span>
</td>
@ -155,8 +158,11 @@
<td>
{% if groups|length > 3 %}
<span class="add-button-wi">
<span title="{{lang.words.show_all|title()}} {{lang.words.groups}}" id="show-all-groups" style="color: #fff">
{{lang.words.show_all|title()}}
<span id="show-all-groups">
{{lang.words.show_all}}
</span>
<span id="hide-all-groups" style="display: none;">
{{lang.words.hide|title()}} {{lang.words.groups}}
</span>
</span>
{% endif %}
@ -183,21 +189,17 @@
{% endfor %}
</table>
<table class="overview-wi">
<table class="overview-wi" id="overview-roles">
<tr class="overviewHead">
<td class="padding10 first-collumn-wi">{{lang.words.role|title()}}</td>
<td class="second-collumn" style="width: 50%">{{lang.words.desc|title()}}</td>
<td></td>
<td></td>
</tr>
<td class="second-collumn" style="width: 60%">{{lang.words.desc|title()}}</td>
</tr>
{% for role in roles %}
<tr class="{{ loop.cycle('odd', 'even') }}">
<td class="padding10 first-collumn-wi">
{{ role.name }}
</td>
<td class="third-collumn-wi">{{ lang.roles[role.name] }}</td>
<td></td>
<td></td>
</tr>
{% endfor %}
</table>
@ -217,8 +219,11 @@
<td>
{% if roxy_wi_log|length > 3 %}
<span class="add-button-wi">
<span title="{{lang.words.show|title()}} {{lang.words.more}}" id="show-all-haproxy-wi-log" style="color: #fff">
{{lang.words.show_all|title()}}
<span id="show-all-haproxy-wi-log">
{{lang.words.show_all}}
</span>
<span id="hide-all-haproxy-wi-log" style="display: none;">
{{lang.words.hide|title()}} {{lang.words.logs}}
</span>
</span>
{% endif %}

View File

@ -3,7 +3,7 @@
{% block h2 %}{{ title }}{% endblock %}
{% block content %}
{% from 'include/input_macros.html' import input, checkbox, select %}
<script src="/inc/overview.js"></script>
<script src="/inc/overview-6.3.9.js"></script>
{% if serv %}
<style>
@media (max-width: 1280px) {

View File

@ -16,9 +16,7 @@
<li><a href="#lists" title="Runtime API: {{lang.words.change|title()}} {{lang.words.dynamically}}} whitelist {{lang.words.and}} blacklist - Roxy-WI">{{lang.words.lists|title()}}</a></li>
<li><a href="#sessions" title="Runtime API: {{lang.words.sessions|title()}}} - Roxy-WI">{{lang.words.sessions|title()}}</a></li>
{% endif %}
{% include 'include/login.html' %}
</ul>
<ul id='browse_histroy'></ul>
<div id="runtimeapi">
<table class="overview">
<tr class="overviewHead">
@ -76,7 +74,7 @@
</script>
<div id="ajaxruntime"></div>
<div class="add-note addName alert-info" style="width: inherit; margin-right: 15px;">
You can read the description of all Run Time API <a href="https://roxy-wi.org/description/runtimeapi#commands" title="Runtime API {{lang.words.desc}}" target="_blank">{{lang.words.here}}</a>
{{lang.phrases.read_desc_runtime_api}} <a href="https://roxy-wi.org/description/runtimeapi#commands" title="Runtime API {{lang.words.desc}}" target="_blank">{{lang.words.here}}</a>
</div>
</div>
{% if role <= 3 %}

View File

@ -1,4 +1,6 @@
{% extends "base.html" %}
{% block title %}{{lang.words.edit|title()}} {{lang.words.section2}}{% endblock %}
{% block h2 %}{{lang.words.edit|title()}} {{lang.words.section2}} {% endblock %}
{% block content %}
{% if is_serv_protected and role > 2 %}
<meta http-equiv="refresh" content="0; url=/app/hapservers.py?service={{service}}">
@ -25,35 +27,32 @@
<script src="/inc/codemirror/mode/nginx.js"></script>
<script src="/inc/codemirror/mode/haproxy.js"></script>
<script src="/inc/codemirror/keymap/sublime.js"></script>
<center>
<p>
<form action="{{ action }}" method="post">
<select autofocus required name="section" id="{{ select_id }}">
<option disabled>------</option>
{% for s in sections %}
{% if s == section %}
<option value="{{ s }}" selected>{{ s }}</option>
{% else %}
<option value="{{ s }}">{{ s }}</option>
{% endif %}
{% endfor %}
</select>
<input type="hidden" value="{{ serv }}" name="serv">
{% if role <= 3 %}
<button type="submit" value="open" name="open" class="btn btn-default" title="{{lang.words.edit|title()}} {{lang.words.running}} {{lang.words.config}}">{{lang.words.edit|title()}}</button>
<form action="{{ action }}" method="post" class="left-space">
<select autofocus required name="section" id="{{ select_id }}">
<option disabled>------</option>
{% for s in sections %}
{% if s == section %}
<option value="{{ s }}" selected>{{ s }}</option>
{% else %}
<option value="{{ s }}">{{ s }}</option>
{% endif %}
</form>
</p>
{% endfor %}
</select>
<input type="hidden" value="{{ serv }}" name="serv">
{% if role <= 3 %}
<button type="submit" value="open" name="open" class="btn btn-default" title="{{lang.words.edit|title()}} {{lang.words.running}} {{lang.words.config}}">{{lang.words.edit|title()}}</button>
{% endif %}
</form>
{% if config %}
{% if role <= 3 %}
<div id="config">
<div id="config" class="left-space">
<h4>{{lang.phrases.you_are_editing}} "{{section}}" {{lang.phrases.section_from_server}} {{ serv }}</h4>
<form action="{{ action }}" name="saveconfig" method="post">
<input type="hidden" value="{{ serv }}" name="serv">
<input type="hidden" value="{{ start_line }}" name="start_line">
<input type="hidden" value="{{ end_line }}" name="end_line">
<input type="hidden" value="{{ cfg }}.old" name="oldconfig">
<div style="margin-left: 2%;width: 60%; text-align: left">
<div style="width: 95%;">
<textarea name="config" class="config" id="config_text_area" rows="35" cols="100" style="height: 40%">{{ config }}</textarea>
</div>
{% if not is_serv_protected or role <= 2 %}
@ -115,5 +114,4 @@
</div>
</div>
{% endif %}
</center>
{% endblock %}

View File

@ -18,12 +18,10 @@
<li><a href="#checker" title="{{lang.words.servers|title()}}: {{lang.words.manage|title()}} Checker - Roxy-WI">Checker</a></li>
<li><a href="#settings" title="{{lang.words.servers|title()}}: {{lang.words.manage|title()}} Roxy-WI {{lang.words.settings}} - Roxy-WI">{{lang.words.settings|title()}}</a></li>
<li><a href="#installproxy" title="{{lang.words.servers|title()}}: {{lang.words.proxy|title()}} {{lang.words.service}} {{lang.words.installation}} - Roxy-WI">{{lang.words.proxy|title()}} {{lang.words.installation}}</a></li>
<li><a href="#backup" title="{{lang.words.servers|title()}}: {{lang.words.manage|title()}} {{lang.words.backup|title()}} configs - Roxy-WI" id="admin-tabs-backup">{{lang.words.backup|title()}}</a></li>
<li><a href="#installmon" title="{{lang.words.servers|title()}}: {{lang.words.monitoring|title()}} service installation - Roxy-WI" id="admin-tabs-mon">{{lang.words.monitoring|title()}} {{lang.words.installation}}</a></li>
<li><a href="#backup" title="{{lang.words.servers|title()}}: {{lang.words.manage|title()}} {{lang.words.backup|title()}} configs - Roxy-WI" id="admin-tabs-backup">{{lang.words.backup|title()}}</a></li>
<li><a href="#geolite2" title="{{lang.words.servers|title()}}: GeoLite2 - Roxy-WI">GeoLite2</a></li>
{% include 'include/login.html' %}
</ul>
<ul id='browse_histroy'></ul>
<div id="users">
{% include 'include/admin_users.html' %}
</div>
@ -165,13 +163,12 @@
<div id="ajax"></div>
{% endif %}
</div>
<div id="backup">
{% include 'include/admin_backup.html' %}
</div>
<div id="installmon">
{% include 'include/mon_installation.html' %}
</div>
<div id="backup">
{% include 'include/admin_backup.html' %}
</div>
<div id="geolite2">
<table>
{% if not is_needed_tool %}
@ -225,23 +222,23 @@
<table style="min-width: 40%;">
<tr class="overviewHead">
<th colspan=13 style="background-color: #d1ecf1; padding: 10px;">
<span id="table_metrics_head" style="position: absolute;margin-left: 43%;">{{lang.admin_page.desc.country_codes|title()}}</span>
<span id="show_country_codes" class="plus switcher_table_metric" title="{{lang.words.show|title()}} {{lang.admin_page.desc.country_codes}}"></span>
<span id="hide_country_codes" class="minus switcher_table_metric" title="{{lang.words.hide|title}} {{lang.admin_page.desc.country_codes}}" style="display: none;"></span>
<span id="table_metrics_head" style="margin-left: 5px;">{{lang.admin_page.desc.country_codes}}</span>
<select id="geoip_select">
{% for code in geoip_country_codes %}
<option>{{code.name}} {{code.code}}</option>
{% endfor %}
</select>
</th>
</tr>
</table>
<div id="geoip_country_codes" style="display: none;">
{% for code in geoip_country_codes %}
<div class="geoip_country_code" id="{{code.code}}">{{code.code}} ({{code.name}})</div>
{% endfor %}
</div>
</div>
</div>
{% include 'include/admins_dialogs.html' %}
{% include 'include/change_pass_form.html' %}
<script>
$('#geoip_select').select2();
$( function() {
$("#geoip_select").selectmenu("destroy");
{% for user in users %}
$("#role-{{user.0}}" ).selectmenu({
width: 100

View File

@ -10,7 +10,7 @@
<style>
</style>
<form style="padding-left: 5px;" action="statsview.py" method="post">
<form action="statsview.py" method="post" class="left-space">
<input type="hidden" id="service" value="{{service}}" />
<select autofocus required name="serv" id="serv">
<option disabled>------</option>
@ -26,11 +26,11 @@
{% if service != 'nginx' and service != 'apache' %}
<div id="stats_filter">
<div id="stats_filter_text">{{lang.words.filter|title()}}:</div>
{{ checkbox('stats_active', title=lang.words.show|title()+' ' + lang.words.active + ' ' + lang.words.servers, desc=lang.words.active|title(), checked='checked') }}
{{ checkbox('stats_drain', title=lang.words.show|title()+' ' + lang.words.active + ' ' + lang.words.servers, desc=lang.words.drain|title(), checked='checked') }}
{{ checkbox('stats_active', title=lang.words.show|title()+' ' + lang.words.actives + ' ' + lang.words.servers, desc=lang.words.actives|title(), checked='checked') }}
{{ checkbox('stats_drain', title=lang.words.show|title()+' ' + lang.words.drains + ' ' + lang.words.servers, desc=lang.words.drains|title(), checked='checked') }}
{{ checkbox('stats_maintain', title=lang.words.show|title()+' ' + lang.words.maintain + ' ' + lang.words.servers, desc=lang.words.maintain|title(), checked='checked') }}
{{ checkbox('stats_down', title='Show DOWN servers', desc='DOWN', checked='checked') }}
{{ checkbox('stats_not_checked', title='Show not checked servers', desc='Not checked', checked='checked') }}
{{ checkbox('stats_down', title=lang.words.show|title()+' DOWN ' + lang.words.servers, desc='DOWN', checked='checked') }}
{{ checkbox('stats_not_checked', title=lang.phrases.show_not_checked, desc=lang.phrases.not_checked, checked='checked') }}
{{ checkbox('stats_backup', title=lang.words.show|title()+' ' + lang.words.backup + ' ' + lang.words.servers, desc=lang.words.backup|title(), checked='checked') }}
{{ checkbox('stats_frontends', title=lang.words.show|title()+' ' + lang.words.frontends, desc=lang.words.frontends|title(), checked='checked') }}
{{ checkbox('stats_backends', title=lang.words.show|title()+' ' + lang.words.backends , desc=lang.words.backends|title(), checked='checked') }}
@ -40,7 +40,7 @@
{% endif %}
</form>
<div id="ajax" style="margin-left: 5px; margin-right: 5px;"></div>
<div id="ajax" style="margin-left: 15px; margin-right: 5px;"></div>
<script>
if (cur_url[1]) {
showStats();
@ -66,6 +66,9 @@
$('td').css('padding', '3px');
$('th').css('padding-top', '4px');
$('th').css('padding-bottom', '4px');
$('h2').css('font-style', 'inherit');
$('h2').css('color', '#fff');
$('h2').css('font-size', '1.5em');
if ($('#service').val() != 'apache') {
$('h1').css('display', 'none');
$('th').css('border-color', '#ddd');
@ -156,4 +159,4 @@
</script>
<link href="/inc/css/style.css" rel="stylesheet">
{% endif %}
{% endblock %}
{% endblock %}

View File

@ -2,7 +2,7 @@
{% block title %}{{title}}{% endblock %}
{% block h2 %}{{title}}{% endblock %}
{% block content %}
<script src="/inc/waf.js"></script>
<script src="/inc/waf-6.3.8.js"></script>
{% if manage_rules == '1' %}
{% from 'include/input_macros.html' import input, checkbox %}
<table class="overview" id="waf_rules">
@ -173,7 +173,7 @@
</table>
{% if service == 'haproxy' %}
<link href="/inc/chart.min.css" rel="stylesheet">
<script src="/inc/overview.js"></script>
<script src="/inc/overview-6.3.9.js"></script>
<script src="/inc/metrics.js"></script>
<script src="/inc/chart.min.js"></script>
<div id="table_metrics"></div>

View File

@ -49,7 +49,7 @@ except Exception as e:
roxywi_common.logging('Roxy-WI server', f'Cannot get a user plan: {e}', roxywi=1)
rendered_template = template.render(
role=user_params['role'], user=user_params['user'], users=users, groups=sql.select_groups(),
h2=1, role=user_params['role'], user=user_params['user'], users=users, groups=sql.select_groups(),
servers=sql.select_servers(full=1), masters=masters, sshs=sql.select_ssh(), roles=sql.select_roles(),
settings=settings, backups=sql.select_backups(), services=services, timezones=pytz.all_timezones,
page="users.py", user_services=user_params['user_services'], ldap_enable=ldap_enable, gits=gits, guide_me=1,

46
inc/admin_settings.js Normal file
View File

@ -0,0 +1,46 @@
$( function() {
$('#nginx-section-head').click(function () {
hideAndShowSettings('nginx');
});
$('#main-section-head').click(function () {
hideAndShowSettings('main');
});
$('#monitoring-section-head').click(function () {
hideAndShowSettings('monitoring');
});
$('#haproxy-section-head').click(function () {
hideAndShowSettings('haproxy');
});
$('#ldap-section-head').click(function () {
hideAndShowSettings('ldap');
});
$('#logs-section-head').click(function () {
hideAndShowSettings('logs');
});
$('#rabbitmq-section-head').click(function () {
hideAndShowSettings('rabbitmq');
});
$('#apache-section-head').click(function () {
hideAndShowSettings('apache');
});
$('#keepalived-section-head').click(function () {
hideAndShowSettings('keepalived');
});
$('#mail-section-head').click(function () {
hideAndShowSettings('mail');
});
});
function hideAndShowSettings(section) {
var ElemId = $('#' + section + '-section-h3');
if(ElemId.attr('class') == 'plus-after') {
$('.' + section + '-section').show();
ElemId.removeClass('plus-after');
ElemId.addClass('minus-after');
$.getScript(awesome);
} else {
$('.' + section + '-section').hide();
ElemId.removeClass('minus-after');
ElemId.addClass('plus-after');
$.getScript(awesome);
}
}

View File

@ -266,6 +266,9 @@
.fa-stop {
color: red !important;
}
.disabled-button > .fa-stop, .disabled-button > .fa-play {
color: gray !important;
}
.service-restart > .fa-sync-alt {
color: orange !important;
}
@ -337,6 +340,9 @@
margin-top: 4px;
font-size: 25px;
}
.alert-warning .fa-exclamation-circle {
margin-top: -5px;
}
.alert-info .fa-info-circle {
margin-top: -3px;
}

File diff suppressed because one or more lines are too long

View File

@ -26,7 +26,7 @@ h2 {
font-size: 1.5em;
background: var(--blue-color);
border: 1px solid var(--blue-color);
padding: 2px 3px 3px 10px;
padding: 2px 3px 3px 15px;
color: #fff;
margin-top: 0;
margin-bottom: 0;
@ -36,14 +36,15 @@ h3 {
margin-top: -0;
margin-bottom: 0;
background: #d1ecf1;
padding: 0.3em;
font-size: 1.6em;
border-bottom: 1px solid #ddd;
padding: 0.3em 0.3em 0.3em 13px;
}
ul#browse_histroy {
padding-left: 12px;
display: block;
margin-top: 1px;
margin-top: 3px;
margin-bottom: -1px;
list-style: none;
border-bottom: 1px solid #D9D9D9;
padding-bottom: 5px;
@ -64,15 +65,15 @@ ul#browse_histroy li+li:before {
}
#browse_histroy a {
color: #767676;
font-size: 9.1px;
font-size: 11.1px;
font-weight: bold;
}
ul#browse_histroy li:first-child a {
font-size: 8.4px;
font-size: 10.4px;
color: #979393;
}
ul#browse_histroy li:last-child a {
font-size: 9.8px;
font-size: 11.8px;
color: #7e7b7b;
}
form {
@ -100,10 +101,10 @@ pre {
top: 0;
right: 0;
left: 0;
z-index: 1000;
display: block;
background-color: var(--menu-color);
font-size: 12px;
z-index: 99;
}
.logoText {
color: #EBF1F1;
@ -182,7 +183,7 @@ pre {
float: right;
margin-top: 3px;
margin-left: 14px;
margin-right: 30px;
margin-right: 50px;
color: #fff !important;
font-size: 15px;
cursor: pointer;
@ -253,9 +254,8 @@ pre {
margin-right: 5px;
}
.configShow, .diff {
margin-left: 16%;
overflow: auto;
width: 70%;
width: 95%;
border: 1px solid #DCDCDC;
border-radius: 5px;
}
@ -354,7 +354,6 @@ pre {
.add-note {
width: 30%;
padding-left: 10px;
font-style: italic;
}
.add_server_number {
width: 70px;
@ -362,13 +361,19 @@ pre {
.overview {
width: 100%;
}
.overview-overflow {
overflow-x: auto;
display: block;
}
.overview-wi {
width: 46%;
width: 47%;
min-width: 566px;
max-width: 50%;
min-height: 160px;
float: left;
margin: 0 20px 20px;
margin: 0 20px 20px 7px;
border-bottom: 1px solid #D9D9D9;
border-top: 1px solid #D9D9D9;
}
.overviewHead {
border-radius: 5px;
@ -418,7 +423,7 @@ pre {
.serverNone {
background-color: #ddd;
}
.add-button, .add-button-wi {
.add-button {
background-color: var(--blue-color);
border-radius: 5px;
color: #fff;
@ -427,23 +432,30 @@ pre {
margin-right: 1px;
cursor: pointer;
}
.add-button:hover, .add-button-wi:hover {
.add-button:hover {
background-color: #5094ee;
}
.add-button:active, .add-button-wi:active {
.add-button:active {
background-color: #5499f4;
box-shadow: 0 1px #666;
}
.add-button-wi {
float: right;
padding-right: 5px;
padding-left: 5px;
font-size: 13px;
cursor: pointer;
color: #b3b3b3;
}
.add-button-wi:hover, .add-button-wi:active {
text-decoration: underline;
color: var(--right-menu-blue-rolor);
}
.serverDown {
background-color: var(--red-color);
}
.padding10 {
padding: 10px 10px 10px 0;
padding: 10px 10px 10px 10px;
border: none;
width: 15%;
}
@ -455,11 +467,9 @@ pre {
padding-top: 20px;
}
.first-collumn {
padding-left: 15px;
width: 20%;
}
.first-collumn-wi {
padding-left: 15px;
width: 40%;
}
.second-collumn {
@ -526,7 +536,6 @@ ul{
opacity: 0;
border-left: 10px solid transparent;
transition: 0.5s opacity;
z-index: 1001;
}
.v_menu a {
background-color: #48505A;
@ -574,17 +583,37 @@ ul{
font-size: 0.9em;
}
.form-login {
text-align: center;
background-color: #fff;
padding: 10px;
padding: 10px 10px 10px 30px;
width: 220px;
background-size: 0 !important;
border: 0 !important;
}
.ui-selectmenu-open, .ui-selectmenu-menu {
z-index: 1010 !important;
}
.ui-dialog {
z-index: 1000 !important;
}
.ui-button {
padding-left: 10px !important;
padding-right: 10px !important;
}
.ui-button:active {
border: none !important;
}
#tabs.ui-widget.ui-widget-content {
border: none !important;
}
#tabs.ui-tabs {
padding: 0 !important;
}
#tabs.ui-widget-header {
border: none !important;
}
#tabs.ui-corner-all {
border-radius: none !important;
}
.overflow_div {
overflow: hidden;
text-overflow: ellipsis;
@ -611,7 +640,7 @@ ul{
}
.ui-tabs-nav {
border-radius: 0 !important;
padding-left: 25px !important;
padding-left: 15px !important;
padding-top: 0.28em !important;
}
.ui-tabs .ui-tabs-panel {
@ -620,26 +649,23 @@ ul{
}
.ui-tabs {
padding-left: 0 !important;
margin-top: -5px !important;
margin-left: -2px;
}
.ui-widget-header {
background: var(--blue-color) !important;
color: #f4f1f1 !important;
}
.ui-menu, .ui-menu-item {
background: #EBF1F1 !important;
}
.ui-dialog {
z-index: 1000 !important;
}
.ui-selectmenu-open, .ui-selectmenu-menu {
z-index: 1010 !important;
}
.ui-corner-all {
border-radius: 3px !important;
}
#tabs.ui-widget.ui-widget-content {
border-bottom: none !important;
/*.ui-visual-focus {*/
/* box-shadow: none !important;*/
/*}*/
.ui-state-focus {
border: none !important;
}
.need-field {
color: var(--red-color);
@ -674,9 +700,10 @@ table {
border-spacing: 0;
border-collapse: collapse;
background-color: transparent;
border-top: 1px solid #ddd;
border-radius: var(--border-radius);
width: 100%;
font-size: 1.2em;
font-size: 1.1em;
}
caption {
color: #777;
@ -704,7 +731,6 @@ td,th {
padding:15px;
margin-bottom:20px;
border:1px solid transparent;
width: 400px;
display: block;
}
.alert a {
@ -713,8 +739,7 @@ td,th {
color: var(--blue-color) !important;
}
.alert-danger, .alert-info, .alert-success, .alert-warning, .added {
margin-left: 15px;
margin-top: 15px;
margin-top: 15px;
}
.alert-danger {
color: #a94442;
@ -731,6 +756,7 @@ td,th {
color: #0c5460;
background-color: #d1ecf1;
border-color: #bee5eb;
margin-left: 15px;
}
.alert-warning {
color: #856404;
@ -767,6 +793,9 @@ label {
font-weight: bold;
padding-right: 10px;
}
.odd {
background-color: white;
}
.even {
background-color: #f3f8fb;
}
@ -924,7 +953,7 @@ label {
padding-left: 4px;
}
.main {
margin: 20px;
margin: 15px;
}
.sort_menu {
clear: both;
@ -934,14 +963,14 @@ label {
}
.group_name {
font-size: 18px;
padding: 10px 20px 0 15px;
padding: 10px 20px 0px 0px;
}
.smon_services {
width: 192px;
height: 162px;
float: left;
background-color: #fbfbfb;;
margin: 10px;
margin: 10px 10px 10px 0px;
padding-left: 15px;
padding-top: 0;
border: 1px solid #A4C7F5;
@ -1244,11 +1273,13 @@ label {
padding: 0 10px 5px 5px;
}
.stats_active, .stats_drain, .stats_maintain, .stats_down, .stats_not_checked, .stats_backup, .stats_frontends, .stats_backends {
color: #000 ;
color: #000 !important;
border-color: rgb(221, 221, 221) !important;
opacity: .8;
}
.stats_active:hover, .stats_not_checked:hover, .stats_backup:hover {
color: darkgrey !important;
.stats_active:hover, .stats_drain:hover, .stats_maintain:hover, .stats_down:hover, .stats_not_checked:hover, .stats_backup:hover, .stats_frontends:hover, .stats_backends:hover {
color: #000 !important;
opacity: 1;
}
.stats_active {
background-color: #c0ffc0 !important;
@ -1308,3 +1339,6 @@ label {
text-overflow: ellipsis;
white-space: nowrap;
}
.left-space {
margin-left: 15px !important;
}

View File

@ -208,7 +208,7 @@ table.dataTable td {
*zoom: 1;
zoom: 1; }
.dataTables_length {
padding-left: 10px;
padding-left: 15px;
}
.dataTables_filter, .dataTables_length {
padding-top: 9px;

View File

@ -23,9 +23,9 @@
color: #FFFFFF;
-webkit-text-shadow: 0 1px 0 #ffffff;
text-shadow: 0 1px 0 #ffffff;
opacity: 0.8;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
filter: alpha(opacity=80);
opacity: 1;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
filter: alpha(opacity=100);
line-height: 1;
}
.toast-close-button:hover,
@ -115,9 +115,9 @@ button.toast-close-button {
-webkit-box-shadow: 0 0 12px #999999;
box-shadow: 0 0 12px #999999;
color: #FFFFFF;
opacity: 0.8;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
filter: alpha(opacity=80);
opacity: 1;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
filter: alpha(opacity=100);
}
#toast-container > div.rtl {
direction: rtl;

View File

@ -165,9 +165,9 @@ function ajaxActionServers(action, id) {
toastr.error(data);
} else if (cur_url[0] == "hapservers.py") {
if (data.indexOf('warning: ') != '-1') {
toastr.warning(data)
toastr.warning(data);
} else {
location.reload()
location.reload();
}
} else {
setTimeout(showOverview(ip, hostnamea), 2000);
@ -347,45 +347,36 @@ $( function() {
console.log(e);
}
$( "#show-all-users" ).click( function() {
$( ".show-users" ).show("fast");
$( "#show-all-users" ).text("Hide");
$( "#show-all-users" ).attr("title", "Hide all users");
$( "#show-all-users" ).attr("id", "hide-all-users");
$("#hide-all-users").click(function() {
$( ".show-users" ).hide("fast");
$( "#hide-all-users" ).attr("title", "Show all users");
$( "#hide-all-users" ).text("Show all");
$( "#hide-all-users" ).attr("id", "show-all-users");
});
$(".show-users").show("fast");
$("#hide-all-users").css("display", "block");
$("#show-all-users").css("display", "none");
});
$("#hide-all-users").click(function() {
$(".show-users").hide("fast");
$("#hide-all-users").css("display", "none");
$("#show-all-users").css("display", "block");
});
$( "#show-all-groups" ).click( function() {
$( ".show-groups" ).show("fast");
$( "#show-all-groups" ).text("Hide");
$( "#show-all-groups" ).attr("title", "Hide all groups");
$( "#show-all-groups" ).attr("id", "hide-all-groups");
$( "#hide-all-groups" ).click( function() {
$( ".show-groups" ).hide("fast");
$( "#hide-all-groups" ).attr("title", "Show all groups");
$( "#hide-all-groups" ).text("Show all");
$( "#hide-all-groups" ).attr("id", "show-all-groups");
});
$(".show-groups").show("fast");
$("#hide-all-groups").css("display", "block");
$("#show-all-groups").css("display", "none");
});
$( "#hide-all-groups" ).click( function() {
$(".show-groups").hide("fast");
$("#hide-all-groups").css("display", "none");
$("#show-all-groups").css("display", "block");
});
$( "#show-all-haproxy-wi-log" ).click( function() {
$( ".show-haproxy-wi-log" ).show("fast");
$( "#show-all-haproxy-wi-log" ).text("Show less");
$( "#show-all-haproxy-wi-log" ).attr("title", "Show less");
$( "#show-all-haproxy-wi-log" ).attr("id", "hide-all-haproxy-wi-log");
$( "#hide-all-haproxy-wi-log" ).click( function() {
$( ".show-haproxy-wi-log" ).hide("fast");
$( "#hide-all-haproxy-wi-log" ).attr("title", "Show more");
$( "#hide-all-haproxy-wi-log" ).text("Show more");
$( "#hide-all-haproxy-wi-log" ).attr("id", "show-all-haproxy-wi-log");
});
$(".show-haproxy-wi-log").show("fast");
$("#hide-all-haproxy-wi-log").css("display", "block");
$("#show-all-haproxy-wi-log").css("display", "none");
});
$( "#hide-all-haproxy-wi-log" ).click( function() {
$(".show-haproxy-wi-log").hide("fast");
$("#hide-all-haproxy-wi-log").css("display", "none");
$("#show-all-haproxy-wi-log").css("display", "block");
});
if (cur_url[0] == "overview.py" || cur_url[0] == "waf.py" || cur_url[0] == "metrics.py") {
@ -583,6 +574,8 @@ function keepalivedBecameMaster(serv) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else if (data.indexOf('no such') != '-1') {
$("#bin_bout").html('Cannot get information');
} else {
$("#bin_bout").html(data);
$.getScript("/inc/fontawesome.min.js")

View File

@ -23,15 +23,14 @@ function show_current_page(id) {
id.parent().css('left', '0');
id.parent().children().css('margin-left', '-20px');
id.parent().find('a').css('padding-left', '20px');
id.find('a').css('padding-left', '30px');
id.find('a').css('border-left', '4px solid var(--right-menu-blue-rolor)');
id.find('a').css('background-color', 'var(--right-menu-blue-rolor)');
}
$( function() {
$('.menu li ul li').each(function () {
var link = $(this).find('a').attr('href');
var link2 = link.split('/')[2]
var link2 = link.split('/')[2];
if (cur_url[1] == null) {
cur_url[1] = 'haproxy';
cur_url[1] = 'haproxy';
}
if (cur_url[0] == link2 && cur_url[1].split('&')[0] != 'service=keepalived' && cur_url[1].split('&')[0] != 'service=nginx' && cur_url[1].split('&')[0] != 'service=apache') {
show_current_page($(this))
@ -83,8 +82,9 @@ $( function() {
show_current_page($(this))
} else if(cur_url[0] == 'add.py' && cur_url[1].split('&')[0] == 'service=nginx#ssl' && link2 == 'add.py?service=nginx#ssl'){
show_current_page($(this))
} else if(cur_url[0] == 'viewlogs.py' && cur_url[1].split('&')[0] == 'type=2' && link2 == 'viewlogs.py?type=2'){
show_current_page($(this))
} else if(cur_url[0] == 'viewlogs.py' && cur_url[1].split('&')[0] == 'type=2' && link2 == 'viewlogs.py?type=2') {
show_current_page($(this));
return false;
} else if(cur_url[0] == 'metrics.py' && cur_url[1].split('&')[0] == 'service=haproxy' && link2 == 'metrics.py?service=haproxy'){
show_current_page($(this))
} else if(cur_url[0] == 'metrics.py' && cur_url[1].split('&')[0] == 'service=nginx' && link2 == 'metrics.py?service=nginx'){
@ -194,16 +194,17 @@ function setRefreshInterval(interval) {
if (interval == "0") {
var autoRefresh = sessionStorage.getItem('auto-refresh');
if (autoRefresh !== undefined) {
var autorefresh_word = $('#translate').attr('data-autorefresh');
sessionStorage.removeItem('auto-refresh');
pauseAutoRefresh();
$('#0').html('<span class="auto-refresh-reload auto-refresh-reload-icon"></span> Auto-refresh');
$('#0').html('<span class="auto-refresh-reload auto-refresh-reload-icon"></span> '+autorefresh_word);
$('.auto-refresh').css('display', 'inline');
$('.auto-refresh').css('font-size', '15px');
$('#1').text('Auto-refresh');
$('.auto-refresh-pause').css('display', 'none');
$('#1').text(autorefresh_word);
$('.auto-refresh-resume').css('display', 'none');
$('.auto-refresh-pause').css('display', 'none');
$.getScript("/inc/fontawesome.min.js");
$.getScript("/inc/scripts.js");
// $.getScript("/inc/script-6.3.9.js");
}
hideAutoRefreshDiv();
} else {
@ -261,12 +262,10 @@ function startSetInterval(interval) {
}
function pauseAutoRefresh() {
clearInterval(intervalId);
$(function() {
$('.auto-refresh-pause').css('display', 'none');
$('.auto-refresh-resume').css('display', 'inline');
sessionStorage.setItem('auto-refresh-pause', '1')
});
}
$('.auto-refresh-pause').css('display', 'none');
$('.auto-refresh-resume').css('display', 'inline');
sessionStorage.setItem('auto-refresh-pause', '1');
}
function pauseAutoResume(){
var autoRefresh = sessionStorage.getItem('auto-refresh');
setRefreshInterval(autoRefresh);
@ -762,7 +761,8 @@ $( function() {
$( "[title]" ).tooltip({
"content": function(){
return $(this).attr("data-help");
}
},
show: {"delay": 1000}
});
$( "input[type=submit], button" ).button();
$( "input[type=checkbox]" ).checkboxradio();
@ -931,7 +931,6 @@ $( function() {
var save_word = $('#translate').attr('data-save');
var change_word = $('#translate').attr('data-change');
var password_word = $('#translate').attr('data-password');
var logout_word = $('#translate').attr('data-logout');
var change_pass_word = change_word + ' ' + password_word
var showUserSettings = $( "#show-user-settings" ).dialog({
autoOpen: false,
@ -950,11 +949,6 @@ $( function() {
changePassword();
$(this).dialog("close");
}
}, {
text: logout_word,
click: function() {
window.location.replace(window.location.origin+'/app/login.py?logout=logout');
}
}, {
text: cancel_word,
click: function () {
@ -965,11 +959,9 @@ $( function() {
$('#show-user-settings-button').click(function() {
if (localStorage.getItem('disabled_alert') == '1') {
$('#disable_alerting option[value="1"]').prop('selected', true);
$('#disable_alerting').selectmenu('refresh');
$('#disable_alerting').prop('checked', false).checkboxradio('refresh');
} else {
$('#disable_alerting option[value="0"]').prop('selected', true);
$('#disable_alerting').selectmenu('refresh');
$('#disable_alerting').prop('checked', true).checkboxradio('refresh');
}
$.ajax( {
url: "options.py",
@ -1124,7 +1116,7 @@ $( function() {
$(this).children(".installmon").css('padding-left', '30px');
$(this).children(".installmon").css('border-left', '4px solid var(--right-menu-blue-rolor)');
});
$( "#tabs" ).tabs( "option", "active", 7 );
$( "#tabs" ).tabs( "option", "active", 6 );
} );
$( ".backup" ).on( "click", function() {
$('.menu li ul li').each(function () {
@ -1133,7 +1125,7 @@ $( function() {
$(this).children(".backup").css('padding-left', '30px');
$(this).children(".backup").css('border-left', '4px solid var(--right-menu-blue-rolor)');
});
$( "#tabs" ).tabs( "option", "active", 6 );
$( "#tabs" ).tabs( "option", "active", 7 );
} );
}
}
@ -1154,12 +1146,10 @@ $( function() {
})
});
function saveUserSettings(){
if ($('#disable_alerting').val() == '0') {
localStorage.removeItem('disabled_alert');
sessionStorage.removeItem('disabled_alert');
} else if ($('#disable_alerting').val() == '1') {
sessionStorage.setItem('disabled_alert', '1');
if ($('#disable_alerting').is(':checked')) {
localStorage.removeItem('disabled_alert');
} else {
localStorage.setItem('disabled_alert', '1');
}
changeCurrentGroupF();
Cookies.set('lang', $('#lang_select').val(), { expires: 365, path: '/app', samesite: 'strict', secure: 'true' });
@ -1674,7 +1664,7 @@ function startIntro(intro) {
}
}
document.addEventListener("DOMContentLoaded", function(event){
statAgriment();
// statAgriment();
});
function sendGet(page) {
var xmlHttp = new XMLHttpRequest();
@ -1694,3 +1684,11 @@ function show_pretty_ansible_error(data) {
function openTab(tabId) {
$( "#tabs" ).tabs( "option", "active", tabId );
}
function showPassword(input) {
var x = document.getElementById(input);
if (x.type === "password") {
x.type = "text";
} else {
x.type = "password";
}
}

View File

@ -15,7 +15,8 @@ $( function() {
docker = '1';
}
if ($('#haproxyaddserv').val() == '------' || $('#haproxyaddserv').val() === null) {
toastr.warning('Select a server');
var select_server = $('#translate').attr('data-select_server');
toastr.warning(select_server);
return false
}
$("#ajax").html(wait_mess);
@ -839,16 +840,6 @@ $( function() {
clearTips();
}
});
$('#show_country_codes').click(function() {
$('#hide_country_codes').show();
$('#geoip_country_codes').show();
$('#show_country_codes').hide();
});
$('#hide_country_codes').click(function() {
$('#show_country_codes').show();
$('#geoip_country_codes').hide();
$('#hide_country_codes').hide();
});
$( "#geoipserv" ).on('selectmenuchange',function() {
if($('#geoip_service option:selected').val() != '------') {
checkGeoipInstallation();
@ -910,7 +901,6 @@ $( function() {
} else if (activeTab == '#updatehapwi') {
loadupdatehapwi();
} else if (activeTab == '#checker'){
loadchecker();
} else if (activeTab == '#openvpn'){
loadopenvpn();
@ -932,51 +922,7 @@ $( function() {
$(this).children(".backup").css('border-left', '4px solid var(--right-menu-blue-rolor)');
});
});
$('#nginx-section-head').click(function () {
hideAndShowSettings('nginx');
});
$('#main-section-head').click(function () {
hideAndShowSettings('main');
});
$('#monitoring-section-head').click(function () {
hideAndShowSettings('monitoring');
});
$('#haproxy-section-head').click(function () {
hideAndShowSettings('haproxy');
});
$('#ldap-section-head').click(function () {
hideAndShowSettings('ldap');
});
$('#logs-section-head').click(function () {
hideAndShowSettings('logs');
});
$('#rabbitmq-section-head').click(function () {
hideAndShowSettings('rabbitmq');
});
$('#apache-section-head').click(function () {
hideAndShowSettings('apache');
});
$('#keepalived-section-head').click(function () {
hideAndShowSettings('keepalived');
});
$('#mail-section-head').click(function () {
hideAndShowSettings('mail');
});
} );
function hideAndShowSettings(section) {
var ElemId = $('#' + section + '-section-h3');
if(ElemId.attr('class') == 'plus-after') {
$('.' + section + '-section').show();
ElemId.removeClass('plus-after');
ElemId.addClass('minus-after');
$.getScript(awesome);
} else {
$('.' + section + '-section').hide();
ElemId.removeClass('minus-after');
ElemId.addClass('plus-after');
$.getScript(awesome);
}
}
window.onload = function() {
$('#tabs').tabs();
var activeTabIdx = $('#tabs').tabs('option','active')
@ -1115,7 +1061,6 @@ function addServer(dialog_id) {
valid = valid && checkLength( $('#new-server-add'), "Hostname", 1 );
valid = valid && checkLength( $('#new-ip'), "IP", 1 );
valid = valid && checkLength( $('#new-port'), "Port", 1 );
console.log(cred)
if (cred == null) {
toastr.error('First select credentials');
return false;
@ -1133,7 +1078,6 @@ function addServer(dialog_id) {
newip: newip,
newport: $('#new-port').val(),
newservergroup: newservergroup,
scan_server: scan_server,
typeip: typeip,
haproxy: haproxy,
nginx: nginx,
@ -1142,17 +1086,14 @@ function addServer(dialog_id) {
enable: enable,
slave: $('#slavefor' ).val(),
cred: cred,
page: cur_url[0].split('#')[0],
page: cur_url,
desc: $('#desc').val(),
token: $('#token').val()
},
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('You should install lshw on the server') != '-1') {
toastr.error(data);
$( dialog_id ).dialog("close");
} else if (data.indexOf('error:') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
common_ajax_action_after_success(dialog_id, 'newserver', 'ajax-servers', data);
@ -1170,11 +1111,36 @@ function addServer(dialog_id) {
$('select:regex(id, apache_exp_addserv)').append('<option value=' + $('#ip-'+id).text() + '>' + $('#hostname-'+id).val() + '</option>').selectmenu("refresh");
$('select:regex(id, node_exp_addserv)').append('<option value=' + $('#ip-'+id).text() + '>' + $('#hostname-'+id).val() + '</option>').selectmenu("refresh");
$('select:regex(id, geoipserv)').append('<option value=' + $('#ip-'+id).text() + '>' + $('#hostname-'+id).val() + '</option>').selectmenu("refresh");
$('select:regex(id, haproxyaddserv)').append('<option value=' + newip + '>' + servername + '</option>').selectmenu("refresh");
$('select:regex(id, nginxaddserv)').append('<option value=' + newip + '>' + servername + '</option>').selectmenu("refresh");
$('select:regex(id, apacheaddserv)').append('<option value=' + newip + '>' + servername + '</option>').selectmenu("refresh");
after_server_creating(servername, newip, scan_server);
}
}
} );
}
}
function after_server_creating(servername, newip, scan_server) {
$.ajax({
url: "options.py",
data: {
act: 'after_adding',
servername: servername,
newip: newip,
scan_server: scan_server,
token: $('#token').val()
},
type: "POST",
success: function (data) {
data = data.replace(/\s+/g, ' ');
if (data.indexOf('You should install lshw on the server') != '-1') {
toastr.error(data);
} else if (data.indexOf('error:') != '-1') {
toastr.error(data);
}
}
} );
}
function addCreds(dialog_id) {
toastr.clear();
var ssh_enable = 0;
@ -1942,23 +1908,11 @@ function updateServer(id) {
toastr.clear();
let typeip = 0;
let enable = 0;
let haproxy = 0;
let nginx = 0;
let apache = 0;
let firewall = 0;
let protected_serv = 0;
if ($('#typeip-'+id).is(':checked')) {
typeip = '1';
}
if ($('#haproxy-'+id).is(':checked')) {
haproxy = '1';
}
if ($('#nginx-'+id).is(':checked')) {
nginx = '1';
}
if ($('#apache-'+id).is(':checked')) {
apache = '1';
}
if ($('#enable-'+id).is(':checked')) {
enable = '1';
}
@ -1979,9 +1933,6 @@ function updateServer(id) {
port: $('#port-'+id).val(),
servergroup: servergroup,
typeip: typeip,
haproxy: haproxy,
nginx: nginx,
apache: apache,
firewall: firewall,
enable: enable,
slave: $('#slavefor-'+id+' option:selected' ).val(),
@ -2008,7 +1959,7 @@ function updateServer(id) {
}
function uploadSsh() {
toastr.clear();
if ($( "#ssh-key-name option:selected" ).val() == "Choose server" || $('#ssh_cert').val() == '') {
if ($( "#ssh-key-name option:selected" ).val() == "------" || $('#ssh_cert').val() == '') {
toastr.error('All fields must be completed');
} else {
$.ajax( {
@ -2128,7 +2079,7 @@ function updateSlack(id) {
}
function updateBackup(id) {
toastr.clear();
if ($( "#backup-type-"+id+" option:selected" ).val() == "Choose server" || $('#backup-rserver-'+id).val() == '' || $('#backup-rpath-'+id).val() == '') {
if ($( "#backup-type-"+id+" option:selected" ).val() == "-------" || $('#backup-rserver-'+id).val() == '' || $('#backup-rpath-'+id).val() == '') {
toastr.error('All fields must be completed');
} else {
$.ajax( {
@ -3012,7 +2963,8 @@ function installService(service){
docker = '1';
}
if ($('#'+service+'addserv').val() == '------') {
toastr.warning('Select a server');
var select_server = $('#translate').attr('data-select_server');
toastr.warning(select_server);
return false
}
$("#ajax").html(wait_mess);
@ -3078,34 +3030,37 @@ function showServiceVersion(service) {
} );
}
function serverIsUp(server_ip, server_id) {
$.ajax({
url: "options.py",
data: {
act: 'server_is_up',
server_is_up: server_ip,
token: $('#token').val()
},
type: "POST",
success: function (data) {
data = data.replace(/^\s+|\s+$/g, '');
if (data.indexOf('up') != '-1') {
$('#server_status-'+server_id).removeClass('serverNone');
$('#server_status-'+server_id).removeClass('serverDown');
$('#server_status-'+server_id).addClass('serverUp');
$('#server_status-'+server_id).attr('title', 'Server is reachable');
} else if (data.indexOf('down') != '-1') {
$('#server_status-'+server_id).removeClass('serverNone');
$('#server_status-'+server_id).removeClass('serverUp');
$('#server_status-'+server_id).addClass('serverDown');
$('#server_status-'+server_id).attr('title', 'Server is unreachable');
} else {
$('#server_status-'+server_id).removeClass('serverDown');
$('#server_status-'+server_id).removeClass('serverUp');
$('#server_status-'+server_id).addClass('serverNone');
$('#server_status-'+server_id).attr('title', 'Cannot get server status');
var cur_url = window.location.href.split('/').pop();
if (cur_url.split('#')[1] == 'servers') {
$.ajax({
url: "options.py",
data: {
act: 'server_is_up',
server_is_up: server_ip,
token: $('#token').val()
},
type: "POST",
success: function (data) {
data = data.replace(/^\s+|\s+$/g, '');
if (data.indexOf('up') != '-1') {
$('#server_status-' + server_id).removeClass('serverNone');
$('#server_status-' + server_id).removeClass('serverDown');
$('#server_status-' + server_id).addClass('serverUp');
$('#server_status-' + server_id).attr('title', 'Server is reachable');
} else if (data.indexOf('down') != '-1') {
$('#server_status-' + server_id).removeClass('serverNone');
$('#server_status-' + server_id).removeClass('serverUp');
$('#server_status-' + server_id).addClass('serverDown');
$('#server_status-' + server_id).attr('title', 'Server is unreachable');
} else {
$('#server_status-' + server_id).removeClass('serverDown');
$('#server_status-' + server_id).removeClass('serverUp');
$('#server_status-' + server_id).addClass('serverNone');
$('#server_status-' + server_id).attr('title', 'Cannot get server status');
}
}
}
});
});
}
}
function confirmChangeGroupsAndRoles(user_id) {
var cancel_word = $('#translate').attr('data-cancel');
@ -3211,3 +3166,101 @@ function saveGroupsAndRoles(user_id) {
}
});
}
function openChangeServerServiceDialog(server_id) {
var cancel_word = $('#translate').attr('data-cancel');
var action_word = $('#translate').attr('data-save');
var user_groups_word = $('#translate').attr('data-user_groups');
var hostname = $('#hostname-'+server_id).val();
$.ajax({
url: "options.py",
data: {
act: 'show_server_services',
server_id: server_id,
token: $('#token').val()
},
type: "POST",
success: function (data) {
$("#groups-roles").html(data);
$("#groups-roles").dialog({
resizable: false,
height: "auto",
width: 700,
modal: true,
title: user_groups_word + ' ' + hostname,
buttons: [{
text: action_word,
click: function () {
changeServerServices(server_id);
$(this).dialog("close");
}
}, {
text: cancel_word,
click: function () {
$(this).dialog("close");
}
}]
});
}
});
}
function addServiceToServer(service_id) {
var service_name = $('#add_service-'+service_id).attr('data-service_name');
var delete_word = $('#translate').attr('data-delete');
var service_word = $('#translate').attr('data-service');
var length_tr = $('#checked_services tbody tr').length;
var tr_class = 'odd';
if (length_tr % 2 != 0) {
tr_class = 'even';
}
var html_tag = '<tr class="'+tr_class+'" id="remove_service-'+service_id+'" data-service_name="'+service_name+'">' +
'<td class="padding20" style="width: 100%;">'+service_name+'</td>' +
'<td><span class="add_user_group" onclick="removeServiceFromUser('+service_id+')" title="'+delete_word+' '+service_word+'">-</span></td></tr>';
$('#add_service-'+service_id).remove();
$("#checked_services tbody").append(html_tag);
}
function removeServiceFromServer(service_id) {
var service_name = $('#remove_service-'+service_id).attr('data-service_name');
var add_word = $('#translate').attr('data-add');
var service_word = $('#translate').attr('data-service');
var length_tr = $('#all_services tbody tr').length;
var tr_class = 'odd';
if (length_tr % 2 != 0) {
tr_class = 'even';
}
var html_tag = '<tr class="'+tr_class+'" id="add_service-'+service_id+'" data-service_name="'+service_name+'">' +
'<td class="padding20" style="width: 100%;">'+service_name+'</td>' +
'<td><span class="add_user_group" onclick="addServiceToUser('+service_id+')" title="'+add_word+' '+service_word+'">+</span></td></tr>';
$('#remove_service-'+service_id).remove();
$("#all_services tbody").append(html_tag);
}
function changeServerServices(server_id) {
var jsonData = {};
$('#checked_services tbody tr').each(function () {
var this_id = $(this).attr('id').split('-')[1];
jsonData[this_id] = 1
});
$('#all_services tbody tr').each(function () {
var this_id = $(this).attr('id').split('-')[1];
jsonData[this_id] = 0
});
$.ajax( {
url: "options.py",
data: {
changeServerServicesId: server_id,
jsonDatas: JSON.stringify(jsonData),
changeServerServicesServer: $('#hostname-'+server_id).val(),
token: $('#token').val()
},
type: "POST",
success: function( data ) {
if (data.indexOf('error:') != '-1' || data.indexOf('Failed') != '-1') {
toastr.error(data);
} else {
$("#server-" + server_id).addClass("update", 1000);
setTimeout(function () {
$("#server-" + server_id).removeClass("update");
}, 2500);
}
}
} );
}

View File

@ -1,4 +1,6 @@
var awesome = "/inc/fontawesome.min.js"
var waf = "/inc/waf-6.3.8.js"
var overview = "/inc/overview-6.3.9.js"
function showOverviewWaf(serv, hostnamea) {
var service = findGetParameter('service');
if (service == 'haproxy') {
@ -9,8 +11,8 @@ function showOverviewWaf(serv, hostnamea) {
for (i = 0; i < serv.length; i++) {
showOverviewWafCallBack(serv[i], hostnamea[i])
}
$.getScript('/inc/overview.js');
$.getScript('/inc/waf.js');
$.getScript(overview);
$.getScript(waf);
}
function showOverviewWafCallBack(serv, hostnamea) {
var service = findGetParameter('service');
@ -31,7 +33,7 @@ function showOverviewWafCallBack(serv, hostnamea) {
$("#"+hostnamea).html(data)
$( "input[type=submit], button" ).button();
$( "input[type=checkbox]" ).checkboxradio();
$.getScript('/inc/overview.js');
$.getScript(overview);
$.getScript(awesome);
}
} );
@ -59,7 +61,7 @@ function metrics_waf(name) {
} );
}
function installWaf(ip1) {
$("#ajax").html('')
$("#ajax").html('');
$("#ajax").html(wait_mess);
var service = findGetParameter('service');
$.ajax( {
@ -80,7 +82,8 @@ function installWaf(ip1) {
} else if (data.indexOf('success') != '-1' ){
toastr.clear();
toastr.success('WAF service has been installed');
showOverviewWaf(ip, hostnamea)
showOverviewWaf(ip, hostnamea);
$("#ajax").html('');
}
}
} );
@ -204,4 +207,4 @@ function addNewConfig() {
}
}
});
}
}

View File

@ -29,7 +29,7 @@
<script defer src="/inc/intro/introjs.min.js"></script>
<link href="/inc/intro/introjs.min.css" rel="stylesheet">
<link href="/inc/intro/introjs-modern.css" rel="stylesheet">
<link href="/inc/css/style.css" rel="stylesheet">
<link href="/inc/css/style-6.3.9.css" rel="stylesheet">
<link href="/inc/css/nprogress.css" rel="stylesheet">
<link href="/inc/css/provisioning.css" rel="stylesheet">
<link href="/inc/css/jquery-ui.min.css" rel="stylesheet">
@ -39,7 +39,7 @@
<script src="/inc/nprogress.js"></script>
<script defer src="/inc/fa-solid.min.js"></script>
<script defer src="/inc/fontawesome.min.js"></script>
<link href="/inc/css/awesome.css" rel="stylesheet">
<link href="/inc/css/awesome-6.3.9.css" rel="stylesheet">
<link href="/inc/css/chart.min.css" rel="stylesheet">
<script src="/inc/metrics.js"></script>
<script src="/inc/chart.min.js"></script>
@ -47,17 +47,17 @@
<script src="/inc/codemirror/codemirror.js"></script>
<script src="/inc/codemirror/nginx.js"></script>
<script src="/inc/codemirror/haproxy.js"></script>
<link href="/inc/css/toastr.css" rel="stylesheet"/>
<link href="/inc/css/toastr-6.3.9.css" rel="stylesheet"/>
<script src="/inc/toastr.js"></script>
<script defer src="/inc/ion.sound.min.js"></script>
<script src="/inc/provisioning.js"></script>
<link href="/inc/css/select2.css" rel="stylesheet" />
<script src="/inc/select2.js"></script>
<script src="/inc/reconnecting-websocket.js"></script>
<link href="/inc/css/table.css" rel="stylesheet" type="text/css">
<link href="/inc/css/table-6.3.9.css" rel="stylesheet" type="text/css">
<script type="text/javascript" charset="utf8" src="/inc/dataTables.min.js"></script>
<script src="/inc/js.cookie.min.js"></script>
<script src="/inc/script.js"></script>
<script src="/inc/script-6.3.9.js"></script>
<meta http-equiv="refresh" content="0; url=/app/overview.py" />
</head>
<body style="background-color: #239dee;">