Pavel Loginov 3 years ago
parent e712586d1b
commit 9b433f05b2

@ -113,7 +113,7 @@ def logging(serv, action, **kwargs):
action + " for: " + serv + "\n"
else:
mess = get_data('date_in_log') + " " + action + " from " + ip + "\n"
log = open(log_path + "/haproxy-wi-"+get_data('logs')+".log", "a")
log = open(log_path + "/roxy-wi-"+get_data('logs')+".log", "a")
elif kwargs.get('provisioning') == 1:
mess = get_data('date_in_log') + " from " + ip + " user: " + login + ", group: " + user_group + ", " + \
action + "\n"
@ -1000,7 +1000,7 @@ def haproxy_wi_log(**kwargs):
group_grep = '|grep "group: ' + user_group + '"'
else:
group_grep = ''
cmd = "find "+log_path+"/haproxy-wi-* -type f -exec stat --format '%Y :%y %n' '{}' \; | sort -nr | cut -d: -f2- | head -1 |awk '{print $4}' |xargs tail"+group_grep+"|sort -r"
cmd = "find "+log_path+"/roxy-wi-* -type f -exec stat --format '%Y :%y %n' '{}' \; | sort -nr | cut -d: -f2- | head -1 |awk '{print $4}' |xargs tail"+group_grep+"|sort -r"
output, stderr = subprocess_execute(cmd)
return output

@ -16,8 +16,8 @@
<td style="width: 5%;">WAF logs</td>
{% endif %}
<td>Number rows</td>
<td class="padding10"><span title="Find in log file(supports regular expressions)">Find (?)<span></td>
<td class="padding10"><span title="Exclude from search in log file(supports regular expressions)">Exclude (?)<span></td>
<td class="padding10 help_cursor"><span title="Find in log file(supports regular expressions)">Find<span></td>
<td class="padding10 help_cursor"><span title="Exclude from search in log file(supports regular expressions)">Exclude<span></td>
<td style="width: 10%;">
<label for="time_range_out_hour" style="padding: 0">Time range:</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') }}
@ -33,8 +33,8 @@
<option disabled selected>Choose log</option>
{% for select in selects %}
{% if page == 'for_editor' %}
{% if select.1.startswith('haproxy-wi') or select.1.startswith('config_edit') or select.1.startswith('port_sca') %}
{% if select.0|int() == serv|int() %}
{% if select.1.startswith('roxy-wi') or select.1.startswith('config_edit') or select.1.startswith('port_sca') %}
{% if select.0 == serv %}
<option value="{{ select.0 }}" selected>{{ select.1 }}</option>
{% else %}
<option value="{{ select.0 }}">{{ select.1 }}</option>
@ -78,7 +78,7 @@
</table>
<div id="ajax">
</div>
{% if select_id == 'viewlogs' and serv != '' and viewlogs != '' and viewlogs != 'haproxy-wi.error.log' and viewlogs != 'haproxy-wi.access.log' %}
{% if select_id == 'viewlogs' and serv != '' and viewlogs != '' and viewlogs != 'roxy-wi.error.log' and viewlogs != 'roxy-wi.access.log' %}
<script>
viewLogs()
if (window.matchMedia('(max-width: 786px)').matches || window.matchMedia('(max-width: 1024px)').matches || window.matchMedia('(max-width: 667px)').matches) {
@ -90,7 +90,7 @@
<div class="add-note addName alert-info" style="width: inherit; margin-right: 15px;">
You can read the descriptions about all logs <a href="https://roxy-wi.org/description.py?description=logs" title="Servers description" target="_blank">here</a>
</div>
{% elif serv == 'haproxy-wi.error.log' or serv == 'haproxy-wi.access.log' %}
{% elif serv == 'roxy-wi.error.log' or serv == 'roxy-wi.access.log' %}
<script>
showApacheLog('{{serv}}');
</script>

@ -14,6 +14,8 @@ if form.getvalue('grep') is None:
else:
grep = form.getvalue('grep')
exgrep = form.getvalue('exgrep') if form.getvalue('exgrep') else ''
if form.getvalue('rows') is None:
rows = 10
else:
@ -65,8 +67,8 @@ except Exception:
selects = funct.get_files(log_path, format="log")
if form.getvalue('type') is None:
selects.append(['fail2ban.log', 'fail2ban.log'])
selects.append(['haproxy-wi.error.log', 'error.log'])
selects.append(['haproxy-wi.access.log', 'access.log'])
selects.append(['roxy-wi.error.log', 'error.log'])
selects.append(['roxy-wi.access.log', 'access.log'])
output_from_parsed_template = template.render(h2=1,
autorefresh=1,
@ -78,6 +80,7 @@ output_from_parsed_template = template.render(h2=1,
selects=selects,
rows=rows,
grep=grep,
exgrep=exgrep,
hour=hour,
hour1=hour1,
minut=minut,

@ -586,7 +586,7 @@ function findGetParameter(parameterName) {
return result;
}
function viewLogs() {
if($('#viewlogs').val() == 'haproxy-wi.error.log' || $('#viewlogs').val() == 'haproxy-wi.access.log' || $('#viewlogs').val() == 'fail2ban.log') {
if($('#viewlogs').val() == 'roxy-wi.error.log' || $('#viewlogs').val() == 'roxy-wi.access.log' || $('#viewlogs').val() == 'fail2ban.log') {
showApacheLog($('#viewlogs').val());
} else {
var rows = $('#rows').val()

Loading…
Cancel
Save