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

94 lines
3.5 KiB

{% extends "base.html" %}
{% block content %}
<script src="/inc/users.js"></script>
<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()' %}
<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 type="text" id="time_range_out_hour" readonly class="time-range" value="{{hour}}">:<input type="text" id="time_range_out_minut" readonly class="time-range" value="{{minut}}"> -
<input type="text" id="time_range_out_hour1" readonly class="time-range" value="{{hour1}}">:<input type="text" id="time_range_out_minut1" readonly class="time-range" value="{{minut1}}">
</td>
<td style="width: 10%;"> </td>
</tr>
<tr>
<td class="padding10 first-collumn" style="width: 10%;">
<form action="" method="get">
<select autofocus required name="serv" id="{{ select_id }}">
{% if onclick == 'viewLogs()' %}
<option disabled selected>Choose log</option>
{% for select in selects %}
{% if select.0 == serv %}
<option value="{{ select.0 }}" selected>{{ select.1 }}</option>
{% else %}
<option value="{{ select.0 }}">{{ select.1 }}</option>
{% endif %}
{% endfor %}
{% else %}
<option disabled selected>Choose server</option>
{% for select in selects %}
{% if select.2 == serv %}
<option value="{{ select.2 }}" selected>{{ select.1 }}</option>
{% else %}
<option value="{{ select.2 }}">{{ select.1 }}</option>
{% endif %}
{% endfor %}
{% endif %}
</select>
</td>
{% if onclick != 'viewLogs()' %}
<td>
<label for="waf"></label><input type="checkbox" id="waf">
</td>
{% endif %}
<td class="padding10" style="width: 10%;">
<input type="number" name="rows" id="rows" value="{{ rows }}" class="form-control" required>
</td>
<td class="padding10" style="width: 10%;">
<input type="text" name="grep" id="grep" class="form-control" 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()
</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()
</script>
{% endif %}
{% endblock %}