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