Changelog: https://roxy-wi.org/changelog#6_3_9
pull/364/head
Aidaho 2023-04-09 16:11:16 +03:00
parent 28eaa9d940
commit 1ba2183618
26 changed files with 239 additions and 282 deletions

View File

@ -305,7 +305,7 @@ elif form.getvalue('mode') is not None:
try:
port_check_val = port_check[i]
except Exception:
port_check_val = port
port_check_val = server_port[i]
servers_split += " server {0} {0}:{1}{2} port {6} maxconn {5} {3} {4} \n".format(
server, server_port[i], check, send_proxy_param, backup_param, maxconn_val, port_check_val

View File

@ -3269,10 +3269,11 @@ def select_user_services(user_id):
def update_user_services(services, user_id):
try:
User.update(user_services=services).where(User.user_id == user_id).execute()
return True
except Exception as e:
out_error(e)
return False
else:
return True
def insert_or_update_service_setting(server_id, service, setting, value):

View File

@ -69,13 +69,19 @@ def update_user():
if form.getvalue('role'):
role_id = int(form.getvalue('role'))
if roxywi_auth.is_admin(level=role_id):
sql.update_user(new_user, email, role_id, user_id, activeuser)
try:
sql.update_user(new_user, email, role_id, user_id, activeuser)
except Exception as e:
print(e)
sql.update_user_role(user_id, group_id, role_id)
roxywi_common.logging(new_user, ' has been updated user ', roxywi=1, login=1)
else:
roxywi_common.logging(new_user, ' tried to privilege escalation', roxywi=1, login=1)
else:
sql.update_user_from_admin_area(new_user, email, user_id, activeuser)
try:
sql.update_user_from_admin_area(new_user, email, user_id, activeuser)
except Exception as e:
print(e)
roxywi_common.logging(new_user, ' has been updated user ', roxywi=1, login=1)

View File

@ -806,13 +806,16 @@ if form.getvalue('newgroup') is not None:
if newgroup is None:
print(error_mess)
else:
if sql.add_group(newgroup, desc):
env = Environment(loader=FileSystemLoader('templates/ajax/'), autoescape=True)
template = env.get_template('/new_group.html')
try:
if sql.add_group(newgroup, desc):
env = Environment(loader=FileSystemLoader('templates/ajax/'), autoescape=True)
template = env.get_template('/new_group.html')
output_from_parsed_template = template.render(groups=sql.select_groups(group=newgroup))
print(output_from_parsed_template)
roxywi_common.logging('Roxy-WI server', f'A new group {newgroup} has been created', roxywi=1, login=1)
output_from_parsed_template = template.render(groups=sql.select_groups(group=newgroup))
print(output_from_parsed_template)
roxywi_common.logging('Roxy-WI server', f'A new group {newgroup} has been created', roxywi=1, login=1)
except Exception as e:
print(e)
if form.getvalue('groupdel') is not None:
import modules.roxywi.group as group_mod
@ -2251,7 +2254,6 @@ if act == 'showListOfVersion':
service = common.checkAjaxInput(form.getvalue('service'))
configver = common.checkAjaxInput(form.getvalue('configver'))
for_delver = common.checkAjaxInput(form.getvalue('for_delver'))
style = common.checkAjaxInput(form.getvalue('style'))
users = sql.select_users()
service_desc = sql.select_service(service)
lang = roxywi_common.get_user_lang()
@ -2282,7 +2284,6 @@ if act == 'showListOfVersion':
for_delver=for_delver,
configs=configs,
users=users,
style=style,
lang=lang)
print(template)

View File

@ -696,7 +696,7 @@
<span title="{{lang.add_page.paste_cert_desc}}" class="help_cursor">{{lang.add_page.desc.paste_cert}}</span>
</td>
</tr>
<tr style="width: 50%;">
<tr>
<td class="first-collumn padding10" valign="top" style="padding-top: 15px;">
<select required id="serv4">
<option disabled selected>------</option>
@ -1012,7 +1012,7 @@
{{lang.words.name|title()}}: {{ input('new_blacklist_name') }}
<button onclick="createList('black')">{{lang.words.create|title()}}</button>
</td>
<td class="padding10 first-collumn">
<td class="first-collumn">
<select required name="serv-black-list" id="serv-black-list">
<option disabled selected>------</option>
<option value="all">{{lang.words.all|title()}}</option>
@ -1043,7 +1043,7 @@
{{lang.words.name|title()}}: {{ input('new_whitelist_name') }}
<button onclick="createList('white')">{{lang.words.create|title()}}</button>
</td>
<td class="padding10 first-collumn">
<td class="first-collumn">
<select required name="serv-white-list" id="serv-white-list">
<option disabled selected>------</option>
<option value="all">{{lang.words.all|title()}}</option>

View File

@ -93,7 +93,7 @@
<td class="padding10 first-collumn">
{{lang.words.actions|title()}}
</td>
<td class="padding10">{{lang.words.version|title()}}</td>
<td class="first-collumn">{{lang.words.version|title()}}</td>
<td style="width: 100%">{{lang.words.desc|title()}}</td>
<td><span onclick="loadServices()" class="refresh" title="{{lang.words.reload|title()}} {{lang.words.services}}"></span></td>
</tr>
@ -110,7 +110,7 @@
<thead>
<tr class="overviewHead">
<td class="padding10 first-collumn" style="width: 25%;">{{lang.words.service|title()}}</td>
<td class="padding10" style="width: 10%">{{lang.words.current2|title()}} {{lang.words.version}}</td>
<td class="first-collumn" style="width: 10%">{{lang.words.current2|title()}} {{lang.words.version}}</td>
<td class="padding10" style="width: 10%">{{lang.words.latest|title()}} {{lang.words.version}}</td>
<td style="width: 10%"></td>
<td style="width: 100%">{{lang.words.desc|title()}}</td>

View File

@ -364,10 +364,9 @@
</div>
{% if configver %}
<br>
<center>
{% if role <= 3 %}
{% if not is_serv_protected or role <= 2 %}
<form action="versions.py?service={{service}}" method="post">
<form action="versions.py?service={{service}}" method="post" class="left-space">
<input type="hidden" value="{{serv}}" name="serv">
<input type="hidden" value="{{configver}}" name="configver">
<input type="hidden" value="1" name="config">
@ -382,7 +381,6 @@
{% endif %}
{% endif %}
<div class="alert alert-info"><b>{{lang.words.note|title()}}:</b> {{lang.phrases.master_slave|title()}}</div>
</center>
{% endif %}
<script>
{% if role <= 3 %}

View File

@ -1,197 +1,147 @@
{% import 'languages/'+lang|default('en')+'.html' as lang1 %}
{% from 'include/input_macros.html' import copy_to_clipboard %}
{% if style == 'new' %}
{% if for_delver == '1' %}
<script>
$(document).ready(function() {
$('#table_version').on('page.dt')
.DataTable( {
"pageLength": 25,
"order": [ 5, "desc" ],
stateSave: true,
"columnDefs": [
{
"searchable": false,
"orderable": false
}
],
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
} );
{% if for_delver == '1' %}
<script>
$(document).ready(function() {
$('#table_version').on('page.dt')
.DataTable( {
"pageLength": 25,
"order": [ 5, "desc" ],
stateSave: true,
"columnDefs": [
{
"searchable": false,
"orderable": false
}
],
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
} );
$('#new_select_all').click(function(){
if($(this).prop('checked')) {
$("form input[type='checkbox']").attr("checked",true).change();
} else {
$("form input[type='checkbox']").attr("checked",false).change();
}
});
$.getScript('/inc/script-6.3.9.js');
function show_diff(id) {
if ($('#show_diff_'+id).css('display') == 'none') {
$('#show_diff_'+id).show();
$('#link_show_diff_'+id).attr('title', 'Hide the full diff');
$('#link_show_diff_'+id).text('Hide diff');
} else {
$('#show_diff_'+id).hide();
$('#link_show_diff_'+id).attr('title', 'Show the full diff');
$('#link_show_diff_'+id).text('Show diff');
}
}
</script>
<style>
.diff {
overflow: auto;
width: 100%;
border: 1px solid #DCDCDC;
border-radius: 5px;
background-color: #fff;
margin: 0;
}
</style>
<form action="{{action}}" method="post">
<table class="overview hover order-column display compact" id="table_version">
<thead>
<tr class="overviewHead">
<th class="padding10 first-collumn" style="width: 1%">
<label for="new_select_all" id="new_label_select_all"></label>
<input type="checkbox" id="new_select_all">
</th>
<th>{{lang1.words.user|title()}}</th>
<th class="padding10 first-collumn" style="width: 30%">
{{lang1.words.local|title()}} {{lang1.words.path}}
</th>
<th class="padding10 first-collumn" style="width: 10%">
{{lang1.words.remote|title()}} {{lang1.words.path}}
</th>
<th class="padding10 first-collumn" style="width: 35%">
{{lang1.words.diff|title()}}
</th>
<th style="width: 10%">
{{lang1.words.created|title()}}
</th>
<th></th>
</tr>
</thead>
<tbody>
{% for c in configs %}
<tr>
<td>
<label for="{{c.id}}" id="select_{{c.id}}"></label>
<input type="checkbox" value="{{c.local_path}}" name="{{c.local_path}}" id="{{c.id}}">
</td>
<td>
{% for u in users %}
{% if u.user_id == c.user_id %}
} );
$('#new_select_all').click(function(){
if($(this).prop('checked')) {
$("form input[type='checkbox']").attr("checked",true).change();
} else {
$("form input[type='checkbox']").attr("checked",false).change();
}
});
$.getScript('/inc/script-6.3.9.js');
function show_diff(id) {
if ($('#show_diff_'+id).css('display') == 'none') {
$('#show_diff_'+id).show();
$('#link_show_diff_'+id).attr('title', 'Hide the full diff');
$('#link_show_diff_'+id).text('Hide diff');
} else {
$('#show_diff_'+id).hide();
$('#link_show_diff_'+id).attr('title', 'Show the full diff');
$('#link_show_diff_'+id).text('Show diff');
}
}
</script>
<style>
.diff {
overflow: auto;
width: 100%;
border: 1px solid #DCDCDC;
border-radius: 5px;
background-color: #fff;
margin: 0;
}
</style>
<form action="{{action}}" method="post">
<table class="overview hover order-column display compact" id="table_version">
<thead>
<tr class="overviewHead">
<th class="padding10 first-collumn" style="width: 1%; padding-left: 15px;">
<label for="new_select_all" id="new_label_select_all"></label>
<input type="checkbox" id="new_select_all">
</th>
<th>{{lang1.words.user|title()}}</th>
<th class="padding10 first-collumn" style="width: 30%">
{{lang1.words.local|title()}} {{lang1.words.path}}
</th>
<th class="padding10 first-collumn" style="width: 10%">
{{lang1.words.remote|title()}} {{lang1.words.path}}
</th>
<th class="padding10 first-collumn" style="width: 35%">
{{lang1.words.diff|title()}}
</th>
<th style="width: 10%">
{{lang1.words.created|title()}}
</th>
<th></th>
</tr>
</thead>
<tbody>
{% for c in configs %}
<tr>
<td style="padding-left: 15px">
<label for="{{c.id}}" id="select_{{c.id}}"></label>
<input type="checkbox" value="{{c.local_path}}" name="{{c.local_path}}" id="{{c.id}}">
</td>
<td>
{% for u in users %}
{% if u.user_id == c.user_id %}
{{ u.username }}
{% endif %}
{% endfor %}
</td>
<td class="padding10 first-collumn" title="{{c.local_path}}">
{% set show = '...'+c.local_path.split('/')[-1] %}
{{ copy_to_clipboard(id=c.local_path, value=c.local_path, show=show) }}
</td>
<td>{{ copy_to_clipboard(id=c.remote_path, value=c.remote_path) }}</td>
<td>
{% if c.diff == '' %}
{{lang1.words.no|title()}} {{lang1.words.diff3}}
{% else %}
<a id="link_show_diff_{{c.id}}" onclick="show_diff('{{c.id}}')" title="Show a difference between this config and previous one" class="link">{{lang1.words.show|title()}} {{lang1.words.diff2}}</a>
<div id="show_diff_{{c.id}}" style="display: none;">
{% set stdout = c.diff.split('\n') %}
{% include 'ajax/compare.html' %}
</div>
{% endif %}
</td>
<td>{{c.date}}</td>
<td style="padding-top: 10px;">
<a href="/app/versions.py?service={{service}}&serv={{serv}}&open=open&configver={{c.local_path.split('/')[-1]}}"
class="ui-button ui-widget ui-corner-all" title="{{lang1.phrases.view_and_upload}}" style="margin-top: -6px;">
{{lang1.words.view|title()}}/{{lang1.words.upload|title()}}
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<input type="hidden" value="{{serv}}" name="serv">
<input type="hidden" value="open" name="open">
<input type="hidden" value="del" name="del">
<input type="hidden" value="{{style}}" name="style">
<p>
<button type="submit" value="" name="" class="btn btn-default">{{lang1.words.delete|title()}}</button>
</p>
</form>
{% else %}
<center>
<h4>Select an old version</h4>
<p>
<select autofocus required name="configver" id="configver">
<option disabled selected>------</option>
{% for file in return_files %}
{% if file == configver %}
<option value="{{file}}" selected>{{file.split('-', maxsplit=1)[1]}}</option>
{% else %}
<option value="{{file}}">{{file.split('-', maxsplit=1)[1]}}</option>
{% endif %}
{% endif %}
{% endfor %}
</select>
<input type="hidden" value="{{serv}}" name="serv">
<input type="hidden" value="open" name="open">
<input type="hidden" value="{{service}}" name="service" id="service">
<a class="ui-button ui-widget ui-corner-all" id="show" title="{{lang1.words.enter|title()}}" onclick="showUploadConfig()">{{lang1.words.select2|title()}}</a>
</p>
<script>
$( "select" ).selectmenu();
showUploadConfig();
</script>
</center>
{% endif %}
</td>
<td class="padding10 first-collumn" title="{{c.local_path}}">
{% set show = '...'+c.local_path.split('/')[-1] %}
{{ copy_to_clipboard(id=c.local_path, value=c.local_path, show=show) }}
</td>
<td>{{ copy_to_clipboard(id=c.remote_path, value=c.remote_path) }}</td>
<td>
{% if c.diff == '' %}
{{lang1.words.no|title()}} {{lang1.words.diff3}}
{% else %}
<a id="link_show_diff_{{c.id}}" onclick="show_diff('{{c.id}}')" title="Show a difference between this config and previous one" class="link">{{lang1.words.show|title()}} {{lang1.words.diff2}}</a>
<div id="show_diff_{{c.id}}" style="display: none;">
{% set stdout = c.diff.split('\n') %}
{% include 'ajax/compare.html' %}
</div>
{% endif %}
</td>
<td>{{c.date}}</td>
<td style="padding-top: 10px;">
<a href="/app/versions.py?service={{service}}&serv={{serv}}&open=open&configver={{c.local_path.split('/')[-1]}}"
class="ui-button ui-widget ui-corner-all" title="{{lang1.phrases.view_and_upload}}" style="margin-top: -6px;">
{{lang1.words.view|title()}}/{{lang1.words.upload|title()}}
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<input type="hidden" value="{{serv}}" name="serv">
<input type="hidden" value="open" name="open">
<input type="hidden" value="del" name="del">
<input type="hidden" value="{{style}}" name="style">
<p>
<button type="submit" value="" name="" class="btn btn-default">{{lang1.words.delete|title()}}</button>
</p>
</form>
{% else %}
{% if for_delver == '1' %}
<center>
<h4>Select a version</h4>
<form action="{{action}}" method="post">
<label for="select_all" id="label_select_all"><b>Select all</b></label>
<input type="checkbox" id="select_all"><br />
{% for file in return_files %}
<label for="{{file}}"> {{file.split('-', maxsplit=1)[1]}} </label><input type="checkbox" value="{{file}}" name="{{file}}" id="{{file}}">
<a href="/app/versions.py?service={{service}}&serv={{serv}}&open=open&configver={{file}}"
class="ui-button ui-widget ui-corner-all" title="View and upload this version of the config" style="margin-top: -6px;">
{{lang1.words.view|title()}}/{{lang1.words.upload|title()}}
</a><br />
{% endfor %}
<input type="hidden" value="{{serv}}" name="serv">
<input type="hidden" value="open" name="open">
<input type="hidden" value="del" name="del">
<p>
<button type="submit" value="" name="" class="btn btn-default">{{lang1.words.delete|title()}}</button>
</p>
</form>
</center>
{% else %}
<center>
<h4>Select an old version</h4>
<p>
<select autofocus required name="configver" id="configver">
<option disabled selected>------</option>
{% for file in return_files %}
{% if file == configver %}
<option value="{{file}}" selected>{{file.split('-', maxsplit=1)[1]}}</option>
{% else %}
<option value="{{file}}">{{file.split('-', maxsplit=1)[1]}}</option>
{% endif %}
{% endfor %}
</select>
<input type="hidden" value="{{serv}}" name="serv">
<input type="hidden" value="open" name="open">
<a class="ui-button ui-widget ui-corner-all" id="show" title="Enter" onclick="showUploadConfig()">{{lang1.words.select2|title()}}</a>
</p>
<script>
$( "select" ).selectmenu();
showUploadConfig();
</script>
</center>
{% endif %}
<div class="left-space">
<h4>{{lang1.words.select|title()}} {{lang1.words.an}} {{lang1.words.version2}}</h4>
<select autofocus required name="configver" id="configver">
<option disabled selected>------</option>
{% for file in return_files %}
{% if file == configver %}
<option value="{{file}}" selected>{{file.split('-', maxsplit=1)[1]}}</option>
{% else %}
<option value="{{file}}">{{file.split('-', maxsplit=1)[1]}}</option>
{% endif %}
{% endfor %}
</select>
<input type="hidden" value="{{serv}}" name="serv">
<input type="hidden" value="open" name="open">
<input type="hidden" value="{{service}}" name="service" id="service">
<a class="ui-button ui-widget ui-corner-all" id="show" title="{{lang1.words.enter|title()}}" onclick="showUploadConfig()">{{lang1.words.select2|title()}}</a>
</div>
<script>
$( "select" ).selectmenu();
showUploadConfig();
</script>
{% endif %}
<script>
$('#select_all').click(function(){

View File

@ -104,8 +104,8 @@
{% else %}
{{lang.smon_page.desc.last_resp_time}}:
{% endif %}
{% if s.responce_time %}
<span title="{{s.responce_time}} ms">{{s.responce_time|truncate(9)}} ms</span>
{% if s.response_time %}
<span title="{{s.response_time}} ms">{{s.response_time|truncate(9)}} ms</span>
{% else %}
N/A
{% endif %}

View File

@ -16,7 +16,6 @@
{% if service != 'keepalived' %}
<a class="ui-button ui-widget ui-corner-all" title="View stat" onclick="openStats()">{{lang.words.stats|title()}}</a>
{% endif %}
<a class="ui-button ui-widget ui-corner-all" title="Change version" onclick="changeVersion()">{{lang.words.change2|title()}} {{lang.words.version2|title()}}</a>
</form>
</p>
{% if aftersave %}
@ -24,7 +23,7 @@
{% if stderr %}
{% include 'include/errors.html' %}
{% else %}
<div class="alert alert-success">
<div class="alert alert-success" style="margin-left: var(--indent);">
{% for f in file %}
{{f}}
{% endfor %}

View File

@ -361,7 +361,7 @@
{% if serv %}
<div id="bin_bout"></div>
<div id="ajax-server-{{s.0}}" class="ajax-server"></div>
<div class="div-server div-backends">
<div class="div-server div-backends" style="margin-bottom: 0px;">
<div class="server-name backends">
{% if service == 'haproxy' %}
{{lang.words.backends|title()}}:
@ -382,21 +382,20 @@
{% if (service == 'haproxy' and s.8.0.9)
or (service == 'nginx' and s.8.0.21)
or (service == 'apache' and s.8.0.27) %}
<div style="clear: both; width: 97%;">
<div style="padding-left: 25px;float: left;margin-top: -15px;">
<div class="metrics-time-range">
<b>{{lang.words.time_range|title()}}:</b>
<select title="Choose time range" id="time-range">
<option value="30">30 minutes</option>
<option value="60">1 hour</option>
<option value="180">3 hours</option>
<option value="360">6 hours</option>
<option value="720">12 hours</option>
<option value="30">30 {{lang.words.minutes}}</option>
<option value="60">1 {{lang.words.hour}}</option>
<option value="180">3 {{lang.words.hours}}</option>
<option value="360">6 {{lang.words.hours2}}</option>
<option value="720">12 {{lang.words.hours2}}</option>
</select>
</div>
<div id="refresh" style="text-align: right;margin-right: 3%;" title="Refresh metrics" onclick="showMetrics()">
<div style="clear: both;"></div>
<div id="refresh" class="metrics-refresh" style="margin-right: 140px;" title="{{lang.words.refresh|title()}}" onclick="showMetrics()">
<span class="refresh"></span>
</div>
</div>
{% endif %}
{% endif %}
{% if service == 'haproxy' and s.8.0.9 %}

View File

@ -5,7 +5,7 @@
<tr class="overviewHead">
<th class="padding10 first-collumn" id="server-name-th">{{lang.words.name|title()}}</th>
<th class="ip-field" style="width: 10% " id="server-ip-th">IP</th>
<th class="checkbox-head" style="width: 5%" class="help_cursor"><span title="SSH port">{{lang.words.port|title()}}</span></th>
<th style="width: 5%" class="help_cursor"><span title="SSH port">{{lang.words.port|title()}}</span></th>
{% if page != "servers.py" %}
<th style="width: 10%">{{lang.words.group|title()}}</th>
{% endif %}

View File

@ -3,7 +3,7 @@
<td class="padding10 first-collumn" style="width: 15%;" class="help_cursor">
<span title="It's just name alias. This alias will be use in 'Servers' page for choose credentials">{{lang.words.name|title()}}<span>
</td>
<td class="padding10 first-collumn" style="width: 25%;" class="help_cursor" id="ssh-key-enabled-td">
<td class="first-collumn" style="width: 25%;" class="help_cursor" id="ssh-key-enabled-td">
<span title="If it is enabled, the key will be used, if turned off - the password. Do not forget to download the keys to all servers or install the sudo without a password">SSH {{lang.words.key}}</span>
</td>
{% if page != "servers.py" %}
@ -16,7 +16,7 @@
</tr>
{% for ssh in sshs %}
<tr style="width: 50%;" id="ssh-table-{{ssh.id}}" class="{{ loop.cycle('odd', 'even') }}">
<td class="first-collumn">
<td class="first-collumn padding10">
{% set id = 'ssh_name-' + ssh.id|string() %}
{{ input(id, value=ssh.name, size='15') }}
</td>
@ -69,7 +69,7 @@
<td></td>
</tr>
<tr style="width: 50%;">
<td class="first-collumn" valign="top" style="padding-top: 15px;">
<td class="first-collumn padding10" valign="top" style="padding-top: 15px;">
<select id="ssh-key-name">
<option disabled selected>------</option>
{% for ssh in sshs %}

View File

@ -5,12 +5,12 @@
<tr class="overviewHead">
<th class="padding10 first-collumn" id="user-login-th">{{lang.words.login|title()}}</th>
<th style="width: 10%">{{lang.words.password|title()}}</th>
<th style="width: 10%" id="user-active-th">{{lang.words.active|title()}}</th>
<th style="width: 10%" class="checkbox-head" id="user-active-th">{{lang.words.active|title()}}</th>
<th style="width: 20%">{{lang.words.email|title()}}</th>
{% if page == "servers.py" %}
<th style="width: 10%" id="user-role-th">{{lang.words.role|title()}}</th>
{% else %}
<th style="width: 10%" id="user-group-role-th">{{lang.words.groups|title()}} {{lang.words.and}} {{lang.words.roles|title()}}</th>
<th style="width: 10%" id="user-group-role-th">{{lang.words.groups|title()}} {{lang.words.and}} {{lang.words.roles|title()}}</th>
{% endif %}
<th style="width: 100%" id="user-services-th">{{lang.words.services|title()}}</th>
<th></th>

View File

@ -851,5 +851,6 @@
"worker2": "worker",
"processes": "processes",
"position": "position",
"global": "global",
}
%}

View File

@ -851,5 +851,6 @@
"worker2": "ouvrier",
"processes": "processus",
"position": "position",
"global": "mondial",
}
%}

View File

@ -851,5 +851,6 @@
"worker2": "trabalhador",
"processes": "processos",
"position": "posição",
"global": "global",
}
%}

View File

@ -851,5 +851,6 @@
"worker2": "рабочих",
"processes": "процессов",
"position": "позицию",
"global": "глобальный",
}
%}

View File

@ -20,8 +20,8 @@
{% if select_id != 'viewlogs' and service != 'nginx' %}
{% endif %}
<td style="width: 10%;">{{lang.words.number|title()}} {{lang.words.rows}}</td>
<td class="help_cursor" style="width: 10%;"><span title="Find in a log file(supports regular expressions)">{{lang.words.find|title()}}<span></td>
<td class="padding10 help_cursor" style="width: 10%;"><span title="Exclude from search in a log file(supports regular expressions)">{{lang.words.exclude|title()}}<span></td>
<td class="help_cursor" style="width: 10%;" title="" data-help="{{lang.phrases.find_in_log}}">{{lang.words.find|title()}}</td>
<td class="help_cursor" style="width: 10%;" title="" data-help="{{lang.phrases.exclude_in_log}}">{{lang.words.exclude|title()}}</td>
<td style="width: 10%;">
<label for="time_range_out_hour" style="padding: 0">{{lang.words.time_range|title()}}:</label>
{{ input('time_range_out_hour', value=hour, class='time-range', readonly='readonly') }}:{{ input('time_range_out_minut', value=minut, class='time-range', readonly='readonly') }}
@ -60,16 +60,16 @@
{% if waf != '1' and select_id != 'viewlogs' %}
<td id="remote_log_files"></td>
{% endif %}
<td class="padding10" style="width: 10%;">
<td style="width: 10%;">
{{ input('rows', type='number', value=rows, required='required', style='width: 110px;') }}
</td>
<td class="padding10" style="width: 10%;">
<td style="width: 10%;">
{{ input('grep', value=grep, style='width: 110px;') }}
</td>
<td class="padding10" style="width: 10%;">
<td style="width: 10%;">
{{ input('exgrep', value=exgrep, style='width: 110px;') }}
</td>
<td class="padding10" style="width: 10%;">
<td style="width: 10%;">
<div id="time-range"></div>
</td>
<td class="padding10 first-collumn" style="width: 1%;">

View File

@ -42,7 +42,7 @@
</tr>
</table>
<div id="table_metrics"></div>
<div style="padding-left: 25px;float: left;margin-top: 6px;">
<div class="metrics-time-range">
<b>{{lang.words.time_range}}:</b>
<select title="Choose time range" id="time-range">
<option value="30">30 {{lang.words.minutes}}</option>
@ -53,11 +53,12 @@
</select>
</div>
{% if service == 'haproxy' %}
<div style="margin-top: 6px;">
<div style="margin-top: var(--indent);">
{{ checkbox('hide_http_metrics', desc=lang.words.hide|title()+' HTTP ' + lang.words.metrics, title=lang.words.hide|title()+' HTTP ' + lang.words.metrics) }}
</div>
{% endif %}
<div id="refresh" style="text-align: right;margin-top: 20px;margin-right: 10px;" title="{{lang.words.refresh|title}} {{lang.words.metrics}}" onclick="showMetrics()">
<div style="clear: both;"></div>
<div id="refresh" class="metrics-refresh" title="{{lang.words.refresh|title}} {{lang.words.metrics}}" onclick="showMetrics()">
<span class="refresh"></span>
</div>
{% for s in servers %}

View File

@ -27,7 +27,7 @@
<script src="/inc/codemirror/mode/nginx.js"></script>
<script src="/inc/codemirror/mode/haproxy.js"></script>
<script src="/inc/codemirror/keymap/sublime.js"></script>
<form action="{{ action }}" method="post" class="left-space">
<form action="{{ action }}" method="post" class="left-space" style="margin-top: var(--indent);">
<select autofocus required name="section" id="{{ select_id }}">
<option disabled>------</option>
{% for s in sections %}

View File

@ -58,7 +58,7 @@
{{lang.words.available|title()}} {{lang.words.versions}} (?)
</td>
<td class="padding10 first-collumn" style="width: 20%;">{{lang.words.server|title()}}</td>
<td class="help_cursor" title="{{lang.admin_page.desc.install_as_docker}}">{{lang.words.use|title()}} Docker</td>
<td class="checkbox-head help_cursor" title="{{lang.admin_page.desc.install_as_docker}}">{{lang.words.use|title()}} Docker</td>
<td>SYN-flood {{lang.words.protection}}</td>
<td></td>
</tr>
@ -96,7 +96,7 @@
<td class="padding10 first-collumn">{{lang.words.current2|title()}} {{lang.words.version}}</td>
<td class="padding10 first-collumn" style="width: 30%;">{{lang.words.available|title()}} {{lang.words.versions}}</td>
<td class="padding10 first-collumn" style="width: 20%;">{{lang.words.server|title()}}</td>
<td class="help_cursor" title="{{lang.admin_page.desc.install_as_docker}}" >{{lang.words.use|title()}} Docker</td>
<td class="checkbox-head help_cursor" title="{{lang.admin_page.desc.install_as_docker}}" >{{lang.words.use|title()}} Docker</td>
<td>SYN-flood {{lang.words.protection}}</td>
<td></td>
</tr>
@ -131,7 +131,7 @@
<td class="padding10 first-collumn">{{lang.words.current2|title()}} {{lang.words.version}}</td>
<td class="padding10 first-collumn" style="width: 30%;">{{lang.words.available|title()}} {{lang.words.versions}}</td>
<td class="padding10 first-collumn" style="width: 20%;">{{lang.words.server|title()}}</td>
<td class="help_cursor" title="{{lang.admin_page.desc.install_as_docker}}" >{{lang.words.use|title()}} Docker</td>
<td class="checkbox-head help_cursor" title="{{lang.admin_page.desc.install_as_docker}}" >{{lang.words.use|title()}} Docker</td>
<td>SYN-flood {{lang.words.protection}}</td>
<td></td>
</tr>

View File

@ -175,7 +175,7 @@
<script src="/inc/metrics.js"></script>
<script src="/inc/chart.min.js"></script>
<div id="table_metrics"></div>
<div style="padding-left: 25px;float: left;margin-top: 3px;">
<div class="metrics-time-range">
<b>{{lang.words.time_range|title()}}:</b>
<select title="Choose time range" id="time-range">
<option value="30">30 {{lang.words.minutes}}</option>
@ -185,7 +185,8 @@
<option value="720">12 {{lang.words.hours2}}</option>
</select>
</div>
<div id="refresh" style="text-align: right;margin-top: 10px;margin-right: 20px; margin-bottom: 10px;" title="{{lang.words.refresh|title()}}" onclick="showWafMetrics()">
<div style="clear: both;"></div>
<div id="refresh" class="metrics-refresh" title="{{lang.words.refresh|title()}}" onclick="showWafMetrics()">
<span class="refresh"></span>
</div>
{% for s in servers %}

View File

@ -457,11 +457,11 @@
}
.caption-icon {
float: left;
margin: 6px 5px 10px 10px;
margin: 6px 5px 10px var(--indent);
font-size: 15px;
}
.caption-icon2 {
float: left;
margin: 8px 5px 10px 10px;
margin: 8px 5px 10px var(--indent);
font-size: 15px;
}

View File

@ -7,6 +7,7 @@
--menu-color: #06212a;
--right-menu-blue-rolor: #5D9CEB;
--border-radius: 3px;
--indent: 15px;
}
html {
font-size: 10px;
@ -80,7 +81,7 @@ form {
margin: 0;
}
pre {
padding-left: 15px;
padding-left: var(--indent);
}
.icon, .icon-hapservs {
max-width: 20px;
@ -273,7 +274,7 @@ pre {
padding: 7px;
}
.lineDiffMinus, .lineDiffPlus, .lineDiff {
padding-left: 15px;
padding-left: var(--indent);
white-space: pre;
}
.lineDiffMinus {
@ -330,7 +331,7 @@ pre {
}
.addOption, .addName {
border-bottom: 1px solid #ddd;
padding: 15px;
padding: var(--indent);
}
.advance {
display: none;
@ -339,8 +340,8 @@ pre {
font-size: 13px !important;
}
.addButton {
padding-top: 15px;
padding-left: 15px;
padding-top: var(--indent);
padding-left: var(--indent);
padding-bottom: 5px;
}
.addButton:hover {
@ -394,7 +395,7 @@ pre {
padding-left: 10px;
}
.checkbox-head {
padding: 0;
padding: 0 0 0 10px;
}
.ip-field {
width: 100px;
@ -403,12 +404,12 @@ pre {
min-width: 225px;
}
.syn-flood-protection-field {
padding-left: 60px;
padding-left: 45px;
}
.overviewTr {
margin: 0;
background-color: #f6f8fa;
padding-left: 15px;
padding-left: var(--indent);
font-size: 15px;
}
.serverUp, .serverDown, .serverNone {
@ -455,12 +456,12 @@ pre {
background-color: var(--red-color);
}
.padding10 {
padding: 10px 10px 10px 10px;
padding: 10px 10px 10px var(--indent);
border: none;
width: 15%;
}
.padding20 {
padding: 15px;
padding: var(--indent);
width: 30%;
}
.padding-top20 {
@ -640,7 +641,7 @@ ul{
}
.ui-tabs-nav {
border-radius: 0 !important;
padding-left: 15px !important;
padding-left: var(--indent) !important;
padding-top: 0.28em !important;
}
.ui-tabs .ui-tabs-panel {
@ -728,7 +729,7 @@ td,th {
background-color: #dff0d8 !important;
}
.alert {
padding:15px;
padding: var(--indent);
margin-bottom:20px;
border:1px solid transparent;
display: block;
@ -739,7 +740,7 @@ td,th {
color: var(--blue-color) !important;
}
.alert-danger, .alert-info, .alert-success, .alert-warning, .added {
margin-top: 15px;
margin-top: var(--indent);
}
.alert-danger {
color: #a94442;
@ -756,7 +757,7 @@ td,th {
color: #0c5460;
background-color: #d1ecf1;
border-color: #bee5eb;
margin-left: 15px;
margin-left: var(--indent);
}
.alert-warning {
color: #856404;
@ -800,7 +801,7 @@ label {
background-color: #f3f8fb;
}
#up-pannel {
margin-top: 15px;
margin-top: var(--indent);
}
.div-server, .div-server-hapwi, .bin_bout {
background-color: #fbfbfb;
@ -944,7 +945,7 @@ label {
height: 300px;
width: 48.8%;
float: left;
margin-left: 20px;
margin-left: var(--indent);
}
.chart-container_overview {
width: 93.3%;
@ -953,7 +954,7 @@ label {
padding-left: 4px;
}
.main {
margin: 15px;
margin: var(--indent);
}
.sort_menu {
clear: both;
@ -971,7 +972,7 @@ label {
float: left;
background-color: #fbfbfb;;
margin: 10px 10px 10px 0px;
padding-left: 15px;
padding-left: var(--indent);
padding-top: 0;
border: 1px solid #A4C7F5;
}
@ -1340,5 +1341,16 @@ label {
white-space: nowrap;
}
.left-space {
margin-left: 15px !important;
margin-left: var(--indent) !important;
}
.metrics-time-range {
float: left;
margin-top: var(--indent);
margin-left: var(--indent);
}
.metrics-refresh {
text-align: right;
margin-top: -25px;
margin-right: 10px;
margin-bottom: 20px;
}

View File

@ -1,4 +1,4 @@
var url = "/inc/script.js";
var url = "/inc/script-6.3.9.js";
var cur_url = window.location.href.split('/').pop();
cur_url = cur_url.split('?');
var intervalId;
@ -156,7 +156,7 @@ if(localStorage.getItem('restart')) {
} else {
$('#'+apply_div).html("You have made changes to the server: "+ip_for_restart+". Changes will take effect only after restart. <a href='hapservers.py' title='Overview'>Go to the HAProxy Overview page and restart</a><a href='#' title='close' id='apply_close' style='float: right'><b>X</b></a>");
}
$.getScript('/inc/overview.js');
$.getScript('/inc/overview-6.3.9.js');
}
}
} );
@ -204,7 +204,6 @@ function setRefreshInterval(interval) {
$('.auto-refresh-resume').css('display', 'none');
$('.auto-refresh-pause').css('display', 'none');
$.getScript("/inc/fontawesome.min.js");
// $.getScript("/inc/script-6.3.9.js");
}
hideAutoRefreshDiv();
} else {
@ -621,10 +620,6 @@ function showListOfVersion(for_delver) {
var service = $('#service').val();
var serv = $("#serv").val();
var configver = findGetParameter('configver');
var style = 'new'
if (localStorage.getItem('version_style') == 'old') {
style = 'old'
}
clearAllAjaxFields();
$.ajax( {
url: "options.py",
@ -634,7 +629,6 @@ function showListOfVersion(for_delver) {
service: service,
configver: configver,
for_delver: for_delver,
style: style,
token: $('#token').val(),
},
type: "POST",
@ -649,15 +643,6 @@ function showListOfVersion(for_delver) {
}
} );
}
function changeVersion(){
if (localStorage.getItem('version_style') == 'old') {
localStorage.setItem('version_style', 'new');
showListOfVersion(1);
} else {
localStorage.setItem('version_style', 'old');
showListOfVersion(1);
}
}
function findGetParameter(parameterName) {
var result = null,
tmp = [];
@ -1474,7 +1459,7 @@ function returnNiceCheckingConfig(data) {
console.log(err);
}
alerts.forEach((element) => {
if (element.indexOf('error: ') != '-1' || element.indexOf('Fatal') != '-1' || element.indexOf('Error') != '-1' || element.indexOf('failed ') != '-1' || element.indexOf('emerg] ') != '-1' || element.indexOf('Syntax error ') != '-1') {
if (element.indexOf('error: ') != '-1' || element.indexOf('Fatal') != '-1' || element.indexOf('Error') != '-1' || element.indexOf('failed ') != '-1' || element.indexOf('emerg] ') != '-1' || element.indexOf('Syntax error ') != '-1' || element.indexOf('Parsing') != '-1') {
alert_error = alert_error + element;
return
}