From a4cfa3a242e73233d6f628b87e01d4f8090011df Mon Sep 17 00:00:00 2001 From: runephilosof-karnovgroup <101270124+runephilosof-karnovgroup@users.noreply.github.com> Date: Mon, 3 Jul 2023 15:06:10 +0200 Subject: [PATCH] Jump to linked log line (#1852) Co-authored-by: Patrick Schratz Co-authored-by: 6543 <6543@obermui.de> --- web/src/components/repo/pipeline/PipelineLog.vue | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/web/src/components/repo/pipeline/PipelineLog.vue b/web/src/components/repo/pipeline/PipelineLog.vue index ad47f3f93..5d060d44a 100644 --- a/web/src/components/repo/pipeline/PipelineLog.vue +++ b/web/src/components/repo/pipeline/PipelineLog.vue @@ -38,13 +38,13 @@ >
{{ line.index + 1 }}>('repo'); const apiClient = useApiClient(); +const route = useRoute(); const loadedStepSlug = ref(); const stepSlug = computed(() => `${repo?.value.owner} - ${repo?.value.name} - ${pipeline.value.id} - ${stepId.value}`); @@ -219,7 +221,9 @@ const flushLogs = debounce((scroll: boolean) => { log.value = buffer; - if (scroll && autoScroll.value) { + if (route.hash.length > 0) { + nextTick(() => document.getElementById(route.hash.substring(1))?.scrollIntoView()); + } else if (scroll && autoScroll.value) { scrollDown(); } }, 500);