mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-23 19:47:07 +09:00
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>
164 lines
7.4 KiB
Handlebars
164 lines
7.4 KiB
Handlebars
{{template "base/head" .}}
|
|
|
|
{{$showCreateWorkflowBadge := Iif .WorkflowBadge true false}}
|
|
{{$showEnableDisableWorkflow := and .AllowDisableOrEnableWorkflow .CurWorkflowIsListed $.CurWorkflow}}
|
|
|
|
<div class="page-content repository actions">
|
|
{{template "repo/header" .}}
|
|
<div class="ui container">
|
|
{{template "base/alert" .}}
|
|
|
|
{{if .HasWorkflowsOrRuns}}
|
|
<div class="flex-container">
|
|
{{template "repo/actions/sidebar" .}}
|
|
<div class="flex-container-main">
|
|
<div class="ui top attached header flex-left-right">
|
|
<strong>{{ctx.Locale.TrN .Page.Paginator.Total "actions.runs.workflow_run_count_1" "actions.runs.workflow_run_count_n" .Page.Paginator.Total}}</strong>
|
|
<div class="ui secondary filter menu flex-text-block tw-m-0">
|
|
<!-- Actor -->
|
|
<div class="ui{{if not .Actors}} disabled{{end}} dropdown jump item">
|
|
<span class="text">{{ctx.Locale.Tr "actions.runs.actor"}}</span>
|
|
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
|
<div class="menu">
|
|
<div class="ui icon search input">
|
|
<i class="icon">{{svg "octicon-search"}}</i>
|
|
<input type="text" placeholder="{{ctx.Locale.Tr "actions.runs.actor"}}">
|
|
</div>
|
|
<a class="item{{if not $.CurActor}} selected{{end}}" href="?workflow={{$.CurWorkflow}}&scoped_workflow_source_repo_id={{$.CurWorkflowRepoID}}&status={{$.CurStatus}}&branch={{$.CurBranch}}&actor=0">
|
|
{{ctx.Locale.Tr "actions.runs.actors_no_select"}}
|
|
</a>
|
|
{{range .Actors}}
|
|
<a class="item{{if eq .ID $.CurActor}} selected{{end}}" href="?workflow={{$.CurWorkflow}}&scoped_workflow_source_repo_id={{$.CurWorkflowRepoID}}&actor={{.ID}}&status={{$.CurStatus}}&branch={{$.CurBranch}}">
|
|
{{ctx.AvatarUtils.Avatar . 20}} {{.GetDisplayName}}
|
|
</a>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
<!-- Status -->
|
|
<div class="ui dropdown jump item">
|
|
<span class="text">{{ctx.Locale.Tr "actions.runs.status"}}</span>
|
|
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
|
<div class="menu">
|
|
<div class="ui icon search input">
|
|
<i class="icon">{{svg "octicon-search"}}</i>
|
|
<input type="text" placeholder="{{ctx.Locale.Tr "actions.runs.status"}}">
|
|
</div>
|
|
<a class="item{{if not $.CurStatus}} selected{{end}}" href="?workflow={{$.CurWorkflow}}&scoped_workflow_source_repo_id={{$.CurWorkflowRepoID}}&actor={{$.CurActor}}&branch={{$.CurBranch}}&status=0">
|
|
{{ctx.Locale.Tr "actions.runs.status_no_select"}}
|
|
</a>
|
|
{{range .StatusInfoList}}
|
|
<a class="item{{if eq .Status $.CurStatus}} selected{{end}}" href="?workflow={{$.CurWorkflow}}&scoped_workflow_source_repo_id={{$.CurWorkflowRepoID}}&actor={{$.CurActor}}&status={{.Status}}&branch={{$.CurBranch}}">
|
|
<span class="flex-text-inline tw-gap-2">
|
|
{{template "repo/icons/action_status" (dict "Status" .StatusName)}}
|
|
{{.DisplayedStatus}}
|
|
</span>
|
|
</a>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
<!-- Branch -->
|
|
<div class="ui{{if not .RunBranches}} disabled{{end}} dropdown jump item" data-test-id="filter-branch">
|
|
<span class="text">{{ctx.Locale.Tr "actions.runs.branch"}}</span>
|
|
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
|
<div class="menu">
|
|
<div class="ui icon search input">
|
|
<i class="icon">{{svg "octicon-search"}}</i>
|
|
<input type="text" placeholder="{{ctx.Locale.Tr "actions.runs.branch"}}">
|
|
</div>
|
|
<a class="item{{if not $.CurBranch}} selected{{end}}" href="?workflow={{$.CurWorkflow}}&scoped_workflow_source_repo_id={{$.CurWorkflowRepoID}}&actor={{$.CurActor}}&status={{$.CurStatus}}">
|
|
{{ctx.Locale.Tr "actions.runs.branches_no_select"}}
|
|
</a>
|
|
{{range .RunBranches}}
|
|
<a class="item{{if eq . $.CurBranch}} selected{{end}}" href="?workflow={{$.CurWorkflow}}&scoped_workflow_source_repo_id={{$.CurWorkflowRepoID}}&actor={{$.CurActor}}&status={{$.CurStatus}}&branch={{.}}">
|
|
{{.}}
|
|
</a>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
|
|
{{if or $showCreateWorkflowBadge $showEnableDisableWorkflow}}
|
|
<button type="button" class="ui jump dropdown btn interact-bg tw-p-2">
|
|
{{svg "octicon-kebab-horizontal"}}
|
|
<div class="menu">
|
|
{{if $showCreateWorkflowBadge}}
|
|
<div class="item show-modal" data-modal="#workflow-status-badge-modal">
|
|
{{ctx.Locale.Tr "actions.workflow.create_status_badge"}}
|
|
</div>
|
|
{{end}}
|
|
{{if $showEnableDisableWorkflow}}
|
|
<a class="item {{if .CurWorkflowRequired}}disabled{{else}}link-action{{end}}"{{if not .CurWorkflowRequired}} data-url="{{$.Link}}/{{if .CurWorkflowDisabled}}enable{{else}}disable{{end}}?workflow={{$.CurWorkflow}}&scoped_workflow_source_repo_id={{$.CurWorkflowRepoID}}&actor={{.CurActor}}&status={{$.CurStatus}}&branch={{$.CurBranch}}"{{end}}>
|
|
{{if .CurWorkflowRequired}}{{ctx.Locale.Tr "actions.workflow.disable"}}{{else if .CurWorkflowDisabled}}{{ctx.Locale.Tr "actions.workflow.enable"}}{{else}}{{ctx.Locale.Tr "actions.workflow.disable"}}{{end}}
|
|
</a>
|
|
{{end}}
|
|
</div>
|
|
</button>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
|
|
{{if .WorkflowDispatchConfig}}
|
|
{{template "repo/actions/workflow_dispatch" .}}
|
|
{{end}}
|
|
|
|
<div class="ui attached segment">
|
|
{{template "repo/actions/runs_list" dict "ActionRunListData" $.ActionRunListData}}
|
|
{{template "base/paginate" dict "Page" $.Page}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{else}}
|
|
{{template "repo/actions/no_workflows" .}}
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
|
|
{{if $showCreateWorkflowBadge}}
|
|
<div id="workflow-status-badge-modal" class="ui tiny modal">
|
|
<div class="header">{{ctx.Locale.Tr "actions.workflow.status_badge"}}</div>
|
|
<div class="content">
|
|
<div class="ui form" data-global-init="initWorkflowBadgeForm"
|
|
data-badge-url="{{.WorkflowBadge.BadgeURL}}"
|
|
data-workflow-url="{{.WorkflowBadge.WorkflowURL}}"
|
|
data-workflow-display-name="{{.WorkflowBadge.DisplayName}}"
|
|
>
|
|
<div class="field">
|
|
<img data-workflow-badge-image src="{{.WorkflowBadge.BadgeURL}}" alt="{{.CurWorkflow}}">
|
|
</div>
|
|
<div class="field">
|
|
<label>{{ctx.Locale.Tr "actions.runs.branch"}}</label>
|
|
<div class="ui selection dropdown">
|
|
<input type="hidden" data-workflow-badge-branch value="{{.Repository.DefaultBranch}}">
|
|
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
|
<div class="text">{{.Repository.DefaultBranch}}</div>
|
|
<div class="menu">
|
|
<div class="item selected" data-value="{{.Repository.DefaultBranch}}">{{.Repository.DefaultBranch}}</div>
|
|
{{range $branchName := .RunBranches}}
|
|
{{if ne $branchName $.Repository.DefaultBranch}}
|
|
<div class="item" data-value="{{$branchName}}">{{$branchName}}</div>
|
|
{{end}}
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="field">
|
|
<label>{{ctx.Locale.Tr "actions.workflow.status_badge_url"}}</label>
|
|
<div class="ui action input">
|
|
<input id="workflow-badge-url" readonly autofocus>
|
|
<button type="button" class="ui icon button" data-tooltip-content="{{ctx.Locale.Tr "copy"}}" data-clipboard-target="#workflow-badge-url">{{svg "octicon-copy" 14}}</button>
|
|
</div>
|
|
</div>
|
|
<div class="field">
|
|
<label>Markdown</label>
|
|
<textarea id="workflow-badge-markdown" rows="2" readonly></textarea>
|
|
</div>
|
|
<div class="field">
|
|
<label>HTML</label>
|
|
<textarea id="workflow-badge-html" rows="2" readonly></textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
|
|
{{template "base/footer" .}}
|