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