haproxy-wi/app/templates/history.html

66 lines
2.5 KiB
HTML
Raw Normal View History

{% from 'include/input_macros.html' import copy_to_clipboard %}
{% extends "base.html" %}
{% block title %}{{ lang.menu_links.history.title }} {{ lang.words[service] }}{% endblock %}
{% block h2 %}{{ lang.menu_links.history.title }} {{ lang.words[service] }}{% endblock %}
{% block content %}
{% if user_status == 0 or user_plan == 'user' %}
{% include 'include/no_sub.html' %}
{% else %}
<link href="/inc/css/table-6.3.9.css" rel="stylesheet" type="text/css">
<script type="text/javascript" charset="utf8" src="/inc/dataTables.min.js"></script>
<script>
$(document).ready(function() {
$('#table_history').on('page.dt')
.DataTable( {
"pageLength": 25,
"order": [ 4, "desc" ],
stateSave: true,
"columnDefs": [
{
"searchable": false,
"orderable": false
}
],
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
} );
} );
</script>
<table class="overview hover order-column display compact" id="table_history">
<thead>
<tr class="overviewHead">
<th class="padding10 first-collumn" style="width: 100px;">{{lang.words.service|title()}}</th>
<th>{{lang.words.user|title()}}</th>
<th style="width: 100px">{{lang.words.service|title()}} IP</th>
<th style="width: 100px">{{lang.words.server|title()}}</th>
<th>{{lang.words.action|title()}}</th>
<th>{{lang.words.date|title()}}</th>
</tr>
</thead>
<tbody>
{% for h in history %}
<tr>
<td>{% if h.service is not none %} {{h.service[0].upper()}}{{h.service[1:]}}{% endif %}</td>
<td>
{% for u in users %}
{% if u.user_id == h.user_id %}
<a href="/app/history.py?service=user&user_id={{u.user_id}}" title="Open history for {{u.username}}">{{ u.username }}</a>
{% endif %}
{% endfor %}
</td>
<td>{{ copy_to_clipboard(id=h.ip, value=h.ip) }}</td>
<td>
{% if h.server_ip != None %}
{% if h.service in ('haproxy', 'nginx', 'apache', 'keepalived') %}
<a href="/app/hapservers.py?service={{h.service}}&serv={{h.server_ip}}" title="Open history for {{h.hostname}}">{{ h.hostname }}</a>
{% endif %}
{% endif %}
</td>
<td>{{h.action}}</td>
<td>{{h.date}}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% endblock %}