Files
lost-city-Website/view/mod/overview.ejs
T
Cyperita 0fa445a2d0 feat: Added change username and mod redirect URL (#15)
* feat: Added starting point for basic web-based moderation tools. Only ban button functions currently.

* fix: Fixed custom ban date, added ban btn check

* feat: Basic login redirecting to previous page

* chore: Made modal CSS classes more reusable

* chore: Moved username validation to separate function

* feat: Added username changing to mod web tools

* fix: Fixed typos in name change dialogs
2025-02-04 11:17:34 -05:00

129 lines
3.9 KiB
Plaintext

<%- include('../_partial/header.ejs', { title: 'Mod Overview', modals: true }); %>
<%- include('../_components/frame-top.ejs'); %>
<%- include('../_components/content-start.ejs'); %>
<%- include('../_components/title-box.ejs', { title: account.username + "'s Mod Overview" }); %>
<%- include('../_components/content-body-start.ejs'); %>
<%- include('../_components/modal-ban-player.ejs'); %>
<%- include('../_components/modal-change-username.ejs'); %>
<% if (account.banned_until) { %>
Banned until: <strong><%= account.banned_until.toISOString().replace("T"," ").substring(0, 19); %></strong><br>
<% } %>
<% if (account.muted_until) { %>
Muted until: <strong><%= account.muted_until.toISOString().replace("T"," ").substring(0, 19); %></strong>
<% } %>
<div style="display: flex; justify-content: space-around;">
<%- include('../_components/stones-button.ejs', { id: 'ban-btn', text: 'Ban', shiny: true }) %>
<%- include('../_components/stones-button.ejs', { id: 'name-change-btn', text: 'Change<br>Name' }); %>
<%- include('../_components/stones-button.ejs', { id: 'mute-btn', text: 'Mute' }) %>
</div>
<h3>Sessions</h3>
<div style="height: 500px; overflow-y: scroll">
<% for (const session of sessions) { %>
<div style="text-align: left">
World: <strong><%= session.world - 9 %></strong>, IP: <strong><a href="/mod/ip/<%= session.ip %>"><%= session.ip.substring(0, 32); %></a></strong>, UID: <strong><a href="/mod/uid/<%= session.uid %>"><%= session.uid %></a></strong>
<span style="float: right">
<%= session.timestamp.toISOString().replace("T"," ").substring(0, 19); %>
</span>
</div>
<hr>
<% } %>
</div>
<hr>
<h3>Public Chat Messages</h3>
<div style="height: 500px; overflow-y: scroll">
<% for (const chat of chats) { %>
<div style="text-align: left">
<strong><%= toDisplayCoord(chat.coord) %></strong>,
World: <strong><%= chat.world - 9 %></strong>
<span style="float: right">
<%= chat.timestamp.toISOString().replace("T"," ").substring(0, 19); %>
</span>
<br>
<%= chat.message %>
</div>
<hr>
<% } %>
</div>
<hr>
<h3>Private Chat Messages</h3>
<div style="height: 500px; overflow-y: scroll">
<% for (const pm of pms) { %>
<div style="text-align: left">
To: <strong><a href="/mod/overview/<%= pm.username %>"><%= toDisplayName(pm.username) %></a></strong>
<span style="float: right">
<%= pm.timestamp.toISOString().replace("T"," ").substring(0, 19); %>
</span>
<br>
<%= pm.message %>
</div>
<hr>
<% } %>
</div>
<hr>
<h3>Events</h3>
<div style="height: 500px; overflow-y: scroll">
<% for (const log of logs) { %>
<div style="text-align: left">
<strong><%= toDisplayCoord(log.coord) %></strong>
<span style="float: right">
<%= log.timestamp.toISOString().replace("T"," ").substring(0, 19); %>
</span>
<br>
<%= log.event %>
</div>
<hr>
<% } %>
</div>
<hr>
<h3>Wealth Events</h3>
<div style="height: 500px; overflow-y: scroll">
<% for (const log of wealth) { %>
<div style="text-align: left">
<strong><%= toDisplayCoord(log.coord) %></strong>
<span style="float: right">
<%= log.timestamp.toISOString().replace("T"," ").substring(0, 19); %>
</span>
<br>
<%= log.event %>
</div>
<hr>
<% } %>
</div>
<%- include('../_components/content-body-end.ejs'); %>
<%- include('../_components/content-end.ejs'); %>
<%- include('../_partial/footer.ejs'); %>
<script>
<% const { password, ...sanitizedAccount } = account %>
const account = JSON.parse(`<%- JSON.stringify(sanitizedAccount) %>`);
</script>
<%- include('../_scripts/mod/overview.ejs'); %>