From a8086f61487f9f879e250a59dabf4f6f001e4442 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Mon, 25 Sep 2023 02:43:12 +0800 Subject: [PATCH] fix issues on action runners page (#27226) (#27233) Backport #27226 by @denyskon - 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) Co-authored-by: Denys Konovalov --- options/locale/locale_en-US.ini | 1 + templates/shared/actions/runner_edit.tmpl | 2 +- templates/shared/actions/runner_list.tmpl | 37 +++++++++++------------ web_src/css/actions.css | 6 ---- 4 files changed, 20 insertions(+), 26 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 74b8931de8..035dc9b9e3 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -3507,6 +3507,7 @@ runners.status.idle = Idle runners.status.active = Active runners.status.offline = Offline runners.version = Version +runners.reset_registration_token = Reset registration token runners.reset_registration_token_success = Runner registration token reset successfully runs.all_workflows = All Workflows diff --git a/templates/shared/actions/runner_edit.tmpl b/templates/shared/actions/runner_edit.tmpl index ec3c25ab87..46bd981999 100644 --- a/templates/shared/actions/runner_edit.tmpl +++ b/templates/shared/actions/runner_edit.tmpl @@ -9,7 +9,7 @@
- {{.Runner.StatusLocaleName $.locale}} + {{.Runner.StatusLocaleName $.locale}}
diff --git a/templates/shared/actions/runner_list.tmpl b/templates/shared/actions/runner_list.tmpl index ead260f128..8c01766edd 100644 --- a/templates/shared/actions/runner_list.tmpl +++ b/templates/shared/actions/runner_list.tmpl @@ -1,17 +1,16 @@

- {{.locale.Tr "actions.runners.runner_manage_panel"}} ({{.locale.Tr "admin.total" .Total}}) + {{ctx.Locale.Tr "actions.runners.runner_manage_panel"}} ({{ctx.Locale.Tr "admin.total" .Total}})
@@ -37,7 +36,7 @@
{{template "shared/searchinput" dict "locale" .locale "Value" .Keyword "AutoFocus" true}} - +
@@ -46,22 +45,22 @@ - {{.locale.Tr "actions.runners.status"}} + {{ctx.Locale.Tr "actions.runners.status"}} {{SortArrow "online" "offline" .SortType false}} - {{.locale.Tr "actions.runners.id"}} + {{ctx.Locale.Tr "actions.runners.id"}} {{SortArrow "oldest" "newest" .SortType false}} - {{.locale.Tr "actions.runners.name"}} + {{ctx.Locale.Tr "actions.runners.name"}} {{SortArrow "alphabetically" "reversealphabetically" .SortType false}} - {{.locale.Tr "actions.runners.version"}} - {{.locale.Tr "actions.runners.owner_type"}} - {{.locale.Tr "actions.runners.labels"}} - {{.locale.Tr "actions.runners.last_online"}} - {{.locale.Tr "edit"}} + {{ctx.Locale.Tr "actions.runners.version"}} + {{ctx.Locale.Tr "actions.runners.owner_type"}} + {{ctx.Locale.Tr "actions.runners.labels"}} + {{ctx.Locale.Tr "actions.runners.last_online"}} + {{ctx.Locale.Tr "edit"}} @@ -69,16 +68,16 @@ {{range .Runners}} - {{.StatusLocaleName $.locale}} + {{.StatusLocaleName $.locale}} {{.ID}}

{{.Name}}

- {{if .Version}}{{.Version}}{{else}}{{$.locale.Tr "unknown"}}{{end}} + {{if .Version}}{{.Version}}{{else}}{{ctx.Locale.Tr "unknown"}}{{end}} {{.BelongsToOwnerType.LocaleString $.locale}} {{range .AgentLabels}}{{.}}{{end}} - {{if .LastOnline}}{{TimeSinceUnix .LastOnline $.locale}}{{else}}{{$.locale.Tr "never"}}{{end}} + {{if .LastOnline}}{{TimeSinceUnix .LastOnline $.locale}}{{else}}{{ctx.Locale.Tr "never"}}{{end}} {{if .Editable $.RunnerOwnerID $.RunnerRepoID}} {{svg "octicon-pencil"}} @@ -88,7 +87,7 @@ {{end}} {{else}} - {{.locale.Tr "actions.runners.none"}} + {{ctx.Locale.Tr "actions.runners.none"}} {{end}} diff --git a/web_src/css/actions.css b/web_src/css/actions.css index f081698c66..e353a013a7 100644 --- a/web_src/css/actions.css +++ b/web_src/css/actions.css @@ -18,12 +18,6 @@ margin-right: 1em; } -.runner-container .runner-status-online { - padding: 0.3em 0.5em; - background-color: var(--color-green); - color: var(--color-white); -} - .runner-container .runner-new-text { color: var(--color-white); }