v2: WZ01112 admin toggle

This commit is contained in:
2026-06-15 12:05:09 +04:00
parent 3e418f9f4a
commit 7fa6b43562
4 changed files with 28 additions and 3 deletions
+10 -1
View File
@@ -11,7 +11,16 @@
</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>
<% if (typeof canAdmin !== 'undefined' && canAdmin) { %>
<form method="POST" action="/v2/toggle-admin" style="display:inline">
<button style="font-size:.8rem;padding:.2rem .6rem;border:1px solid #ccc;border-radius:4px;background:<%= adminMode ? '#2563eb' : '#fff' %>;color:<%= adminMode ? '#fff' : '#333' %>;cursor:pointer;">
<%= adminMode ? 'Выйти из админки' : 'Администратор' %>
</button>
</form>
<% } %>
<%= user.email %>
</span>
<span>
<form method="GET" action="/v2/app" style="display:inline">
<select name="switchTo" onchange="this.form.submit()">