2018-05-05 12:40:41 +00:00
{% extends "base.html" %}
{% block content %}
2019-10-25 07:18:57 +00:00
{% from 'include/input_macros.html' import input, checkbox %}
2018-05-07 19:09:56 +00:00
< script src = "/inc/users.js" > < / script >
2020-02-05 08:15:57 +00:00
< input type = "hidden" id = "service" value = "{{service}}" / >
2018-05-05 12:40:41 +00:00
< table class = "overview" >
< tr class = "overviewHead" >
2018-05-18 18:09:14 +00:00
< td class = "padding10 first-collumn" style = "width: 10%;" >
2020-07-05 06:59:51 +00:00
{% if select_id == 'viewlogs' %}
2018-05-07 19:09:56 +00:00
Log
{% else %}
Server
{% endif %}
< / td >
2020-08-08 20:22:45 +00:00
{% if select_id != 'viewlogs' and service != 'nginx' %}
2018-08-17 11:55:17 +00:00
< td style = "width: 5%;" > WAF logs< / td >
2018-08-23 14:27:28 +00:00
{% endif %}
2020-07-05 06:59:51 +00:00
< 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 >
2018-05-18 18:09:14 +00:00
< td style = "width: 10%;" >
2018-10-11 02:49:50 +00:00
< label for = "time_range_out_hour" style = "padding: 0" > Time range:< / label >
2019-10-25 07:18:57 +00:00
{{ input('time_range_out_hour', value=hour, class='time-range', readonly='readonly') }}:{{ input('time_range_out_minut', value=minut, class='time-range', readonly='readonly') }}
{{ input('time_range_out_hour1', value=hour1, class='time-range', readonly='readonly') }}:{{ input('time_range_out_minut1', value=minut1, class='time-range', readonly='readonly') }}
2018-05-18 18:09:14 +00:00
< / td >
2020-07-05 06:59:51 +00:00
< td > < / td >
2018-05-05 12:40:41 +00:00
< / tr >
< tr >
2018-05-18 18:09:14 +00:00
< td class = "padding10 first-collumn" style = "width: 10%;" >
2020-07-05 06:59:51 +00:00
< form action = "" method = "post" id = "show_log_form" >
{% if select_id == 'viewlogs' %}
< select autofocus required name = "serv" id = "{{ select_id }}" >
2018-05-08 09:12:16 +00:00
< option disabled selected > Choose log< / option >
2018-05-07 19:09:56 +00:00
{% for select in selects %}
2020-08-11 06:44:03 +00:00
{% if page == 'for_editor' %}
2021-03-03 13:47:42 +00:00
{% if select.1.startswith('haproxy-wi') or select.1.startswith('config_edit') or select.1.startswith('port_sca') %}
2020-08-11 06:44:03 +00:00
{% if select.0|int() == serv|int() %}
< option value = "{{ select.0 }}" selected > {{ select.1 }}< / option >
{% else %}
< option value = "{{ select.0 }}" > {{ select.1 }}< / option >
{% endif %}
{% endif %}
2018-05-07 19:09:56 +00:00
{% else %}
2020-08-11 06:44:03 +00:00
{% if select.0|int() == serv|int() %}
< option value = "{{ select.0 }}" selected > {{ select.1 }}< / option >
{% else %}
< option value = "{{ select.0 }}" > {{ select.1 }}< / option >
{% endif %}
2018-05-07 19:09:56 +00:00
{% endif %}
{% endfor %}
2019-10-25 07:18:57 +00:00
< / select >
2018-05-07 19:09:56 +00:00
{% else %}
2019-10-25 07:18:57 +00:00
{% include 'include/select.html' %}
{% endif %}
2018-05-05 12:40:41 +00:00
< / td >
2020-08-08 20:22:45 +00:00
{% if select_id != 'viewlogs' and service != 'nginx' %}
2018-08-17 11:55:17 +00:00
< td >
2019-10-25 07:18:57 +00:00
{{ checkbox('waf') }}
2018-08-17 11:55:17 +00:00
< / td >
2018-08-23 14:27:28 +00:00
{% endif %}
2018-05-18 18:09:14 +00:00
< td class = "padding10" style = "width: 10%;" >
2020-07-05 06:59:51 +00:00
{{ input('rows', type='number', value=rows, required='required', size='5') }}
2018-05-05 12:40:41 +00:00
< / td >
2018-05-18 18:09:14 +00:00
< td class = "padding10" style = "width: 10%;" >
2019-10-25 07:18:57 +00:00
{{ input('grep', value=grep) }}
2018-05-05 12:40:41 +00:00
< / td >
2020-07-05 06:59:51 +00:00
< td class = "padding10" style = "width: 10%;" >
{{ input('exgrep', value=exgrep) }}
< / td >
2018-05-18 18:09:14 +00:00
< td class = "padding10" style = "width: 10%;" >
< div id = "time-range" > < / div >
< / td >
< td class = "padding10 first-collumn" style = "width: 10%;" >
2020-07-05 06:59:51 +00:00
< button type = "submit" name = "Show log" value = "Show" id = "show_log_button" > Show< / button >
2018-05-05 12:40:41 +00:00
< / form >
2018-05-18 18:09:14 +00:00
< / td >
2018-05-05 12:40:41 +00:00
< / tr >
< / table >
< div id = "ajax" >
< / div >
2020-07-05 06:59:51 +00:00
{% if select_id == 'viewlogs' and serv != '' and viewlogs != '' and viewlogs != 'haproxy-wi.error.log' and viewlogs != 'haproxy-wi.access.log' %}
2019-09-29 20:16:24 +00:00
< script >
viewLogs()
2019-12-04 05:43:03 +00:00
if (window.matchMedia('(max-width: 786px)').matches || window.matchMedia('(max-width: 1024px)').matches || window.matchMedia('(max-width: 667px)').matches) {
$( "#viewlogs" ).selectmenu({
width: 150
});
}
2019-09-29 20:16:24 +00:00
< / script >
2019-10-02 06:35:34 +00:00
< div class = "add-note addName alert-info" style = "width: inherit; margin-right: 15px;" >
You can read the descriptions about all logs < a href = "https://haproxy-wi.org/description.py?description=logs" title = "Servers description" target = "_blank" > here< / a >
< / div >
2019-09-29 20:16:24 +00:00
{% elif serv == 'haproxy-wi.error.log' or serv == 'haproxy-wi.access.log' %}
< script >
showApacheLog('{{serv}}');
< / script >
2019-10-02 06:35:34 +00:00
< div class = "add-note addName alert-info" style = "width: inherit; margin-right: 15px;" >
You can read the description about all logs file < a href = "https://haproxy-wi.org/description.py?description=logs" title = "Servers description" target = "_blank" > here< / a >
< / div >
2019-09-29 20:16:24 +00:00
{% else %}
< script >
2019-10-04 06:23:48 +00:00
{% if waf == '1' %}
$('#waf').prop('checked', true);
{% endif %}
2019-09-29 20:16:24 +00:00
showLog()
2019-12-04 05:43:03 +00:00
if (window.matchMedia('(max-width: 786px)').matches || window.matchMedia('(max-width: 1024px)').matches || window.matchMedia('(max-width: 667px)').matches) {
$( "#serv" ).selectmenu({
width: 150
});
}
2019-09-29 20:16:24 +00:00
< / script >
{% endif %}
2018-05-05 12:40:41 +00:00
{% endblock %}