Signed-off-by: brookjeynes me@brookjeynes.dev
+8
-9
internal/server/views/partials/horizonal-bar-chart.templ
+8
-9
internal/server/views/partials/horizonal-bar-chart.templ
···
11
<div class="flex flex-col gap-3 px-6">
12
for _, item := range params.Data {
13
{{
14
-
widthPercentage := 0.0
15
-
if item.MaxValue > 0 {
16
-
widthPercentage = (item.Value.Seconds() / item.MaxValue.Seconds()) * 100
17
-
}
18
}}
19
<div class="flex items-center gap-2 text-sm">
20
<span title={ item.Label } class="w-28 truncate text-right">{ item.Label }</span>
21
<div class="flex-grow bg-gray-light rounded-md h-6">
22
-
<div
23
-
class="bg-primary h-6 rounded-md"
24
-
style={ fmt.Sprintf("width: %.2f%%", widthPercentage) }
25
-
></div>
26
</div>
27
-
<span class="w-12 font-medium text-text-muted">{ item.Value }</span>
28
</div>
29
}
30
</div>
···
11
<div class="flex flex-col gap-3 px-6">
12
for _, item := range params.Data {
13
{{
14
+
widthPercentage := 0.0
15
+
if item.MaxValue > 0 {
16
+
widthPercentage = (item.Value.Seconds() / item.MaxValue.Seconds()) * 100
17
+
}
18
}}
19
<div class="flex items-center gap-2 text-sm">
20
<span title={ item.Label } class="w-28 truncate text-right">{ item.Label }</span>
21
<div class="flex-grow bg-gray-light rounded-md h-6">
22
+
<div class="bg-primary h-6 rounded-md" style={ fmt.Sprintf("width: %.2f%%", widthPercentage) }></div>
23
</div>
24
+
<span title={ item.Value } class="w-12 font-medium text-text-muted text-nowrap">
25
+
{ FormatDuration(item.Value) }
26
+
</span>
27
</div>
28
}
29
</div>
History
1 round
0 comments
brookjeynes.dev
submitted
#0
1 commit
expand
collapse
feat(views/stats): update duration numbers to be more human readable
Signed-off-by: brookjeynes <me@brookjeynes.dev>
expand 0 comments
pull request successfully merged