Skip to content

Commit 63b25e8

Browse files
authored
fix issues on action runners page (#27226)
- switch from some weird status badge to label - translate untranslated `Reset registration token` string - change documentation link from act_runner README to Gitea Docs site - fix "No runners available" message width - use `ctx.Locale.Tr` where possible ![grafik](https://github.com/go-gitea/gitea/assets/47871822/65547228-f9ed-4f80-9cfd-df5e55513a44)
1 parent efd5176 commit 63b25e8

File tree

4 files changed

+20
-26
lines changed

4 files changed

+20
-26
lines changed

options/locale/locale_en-US.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3507,6 +3507,7 @@ runners.status.idle = Idle
35073507
runners.status.active = Active
35083508
runners.status.offline = Offline
35093509
runners.version = Version
3510+
runners.reset_registration_token = Reset registration token
35103511
runners.reset_registration_token_success = Runner registration token reset successfully
35113512
35123513
runs.all_workflows = All Workflows

templates/shared/actions/runner_edit.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<div class="runner-basic-info">
1010
<div class="field gt-dib gt-mr-4">
1111
<label>{{.locale.Tr "actions.runners.status"}}</label>
12-
<span class="runner-status-{{if .Runner.IsOnline}}online{{else}}offline{{end}}">{{.Runner.StatusLocaleName $.locale}}</span>
12+
<span class="ui {{if .Runner.IsOnline}}green{{else}}basic{{end}} label">{{.Runner.StatusLocaleName $.locale}}</span>
1313
</div>
1414
<div class="field gt-dib gt-mr-4">
1515
<label>{{.locale.Tr "actions.runners.last_online"}}</label>

templates/shared/actions/runner_list.tmpl

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
11
<div class="runner-container">
22

33
<h4 class="ui top attached header">
4-
{{.locale.Tr "actions.runners.runner_manage_panel"}} ({{.locale.Tr "admin.total" .Total}})
4+
{{ctx.Locale.Tr "actions.runners.runner_manage_panel"}} ({{ctx.Locale.Tr "admin.total" .Total}})
55
<div class="ui right">
66
<div class="ui top right pointing dropdown">
77
<button class="ui primary tiny button">
8-
{{.locale.Tr "actions.runners.new"}}
8+
{{ctx.Locale.Tr "actions.runners.new"}}
99
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
1010
</button>
1111
<div class="menu">
1212
<div class="item">
13-
{{/* TODO: replece the document link when there's a better one than the README of act_runner */}}
14-
<a href="https://gitea.com/gitea/act_runner/src/branch/main/README.md">{{.locale.Tr "actions.runners.new_notice"}}</a>
13+
<a href="https://docs.gitea.com/usage/actions/act-runner">{{ctx.Locale.Tr "actions.runners.new_notice"}}</a>
1514
</div>
1615
<div class="divider"></div>
1716
<div class="header">
1817
Registration Token
1918
</div>
2019
<div class="ui input">
2120
<input type="text" value="{{.RegistrationToken}}">
22-
<button class="ui basic label button" aria-label="{{.locale.Tr "copy"}}" data-clipboard-text="{{.RegistrationToken}}">
21+
<button class="ui basic label button" aria-label="{{ctx.Locale.Tr "copy"}}" data-clipboard-text="{{.RegistrationToken}}">
2322
{{svg "octicon-copy" 14}}
2423
</button>
2524
</div>
2625
<div class="divider"></div>
2726
<div class="item">
28-
<a href="{{$.Link}}/reset_registration_token">Reset registration token</a>
27+
<a href="{{$.Link}}/reset_registration_token">{{ctx.Locale.Tr "actions.runners.reset_registration_token"}}</a>
2928
</div>
3029
</div>
3130
</div>
@@ -37,7 +36,7 @@
3736
<!-- Search Text -->
3837
<div class="ui fluid action input">
3938
{{template "shared/searchinput" dict "locale" .locale "Value" .Keyword "AutoFocus" true}}
40-
<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
39+
<button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button>
4140
</div>
4241
</form>
4342
</div>
@@ -46,39 +45,39 @@
4645
<thead>
4746
<tr>
4847
<th data-sortt-asc="online" data-sortt-desc="offline">
49-
{{.locale.Tr "actions.runners.status"}}
48+
{{ctx.Locale.Tr "actions.runners.status"}}
5049
{{SortArrow "online" "offline" .SortType false}}
5150
</th>
5251
<th data-sortt-asc="newest" data-sortt-desc="oldest">
53-
{{.locale.Tr "actions.runners.id"}}
52+
{{ctx.Locale.Tr "actions.runners.id"}}
5453
{{SortArrow "oldest" "newest" .SortType false}}
5554
</th>
5655
<th data-sortt-asc="alphabetically" data-sortt-desc="reversealphabetically">
57-
{{.locale.Tr "actions.runners.name"}}
56+
{{ctx.Locale.Tr "actions.runners.name"}}
5857
{{SortArrow "alphabetically" "reversealphabetically" .SortType false}}
5958
</th>
60-
<th>{{.locale.Tr "actions.runners.version"}}</th>
61-
<th>{{.locale.Tr "actions.runners.owner_type"}}</th>
62-
<th>{{.locale.Tr "actions.runners.labels"}}</th>
63-
<th>{{.locale.Tr "actions.runners.last_online"}}</th>
64-
<th>{{.locale.Tr "edit"}}</th>
59+
<th>{{ctx.Locale.Tr "actions.runners.version"}}</th>
60+
<th>{{ctx.Locale.Tr "actions.runners.owner_type"}}</th>
61+
<th>{{ctx.Locale.Tr "actions.runners.labels"}}</th>
62+
<th>{{ctx.Locale.Tr "actions.runners.last_online"}}</th>
63+
<th>{{ctx.Locale.Tr "edit"}}</th>
6564
</tr>
6665
</thead>
6766
<tbody>
6867
{{if .Runners}}
6968
{{range .Runners}}
7069
<tr>
7170
<td>
72-
<span class="runner-status-{{if .IsOnline}}online{{else}}offline{{end}}">{{.StatusLocaleName $.locale}}</span>
71+
<span class="ui {{if .IsOnline}}green{{else}}basic{{end}} label">{{.StatusLocaleName $.locale}}</span>
7372
</td>
7473
<td>{{.ID}}</td>
7574
<td><p data-tooltip-content="{{.Description}}">{{.Name}}</p></td>
76-
<td>{{if .Version}}{{.Version}}{{else}}{{$.locale.Tr "unknown"}}{{end}}</td>
75+
<td>{{if .Version}}{{.Version}}{{else}}{{ctx.Locale.Tr "unknown"}}{{end}}</td>
7776
<td><span data-tooltip-content="{{.BelongsToOwnerName}}">{{.BelongsToOwnerType.LocaleString $.locale}}</span></td>
7877
<td class="runner-tags">
7978
{{range .AgentLabels}}<span class="ui label">{{.}}</span>{{end}}
8079
</td>
81-
<td>{{if .LastOnline}}{{TimeSinceUnix .LastOnline $.locale}}{{else}}{{$.locale.Tr "never"}}{{end}}</td>
80+
<td>{{if .LastOnline}}{{TimeSinceUnix .LastOnline $.locale}}{{else}}{{ctx.Locale.Tr "never"}}{{end}}</td>
8281
<td class="runner-ops">
8382
{{if .Editable $.RunnerOwnerID $.RunnerRepoID}}
8483
<a href="{{$.Link}}/{{.ID}}">{{svg "octicon-pencil"}}</a>
@@ -88,7 +87,7 @@
8887
{{end}}
8988
{{else}}
9089
<tr>
91-
<td class="center aligned" colspan="6">{{.locale.Tr "actions.runners.none"}}</td>
90+
<td class="center aligned" colspan="8">{{ctx.Locale.Tr "actions.runners.none"}}</td>
9291
</tr>
9392
{{end}}
9493
</tbody>

web_src/css/actions.css

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@
1818
margin-right: 1em;
1919
}
2020

21-
.runner-container .runner-status-online {
22-
padding: 0.3em 0.5em;
23-
background-color: var(--color-green);
24-
color: var(--color-white);
25-
}
26-
2721
.runner-container .runner-new-text {
2822
color: var(--color-white);
2923
}

0 commit comments

Comments
 (0)