2022-03-13 16:16:46 +03:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
|
2022-08-27 09:53:10 +03:00
|
|
|
<%- include("extra/meta", {title: "Admin Panel!" }) %>
|
2022-08-26 21:16:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
<body style="text-align: center;">
|
|
|
|
<%- include("extra/navbar") %>
|
2022-08-29 22:02:27 +03:00
|
|
|
<style>
|
|
|
|
table {
|
|
|
|
font-family: arial, sans-serif;
|
|
|
|
border-collapse: collapse;
|
|
|
|
width: 100%;
|
|
|
|
}
|
2022-09-01 14:02:47 +03:00
|
|
|
|
|
|
|
td,
|
|
|
|
th {
|
2022-08-29 22:02:27 +03:00
|
|
|
border: 1px solid #dddddd;
|
|
|
|
text-align: left;
|
|
|
|
padding: 8px;
|
2022-09-09 17:38:13 +03:00
|
|
|
color: var(--anti);
|
2022-08-29 22:02:27 +03:00
|
|
|
}
|
2022-09-01 14:02:47 +03:00
|
|
|
|
2022-08-29 22:02:27 +03:00
|
|
|
tr:nth-child(even) {
|
|
|
|
background-color: #dddddd;
|
|
|
|
}
|
2022-09-01 14:02:47 +03:00
|
|
|
</style>
|
2022-08-29 22:02:27 +03:00
|
|
|
|
|
|
|
<div>
|
2022-08-31 18:11:54 +03:00
|
|
|
<h1 style="color: var(--main);">Welcome to the admin panel of the forum, <%= user.name %>!</h1>
|
2022-09-01 14:02:47 +03:00
|
|
|
|
2022-08-29 22:02:27 +03:00
|
|
|
<a class="btn-primary" onclick="ban();">IP BAN</a>
|
|
|
|
<a class="btn-outline-primary" onclick="unban();">REMOVE IP BAN</a>
|
2022-09-16 23:38:06 +03:00
|
|
|
<a href="/categories/create" class="btn-primary">Create Category</a>
|
2022-10-09 22:57:46 +03:00
|
|
|
<a href="/admin/config" class="btn-primary">Edit config</a>
|
2022-09-01 14:02:47 +03:00
|
|
|
|
2022-08-31 18:11:54 +03:00
|
|
|
<h2 style="color: var(--second);">Banned users:</h2>
|
2022-08-29 21:32:57 +03:00
|
|
|
|
2022-09-01 14:02:47 +03:00
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<th>IP</th>
|
|
|
|
<th>Reason</th>
|
|
|
|
<th>AuthorID</th>
|
|
|
|
</tr>
|
|
|
|
<% for (const ban of bans) { %>
|
|
|
|
<tr>
|
|
|
|
<td><%=ban.ip%></td>
|
|
|
|
<td><%=ban.reason%></td>
|
|
|
|
<td><%=ban.authorID%></td>
|
|
|
|
</tr>
|
|
|
|
<% } %>
|
|
|
|
</table>
|
|
|
|
|
2022-09-17 16:56:19 +03:00
|
|
|
<div>
|
|
|
|
<h2 style="color: var(--second);">Admins:</h2>
|
|
|
|
<ul>
|
|
|
|
<% for (const admin of admins) { %>
|
|
|
|
<li> <a style="color: var(--anti);" href="<%= admin.getLink() %>"><%= admin.name %></a> </li>
|
|
|
|
<% } %>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2022-09-01 14:02:47 +03:00
|
|
|
|
|
|
|
<script type="module">
|
|
|
|
import request from "../../js/request.js";
|
|
|
|
|
|
|
|
window.unban = async function() {
|
|
|
|
const ip = prompt("Enter ip to unban");
|
|
|
|
const response = await request("/api/bans/" + ip, "DELETE");
|
|
|
|
if (response)
|
|
|
|
alert("IP unbanned!");
|
|
|
|
else
|
|
|
|
alert("IP is not unbanned!");
|
|
|
|
location.reload();
|
|
|
|
}
|
|
|
|
window.ban = async function() {
|
|
|
|
const ip = prompt("Enter ip to ban");
|
|
|
|
const response = await request("/api/bans/" + ip);
|
|
|
|
if (response)
|
|
|
|
alert("IP banned!");
|
|
|
|
else
|
|
|
|
alert("IP is not banned!");
|
|
|
|
location.reload();
|
|
|
|
}
|
|
|
|
</script>
|
2022-08-29 22:02:27 +03:00
|
|
|
</div>
|
2022-09-17 00:51:52 +03:00
|
|
|
<%- include("extra/footer") %>
|
2022-09-01 14:02:47 +03:00
|
|
|
|
|
|
|
</body>
|
|
|
|
|
|
|
|
</html>
|