Skip to content

Commit da461b5

Browse files
HesterGsilverwind
andauthored
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` <img width="898" alt="ellipsis" src="https://github.com/go-gitea/gitea/assets/17645053/e2fb7049-3125-4252-970d-15b0751febc7"> 4. Fixed #24625 (comment) by adding explicit conditions to `ActionRunStatus.vue` and `status.tmpl` 5. Adjust some css styles --------- Co-authored-by: silverwind <me@silverwind.io>
1 parent cdb088c commit da461b5

File tree

6 files changed

+130
-54
lines changed

6 files changed

+130
-54
lines changed

options/locale/locale_en-US.ini

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ milestones = Milestones
8080
ok = OK
8181
cancel = Cancel
8282
rerun = Re-run
83+
rerun_all = Re-run all jobs
8384
save = Save
8485
add = Add
8586
add_all = Add All

templates/repo/actions/status.tmpl

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<!-- This template should be kept the same as web_src/js/components/ActionRunStatus.vue
22
Please also update the vue file above if this template is modified.
3+
action status accepted: success, skipped, waiting, blocked, running, failure, cancelled, unknown
34
-->
45
{{- $size := 16 -}}
56
{{- if .size -}}
@@ -11,7 +12,7 @@
1112
{{- $className = .className -}}
1213
{{- end -}}
1314

14-
<span data-tooltip-content="{{.locale.Tr (printf "actions.status.%s" .status)}}">
15+
<span class="gt-df gt-ac" data-tooltip-content="{{.locale.Tr (printf "actions.status.%s" .status)}}">
1516
{{if eq .status "success"}}
1617
{{svg "octicon-check-circle-fill" $size (printf "text green %s" $className)}}
1718
{{else if eq .status "skipped"}}
@@ -22,7 +23,7 @@
2223
{{svg "octicon-blocked" $size (printf "text yellow %s" $className)}}
2324
{{else if eq .status "running"}}
2425
{{svg "octicon-meter" $size (printf "text yellow job-status-rotate %s" $className)}}
25-
{{else}}
26+
{{else if or (eq .status "failure") or (eq .status "cancelled") or (eq .status "unknown")}}
2627
{{svg "octicon-x-circle-fill" $size (printf "text red %s" $className)}}
2728
{{end}}
2829
</span>

templates/repo/actions/view.tmpl

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
data-locale-approve="{{.locale.Tr "repo.diff.review.approve"}}"
1010
data-locale-cancel="{{.locale.Tr "cancel"}}"
1111
data-locale-rerun="{{.locale.Tr "rerun"}}"
12+
data-locale-rerun-all="{{.locale.Tr "rerun_all"}}"
1213
data-locale-status-unknown="{{.locale.Tr "actions.status.unknown"}}"
1314
data-locale-status-waiting="{{.locale.Tr "actions.status.waiting"}}"
1415
data-locale-status-running="{{.locale.Tr "actions.status.running"}}"

web_src/css/base.css

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
/* console colors */
7272
--color-console-fg: #ffffff;
7373
--color-console-bg: #171717;
74+
--color-console-hover-bg: #ffffff16;
7475
/* named colors */
7576
--color-red: #db2828;
7677
--color-orange: #f2711c;

web_src/js/components/ActionRunStatus.vue

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<!-- This vue should be kept the same as templates/repo/actions/status.tmpl
22
Please also update the template file above if this vue is modified.
3+
action status accepted: success, skipped, waiting, blocked, running, failure, cancelled, unknown
34
-->
45
<template>
5-
<span :data-tooltip-content="localeStatus" v-if="status">
6+
<span class="gt-df gt-ac" :data-tooltip-content="localeStatus" v-if="status">
67
<SvgIcon name="octicon-check-circle-fill" class="text green" :size="size" :class-name="className" v-if="status === 'success'"/>
78
<SvgIcon name="octicon-skip" class="text grey" :size="size" :class-name="className" v-else-if="status === 'skipped'"/>
89
<SvgIcon name="octicon-clock" class="text yellow" :size="size" :class-name="className" v-else-if="status === 'waiting'"/>
910
<SvgIcon name="octicon-blocked" class="text yellow" :size="size" :class-name="className" v-else-if="status === 'blocked'"/>
1011
<SvgIcon name="octicon-meter" class="text yellow" :size="size" :class-name="'job-status-rotate ' + className" v-else-if="status === 'running'"/>
11-
<SvgIcon name="octicon-x-circle-fill" class="text red" :size="size" v-else/>
12+
<SvgIcon name="octicon-x-circle-fill" class="text red" :size="size" v-else-if="['failure', 'cancelled', 'unknown'].includes(status)" />
1213
</span>
1314
</template>
1415

0 commit comments

Comments
 (0)