Update crash group title, add stack trace drop down
This commit is contained in:
parent
aa0c47d9e7
commit
bbecd40ce9
|
|
@ -111,5 +111,6 @@ type CrashGroup struct {
|
|||
RepoName string `json:"repo_name,omitempty"`
|
||||
Fingerprint string `json:"fingerprint,omitempty"`
|
||||
OccurrenceCount uint `json:"occurrence_count,omitempty"`
|
||||
SampleTrace *string `json:"sample_trace,omitempty"`
|
||||
ForgejoIssueURL *string `json:"forgejo_issue_url,omitempty"`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,6 +123,14 @@ func (h *IngestHandler) Create(c *gin.Context) {
|
|||
if len(result.Frames) > 0 && strings.TrimSpace(result.Frames[0].Function) != "" {
|
||||
title = req.Type + ": " + result.Frames[0].Function
|
||||
}
|
||||
shortFP := result.Fingerprint
|
||||
if len(shortFP) > 8 {
|
||||
shortFP = shortFP[:8]
|
||||
}
|
||||
if req.CrashMessage != "" {
|
||||
title += " — " + req.CrashMessage
|
||||
}
|
||||
title += " [" + shortFP + "]"
|
||||
group, groupErr := models.CreateCrashGroup(ctx, h.DB, sig.ID, repo.ID, title)
|
||||
if groupErr == nil && h.ForgejoSync != nil {
|
||||
_ = h.ForgejoSync.CreateIssueForCrashGroup(ctx, group, req.StackTrace)
|
||||
|
|
|
|||
|
|
@ -117,6 +117,7 @@ func enrichCrashGroup(ctx context.Context, db *gorm.DB, model CrashGroup) (*cair
|
|||
group.RepoName = repo.Name
|
||||
group.Fingerprint = sig.Fingerprint
|
||||
group.OccurrenceCount = sig.OccurrenceCount
|
||||
group.SampleTrace = sig.SampleTrace
|
||||
return &group, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -445,6 +445,12 @@ code {
|
|||
box-shadow: 0 0 10px var(--accent-glow-soft);
|
||||
}
|
||||
|
||||
/* ======= CRASH GROUP LIST ======= */
|
||||
.crashgroup-row { cursor: pointer; }
|
||||
.trace-row td { padding: 0 !important; border-bottom: 1px solid var(--border); }
|
||||
.trace-row .code-block { margin: 0.5rem 0.75rem; max-height: 300px; overflow-y: auto; }
|
||||
.trace-row:hover td { background: none; box-shadow: none; }
|
||||
|
||||
/* ======= CRASH GROUP DETAIL ======= */
|
||||
.crashgroup-title {
|
||||
font-family: var(--font-heading);
|
||||
|
|
|
|||
|
|
@ -19,18 +19,34 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
{{range .CrashGroups}}
|
||||
<tr>
|
||||
<tr class="crashgroup-row" onclick="toggleTrace(this)">
|
||||
<td><span class="badge badge-status-{{.Status}}">{{.Status}}</span></td>
|
||||
<td>{{.Title}}</td>
|
||||
<td>{{.RepoName}}</td>
|
||||
<td>{{.OccurrenceCount}}</td>
|
||||
<td>{{timeAgo .FirstSeenAt}}</td>
|
||||
<td>{{timeAgo .LastSeenAt}}</td>
|
||||
<td><a href="/crashgroups/{{.ID}}" class="btn btn-sm">View</a></td>
|
||||
<td><a href="/crashgroups/{{.ID}}" class="btn btn-sm" onclick="event.stopPropagation()">View</a></td>
|
||||
</tr>
|
||||
{{if .SampleTrace}}
|
||||
<tr class="trace-row" style="display: none;">
|
||||
<td colspan="7">
|
||||
<div class="code-block">{{.SampleTrace}}</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
function toggleTrace(row) {
|
||||
var traceRow = row.nextElementSibling;
|
||||
if (traceRow && traceRow.classList.contains('trace-row')) {
|
||||
traceRow.style.display = traceRow.style.display === 'none' ? '' : 'none';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{{else}}
|
||||
<p class="empty-state">No crash groups yet. Crash groups are created automatically when artifacts with stack traces are uploaded.</p>
|
||||
{{end}}
|
||||
|
|
|
|||
Loading…
Reference in New Issue