You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
haproxy-wi/app/templates/logs.html

99 lines
3.7 KiB

{% extends "base.html" %}
{% block content %}
{% from 'include/input_macros.html' import input, checkbox %}
<script src="/inc/users.js"></script>
<input type="hidden" id="service" value="{{service}}" />
<table class="overview">
<tr class="overviewHead">
<td class="padding10 first-collumn" style="width: 10%;">
{% if onclick == 'viewLogs()' %}
Log
{% else %}
Server
{% endif %}
</td>
{% if onclick != 'viewLogs()' and service != 'nginx' %}
<td style="width: 5%;">WAF logs</td>
{% endif %}
<td style="width: 10%;">Number rows</td>
<td class="padding10" style="width: 10%;">Ex for grep</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') }}
{{ input('time_range_out_hour1', value=hour1, class='time-range', readonly='readonly') }}:{{ input('time_range_out_minut1', value=minut1, class='time-range', readonly='readonly') }}
</td>
<td style="width: 10%;"> </td>
</tr>
<tr>
<td class="padding10 first-collumn" style="width: 10%;">
<form action="" method="post">
{% if onclick == 'viewLogs()' %}
<select autofocus required name="serv" id="{{ select_id }}">
<option disabled selected>Choose log</option>
{% for select in selects %}
{% if select.0|int() == serv|int() %}
<option value="{{ select.0 }}" selected>{{ select.1 }}</option>
{% else %}
<option value="{{ select.0 }}">{{ select.1 }}</option>
{% endif %}
{% endfor %}
</select>
{% else %}
{% include 'include/select.html' %}
{% endif %}
</td>
{% if onclick != 'viewLogs()' and service != 'nginx' %}
<td>
{{ checkbox('waf') }}
</td>
{% endif %}
<td class="padding10" style="width: 10%;">
{{ input('rows', type='number', value=rows, required='required') }}
</td>
<td class="padding10" style="width: 10%;">
{{ input('grep', value=grep) }}
</td>
<td class="padding10" style="width: 10%;">
<div id="time-range"></div>
</td>
<td class="padding10 first-collumn" style="width: 10%;">
<a class="ui-button ui-widget ui-corner-all" id="show" title="Show logs" onclick="{{ onclick }}">Show</a>
</form>
</td>
</tr>
</table>
<div id="ajax">
</div>
{% if onclick == 'viewLogs()' and serv != '' and viewlogs != '' and viewlogs != 'haproxy-wi.error.log' and viewlogs != 'haproxy-wi.access.log' %}
<script>
viewLogs()
if (window.matchMedia('(max-width: 786px)').matches || window.matchMedia('(max-width: 1024px)').matches || window.matchMedia('(max-width: 667px)').matches) {
$( "#viewlogs" ).selectmenu({
width: 150
});
}
</script>
<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>
{% elif serv == 'haproxy-wi.error.log' or serv == 'haproxy-wi.access.log' %}
<script>
showApacheLog('{{serv}}');
</script>
<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>
{% else %}
<script>
{% if waf == '1' %}
$('#waf').prop('checked', true);
{% endif %}
showLog()
if (window.matchMedia('(max-width: 786px)').matches || window.matchMedia('(max-width: 1024px)').matches || window.matchMedia('(max-width: 667px)').matches) {
$( "#serv" ).selectmenu({
width: 150
});
}
</script>
{% endif %}
{% endblock %}