forked from tangled.org/core
Monorepo for Tangled — https://tangled.org
1{{ define "title" }} {{ .Workflow }} &middot; pipeline {{ .Pipeline.Id }} &middot; {{ .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 {{ block "logs" . }} {{ end }} 16 </div> 17</section> 18{{ template "fragments/workflow-timers" }} 19{{ end }} 20 21{{ define "sidebar" }} 22 {{ $active := .Workflow }} 23 24 {{ $activeTab := "bg-white dark:bg-gray-700 drop-shadow-sm" }} 25 {{ $inactiveTab := "bg-gray-100 dark:bg-gray-800" }} 26 27 {{ with .Pipeline }} 28 {{ $id := .Id }} 29 <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"> 30 {{ range $name, $all := .Statuses }} 31 <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"> 32 <div 33 class="flex gap-2 items-center justify-between p-2 {{ if eq $name $active }} {{ $activeTab }} {{ else }} {{ $inactiveTab }} {{ end }}"> 34 {{ $lastStatus := $all.Latest }} 35 {{ $kind := $lastStatus.Status.String }} 36 37 <div id="left" class="flex items-center gap-2 flex-shrink-0"> 38 {{ template "repo/pipelines/fragments/workflowSymbol" $all }} 39 {{ $name }} 40 </div> 41 <div id="right" class="flex items-center gap-2 flex-shrink-0"> 42 <span class="font-bold">{{ $kind }}</span> 43 {{ if .TimeTaken }} 44 {{ template "repo/fragments/duration" .TimeTaken }} 45 {{ else }} 46 {{ template "repo/fragments/shortTimeAgo" $lastStatus.Created }} 47 {{ end }} 48 </div> 49 </div> 50 </a> 51 {{ end }} 52 </div> 53 {{ end }} 54{{ end }} 55 56{{ define "logs" }} 57 <div id="log-stream" 58 class="text-sm" 59 hx-ext="ws" 60 ws-connect="/{{ $.RepoInfo.FullName }}/pipelines/{{ .Pipeline.Id }}/workflow/{{ .Workflow }}/logs"> 61 <div id="lines" class="flex flex-col gap-2"> 62 <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"> 63 <span class="flex items-center gap-2"> 64 {{ i "triangle-alert" "size-4" }} No logs for this workflow 65 </span> 66 </div> 67 </div> 68 </div> 69{{ end }}