haproxy-wi/app/templates/ajax/stick_tables.html

156 lines
4.3 KiB
HTML

{% import 'languages/'+lang|default('en')+'.html' as lang %}
{% from 'include/input_macros.html' import copy_to_clipboard %}
{%- for t in table %}
{%- if t.1.0 != '' -%}
{% set headers = t.1.0.split(':')[1] %}
{% set headers = headers.split(' ') %}
<script>
$(document).ready(function() {
$('#{{t.0.0.strip()}}').on( 'page.dt', function () { $.getScript("/inc/fontawesome.min.js"); } )
.DataTable( {
"pageLength": 10,
"columnDefs": [
{
"searchable": false,
"orderable": false,
"targets": -1
}
],
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
} );
} );
</script>
{% endif %}
<table class="overview">
<tr class="overviewHead">
<td class="padding10 first-collumn">
{{lang.words.table|title()}} {{lang.words.name}}:{{t.0.0}}
</td>
<td class="padding10 first-collumn">
{{lang.words.type|title()}}: {{t.0.1}}
</td>
<td class="padding10 first-collumn">
{{lang.words.size|title()}}: {{t.0.2|int() / 1024 / 1024}} Mb
</td>
<td class="padding10 first-collumn">
{{lang.words.used|title()}}: {{t.0.3}}
</td>
<td>
<button title="{{lang.words.w_clear|title()}} {{lang.words.table}} {{t.0.0}}" onclick="clearTable('{{t.0.0}}')">{{lang.words.w_clear|title()}} {{lang.words.table}}</button>
</td>
</tr>
</table>
{%- if t.1.0 != '' -%}
<table class="overview hover order-column display compact" id="{{t.0.0.strip()}}">
{% set headers = t.1.0.split(':')[1] %}
{% set headers = headers.split(' ') %}
<thead>
<tr class="overviewHead">
<th class="padding10" style="width: 10%; padding-left: 10px;">IP</th>
<th>Use</th>
<th>Exp</th>
<th>
{{headers.4.split('=')[0].split('(')[0]}}
</th>
{% if headers|length > 5 %}
<th>
{{headers.5.split('=')[0].split('(')[0]}}
</th>
{% endif %}
{% if headers|length > 6 %}
<th>
{{headers.6.split('=')[0].split('(')[0]}}
</th>
{% endif %}
{% if headers|length > 7 %}
<th>
{{headers.7.split('=')[0].split('(')[0]}}
</th>
{% endif %}
{% if headers|length > 8 %}
<th>
{{headers.8.split('=')[0].split('(')[0]}}
</th>
{% endif %}
{% if headers|length > 9 %}
<th>
{{headers.9.split('=')[0].split('(')[0]}}
</th>
{% endif %}
{% if headers|length > 10 %}
<th>
{{headers.10.split('=')[0].split('(')[0]}}
</th>
{% endif %}
{% if headers|length > 11 %}
<th>
{{headers.11.split('=')[0].split('(')[0]}}
</th>
{% endif %}
<th style="width: 10px;">
</th>
</tr>
</thead>
<tbody>
{% for b in t.1 %}
{% set body = b.split(' ') %}
{% if body.0 != '' %}
<tr>
<td class="padding10" style="width: 10%; padding-left: 10px;">
{{ copy_to_clipboard(value=body.1.split('=')[1]) }}
</td>
<td>
{{body.2.split('=')[1]}}
</td>
<td>
{{body.3.split('=')[1]|int() / 1000 }} s
</td>
{% if body|length > 4 %}
<td>
{{body.4.split('=')[1]}}
</td>
{% endif %}
{% if body|length > 5 %}
<td>
{{body.5.split('=')[1]}}
</td>
{% endif %}
{% if body|length > 6 %}
<td>
{{body.6.split('=')[1]}}
</td>
{% endif %}
{% if body|length > 7 %}
<td>
{{body.7.split('=')[1]}}
</td>
{% endif %}
{% if body|length > 8 %}
<td>
{{body.8.split('=')[1]}}
</td>
{% endif %}
{% if body|length > 9 %}
<td>
{{body.9.split('=')[1]}}
</td>
{% endif %}
{% if body|length > 10 %}
<td>
{{body.10.split('=')[1]}}
</td>
{% endif %}
<td>
<a class="delete" title="{{lang.words.delete|title()}} {{lang.words.this}} {{lang.words.entry}}" style="cursor: pointer;" onclick="deleteTableEntry(this, '{{t.0.0.strip()}}', '{{body.1.split('=')[1]}}')"></a>
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
{% else %}
<span class="alert alert-warning" style="margin-bottom: 0px;">{{lang.words.table|title()}} {{lang.words.is}} {{lang.words.w_empty}}</span>
{% endif %}
<br />
<br />
{% endfor %}