mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-19 09:37:50 -05:00
feat(modpanel): the mod log as its own page
The admin panel's "What they did" table, in the moderator panel too: the latest 300 entries. A new permission, staff.log, which moderators and admins have by default, guards the page and its route. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
0f367c55b8
commit
8368692b99
3 files changed
+38
-1
No files matched your search
@@ -475,6 +475,7 @@
|
||||
<button role="tab" data-tab="masterpieces" data-needs="player.view" aria-selected="false"><span class="icon" aria-hidden="true">▣</span>Masterpieces<span id="masterpiece-count"></span></button>
|
||||
<button role="tab" data-tab="bans" data-needs="player.view" aria-selected="false"><span class="icon" aria-hidden="true">⊘</span>Bans</button>
|
||||
<button role="tab" data-tab="stats" data-needs="player.view" aria-selected="false"><span class="icon" aria-hidden="true">▤</span>Stats</button>
|
||||
<button role="tab" data-tab="mod-log" data-needs="staff.log" aria-selected="false" hidden><span class="icon" aria-hidden="true">☰</span>Mod log</button>
|
||||
<button role="tab" data-tab="review" data-needs="items.approve" aria-selected="false" hidden><span class="icon" aria-hidden="true">✔</span>Review</button>
|
||||
<button role="tab" data-tab="wear-rules" data-needs="items.restrict" aria-selected="false" hidden><span class="icon" aria-hidden="true">⚑</span>Wear rules</button>
|
||||
<button role="tab" data-tab="items" data-needs="items.create" aria-selected="false" hidden><span class="icon" aria-hidden="true">❖</span>Items</button>
|
||||
@@ -992,6 +993,17 @@
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div data-view="mod-log" hidden>
|
||||
<section>
|
||||
<h2>What staff did</h2>
|
||||
<div class="table-wrap"><table>
|
||||
<thead><tr><th>When</th><th>Who</th><th>What</th><th>Player</th><th>Detail</th></tr></thead>
|
||||
<tbody id="mod-log"></tbody>
|
||||
</table></div>
|
||||
<div class="empty" id="no-mod-log" hidden>Nothing yet.</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div data-view="bans" hidden>
|
||||
<section>
|
||||
<h2>Banned and silenced</h2>
|
||||
@@ -2961,6 +2973,19 @@
|
||||
else if (shown === "stats") {
|
||||
await window.statsView.load(api);
|
||||
}
|
||||
else if (shown === "mod-log") {
|
||||
const result = await api("modlog");
|
||||
if (result.ok) {
|
||||
$("mod-log").replaceChildren(...result.data.log.map(entry => {
|
||||
const row = el("tr");
|
||||
const detail = el("td", entry.detail);
|
||||
detail.style.whiteSpace = "normal";
|
||||
row.append(el("td", when(entry.at)), el("td", entry.by), el("td", entry.action), el("td", entry.target || "—"), detail);
|
||||
return row;
|
||||
}));
|
||||
$("no-mod-log").hidden = result.data.log.length > 0;
|
||||
}
|
||||
}
|
||||
else if (shown === "bans") {
|
||||
const [result, hits] = await Promise.all([api("bans"), api("filterhits")]);
|
||||
if (result.ok) {
|
||||
|
||||
Reference in new issue
Block a user