A vibe coded tangled fork which supports pijul.
at ef3dbf02ea0d133dffb20583ac15c761951b9c8f 160 lines 6.3 kB view raw
1{{ define "title" }}pipelines &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 {{ $active := "all" }} 11 {{ if .FilteringByPush }} 12 {{ $active = "push" }} 13 {{ else if .FilteringByPR }} 14 {{ $active = "pr" }} 15 {{ end }} 16 17 {{ $all := 18 (dict 19 "Key" "all" 20 "Value" "all" 21 "Icon" "package" 22 "Meta" "") }} 23 {{ $push := 24 (dict 25 "Key" "push" 26 "Value" "push" 27 "Icon" "git-commit-horizontal" 28 "Meta" "") }} 29 {{ $pr := 30 (dict 31 "Key" "pr" 32 "Value" "pull request" 33 "Icon" "git-pull-request" 34 "Meta" "") }} 35 {{ $values := list $all $push $pr }} 36 37 <div class="flex justify-between items-center gap-4"> 38 <div> 39 {{ template "fragments/tabSelector" (dict "Name" "trigger" "Values" $values "Active" $active) }} 40 </div> 41 <div class="text-sm text-gray-600 dark:text-gray-400"> 42 {{ len .Pipelines }} pipeline run{{ if ne (len .Pipelines) 1 }}s{{ end }} 43 </div> 44 </div> 45{{ end }} 46 47{{ define "repoAfter" }} 48{{ if .Pipelines }} 49 <div class="flex flex-col gap-2 mt-2"> 50 {{ range .Pipelines }} 51 {{ template "pipelineCard" (dict "Root" $ "Pipeline" .) }} 52 {{ end }} 53 </div> 54{{ else }} 55 <div class="mt-2 py-12 flex flex-col items-center justify-center gap-6 text-center border border-gray-200 dark:border-gray-700 rounded bg-gray-50 dark:bg-gray-900"> 56 <div class="flex justify-center"> 57 {{ i "package" "size-16 text-gray-300 dark:text-gray-700" }} 58 </div> 59 60 <div class="flex flex-col gap-2"> 61 <p class="text-lg font-semibold dark:text-white"> 62 No pipelines have been run yet 63 </p> 64 <p class="text-sm text-gray-600 dark:text-gray-400 max-w-md"> 65 Get started by configuring CI/CD for this repository 66 </p> 67 </div> 68 69 <div class="flex flex-col gap-3 text-left max-w-md"> 70 <div class="flex items-start gap-3"> 71 <span class="mt-0.5 text-xs bg-gray-200 dark:bg-gray-700 rounded-full size-6 flex items-center justify-center font-semibold shrink-0">1</span> 72 <p class="text-sm text-gray-700 dark:text-gray-300"> 73 Choose a spindle in your 74 <a href="/{{ .RepoInfo.FullName }}/settings?tab=pipelines" class="underline hover:no-underline">repository settings</a> 75 </p> 76 </div> 77 <div class="flex items-start gap-3"> 78 <span class="mt-0.5 text-xs bg-gray-200 dark:bg-gray-700 rounded-full size-6 flex items-center justify-center font-semibold shrink-0">2</span> 79 <p class="text-sm text-gray-700 dark:text-gray-300"> 80 Configure your CI/CD 81 <a href="https://docs.tangled.org/spindles.html#pipelines" class="underline hover:no-underline" target="_blank" rel="noopener">pipeline</a> 82 </p> 83 </div> 84 <div class="flex items-start gap-3"> 85 <span class="mt-0.5 text-xs bg-gray-200 dark:bg-gray-700 rounded-full size-6 flex items-center justify-center font-semibold shrink-0">3</span> 86 <p class="text-sm text-gray-700 dark:text-gray-300"> 87 Trigger a workflow with a push or pull request 88 </p> 89 </div> 90 </div> 91 </div> 92{{ end }} 93{{ end }} 94 95{{ define "pipelineCard" }} 96 {{ $root := .Root }} 97 {{ $p := .Pipeline }} 98 {{ with $p }} 99 <div class="relative rounded drop-shadow-sm bg-white px-6 py-4 dark:bg-gray-800"> 100 <div class="grid grid-cols-[1fr_auto] md:grid-cols-[1fr_auto_9rem_7rem] gap-3 md:gap-4 items-start md:items-center"> 101 <!-- Trigger info --> 102 <div class="flex items-center gap-2 flex-wrap"> 103 {{ $target := .Trigger.TargetRef }} 104 {{ $workflows := .Workflows }} 105 106 <!-- Status icon with tooltip --> 107 <span class="relative z-50 mr-4"> 108 {{ template "repo/pipelines/fragments/pipelineSymbolLong" (dict "Pipeline" . "RepoInfo" $root.RepoInfo) }} 109 </span> 110 111 {{ if .IsResponding }} 112 <a href="/{{ $root.RepoInfo.FullName }}/pipelines/{{ .Id }}/workflow/{{ index $workflows 0 }}" class="flex items-center gap-2 flex-wrap no-underline hover:underline"> 113 {{ end }} 114 {{ if .Trigger.IsPush }} 115 {{ i "git-commit-horizontal" "size-4 text-gray-500 dark:text-gray-400 shrink-0" }} 116 <span class="text-sm text-gray-600 dark:text-gray-400">Push to</span> 117 <span class="font-semibold dark:text-white">{{ $target }}</span> 118 {{ else if .Trigger.IsPullRequest }} 119 {{ i "git-pull-request" "size-4 text-gray-500 dark:text-gray-400 shrink-0" }} 120 <span class="text-sm text-gray-600 dark:text-gray-400">Pull request</span> 121 <span class="font-semibold dark:text-white">{{ $target }}</span> 122 {{ i "arrow-left" "size-3 text-gray-500 dark:text-gray-400" }} 123 <span class="font-semibold dark:text-white">{{ .Trigger.PRSourceBranch }}</span> 124 {{ end }} 125 {{ if .IsResponding }} 126 </a> 127 {{ end }} 128 </div> 129 130 <!-- Metadata stacked on mobile, separate columns on desktop --> 131 <div class="flex flex-col gap-2 items-end md:contents"> 132 <!-- Commit SHA --> 133 <div class="font-mono text-xs text-gray-500 dark:text-gray-400"> 134 <a href="/{{ $root.RepoInfo.FullName }}/commit/{{ .Sha }}" class="text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-900 no-underline hover:underline px-2 py-1 rounded"> 135 {{ slice .Sha 0 8 }} 136 </a> 137 </div> 138 139 <!-- Time --> 140 <div class="text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap text-right"> 141 {{ template "repo/fragments/time" .Created }} 142 </div> 143 144 <!-- Duration --> 145 <div class="text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap text-right"> 146 {{ $t := .TimeTaken }} 147 {{ if $t }} 148 <span class="flex items-center gap-1"> 149 {{ i "clock" "size-3" }} 150 <time title="{{ $t }}">{{ $t | durationFmt }}</time> 151 </span> 152 {{ else }} 153 <span class="text-gray-400 dark:text-gray-600">--</span> 154 {{ end }} 155 </div> 156 </div> 157 </div> 158 </div> 159 {{ end }} 160{{ end }}