From da461b5a085c0fbf705df9a751159d13bee7139a Mon Sep 17 00:00:00 2001 From: HesterG Date: Mon, 22 May 2023 12:17:24 +0800 Subject: [PATCH] Improvements for action detail page (#24718) Close #24625 Main changes: 1. For the left panel, show rerun icon only on hover, and add style when the job is selected, and removed icon on the "rerun all" button and modify the text on the button https://github.com/go-gitea/gitea/assets/17645053/cc437a17-d2e9-4f1b-a8cf-f56e53962767 2. Adjust fonts, and add on hover effects to the log lines. And add loading effect when the job is done and the job step log is expanded for the first time. (With reference to github) https://github.com/go-gitea/gitea/assets/17645053/2808d77d-f402-4fb0-8819-7aa0a018cf0c 3. Add `gt-ellipsis` to `step-summary-msg` and `job-brief-name` ellipsis 4. Fixed https://github.com/go-gitea/gitea/issues/24625#issuecomment-1541380010 by adding explicit conditions to `ActionRunStatus.vue` and `status.tmpl` 5. Adjust some css styles --------- Co-authored-by: silverwind --- options/locale/locale_en-US.ini | 1 + templates/repo/actions/status.tmpl | 5 +- templates/repo/actions/view.tmpl | 1 + web_src/css/base.css | 1 + web_src/js/components/ActionRunStatus.vue | 5 +- web_src/js/components/RepoActionView.vue | 171 +++++++++++++++------- 6 files changed, 130 insertions(+), 54 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index e5742157d..80ccecbce 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -80,6 +80,7 @@ milestones = Milestones ok = OK cancel = Cancel rerun = Re-run +rerun_all = Re-run all jobs save = Save add = Add add_all = Add All diff --git a/templates/repo/actions/status.tmpl b/templates/repo/actions/status.tmpl index ab2ee8482..cdc747aa8 100644 --- a/templates/repo/actions/status.tmpl +++ b/templates/repo/actions/status.tmpl @@ -1,5 +1,6 @@ {{- $size := 16 -}} {{- if .size -}} @@ -11,7 +12,7 @@ {{- $className = .className -}} {{- end -}} - + {{if eq .status "success"}} {{svg "octicon-check-circle-fill" $size (printf "text green %s" $className)}} {{else if eq .status "skipped"}} @@ -22,7 +23,7 @@ {{svg "octicon-blocked" $size (printf "text yellow %s" $className)}} {{else if eq .status "running"}} {{svg "octicon-meter" $size (printf "text yellow job-status-rotate %s" $className)}} -{{else}} +{{else if or (eq .status "failure") or (eq .status "cancelled") or (eq .status "unknown")}} {{svg "octicon-x-circle-fill" $size (printf "text red %s" $className)}} {{end}} diff --git a/templates/repo/actions/view.tmpl b/templates/repo/actions/view.tmpl index 8d6559ee9..3a3a069cb 100644 --- a/templates/repo/actions/view.tmpl +++ b/templates/repo/actions/view.tmpl @@ -9,6 +9,7 @@ data-locale-approve="{{.locale.Tr "repo.diff.review.approve"}}" data-locale-cancel="{{.locale.Tr "cancel"}}" data-locale-rerun="{{.locale.Tr "rerun"}}" + data-locale-rerun-all="{{.locale.Tr "rerun_all"}}" data-locale-status-unknown="{{.locale.Tr "actions.status.unknown"}}" data-locale-status-waiting="{{.locale.Tr "actions.status.waiting"}}" data-locale-status-running="{{.locale.Tr "actions.status.running"}}" diff --git a/web_src/css/base.css b/web_src/css/base.css index eb12ffef7..4b9f1eef2 100644 --- a/web_src/css/base.css +++ b/web_src/css/base.css @@ -71,6 +71,7 @@ /* console colors */ --color-console-fg: #ffffff; --color-console-bg: #171717; + --color-console-hover-bg: #ffffff16; /* named colors */ --color-red: #db2828; --color-orange: #f2711c; diff --git a/web_src/js/components/ActionRunStatus.vue b/web_src/js/components/ActionRunStatus.vue index 0786cb60a..bddf307a1 100644 --- a/web_src/js/components/ActionRunStatus.vue +++ b/web_src/js/components/ActionRunStatus.vue @@ -1,14 +1,15 @@ diff --git a/web_src/js/components/RepoActionView.vue b/web_src/js/components/RepoActionView.vue index 28adfbc6e..b2fd63dd1 100644 --- a/web_src/js/components/RepoActionView.vue +++ b/web_src/js/components/RepoActionView.vue @@ -1,28 +1,30 @@