fix: show activity type in ap errors acp page

This commit is contained in:
Julian Lam
2026-04-16 13:35:38 -04:00
parent 3b33680736
commit 3098836d3c
2 changed files with 6 additions and 2 deletions

View File

@@ -117,17 +117,20 @@ federationController.errors = async function (req, res) {
return null;
}
let { type, body, stack } = errorObj[idx];
let activityType;
let hostname = 'Invalid hostname';
const timestampISO = new Date(timestamp).toISOString();
try {
body = JSON.stringify(JSON.parse(body), null, 4);
const parsed = JSON.parse(body);
({ type: activityType } = parsed);
body = JSON.stringify(parsed, null, 4);
stack = validator.escape(stack.replace(/\s+$/gm, ''));
({ hostname } = new URL(id));
} catch (e) {
// noop
}
return { id, type, body, stack, hostname, timestamp, timestampISO };
return { id, type, activityType, body, stack, hostname, timestamp, timestampISO };
}).filter(Boolean);
res.render('admin/federation/errors', {

View File

@@ -13,6 +13,7 @@
<summary>
<span title="{./timestampISO}" class="timeago text-secondary text-sm"></span>
<span class="badge text-bg-primary">{{{ if (./type == "in") }}}IN{{{ else }}}OUT{{{ end }}}</span>
<span class="badge text-bg-secondary">{./activityType}</span>
<br/ >
<code>{./id}</code>
</summary>