Changelog: https://roxy-wi.org/changelog#6_3_9
pull/364/head v6.3.9.0
Aidaho 2023-04-14 11:18:20 +03:00
parent 24aff57031
commit d58b3b9ee2
11 changed files with 60 additions and 82 deletions

View File

@ -254,11 +254,14 @@ elif form.getvalue('mode') is not None:
acl += ' http-request deny'
acl_then_value = ''
elif acl_then[i] == '6':
acl += ' return '
acl += f' acl return_{acl_value[i]} {acl_if_word} {acl_value[i]}\n'
acl += f' http-request return if return_{acl_value[i]}\n'
elif acl_then[i] == '7':
acl += ' set-header '
acl += f' acl set_header_{acl_value[i]} {acl_if_word} {acl_value[i]}\n'
acl += f' http-request set-header if set_header_{acl_value[i]}\n'
acl += acl_then_value + ' if { ' + acl_if_word + acl_value[i] + ' } \n'
if acl_then[i] in ('2', '3', '4', '5'):
acl += acl_then_value + ' if { ' + acl_if_word + acl_value[i] + ' } \n'
except Exception:
acl = ''

View File

@ -65,9 +65,8 @@
{{ s.3 }}
{% endif %}
</td>
<td>
<td colspan="2">
{{ services_name[s.0]['desc'] }}
</td>
<td></td>
</tr>
{% endfor %}

View File

@ -38,10 +38,9 @@
<a class="ui-button ui-widget ui-corner-all" onclick="updateService('roxy-wi')" title="{{lang.words.w_update|title()}} Roxy-WI">{{lang.words.w_update|title()}}</a>
{% endif %}
</td>
<td>
<td colspan="2">
{{lang.admin_page.desc.main_app}}
</td>
<td></td>
</tr>
{% for s in services %}
{% if s.0 in ('roxy-wi-smon', 'roxy-wi-checker', 'roxy-wi-keep_alive', 'roxy-wi-metrics', 'roxy-wi-portscanner', 'roxy-wi-socket', 'roxy-wi-prometheus-exporter') %}

View File

@ -9,12 +9,12 @@
{% for s in smon %}
{% if s.en == 1 %}
{% if s.status == 1 and s.http_status == 1 and s.body_status == 1 %}
{% if up.append('1') %} {% endif %}
{% if up.append('1') %} {% endif %}
{% else %}
{% if down.append('1') %} {% endif %}
{% if down.append('1') %} {% endif %}
{% endif %}
{% else %}
{% if dis.append(s.group) %} {% endif %}
{% if dis.append(s.group) %} {% endif %}
{% 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>
@ -26,7 +26,7 @@
{% set group = [] %}
{% set group_prev = [] %}
{%- for s in smon -%}
{% set checks = lang.smon_page.desc.enabled_checks +': <br>' + lang.phrases.port_check|title() %}
{% set checks = lang.smon_page.desc.enabled_checks +': <br>' + lang.phrases.port_check %}
{% if s.http %}
{% set checks = checks + ',<br>' + lang.smon_page.desc.http_status_check + ': ' + s.http.split(':')[0]|string() + '://' + s.ip|string() + ':' + s.port|string() + s.http.split(':')[1]|string() %}
{% endif %}
@ -36,66 +36,52 @@
{% if s.ssl_expire_date %}
{% set checks = checks + ',<br> SSL ' + lang.words.expire + ': ' + s.ssl_expire_date %}
{% endif %}
{% if s.group %}
{% if s.group not in group %}
<div class="smon_group">
<div class="group_name">
{{ s.group }}
</div>
</div>
{% endif %}
{% if group.append(s.group) %} {% endif %}
{% else %}
<div class="smon_group">
<div class="group_name">
None
</div>
</div>
{% endif %}
{% if s.en == 1 %}
{% if s.status == 1 and s.http_status == 1 and s.body_status == 1 %}
<div class="smon_services good div-server-head-up"
{% set additional_classes = 'good div-server-head-up' %}
{% set uptime_desc = lang.words.uptime + ': <time class="timeago" datetime="'+s.time_state|string()+'">'+s.time_state|string()+'</time>' %}
{% elif s.status == 0 or s.http_status == 0 or s.body_status == 0 %}
{% set additional_classes = 'err div-server-head-down' %}
{% set uptime_desc = lang.words.downtime + ': <time class="timeago" datetime="'+s.time_state|string()+'">'+s.time_state|string()+'</time>' %}
{% else %}
<div class="smon_services err div-server-head-down"
{% set additional_classes = 'err div-server-head-down' %}
{% set uptime_desc = lang.words.uptime + ': N/A' %}
{% endif %}
{% else %}
<div class="smon_services dis div-server-head-dis"
{% set additional_classes = 'dis div-server-head-dis' %}
{% set uptime_desc = lang.words.uptime + ': N/A' %}
{% endif %}
data-help="{{checks}}"
title="{{checks}}">
{% set additional_style = '' %}
{% if s.ip|string|length > 23 %}
{% set additional_style = 'font-size: 11px;' %}
{% elif s.ip|string|length > 20 %}
{% set additional_style = 'font-size: 12px;' %}
{% elif s.ip|string|length > 17 %}
{% set additional_style = 'font-size: 15px;' %}
{% endif %}
{% if s.group not in group %}
<div class="smon_group">
<div class="group_name">
{% if s.group %} {{ s.group }} {% else %} None {% endif %}
</div>
</div>
{% endif %}
{% if group.append(s.group) %} {% endif %}
<div class="smon_services {{additional_classes}}" data-help="{{checks}}" title="{{checks}}">
<div class="ip">
{% if s.ip|string|length > 23 %}
<span style="font-size: 11px;">
{% elif s.ip|string|length > 20 %}
<span style="font-size: 12px;">
{% elif s.ip|string|length > 17 %}
<span style="font-size: 15px;">
{% else %}
<span>
{% endif %}
<a href="smon.py?action=history&host={{s.ip}}" title="{{lang.words.view|title()}} {{lang.words.history}} {{lang.words.for}} {{s.ip}} {{lang.words.host}}" class="link">{{s.ip}}:{{s.port}}</a>
</span>
<span style="{{additional_style}}">
<a href="smon.py?action=history&host={{s.ip}}" title="{{lang.words.view|title()}} {{lang.words.history}} {{lang.words.for}} {{s.ip}} {{lang.words.host}}" class="link">{{s.ip}}:{{s.port}}</a>
</span>
</div>
<div class="desc">
{% if s.desc is not none %}
{% if s.desc %}
<b>{{s.desc}}</b>
{% else %}
{{lang.words.desc|title()}}: None
{{lang.words.desc|title()}}: {{lang.words.none}}
{% endif %}
</div>
<div class="desc">
{% if s.en == 1 %}
{% if s.status == 1 and s.http_status == 1 and s.body_status == 1 %}
{{lang.words.uptime}}: <time class="timeago" datetime="{{s.time_state}}">{{s.time_state}}</time>
{% elif s.status == 0 or s.http_status == 0 or s.body_status == 0 %}
{{lang.words.downtime}}: <time class="timeago" datetime="{{s.time_state}}">{{s.time_state}}</time>
{% else %}
{{lang.words.uptime}}: N/A
{% endif %}
{% else %}
{{lang.words.uptime}}: N/A
{% endif %}
{{uptime_desc|safe}}
</div>
<div class="res_time">
{% if s.en == 1 %}
@ -116,40 +102,28 @@
{% if s.en == 1 %}
{% if s.status == 1 and s.http_status == 1 and s.body_status == 1 %}
<div class="up">
<center>
{{lang.smon_page.desc.UP}}
</center>
{{lang.smon_page.desc.UP}}
</div>
{% elif s.http_status == 0 %}
<div class="down">
<center style="padding-top: 7px;">
{{lang.smon_page.desc.HTTP_FAILURE}}
</center>
{{lang.smon_page.desc.HTTP_FAILURE}}
</div>
{% elif s.body_status == 0 %}
<div class="down">
<center style="padding-top: 7px;">
{{lang.smon_page.desc.BODY_FAILURE}}
</center>
{{lang.smon_page.desc.BODY_FAILURE}}
</div>
{% elif s.status == 3 %}
<div class="unknown">
<center style="padding-top: 7px;">
{{lang.smon_page.desc.UNKNOWN}}
</center>
{{lang.smon_page.desc.UNKNOWN}}
</div>
{% else %}
<div class="down">
<center style="padding-top: 7px;">
{{lang.smon_page.desc.PORT_DOWN}}
</center>
{{lang.smon_page.desc.PORT_DOWN}}
</div>
{% endif %}
{% else %}
<div class="disable">
<center>
{{lang.smon_page.desc.DISABLED}}
</center>
{{lang.smon_page.desc.DISABLED}}
</div>
{% endif %}
</div>

View File

@ -292,7 +292,7 @@
"you_are_editing": "You are editing",
"section_from_server": "section from server",
"how_to_install": "how to install",
"port_check": "port check",
"port_check": "Port check",
"possible_service_name": "Possible service name",
"server_info": "Server info",
"user_groups": "User groups",

View File

@ -292,7 +292,7 @@
"you_are_editing": "Você está editando",
"section_from_server": "Seção do servidor",
"how_to_install": "como instalar",
"port_check": "verificação de porta",
"port_check": "Verificação de porta",
"possible_service_name": "Possible service name",
"server_info": "Informação sobre o servidor",
"user_groups": "Grupos de usuários",

View File

@ -292,7 +292,7 @@
"you_are_editing": "Вы редактируете",
"section_from_server": "секцию с сервера",
"how_to_install": "как установить",
"port_check": "проверка порта",
"port_check": "Проверка порта",
"possible_service_name": "Возможное название службы",
"server_info": "Информация о сервере",
"user_groups": "Пользовательские группы",
@ -559,7 +559,7 @@
"w_update": "обновить",
"updating": "обновление",
"monitoring": "мониторинг",
"auto": "автоматическое",
"auto": "авто",
"refresh": "обновление",
"refresh2": "обновить",
"no": "нет",

View File

@ -1823,11 +1823,11 @@ function addProxy(form_name) {
type: frm.attr('method'),
success: function( data ) {
data = data.replace(/\n/g, "<br>");
if (data.indexOf('error: ') != '-1' || data.indexOf('Fatal') != '-1') {
if (data.indexOf('error: ') != '-1' || data.indexOf('Error(s)') != '-1' || data.indexOf('Fatal') != '-1') {
returnNiceCheckingConfig(data);
} else if (data == '') {
toastr.clear();
toastr.error('error: Proxy cannot be empty');
toastr.error('error: Something went wrong. Check configuration');
} else {
toastr.clear();
returnNiceCheckingConfig(data);

View File

@ -1019,6 +1019,7 @@ label {
width: 177px;
font-size: 30px;
color: #fff;
text-align: center;
}
.up {
color: #3c763d;
@ -1030,6 +1031,8 @@ label {
background-color: #f2dede;
border-color: #ebccd1;
font-size: 22px;
padding-top: 7px;
height: 38px;
}
.unknown {
color: #856404;

View File

@ -1459,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' || element.indexOf('Parsing') != '-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' || element.indexOf('parsing') != '-1') {
alert_error = alert_error + element;
return
}

View File

@ -215,7 +215,7 @@ $( function() {
updateSmon(id[2])
});
var add_word = $('#translate').attr('data-add');
var cancel_word = $('#translate').attr('data-cancel_word');
var cancel_word = $('#translate').attr('data-cancel');
var smon_add_tabel_title = $( "#smon-add-table-overview" ).attr('title');
var addSmonServer = $( "#smon-add-table" ).dialog({
autoOpen: false,