This repository has no description
1{{ define "title" }}{{ .Workflow }} · Pipeline {{ .Pipeline.Id }} · {{ .RepoInfo.FullName }} · Tangled{{ end }}
2
3{{ define "extrameta" }}
4 {{ $title := "Pipelines"}}
5 {{ $url := printf "https://tangled.org/%s/pipelines" .RepoInfo.FullName }}
6 {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo "Title" $title "Url" $url) }}
7{{ end }}
8
9{{ define "repoContent" }}
10<section class="w-full grid grid-cols-1 md:grid-cols-4 gap-2 mt-2">
11 <div class="col-span-1">
12 {{ block "sidebar" . }} {{ end }}
13 </div>
14 <div class="col-span-1 md:col-span-3">
15 <!-- TODO(boltless): explicitly check for pipeline cancel permission -->
16 {{ if $.RepoInfo.Roles.IsOwner }}
17 <div class="flex justify-between mb-2">
18 <div id="workflow-error" class="text-red-500 dark:text-red-400"></div>
19 <button
20 class="btn"
21 hx-post="/{{ $.RepoInfo.FullName }}/pipelines/{{ .Pipeline.Id }}/workflow/{{ .Workflow }}/cancel"
22 hx-swap="none"
23 {{ if (index .Pipeline.Statuses .Workflow).Latest.Status.IsFinish -}}
24 disabled
25 {{- end }}
26 >Cancel</button>
27 </div>
28 {{ end }}
29 {{ with (index .Pipeline.Statuses .Workflow).Latest }}
30 {{ if .Error }}
31 <div class="mb-2 flex items-start gap-2 p-3 rounded border border-red-200 dark:border-red-900/60 bg-red-50/60 dark:bg-red-950/20 text-red-700 dark:text-red-400 text-sm">
32 {{ i "triangle-alert" "size-4 shrink-0 mt-0.5" }}
33 <div class="flex-1 min-w-0">
34 <div class="break-words whitespace-pre-wrap">{{- .ErrorMessage -}}</div>
35 {{- with .ErrorDetails }}
36 <div class="font-mono break-words whitespace-pre-wrap">{{- . -}}</div>
37 {{- end }}
38 </div>
39 </div>
40 {{ end }}
41 {{ end }}
42 {{ block "logs" . }} {{ end }}
43 </div>
44</section>
45{{ template "fragments/workflow-timers" }}
46{{ end }}
47
48{{ define "sidebar" }}
49 {{ $active := .Workflow }}
50
51 {{ $activeTab := "bg-white dark:bg-gray-700 drop-shadow-sm" }}
52 {{ $inactiveTab := "bg-gray-100 dark:bg-gray-800" }}
53
54 {{ with .Pipeline }}
55 {{ $id := .Id }}
56 <div class="sticky top-2 grid grid-cols-1 rounded border border-gray-200 dark:border-gray-700 divide-y divide-gray-200 dark:divide-gray-700">
57 {{ range $name, $all := .Statuses }}
58 <a href="/{{ $.RepoInfo.FullName }}/pipelines/{{ $id }}/workflow/{{ $name }}" class="no-underline hover:no-underline hover:bg-gray-100/25 hover:dark:bg-gray-700/25">
59 <div
60 class="flex gap-2 items-center justify-between p-2 {{ if eq $name $active }} {{ $activeTab }} {{ else }} {{ $inactiveTab }} {{ end }}">
61 {{ $lastStatus := $all.Latest }}
62 {{ $kind := $lastStatus.Status.String }}
63
64 <div id="left" class="flex items-center gap-2 flex-1 min-w-0">
65 <div id="workflow-symbol-{{ normalizeForHtmlId $name }}" class="flex-shrink-0">
66 {{ template "repo/pipelines/fragments/workflowSymbol" $all }}
67 </div>
68 <span class="truncate" title="{{ $name }}">
69 {{ $name }}
70 </span>
71 </div>
72 <div id="right" class="flex items-center gap-2 flex-shrink-0">
73 <span class="font-bold">{{ $kind }}</span>
74 {{ if .TimeTaken }}
75 {{ template "repo/fragments/duration" .TimeTaken }}
76 {{ else }}
77 {{ template "repo/fragments/shortTimeAgo" $lastStatus.Created }}
78 {{ end }}
79 </div>
80 </div>
81 </a>
82 {{ end }}
83 </div>
84 {{ end }}
85{{ end }}
86
87{{ define "logs" }}
88 <div id="log-stream"
89 class="text-sm"
90 hx-ext="ws"
91 ws-connect="/{{ $.RepoInfo.FullName }}/pipelines/{{ .Pipeline.Id }}/workflow/{{ .Workflow }}/logs">
92 <div id="lines" class="flex flex-col gap-2">
93 <div class="text-base text-gray-500 flex items-center justify-center italic p-12 only:flex hidden border border-gray-200 dark:border-gray-700 rounded">
94 <span class="flex items-center gap-2">
95 {{ i "triangle-alert" "size-4" }} No logs for this workflow
96 </span>
97 </div>
98 </div>
99 </div>
100{{ end }}