A vibe coded tangled fork which supports pijul.
1{{ define "repo/pipelines/fragments/pipelineSymbol" }}
2 <div class="cursor-pointer">
3 {{ $c := .Counts }}
4 {{ $statuses := .Statuses }}
5 {{ $total := len $statuses }}
6 {{ $success := index $c "success" }}
7 {{ $allPass := eq $success $total }}
8
9 {{ if $allPass }}
10 <div class="flex gap-1 items-center">
11 {{ i "check" "size-4 text-green-600 dark:text-green-400 " }}
12 <span>{{ $total }}/{{ $total }}</span>
13 </div>
14 {{ else }}
15 {{ $radius := f64 8 }}
16 {{ $circumference := mulf64 2.0 (mulf64 3.1416 $radius) }}
17 {{ $offset := 0.0 }}
18 <div class="flex gap-1 items-center">
19 <svg class="w-4 h-4 transform -rotate-90" viewBox="0 0 20 20">
20 <circle cx="10" cy="10" r="{{ $radius }}" fill="none" stroke="#f3f4f633" stroke-width="2"/>
21
22 {{ range $kind, $count := $c }}
23 {{ $color := "" }}
24 {{ if or (eq $kind "pending") (eq $kind "running") }}
25 {{ $color = "#eab308" }}
26 {{ else if eq $kind "success" }}
27 {{ $color = "#10b981" }}
28 {{ else if eq $kind "cancelled" }}
29 {{ $color = "#6b7280" }}
30 {{ else }}
31 {{ $color = "#ef4444" }}
32 {{ end }}
33
34 {{ $percent := divf64 (f64 $count) (f64 $total) }}
35 {{ $length := mulf64 $percent $circumference }}
36
37 <circle
38 cx="10" cy="10" r="{{ $radius }}"
39 fill="none"
40 stroke="{{ $color }}"
41 stroke-width="2"
42 stroke-dasharray="{{ printf "%.2f %.2f" $length (subf64 $circumference $length) }}"
43 stroke-dashoffset="{{ printf "%.2f" (negf64 $offset) }}"
44 />
45 {{ $offset = addf64 $offset $length }}
46 {{ end }}
47 </svg>
48 <span>{{ $success }}/{{ $total }}</span>
49 </div>
50 {{ end }}
51 </div>
52{{ end }}
53