loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

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)

authored by

Denys Konovalov and committed by
GitHub
63b25e81 efd51762

+20 -26
+1
options/locale/locale_en-US.ini
··· 3507 3507 runners.status.active = Active 3508 3508 runners.status.offline = Offline 3509 3509 runners.version = Version 3510 + runners.reset_registration_token = Reset registration token 3510 3511 runners.reset_registration_token_success = Runner registration token reset successfully 3511 3512 3512 3513 runs.all_workflows = All Workflows
+1 -1
templates/shared/actions/runner_edit.tmpl
··· 9 9 <div class="runner-basic-info"> 10 10 <div class="field gt-dib gt-mr-4"> 11 11 <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> 13 13 </div> 14 14 <div class="field gt-dib gt-mr-4"> 15 15 <label>{{.locale.Tr "actions.runners.last_online"}}</label>
+18 -19
templates/shared/actions/runner_list.tmpl
··· 1 1 <div class="runner-container"> 2 2 3 3 <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}}) 5 5 <div class="ui right"> 6 6 <div class="ui top right pointing dropdown"> 7 7 <button class="ui primary tiny button"> 8 - {{.locale.Tr "actions.runners.new"}} 8 + {{ctx.Locale.Tr "actions.runners.new"}} 9 9 {{svg "octicon-triangle-down" 14 "dropdown icon"}} 10 10 </button> 11 11 <div class="menu"> 12 12 <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> 15 14 </div> 16 15 <div class="divider"></div> 17 16 <div class="header"> ··· 19 18 </div> 20 19 <div class="ui input"> 21 20 <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}}"> 23 22 {{svg "octicon-copy" 14}} 24 23 </button> 25 24 </div> 26 25 <div class="divider"></div> 27 26 <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> 29 28 </div> 30 29 </div> 31 30 </div> ··· 37 36 <!-- Search Text --> 38 37 <div class="ui fluid action input"> 39 38 {{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> 41 40 </div> 42 41 </form> 43 42 </div> ··· 46 45 <thead> 47 46 <tr> 48 47 <th data-sortt-asc="online" data-sortt-desc="offline"> 49 - {{.locale.Tr "actions.runners.status"}} 48 + {{ctx.Locale.Tr "actions.runners.status"}} 50 49 {{SortArrow "online" "offline" .SortType false}} 51 50 </th> 52 51 <th data-sortt-asc="newest" data-sortt-desc="oldest"> 53 - {{.locale.Tr "actions.runners.id"}} 52 + {{ctx.Locale.Tr "actions.runners.id"}} 54 53 {{SortArrow "oldest" "newest" .SortType false}} 55 54 </th> 56 55 <th data-sortt-asc="alphabetically" data-sortt-desc="reversealphabetically"> 57 - {{.locale.Tr "actions.runners.name"}} 56 + {{ctx.Locale.Tr "actions.runners.name"}} 58 57 {{SortArrow "alphabetically" "reversealphabetically" .SortType false}} 59 58 </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> 65 64 </tr> 66 65 </thead> 67 66 <tbody> ··· 69 68 {{range .Runners}} 70 69 <tr> 71 70 <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> 73 72 </td> 74 73 <td>{{.ID}}</td> 75 74 <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> 77 76 <td><span data-tooltip-content="{{.BelongsToOwnerName}}">{{.BelongsToOwnerType.LocaleString $.locale}}</span></td> 78 77 <td class="runner-tags"> 79 78 {{range .AgentLabels}}<span class="ui label">{{.}}</span>{{end}} 80 79 </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> 82 81 <td class="runner-ops"> 83 82 {{if .Editable $.RunnerOwnerID $.RunnerRepoID}} 84 83 <a href="{{$.Link}}/{{.ID}}">{{svg "octicon-pencil"}}</a> ··· 88 87 {{end}} 89 88 {{else}} 90 89 <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> 92 91 </tr> 93 92 {{end}} 94 93 </tbody>
-6
web_src/css/actions.css
··· 18 18 margin-right: 1em; 19 19 } 20 20 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 - 27 21 .runner-container .runner-new-text { 28 22 color: var(--color-white); 29 23 }