v2→main: интеграция — v2 как основной UI (/), старый UI закомментирован
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
</style></head><body>
|
||||
<div class="bar">
|
||||
<span><strong>📋 Аудит</strong> <%= company ? company.client_id : 'Все компании' %></span>
|
||||
<span><a href="/v2/admin">← Админка</a> | <a href="/v2/app">Пользовательский</a></span>
|
||||
<span><a href="/admin">← Админка</a> | <a href="/app">Пользовательский</a></span>
|
||||
</div>
|
||||
<table>
|
||||
<tr><th>Дата</th><th>Действие</th><th>Кто</th><th>От имени</th><th>Компания</th><th>Значения</th></tr>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</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>
|
||||
<span><a href="/admin">← Админка</a></span>
|
||||
</div>
|
||||
<p>Записей: <strong><%= used %></strong> из <%= limit %> <%= includeDeleted ? '(с удалёнными: ' + entries.length + ')' : '' %></p>
|
||||
<table>
|
||||
|
||||
+6
-6
@@ -13,12 +13,12 @@
|
||||
</style></head><body>
|
||||
<div class="bar">
|
||||
<span><strong>🛡️ ADMIN</strong> v<%= version %></span>
|
||||
<span><%= user.email || '—' %> | <a href="/v2/app">← Пользовательский</a> | <a href="/v2/logout">Выйти</a></span>
|
||||
<span><%= user.email || '—' %> | <a href="/app">← Пользовательский</a> | <a href="/logout">Выйти</a></span>
|
||||
</div>
|
||||
<script>
|
||||
const p=new URLSearchParams(location.search);
|
||||
if(p.get('msg')){document.write('<div class="msg">'+p.get('msg')+'</div>');history.replaceState(null,'','/v2/admin');}
|
||||
if(p.get('error')){document.write('<div class="err">'+p.get('error')+'</div>');history.replaceState(null,'','/v2/admin');}
|
||||
if(p.get('msg')){document.write('<div class="msg">'+p.get('msg')+'</div>');history.replaceState(null,'','/admin');}
|
||||
if(p.get('error')){document.write('<div class="err">'+p.get('error')+'</div>');history.replaceState(null,'','/admin');}
|
||||
</script>
|
||||
<h2>Компании (<%= companies.length %>)</h2>
|
||||
<table>
|
||||
@@ -31,11 +31,11 @@
|
||||
<td><strong><%= c.active_count %></strong> / <%= c.custom_limit != null ? c.custom_limit : 15 %></td>
|
||||
<td><%= c.custom_limit != null ? c.custom_limit : '—' %></td>
|
||||
<td>
|
||||
<a href="/v2/admin/audit?companyId=<%= c.id %>">аудит</a> |
|
||||
<a href="/v2/admin/entries?companyId=<%= c.id %>">записи</a>
|
||||
<a href="/admin/audit?companyId=<%= c.id %>">аудит</a> |
|
||||
<a href="/admin/entries?companyId=<%= c.id %>">записи</a>
|
||||
</td>
|
||||
<td>
|
||||
<form method="POST" action="/v2/admin/limit" style="display:inline">
|
||||
<form method="POST" action="/admin/limit" style="display:inline">
|
||||
<input type="hidden" name="companyId" value="<%= c.id %>">
|
||||
<input name="limit" value="<%= c.custom_limit || 15 %>" size="3">
|
||||
<button>установить</button>
|
||||
|
||||
+9
-9
@@ -11,26 +11,26 @@
|
||||
</style></head><body>
|
||||
<div class="bar">
|
||||
<span><strong>V2 IP WhiteList</strong> <small>v<%= version %></small></span>
|
||||
<span><%= user.email %> <% if (user.isAdmin) { %>| <a href="/v2/admin">ADMIN</a><% } %></span>
|
||||
<span><%= user.email %> <% if (user.isAdmin) { %>| <a href="/admin">ADMIN</a><% } %></span>
|
||||
<span>
|
||||
<form method="GET" action="/v2/app" style="display:inline">
|
||||
<form method="GET" action="/app" style="display:inline">
|
||||
<select name="switchTo" onchange="this.form.submit()">
|
||||
<% companies.forEach(function(c) { %>
|
||||
<option value="<%= c.client_id %>" <%= c.client_id === activeClientId ? 'selected' : '' %>><%= c.company_name || c.client_id %> (<%= c.client_id %>)</option>
|
||||
<% }) %>
|
||||
</select>
|
||||
</form>
|
||||
<a href="/v2/logout">Выйти</a>
|
||||
<a href="/logout">Выйти</a>
|
||||
</span>
|
||||
</div>
|
||||
<script>
|
||||
const p=new URLSearchParams(location.search);
|
||||
if(p.get('msg')){document.body.insertAdjacentHTML('afterbegin','<div style="background:#4caf50;color:#fff;padding:8px">'+p.get('msg')+'</div>');history.replaceState(null,'','/v2/app')}
|
||||
if(p.get('error')){document.body.insertAdjacentHTML('afterbegin','<div style="background:#f44336;color:#fff;padding:8px">'+p.get('error')+'</div>');history.replaceState(null,'','/v2/app')}
|
||||
if(p.get('msg')){document.body.insertAdjacentHTML('afterbegin','<div style="background:#4caf50;color:#fff;padding:8px">'+p.get('msg')+'</div>');history.replaceState(null,'','/app')}
|
||||
if(p.get('error')){document.body.insertAdjacentHTML('afterbegin','<div style="background:#f44336;color:#fff;padding:8px">'+p.get('error')+'</div>');history.replaceState(null,'','/app')}
|
||||
</script>
|
||||
<p>Записей: <strong><%= used %></strong> из <%= limit %></p>
|
||||
<div class="add-form">
|
||||
<form method="POST" action="/v2/app/add">
|
||||
<form method="POST" action="/app/add">
|
||||
<input name="cidr" placeholder="x.x.x.x/xx" size="18" required>
|
||||
<input name="comment" placeholder="комментарий" size="30">
|
||||
<button>Добавить</button>
|
||||
@@ -51,12 +51,12 @@
|
||||
<% if (e.deleted_at) { %>
|
||||
<span style="color:#888">удалено</span>
|
||||
<% } else { %>
|
||||
<form method="POST" action="/v2/app/edit/<%= e.id %>" style="display:inline">
|
||||
<form method="POST" action="/app/edit/<%= e.id %>" style="display:inline">
|
||||
<input name="cidr" value="<%= e.value_cidr %>" size="18">
|
||||
<input name="comment" value="<%= e.comment || '' %>" size="20">
|
||||
<button>изменить</button>
|
||||
</form>
|
||||
<form method="POST" action="/v2/app/delete/<%= e.id %>" style="display:inline">
|
||||
<form method="POST" action="/app/delete/<%= e.id %>" style="display:inline">
|
||||
<button onclick="return confirm('Удалить?')">удалить</button>
|
||||
</form>
|
||||
<% } %>
|
||||
@@ -64,5 +64,5 @@
|
||||
</tr>
|
||||
<% }) %>
|
||||
</table>
|
||||
<p><a href="/v2/app?deleted=<%= includeDeleted ? '0' : '1' %>"><%= includeDeleted ? 'Скрыть удалённые' : 'Показать удалённые' %></a></p>
|
||||
<p><a href="/app?deleted=<%= includeDeleted ? '0' : '1' %>"><%= includeDeleted ? 'Скрыть удалённые' : 'Показать удалённые' %></a></p>
|
||||
</body></html>
|
||||
|
||||
Reference in New Issue
Block a user