Skip to content

Commit d5678e9

Browse files
silverwindGiteaBot
authored andcommitted
Tweak actions menu (go-gitea#26278)
Ressurect lost changes from go-gitea#24451. - Always show icons for each entry in the menu - Make all checkboxes toggle only their feature, e.g. "seconds" and "timestamps" can now be toggled on together. - Reorder the items <img width="845" alt="Screenshot 2023-08-01 at 19 19 27" src="https://github.com/go-gitea/gitea/assets/115237/8a76e9bf-7966-42a6-87c9-e88cdddaec82"> --------- Co-authored-by: Giteabot <[email protected]>
1 parent 7c732a9 commit d5678e9

File tree

1 file changed

+10
-20
lines changed

1 file changed

+10
-20
lines changed

web_src/js/components/RepoActionView.vue

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -74,23 +74,23 @@
7474
<SvgIcon name="octicon-gear" :size="18"/>
7575
</button>
7676
<div class="menu transition action-job-menu" :class="{visible: menuVisible}" v-if="menuVisible" v-cloak>
77-
<a class="item" :href="run.link+'/jobs/'+jobIndex+'/logs'" target="_blank">
78-
<i class="icon"><SvgIcon name="octicon-download"/></i>
79-
{{ locale.downloadLogs }}
80-
</a>
8177
<a class="item" @click="toggleTimeDisplay('seconds')">
82-
<i class="icon"><SvgIcon v-show="timeVisible['log-time-seconds']" name="octicon-check"/></i>
78+
<i class="icon"><SvgIcon :name="timeVisible['log-time-seconds'] ? 'octicon-check' : 'gitea-empty-checkbox'"/></i>
8379
{{ locale.showLogSeconds }}
8480
</a>
8581
<a class="item" @click="toggleTimeDisplay('stamp')">
86-
<i class="icon"><SvgIcon v-show="timeVisible['log-time-stamp']" name="octicon-check"/></i>
82+
<i class="icon"><SvgIcon :name="timeVisible['log-time-stamp'] ? 'octicon-check' : 'gitea-empty-checkbox'"/></i>
8783
{{ locale.showTimeStamps }}
8884
</a>
89-
<div class="divider"/>
9085
<a class="item" @click="toggleFullScreen()">
91-
<i class="icon"><SvgIcon v-show="isFullScreen" name="octicon-check"/></i>
86+
<i class="icon"><SvgIcon :name="isFullScreen ? 'octicon-check' : 'gitea-empty-checkbox'"/></i>
9287
{{ locale.showFullScreen }}
9388
</a>
89+
<div class="divider"/>
90+
<a :class="['item', currentJob.steps.length === 0 ? 'disabled' : '']" :href="run.link+'/jobs/'+jobIndex+'/logs'" target="_blank">
91+
<i class="icon"><SvgIcon name="octicon-download"/></i>
92+
{{ locale.downloadLogs }}
93+
</a>
9494
</div>
9595
</div>
9696
</div>
@@ -397,20 +397,10 @@ const sfc = {
397397
if (this.menuVisible) this.menuVisible = false;
398398
},
399399
400-
// show at most one of log seconds and timestamp (can be both invisible)
401400
toggleTimeDisplay(type) {
402-
const toToggleTypes = [];
403-
const other = type === 'seconds' ? 'stamp' : 'seconds';
404401
this.timeVisible[`log-time-${type}`] = !this.timeVisible[`log-time-${type}`];
405-
toToggleTypes.push(type);
406-
if (this.timeVisible[`log-time-${type}`] && this.timeVisible[`log-time-${other}`]) {
407-
this.timeVisible[`log-time-${other}`] = false;
408-
toToggleTypes.push(other);
409-
}
410-
for (const toToggle of toToggleTypes) {
411-
for (const el of this.$refs.steps.querySelectorAll(`.log-time-${toToggle}`)) {
412-
toggleElem(el, this.timeVisible[`log-time-${toToggle}`]);
413-
}
402+
for (const el of this.$refs.steps.querySelectorAll(`.log-time-${type}`)) {
403+
toggleElem(el, this.timeVisible[`log-time-${type}`]);
414404
}
415405
},
416406

0 commit comments

Comments
 (0)