Files
ipwhitelist-app/views/v2/admin-entries.ejs
T
naeel 591a4c3216 Миграции: _migrations + applyMigrations + sql/migrations/
APP_ENV: test/production с жёлтым баннером в UI
Config: версия 0.1.12
2026-07-08 07:11:16 +04:00

34 lines
2.0 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}
.test-banner{background:#fef3cd;color:#856404;padding:12px;text-align:center;font-weight:bold;border-bottom:2px solid #f0b400;font-size:14px}
</style></head>
<body>
<% if (env === 'test') { %><div class="test-banner">⚠️ ТЕСТОВЫЙ СТЕНД — данные могут быть удалены в любой момент</div><% } %>
<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>