diff --git a/apps/status/src/views/page.ejs b/apps/status/src/views/page.ejs index 7fabaa9..e55032b 100644 --- a/apps/status/src/views/page.ejs +++ b/apps/status/src/views/page.ejs @@ -180,6 +180,24 @@ .incident-update .body code { background: var(--bg); padding: 0.1em 0.3em; border-radius: 3px; font-size: 0.85em; } .past-incidents { margin-top: 3rem; } .past-incidents h2 { font-size: 1.1rem; margin-bottom: 1rem; } + /* Past incidents — Atlassian-style: grouped by date with light typography. */ + .past-day { margin-bottom: 2rem; } + .past-day-header { font-size: 0.95rem; font-weight: 600; color: var(--fg); padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); margin: 0 0 1rem; } + .past-day-empty { font-size: 0.85rem; color: var(--muted); margin: 0.25rem 0 0; } + .past-item { margin-bottom: 1.25rem; } + .past-item:last-child { margin-bottom: 0; } + .past-item-title { font-size: 0.95rem; font-weight: 600; color: var(--fg); margin: 0 0 0.5rem; } + .past-update { font-size: 0.8rem; line-height: 1.55; color: var(--fg); padding-left: 0.75rem; border-left: 2px solid var(--border); margin-bottom: 0.5rem; } + .past-update:last-child { margin-bottom: 0; } + .past-update-status { font-weight: 600; text-transform: capitalize; } + .past-update-status.investigating { color: var(--bar-partial); } + .past-update-status.identified { color: var(--bar-partial); } + .past-update-status.monitoring { color: var(--accent); } + .past-update-status.resolved { color: var(--bar-up); } + .past-update-body { color: var(--fg); } + .past-update-body p { display: inline; margin: 0; } + .past-update-body code { background: var(--bg); padding: 0.05em 0.3em; border-radius: 3px; font-size: 0.85em; } + .past-update-time { color: var(--muted); font-size: 0.7rem; margin-top: 0.15rem; } footer { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.8rem; text-align: center; } a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; } @@ -313,29 +331,44 @@ <% }); %> <% if (incidents.recent.length > 0) { %> + <% + // Group past incidents by their started_at date (Y-M-D in local time). + // Atlassian-style: each date is its own section, incidents listed below. + var pastByDate = {}; + var pastOrder = []; + for (var pi = 0; pi < incidents.recent.length; pi++) { + var inc = incidents.recent[pi]; + var d = new Date(inc.started_at); + var key = d.getFullYear() + '-' + (d.getMonth()+1) + '-' + d.getDate(); + if (!pastByDate[key]) { + pastByDate[key] = { date: d, items: [] }; + pastOrder.push(key); + } + pastByDate[key].items.push(inc); + } + %>

Past incidents

- <% incidents.recent.forEach(function(i) { %> -
-
<%= i.title %>
-
- <%= i.status %> - Started <%= fmtTimestamp(i.started_at) %> - <% if (i.resolved_at) { %> · Resolved <%= fmtTimestamp(i.resolved_at) %><% } %> -
- <% if (i.updates && i.updates.length > 0) { %> -
- <% i.updates.forEach(function(u) { %> -
-
- <%= u.status %> - <%= fmtTimestamp(u.created_at) %> + <% pastOrder.forEach(function(k) { + var day = pastByDate[k]; + var dateLabel = day.date.toLocaleDateString(undefined, { year: 'numeric', month: 'long', day: 'numeric' }); + %> +
+

<%= dateLabel %>

+ <% day.items.forEach(function(i) { %> +
+
<%= i.title %>
+ <% if (i.updates && i.updates.length > 0) { %> + <% i.updates.forEach(function(u) { %> +
+ <%= u.status %> + - <%~ u.body_html %> +
<%= fmtTimestamp(u.created_at) %>
-
<%~ u.body_html %>
-
- <% }); %> + <% }); %> + <% } %>
- <% } %> + <% }); %>
<% }); %>