Files
gitea/templates/repo/actions/sidebar.tmpl
T
3875db1974 feat(actions): add build queue view (#38585)
Adds a read-only Actions job queue: running jobs first, then waiting
jobs in the order a runner picks them up. It is shown instance-wide in
the admin Actions section with owner, repository and status filters, and
per repository in the Actions tab. Both lists refresh in place.

Pending work is currently only visible per repository and newest-first,
so nothing shows what is queued, in which order, or what occupies the
runners. Reordering the queue will be proposed separately.

A migration adds indexes for the runner pickup query and
repository-scoped status lookups.

* Fix #34198

<img width="1345" height="451" alt="image"
src="https://github.com/user-attachments/assets/7d52ff76-81b4-44e8-b583-d7d89c9dffcd"
/>
<img width="1809" height="1134" alt="image"
src="https://github.com/user-attachments/assets/4d56c0cb-bae7-4ce2-8f3c-75163b2bc7f4"
/>

---------

Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-09-26 08:01:41 +00:00

64 lines
3.4 KiB
Handlebars

<div class="flex-container-nav">
<div class="ui fluid vertical menu">
<a class="item {{if and (not $.CurWorkflow) (not $.PageIsActionsJobQueue)}}active{{end}}" href="{{$.RepoLink}}/actions?actor={{$.CurActor}}&status={{$.CurStatus}}&branch={{$.CurBranch}}">{{ctx.Locale.Tr "actions.runs.all_workflows"}}</a>
{{range .workflows}}
<a class="item flex-text-block {{if and (eq .EntryName $.CurWorkflow) (not $.CurWorkflowScopedRepoID)}}active{{end}}" href="{{$.RepoLink}}/actions?workflow={{.EntryName}}&actor={{$.CurActor}}&status={{$.CurStatus}}&branch={{$.CurBranch}}">
<span class="gt-ellipsis" data-tooltip-content="{{.DisplayName}}">{{.DisplayName}}</span>
{{if .ErrMsg}}
<span class="flex-text-inline tw-shrink-0" data-tooltip-content="{{.ErrMsg}}">{{svg "octicon-alert" 16 "tw-text-red"}}</span>
{{end}}
{{if $.ActionsConfig.IsWorkflowDisabled .EntryName}}
<div class="ui red label tw-shrink-0">{{ctx.Locale.Tr "disabled"}}</div>
{{end}}
</a>
{{end}}
{{range .ScopedWorkflowGroups}}
<details class="item scoped-workflow-group"{{if .IsActive}} open{{end}}>
<summary>
<span class="gt-ellipsis tw-min-w-0" data-tooltip-content="{{.SourceRepoName}}">{{if .FromInstance}}{{.SourceRepoName}}{{else}}{{.SourceRepoShortName}}{{end}}</span>
<span class="ui label">{{if .FromInstance}}{{ctx.Locale.Tr "actions.workflow.scope_global"}}{{else}}{{ctx.Locale.Tr "actions.workflow.scope_owner"}}{{end}}</span>
</summary>
{{range .Workflows}}
<a class="item flex-text-block {{if and (eq .EntryName $.CurWorkflow) (eq .SourceRepoID $.CurWorkflowScopedRepoID)}}active{{end}}" href="{{$.RepoLink}}/actions?workflow={{.EntryName}}&scoped_workflow_source_repo_id={{.SourceRepoID}}&actor={{$.CurActor}}&status={{$.CurStatus}}&branch={{$.CurBranch}}">
<span class="gt-ellipsis tw-min-w-0" data-tooltip-content="{{.EntryName}}">{{.DisplayName}}</span>
{{if .Required}}
<span class="ui label">{{ctx.Locale.Tr "actions.workflow.required"}}</span>
{{else if .Disabled}}
<span class="ui red label">{{ctx.Locale.Tr "disabled"}}</span>
{{end}}
</a>
{{end}}
</details>
{{end}}
{{if .OtherWorkflows}}
<details class="item"{{if not $.CurWorkflowIsListed}} open{{end}}>
<summary data-tooltip-content="{{ctx.Locale.Tr "actions.runs.other_workflows_tooltip"}}">
<span class="flex-text-block">
{{ctx.Locale.Tr "actions.runs.other_workflows"}}
<span class="ui label">{{len .OtherWorkflows}}</span>
</span>
</summary>
<div class="menu items-full-width">
{{range .OtherWorkflows}}
<a class="item {{if eq . $.CurWorkflow}}active{{end}}" href="{{$.RepoLink}}/actions?workflow={{.}}&actor={{$.CurActor}}&status={{$.CurStatus}}">
<span class="gt-ellipsis" data-tooltip-content="{{.}}">{{.}}</span>
</a>
{{end}}
</div>
</details>
{{end}}
</div>
<div class="ui fluid secondary vertical menu flex-items-block">
{{/* At the moment, the "job queue" page is view-only, it doesn't really do any management.
GitHub has a similar menu section which contains "cache management" and more, so this section is designed for the future */}}
<div>{{ctx.Locale.Tr "actions.management"}}</div>
<a class="item {{if $.PageIsActionsJobQueue}}active{{end}}" href="{{$.RepoLink}}/actions/job_queue">
{{svg "octicon-list-ordered"}}
<span class="gt-ellipsis">{{ctx.Locale.Tr "actions.job_queue.title"}}</span>
</a>
</div>
</div>