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 += ' http-request deny'
acl_then_value = '' acl_then_value = ''
elif acl_then[i] == '6': 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': 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: except Exception:
acl = '' acl = ''

View File

@ -65,9 +65,8 @@
{{ s.3 }} {{ s.3 }}
{% endif %} {% endif %}
</td> </td>
<td> <td colspan="2">
{{ services_name[s.0]['desc'] }} {{ services_name[s.0]['desc'] }}
</td> </td>
<td></td>
</tr> </tr>
{% endfor %} {% 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> <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 %} {% endif %}
</td> </td>
<td> <td colspan="2">
{{lang.admin_page.desc.main_app}} {{lang.admin_page.desc.main_app}}
</td> </td>
<td></td>
</tr> </tr>
{% for s in services %} {% 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') %} {% 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 %} {% for s in smon %}
{% if s.en == 1 %} {% if s.en == 1 %}
{% if s.status == 1 and s.http_status == 1 and s.body_status == 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 %} {% else %}
{% if down.append('1') %} {% endif %} {% if down.append('1') %} {% endif %}
{% endif %} {% endif %}
{% else %} {% else %}
{% if dis.append(s.group) %} {% endif %} {% if dis.append(s.group) %} {% endif %}
{% endif %} {% endif %}
{% endfor %} {% 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> <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 = [] %}
{% set group_prev = [] %} {% set group_prev = [] %}
{%- for s in smon -%} {%- 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 %} {% 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() %} {% 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 %} {% endif %}
@ -36,66 +36,52 @@
{% if s.ssl_expire_date %} {% if s.ssl_expire_date %}
{% set checks = checks + ',<br> SSL ' + lang.words.expire + ': ' + s.ssl_expire_date %} {% set checks = checks + ',<br> SSL ' + lang.words.expire + ': ' + s.ssl_expire_date %}
{% endif %} {% 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.en == 1 %}
{% if s.status == 1 and s.http_status == 1 and s.body_status == 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 %} {% 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 %} {% endif %}
{% else %} {% 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 %} {% endif %}
data-help="{{checks}}" {% set additional_style = '' %}
title="{{checks}}"> {% 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"> <div class="ip">
{% if s.ip|string|length > 23 %} <span style="{{additional_style}}">
<span style="font-size: 11px;"> <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>
{% 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> </span>
</div> </div>
<div class="desc"> <div class="desc">
{% if s.desc is not none %} {% if s.desc %}
<b>{{s.desc}}</b> <b>{{s.desc}}</b>
{% else %} {% else %}
{{lang.words.desc|title()}}: None {{lang.words.desc|title()}}: {{lang.words.none}}
{% endif %} {% endif %}
</div> </div>
<div class="desc"> <div class="desc">
{% if s.en == 1 %} {{uptime_desc|safe}}
{% 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 %}
</div> </div>
<div class="res_time"> <div class="res_time">
{% if s.en == 1 %} {% if s.en == 1 %}
@ -116,40 +102,28 @@
{% if s.en == 1 %} {% if s.en == 1 %}
{% if s.status == 1 and s.http_status == 1 and s.body_status == 1 %} {% if s.status == 1 and s.http_status == 1 and s.body_status == 1 %}
<div class="up"> <div class="up">
<center> {{lang.smon_page.desc.UP}}
{{lang.smon_page.desc.UP}}
</center>
</div> </div>
{% elif s.http_status == 0 %} {% elif s.http_status == 0 %}
<div class="down"> <div class="down">
<center style="padding-top: 7px;"> {{lang.smon_page.desc.HTTP_FAILURE}}
{{lang.smon_page.desc.HTTP_FAILURE}}
</center>
</div> </div>
{% elif s.body_status == 0 %} {% elif s.body_status == 0 %}
<div class="down"> <div class="down">
<center style="padding-top: 7px;"> {{lang.smon_page.desc.BODY_FAILURE}}
{{lang.smon_page.desc.BODY_FAILURE}}
</center>
</div> </div>
{% elif s.status == 3 %} {% elif s.status == 3 %}
<div class="unknown"> <div class="unknown">
<center style="padding-top: 7px;"> {{lang.smon_page.desc.UNKNOWN}}
{{lang.smon_page.desc.UNKNOWN}}
</center>
</div> </div>
{% else %} {% else %}
<div class="down"> <div class="down">
<center style="padding-top: 7px;"> {{lang.smon_page.desc.PORT_DOWN}}
{{lang.smon_page.desc.PORT_DOWN}}
</center>
</div> </div>
{% endif %} {% endif %}
{% else %} {% else %}
<div class="disable"> <div class="disable">
<center> {{lang.smon_page.desc.DISABLED}}
{{lang.smon_page.desc.DISABLED}}
</center>
</div> </div>
{% endif %} {% endif %}
</div> </div>

View File

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

View File

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

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": "Проверка порта",
"possible_service_name": "Возможное название службы", "possible_service_name": "Возможное название службы",
"server_info": "Информация о сервере", "server_info": "Информация о сервере",
"user_groups": "Пользовательские группы", "user_groups": "Пользовательские группы",
@ -559,7 +559,7 @@
"w_update": "обновить", "w_update": "обновить",
"updating": "обновление", "updating": "обновление",
"monitoring": "мониторинг", "monitoring": "мониторинг",
"auto": "автоматическое", "auto": "авто",
"refresh": "обновление", "refresh": "обновление",
"refresh2": "обновить", "refresh2": "обновить",
"no": "нет", "no": "нет",

View File

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

View File

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

View File

@ -1459,7 +1459,7 @@ function returnNiceCheckingConfig(data) {
console.log(err); console.log(err);
} }
alerts.forEach((element) => { 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; alert_error = alert_error + element;
return return
} }

View File

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