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 <span class="font-mono break-words whitespace-pre-wrap">{{- .Error -}}</span>
34 </div>
35 {{ end }}
36 {{ end }}
37 {{ block "logs" . }} {{ end }}
38 </div>
39</section>
40{{ template "fragments/workflow-timers" }}
41{{ end }}
42
43{{ define "sidebar" }}
44 {{ $active := .Workflow }}
45
46 {{ $activeTab := "bg-white dark:bg-gray-700 drop-shadow-sm" }}
47 {{ $inactiveTab := "bg-gray-100 dark:bg-gray-800" }}
48
49 {{ with .Pipeline }}
50 {{ $id := .Id }}
51 <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">
52 {{ range $name, $all := .Statuses }}
53 <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">
54 <div
55 class="flex gap-2 items-center justify-between p-2 {{ if eq $name $active }} {{ $activeTab }} {{ else }} {{ $inactiveTab }} {{ end }}">
56 {{ $lastStatus := $all.Latest }}
57 {{ $kind := $lastStatus.Status.String }}
58
59 <div id="left" class="flex items-center gap-2 flex-1 min-w-0">
60 <div id="workflow-symbol-{{ normalizeForHtmlId $name }}" class="flex-shrink-0">
61 {{ template "repo/pipelines/fragments/workflowSymbol" $all }}
62 </div>
63 <span class="truncate" title="{{ $name }}">
64 {{ $name }}
65 </span>
66 </div>
67 <div id="right" class="flex items-center gap-2 flex-shrink-0">
68 <span class="font-bold">{{ $kind }}</span>
69 {{ if .TimeTaken }}
70 {{ template "repo/fragments/duration" .TimeTaken }}
71 {{ else }}
72 {{ template "repo/fragments/shortTimeAgo" $lastStatus.Created }}
73 {{ end }}
74 </div>
75 </div>
76 </a>
77 {{ end }}
78 </div>
79 {{ end }}
80{{ end }}
81
82{{ define "logs" }}
83 <div id="log-stream"
84 class="text-sm"
85 hx-ext="ws"
86 ws-connect="/{{ $.RepoInfo.FullName }}/pipelines/{{ .Pipeline.Id }}/workflow/{{ .Workflow }}/logs">
87 <div id="lines" class="flex flex-col gap-2">
88 <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">
89 <span class="flex items-center gap-2">
90 {{ i "triangle-alert" "size-4" }} No logs for this workflow
91 </span>
92 </div>
93 </div>
94 </div>
95{{ end }}