This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

core / appview / pages / templates / repo / pipelines / workflow.html
5.4 kB 131 lines
1{{ define "title" }}{{ .Workflow }} &middot; Pipeline {{ .Pipeline.Id }} &middot; {{ .RepoInfo.FullName }} &middot; 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 {{ $status := (index .Pipeline.Statuses .Workflow).Latest.Status }} 18 <div class="flex justify-between items-center mb-2"> 19 <button 20 class="btn group" 21 hx-post="/{{ $.RepoInfo.FullName }}/pipelines/{{ .Pipeline.Id }}/retry" 22 hx-swap="none" 23 hx-disabled-elt="this" 24 {{ if .Pipeline.InProgress -}} 25 disabled 26 {{- end }} 27 > 28 {{ i "loader-circle" "size-4 animate-spin hidden group-[.htmx-request]:inline" }} 29 <span class="group-[.htmx-request]:hidden">Retry pipeline</span> 30 </button> 31 <div class="flex items-center gap-2"> 32 <div id="workflow-error" class="text-red-500 dark:text-red-400"></div> 33 <button 34 class="btn group" 35 hx-post="/{{ $.RepoInfo.FullName }}/pipelines/{{ .Pipeline.Id }}/workflow/{{ .Workflow }}/retry" 36 hx-swap="none" 37 hx-disabled-elt="this" 38 {{ if not $status.IsFinish -}} 39 disabled 40 {{- end }} 41 > 42 {{ i "loader-circle" "size-4 animate-spin hidden group-[.htmx-request]:inline" }} 43 <span class="group-[.htmx-request]:hidden">Retry workflow</span> 44 </button> 45 <button 46 class="btn group" 47 hx-post="/{{ $.RepoInfo.FullName }}/pipelines/{{ .Pipeline.Id }}/workflow/{{ .Workflow }}/cancel" 48 hx-swap="none" 49 hx-disabled-elt="this" 50 {{ if $status.IsFinish -}} 51 disabled 52 {{- end }} 53 > 54 {{ i "loader-circle" "size-4 animate-spin hidden group-[.htmx-request]:inline" }} 55 <span class="group-[.htmx-request]:hidden">Cancel</span> 56 </button> 57 </div> 58 </div> 59 {{ end }} 60 {{ with (index .Pipeline.Statuses .Workflow).Latest }} 61 {{ if .Error }} 62 <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"> 63 {{ i "triangle-alert" "size-4 shrink-0 mt-0.5" }} 64 <div class="flex-1 min-w-0"> 65 <div class="break-words whitespace-pre-wrap">{{- .ErrorMessage -}}</div> 66 {{- with .ErrorDetails }} 67 <div class="font-mono break-words whitespace-pre-wrap">{{- . -}}</div> 68 {{- end }} 69 </div> 70 </div> 71 {{ end }} 72 {{ end }} 73 {{ block "logs" . }} {{ end }} 74 </div> 75</section> 76{{ template "fragments/workflow-timers" }} 77{{ end }} 78 79{{ define "sidebar" }} 80 {{ $active := .Workflow }} 81 82 {{ $activeTab := "bg-white dark:bg-gray-700 drop-shadow-sm" }} 83 {{ $inactiveTab := "bg-gray-100 dark:bg-gray-800" }} 84 85 {{ with .Pipeline }} 86 {{ $id := .Id }} 87 <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"> 88 {{ range $name, $all := .Statuses }} 89 <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"> 90 <div 91 class="flex gap-2 items-center justify-between p-2 {{ if eq $name $active }} {{ $activeTab }} {{ else }} {{ $inactiveTab }} {{ end }}"> 92 {{ $lastStatus := $all.Latest }} 93 {{ $kind := $lastStatus.Status.String }} 94 95 <div id="left" class="flex items-center gap-2 flex-1 min-w-0"> 96 <div id="workflow-symbol-{{ normalizeForHtmlId $name }}" class="flex-shrink-0"> 97 {{ template "repo/pipelines/fragments/workflowSymbol" $all }} 98 </div> 99 <span class="truncate" title="{{ $name }}"> 100 {{ $name }} 101 </span> 102 </div> 103 <div id="right" class="flex items-center gap-2 flex-shrink-0"> 104 <span class="font-bold">{{ $kind }}</span> 105 {{ if .TimeTaken }} 106 {{ template "repo/fragments/duration" .TimeTaken }} 107 {{ else }} 108 {{ template "repo/fragments/shortTimeAgo" $lastStatus.Created }} 109 {{ end }} 110 </div> 111 </div> 112 </a> 113 {{ end }} 114 </div> 115 {{ end }} 116{{ end }} 117 118{{ define "logs" }} 119 <div id="log-stream" 120 class="text-sm" 121 hx-ext="ws" 122 ws-connect="/{{ $.RepoInfo.FullName }}/pipelines/{{ .Pipeline.Id }}/workflow/{{ .Workflow }}/logs"> 123 <div id="lines" class="flex flex-col gap-2"> 124 <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"> 125 <span class="flex items-center gap-2"> 126 {{ i "triangle-alert" "size-4" }} No logs for this workflow 127 </span> 128 </div> 129 </div> 130 </div> 131{{ end }}