Skip to content

Commit 2fc0eb9

Browse files
silverwindGiteaBot
andauthored
Tweak actions menu (#26278)
Ressurect lost changes from #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 a321a4c commit 2fc0eb9

File tree

1 file changed

+10
-20
lines changed

1 file changed

+10
-20
lines changed

web_src/js/components/RepoActionView.vue

+10-20
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', currentJob.steps.length === 0 ? 'disabled' : '']" :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>
@@ -401,20 +401,10 @@ const sfc = {
401401
if (this.menuVisible) this.menuVisible = false;
402402
},
403403
404-
// show at most one of log seconds and timestamp (can be both invisible)
405404
toggleTimeDisplay(type) {
406-
const toToggleTypes = [];
407-
const other = type === 'seconds' ? 'stamp' : 'seconds';
408405
this.timeVisible[`log-time-${type}`] = !this.timeVisible[`log-time-${type}`];
409-
toToggleTypes.push(type);
410-
if (this.timeVisible[`log-time-${type}`] && this.timeVisible[`log-time-${other}`]) {
411-
this.timeVisible[`log-time-${other}`] = false;
412-
toToggleTypes.push(other);
413-
}
414-
for (const toToggle of toToggleTypes) {
415-
for (const el of this.$refs.steps.querySelectorAll(`.log-time-${toToggle}`)) {
416-
toggleElem(el, this.timeVisible[`log-time-${toToggle}`]);
417-
}
406+
for (const el of this.$refs.steps.querySelectorAll(`.log-time-${type}`)) {
407+
toggleElem(el, this.timeVisible[`log-time-${type}`]);
418408
}
419409
},
420410

0 commit comments

Comments
 (0)