Revert dynamic autofollow (#6061)

This commit is contained in:
qwerty287
2026-02-03 20:01:45 +01:00
committed by GitHub
parent 52cb9f6c21
commit 8b11ab56a9
2 changed files with 17 additions and 4 deletions

View File

@@ -227,7 +227,9 @@
"deploy": "Deploy",
"restart_success": "Pipeline restarted",
"log_download": "Download",
"log_delete": "Delete"
"log_delete": "Delete",
"log_auto_scroll": "Enable automatic scrolling",
"log_auto_scroll_off": "Disable automatic scrolling"
},
"protected": {
"awaits": "This pipeline is awaiting approval from a maintainer!",

View File

@@ -44,6 +44,16 @@
icon="trash"
@click="deleteLogs"
/>
<IconButton
v-if="step?.finished === undefined"
:title="
autoScroll ? $t('repo.pipeline.actions.log_auto_scroll_off') : $t('repo.pipeline.actions.log_auto_scroll')
"
class="hover:bg-white/10!"
:icon="autoScroll ? 'auto-scroll' : 'auto-scroll-off'"
@click="autoScroll = !autoScroll"
/>
<IconButton class="hover:bg-white/10! md:hidden!" icon="close" @click="$emit('update:step-id', null)" />
</div>
</div>
@@ -112,6 +122,7 @@
<script lang="ts" setup>
import '~/style/console.css';
import { useStorage } from '@vueuse/core';
import { AnsiUp } from 'ansi_up';
import { decode } from 'js-base64';
import { debounce } from 'lodash';
@@ -166,7 +177,7 @@ const hasLogs = computed(
// we do not have logs for skipped steps
repo?.value && pipeline.value && step.value && step.value.state !== 'skipped',
);
const autoScroll = useStorage('woodpecker:log-auto-scroll', true);
const showActions = ref(false);
const downloadInProgress = ref(false);
const ansiUp = ref(new AnsiUp());
@@ -256,7 +267,7 @@ const flushLogs = debounce((scroll: boolean) => {
if (route.hash.length > 0) {
nextTick(() => document.getElementById(route.hash.substring(1))?.scrollIntoView());
} else if (scroll && isScrolledToBottom()) {
} else if (scroll && autoScroll.value && isScrolledToBottom()) {
scrollDown();
}
}, 500);
@@ -380,7 +391,7 @@ watch(stepSlug, async () => {
watch(step, async (newStep, oldStep) => {
if (oldStep?.name === newStep?.name) {
if (oldStep?.finished !== newStep?.finished && isScrolledToBottom()) {
if (oldStep?.finished !== newStep?.finished && autoScroll.value && isScrolledToBottom()) {
scrollDown();
}