mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-06 16:06:08 +02:00
fix: show activity type in ap errors acp page
This commit is contained in:
@@ -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', {
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user