aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2025-08-06 11:19:56 +0200
committerAleksandr Nogikh <nogikh@google.com>2025-08-07 09:24:57 +0000
commitc03873ec186a3b88b345caaa713a57c5f6ea9c9b (patch)
tree8cba7dc1736e086f2697535ff432e6aef9a0118d /pkg
parent3ba98b073d93c50bf808f43b482702184f6da7c5 (diff)
pkg/manager: embed BugInfo into UICrashType
This reduces the redundancy a bit.
Diffstat (limited to 'pkg')
-rw-r--r--pkg/manager/html/crash.html2
-rw-r--r--pkg/manager/html/main.html8
-rw-r--r--pkg/manager/http.go32
3 files changed, 15 insertions, 27 deletions
diff --git a/pkg/manager/html/crash.html b/pkg/manager/html/crash.html
index 48c50ab71..85e2e7619 100644
--- a/pkg/manager/html/crash.html
+++ b/pkg/manager/html/crash.html
@@ -3,7 +3,7 @@ Copyright 2024 syzkaller project authors. All rights reserved.
Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
*/}}
-<b>{{.Description}}</b>
+<b>{{.Title}}</b>
{{if .Triaged}}
Report: <a href="/report?id={{.ID}}">{{.Triaged}}</a>
diff --git a/pkg/manager/html/main.html b/pkg/manager/html/main.html
index eb3644bba..d034fdded 100644
--- a/pkg/manager/html/main.html
+++ b/pkg/manager/html/main.html
@@ -30,8 +30,8 @@ Use of this source code is governed by Apache 2 LICENSE that can be found in the
</tr>
{{range $c := $.Crashes}}
<tr>
- <td class="title"><a href="/crash?id={{$c.ID}}">{{$c.Description}}</a></td>
- <td class="stat {{if not $c.Active}}inactive{{end}}">{{$c.Count}}</td>
+ <td class="title"><a href="/crash?id={{$c.ID}}">{{$c.Title}}</a></td>
+ <td class="stat {{if not $c.Active}}inactive{{end}}">{{len $c.Crashes}}</td>
<td class="time {{if not $c.New}}inactive{{end}}">{{formatTime $c.FirstTime}}</td>
<td class="time {{if not $c.Active}}inactive{{end}}">{{formatTime $c.LastTime}}</td>
<td>
@@ -39,8 +39,8 @@ Use of this source code is governed by Apache 2 LICENSE that can be found in the
{{if $c.Triaged}}
<a href="/report?id={{$c.ID}}">{{$c.Triaged}}</a>
{{end}}
- {{if $c.Strace}}
- <a href="/file?name={{$c.Strace}}">Strace</a>
+ {{if $c.StraceFile}}
+ <a href="/file?name={{$c.StraceFile}}">Strace</a>
{{end}}
</td>
</tr>
diff --git a/pkg/manager/http.go b/pkg/manager/http.go
index 3e7ba6fcf..e6a7d6b46 100644
--- a/pkg/manager/http.go
+++ b/pkg/manager/http.go
@@ -355,17 +355,11 @@ func makeUICrashType(info *BugInfo, startTime time.Time, repros map[string]bool)
triaged := reproStatus(info.HasRepro, info.HasCRepro, repros[info.Title],
info.ReproAttempts >= MaxReproAttempts)
return UICrashType{
- Description: info.Title,
- FirstTime: info.FirstTime,
- LastTime: info.LastTime,
- New: info.FirstTime.After(startTime),
- Active: info.LastTime.After(startTime),
- ID: info.ID,
- Count: len(info.Crashes),
- Triaged: triaged,
- Strace: info.StraceFile,
- Crashes: crashes,
- ReproAttempts: info.ReproAttempts,
+ BugInfo: *info,
+ New: info.FirstTime.After(startTime),
+ Active: info.LastTime.After(startTime),
+ Triaged: triaged,
+ Crashes: crashes,
}
}
@@ -1029,17 +1023,11 @@ type UICrashPage struct {
}
type UICrashType struct {
- Description string
- FirstTime time.Time
- LastTime time.Time
- New bool // was first found in the current run
- Active bool // was found in the current run
- ID string
- Count int
- Triaged string
- Strace string
- ReproAttempts int
- Crashes []UICrash
+ BugInfo
+ New bool // was first found in the current run
+ Active bool // was found in the current run
+ Triaged string
+ Crashes []UICrash
}
type UICrash struct {