mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-12-02 17:13:33 +01:00
fix(admin): group errors by code and service, list the routes that failed
- An issue is now one error code (or exception type) per service: one cause,
such as a rate-limit burst, hits many routes. Rows show the most frequent
route and "+N routes"; the issue page lists them with a count and a bar.
- The request header shows the viewer as a role ("Viewer: owner", "Viewer not
signed in") beside the owner chip, with a user link only for another user.
- List meta parts no longer leave a lone separator when they wrap.
- The issue page shows the 10 latest occurrences and a "Show all" button
instead of clipping the list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c91e662034
commit
d3860f29ad
11 files changed
+136
-65
No files matched your search
@@ -80,6 +80,13 @@ export function waterfall(events, issue) {
|
||||
return { rows, span: Math.round(span) };
|
||||
}
|
||||
|
||||
/** Role-only chip for the request header: the owner is already linked beside it. */
|
||||
export function viewerChip(viewer) {
|
||||
if (!viewer) return "";
|
||||
if (viewer === "visitor" || viewer === "anonymous") return "Viewer not signed in";
|
||||
return `Viewer: ${(SIGNED_IN[viewer] || viewer).toLowerCase()}`;
|
||||
}
|
||||
|
||||
/** Plain-language viewer label for #991's viewer field. */
|
||||
export function viewerLabel(viewer) {
|
||||
if (!viewer) return "";
|
||||
@@ -132,6 +139,7 @@ function installFormatters(state) {
|
||||
state.errUserHref = id => `/admin/users/id:${encodeURIComponent(id)}`;
|
||||
state.errTrendMax = trend => Math.max(1, ...(trend || [0]));
|
||||
state.viewerLabel = viewerLabel;
|
||||
state.viewerChip = viewerChip;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -182,6 +190,7 @@ export const errorsAdminController = function (state, http, location, interval)
|
||||
state.errView = "list";
|
||||
state.selectedIssue = null;
|
||||
state.missingIssue = "";
|
||||
state.showAllOccurrences = false;
|
||||
state.occurrenceIndex = -1;
|
||||
state.requestTab = "timeline";
|
||||
state.trace = null;
|
||||
@@ -266,6 +275,7 @@ export const errorsAdminController = function (state, http, location, interval)
|
||||
return;
|
||||
}
|
||||
const issue = (state.issueData?.issues || []).find(item => item.id === issueId) || null;
|
||||
if (issue?.id !== state.selectedIssue?.id) state.showAllOccurrences = false;
|
||||
state.selectedIssue = issue;
|
||||
state.missingIssue = issue || state.issueLoading ? "" : issueId;
|
||||
const index = Number.parseInt(q.occurrence, 10);
|
||||
|
||||
Reference in new issue
Block a user