Files
ipwhitelist-app/views/v2/admin-entries.ejs
T

31 lines
1.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html><head><meta charset="utf-8"><title>Записи — <%= company.client_id %> — v<%= version %></title>
<style>
body{font-family:sans-serif;max-width:1000px;margin:20px auto;color:#222}
table{width:100%;border-collapse:collapse;margin:10px 0}
th,td{border:1px solid #ccc;padding:6px;text-align:left}
th{background:#263238;color:#fff}
.bar{display:flex;justify-content:space-between;align-items:center;background:#263238;color:#fff;padding:10px;margin-bottom:15px}
.bar a{color:#80cbc4}
</style></head><body>
<div class="bar">
<span><strong>📋 Записи</strong> <%= company.client_id %> — <%= company.name || company.client_id %></span>
<span><a href="/v2/admin">← Админка</a></span>
</div>
<p>Записей: <strong><%= used %></strong> из <%= limit %> <%= includeDeleted ? '(с удалёнными: ' + entries.length + ')' : '' %></p>
<table>
<tr><th>CIDR</th><th>Комментарий</th><th>Кто</th><th>Когда</th><th>Статус</th></tr>
<% if (entries.length === 0) { %><tr><td colspan="5">Нет записей</td></tr><% } %>
<% entries.forEach(function(e) { %>
<tr style="<%= e.deleted_at ? 'text-decoration:line-through;opacity:0.5' : '' %>">
<td><%= e.value_cidr %></td>
<td><%= e.comment || '' %></td>
<td><%= e.created_by %></td>
<td><%= new Date(e.created_at).toLocaleString('ru') %></td>
<td><%= e.deleted_at ? 'удалено' : 'активна' %></td>
</tr>
<% }) %>
</table>
<p><a href="?companyId=<%= company.id %>&deleted=<%= includeDeleted ? '0' : '1' %>"><%= includeDeleted ? 'Скрыть удалённые' : 'Показать удалённые' %></a></p>
</body></html>