From 63b25e816db6862bad9ad14ab272901b5570f48b Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Sun, 24 Sep 2023 20:12:21 +0200 Subject: [PATCH] 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) --- 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 74b8931de..035dc9b9e 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 ec3c25ab8..46bd98199 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 ead260f12..8c01766ed 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 f081698c6..e353a013a 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); }