Files
gitea/templates/shared/actions/runner_edit.tmpl
GitCaddy 469551095b
Some checks failed
Build and Release / Create Release (push) Has been skipped
Build and Release / Unit Tests (push) Successful in 2m1s
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 2m22s
Build and Release / Lint (push) Failing after 2m48s
Build and Release / Build Binaries (amd64, darwin) (push) Has been skipped
Build and Release / Build Binaries (amd64, linux) (push) Has been skipped
Build and Release / Build Binaries (amd64, windows) (push) Has been skipped
Build and Release / Build Binaries (arm64, darwin) (push) Has been skipped
Build and Release / Build Binaries (arm64, linux) (push) Has been skipped
UI: Split runner edit page with capabilities panel on right
- Two-column layout: basic info left, capabilities right
- Task list remains full-width below
- Vertical layout for capabilities (better for future expansion)
- Shows Docker availability status
2026-01-11 07:22:13 +00:00

190 lines
7.1 KiB
Handlebars

<div class="runner-container">
<h4 class="ui top attached header">
{{ctx.Locale.Tr "actions.runners.runner_title"}} {{.Runner.ID}} {{.Runner.Name}}
</h4>
<div class="ui attached segment">
<div class="ui two column stackable grid">
<!-- Left Column: Basic Info & Controls -->
<div class="column">
<form class="ui form" method="post">
{{template "base/disable_form_autofill"}}
<div class="runner-basic-info">
<div class="field">
<label>{{ctx.Locale.Tr "actions.runners.status"}}</label>
<span class="ui {{if .Runner.IsOnline}}green{{else}}basic{{end}} label">{{.Runner.StatusLocaleName ctx.Locale}}</span>
</div>
<div class="field">
<label>{{ctx.Locale.Tr "actions.runners.last_online"}}</label>
<span>{{if .Runner.LastOnline}}{{DateUtils.TimeSince .Runner.LastOnline}}{{else}}{{ctx.Locale.Tr "never"}}{{end}}</span>
</div>
<div class="field">
<label>{{ctx.Locale.Tr "actions.runners.labels"}}</label>
<span>
{{range .Runner.AgentLabels}}
<span class="ui label">{{.}}</span>
{{end}}
</span>
</div>
<div class="field">
<label>{{ctx.Locale.Tr "actions.runners.owner_type"}}</label>
<span data-tooltip-content="{{.Runner.BelongsToOwnerName}}">{{.Runner.BelongsToOwnerType.LocaleString ctx.Locale}}</span>
</div>
</div>
<div class="divider"></div>
<div class="field">
<label for="description">{{ctx.Locale.Tr "actions.runners.description"}}</label>
<input id="description" name="description" value="{{.Runner.Description}}">
</div>
<div class="divider"></div>
<div class="field">
<button class="ui primary button" data-url="{{.Link}}">{{ctx.Locale.Tr "actions.runners.update_runner"}}</button>
<button class="ui red button delete-button" data-url="{{.Link}}/delete" data-modal="#runner-delete-modal">
{{ctx.Locale.Tr "actions.runners.delete_runner"}}</button>
</div>
</form>
</div>
<!-- Right Column: Capabilities -->
<div class="column">
{{if .Runner.CapabilitiesJSON}}
<div class="ui segment runner-capabilities">
<h5 class="ui header">{{ctx.Locale.Tr "actions.runners.capabilities"}}</h5>
{{if .RunnerCapabilities}}
{{if .RunnerCapabilities.OS}}
<div class="field tw-mb-3">
<label>{{ctx.Locale.Tr "actions.runners.capabilities.os"}}</label>
<span class="ui label">{{.RunnerCapabilities.OS}}/{{.RunnerCapabilities.Arch}}</span>
</div>
{{end}}
<div class="field tw-mb-3">
<label>{{ctx.Locale.Tr "actions.runners.capabilities.docker"}}</label>
{{if .RunnerCapabilities.Docker}}
<span class="ui green label">{{svg "octicon-check" 14}} {{ctx.Locale.Tr "actions.runners.capabilities.available"}}</span>
{{else}}
<span class="ui basic label">{{svg "octicon-x" 14}} Not available</span>
{{end}}
</div>
{{if .RunnerCapabilities.Shell}}
<div class="field tw-mb-3">
<label>{{ctx.Locale.Tr "actions.runners.capabilities.shells"}}</label>
<div>
{{range .RunnerCapabilities.Shell}}
<span class="ui label">{{.}}</span>
{{end}}
</div>
</div>
{{end}}
{{if .RunnerCapabilities.Tools}}
<div class="field tw-mb-3">
<label>{{ctx.Locale.Tr "actions.runners.capabilities.tools"}}</label>
<div class="tw-flex tw-flex-wrap tw-gap-1">
{{range $tool, $versions := .RunnerCapabilities.Tools}}
<span class="ui small label">{{$tool}} {{range $versions}}{{.}} {{end}}</span>
{{end}}
</div>
</div>
{{end}}
{{if .RunnerCapabilities.Disk}}
<div class="field tw-mb-3">
<label>{{ctx.Locale.Tr "actions.runners.capabilities.disk"}}</label>
{{$diskUsed := .RunnerCapabilities.Disk.UsedPercent}}
{{$diskFreeGB := DivideFloat64 (Int64ToFloat64 .RunnerCapabilities.Disk.Free) 1073741824.0}}
{{$diskTotalGB := DivideFloat64 (Int64ToFloat64 .RunnerCapabilities.Disk.Total) 1073741824.0}}
{{$diskUsedInt := printf "%.0f" $diskUsed}}
<div class="ui small progress {{if ge $diskUsed 95.0}}red{{else if ge $diskUsed 85.0}}yellow{{else}}green{{end}}" data-percent="{{$diskUsedInt}}" style="margin-bottom: 0.5em;">
<div class="bar" style="width: {{$diskUsedInt}}%;">
<div class="progress">{{printf "%.1f" $diskUsed}}%</div>
</div>
</div>
<div class="tw-text-sm tw-text-secondary">
{{printf "%.1f" $diskFreeGB}} GB free / {{printf "%.1f" $diskTotalGB}} GB total
{{if ge $diskUsed 95.0}}
<span class="ui red text tw-ml-2">{{svg "octicon-alert" 14}}</span>
{{else if ge $diskUsed 85.0}}
<span class="ui yellow text tw-ml-2">{{svg "octicon-alert" 14}}</span>
{{end}}
</div>
</div>
{{end}}
{{if .RunnerCapabilities.Limitations}}
<div class="field tw-mb-3">
<label>{{ctx.Locale.Tr "actions.runners.capabilities.limitations"}}</label>
<ul class="tw-mt-1 tw-ml-4 tw-text-sm">
{{range .RunnerCapabilities.Limitations}}
<li>{{.}}</li>
{{end}}
</ul>
</div>
{{end}}
{{else}}
<pre class="tw-text-sm"><code>{{.Runner.CapabilitiesJSON}}</code></pre>
{{end}}
</div>
{{else}}
<div class="ui segment">
<h5 class="ui header">{{ctx.Locale.Tr "actions.runners.capabilities"}}</h5>
<p class="tw-text-secondary">No capabilities reported</p>
</div>
{{end}}
</div>
</div>
</div>
<h4 class="ui top attached header">
{{ctx.Locale.Tr "actions.runners.task_list"}}
</h4>
<div class="ui attached segment">
<table class="ui very basic striped table unstackable">
<thead>
<tr>
<th>{{ctx.Locale.Tr "actions.runners.task_list.run"}}</th>
<th>{{ctx.Locale.Tr "actions.runners.task_list.status"}}</th>
<th>{{ctx.Locale.Tr "actions.runners.task_list.repository"}}</th>
<th>{{ctx.Locale.Tr "actions.runners.task_list.commit"}}</th>
<th>{{ctx.Locale.Tr "actions.runners.task_list.done_at"}}</th>
</tr>
</thead>
<tbody>
{{range .Tasks}}
<tr>
<td><a href="{{.GetRunLink}}" target="_blank">{{.ID}}</a></td>
<td><span class="ui label task-status-{{.Status.String}}">{{.Status.LocaleString ctx.Locale}}</span></td>
<td><a href="{{.GetRepoLink}}" target="_blank">{{.GetRepoName}}</a></td>
<td>
<strong><a href="{{.GetCommitLink}}" target="_blank">{{ShortSha .CommitSHA}}</a></strong>
</td>
<td>{{if .IsStopped}}
<span>{{DateUtils.TimeSince .Stopped}}</span>
{{else}}-{{end}}</td>
</tr>
{{end}}
{{if not .Tasks}}
<tr>
<td colspan="5">{{ctx.Locale.Tr "actions.runners.task_list.no_tasks"}}</td>
</tr>
{{end}}
</tbody>
</table>
{{template "base/paginate" .}}
</div>
<div class="ui g-modal-confirm delete modal" id="runner-delete-modal">
<div class="header">
{{svg "octicon-trash"}}
{{ctx.Locale.Tr "actions.runners.delete_runner_header"}}
</div>
<div class="content">
<p>{{ctx.Locale.Tr "actions.runners.delete_runner_notice"}}</p>
</div>
{{template "base/modal_actions_confirm" .}}
</div>
</div>