Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add header to pipeline log and always show buttons #2140

Merged
merged 2 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions web/src/assets/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@
"exit_code": "Exit Code {exitCode}",
"loading": "Loading…",
"pipeline": "Pipeline #{pipelineId}",
"log_title": "Step Logs",
"log_download_error": "There was an error while downloading the log file",
"actions": {
"cancel": "Cancel",
Expand Down
39 changes: 22 additions & 17 deletions web/src/components/repo/pipeline/PipelineLog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,27 @@
@mouseover="showActions = true"
@mouseleave="showActions = false"
>
<div v-show="showActions" class="absolute top-0 right-0 z-40 mt-4 mr-6 hidden md:flex">
<Button
v-if="step?.end_time !== undefined"
:is-loading="downloadInProgress"
:title="$t('repo.pipeline.actions.log_download')"
start-icon="download"
@click="download"
/>
<Button
v-if="step?.end_time === undefined"
:title="
autoScroll ? $t('repo.pipeline.actions.log_auto_scroll_off') : $t('repo.pipeline.actions.log_auto_scroll')
"
:start-icon="autoScroll ? 'auto-scroll' : 'auto-scroll-off'"
@click="autoScroll = !autoScroll"
/>
<div class="flex flex-row items-center w-full bg-wp-code-100 px-4 py-2">
<span class="text-base font-bold text-wp-code-text-alt-100">{{ $t('repo.pipeline.log_title') }}</span>
<div class="flex flex-row items-center ml-auto gap-x-2">
<IconButton
v-if="step?.end_time !== undefined"
:is-loading="downloadInProgress"
:title="$t('repo.pipeline.actions.log_download')"
class="!hover:bg-white !hover:bg-opacity-10"
icon="download"
@click="download"
/>
<IconButton
v-if="step?.end_time === undefined"
:title="
autoScroll ? $t('repo.pipeline.actions.log_auto_scroll_off') : $t('repo.pipeline.actions.log_auto_scroll')
"
class="!hover:bg-white !hover:bg-opacity-10"
:icon="autoScroll ? 'auto-scroll' : 'auto-scroll-off'"
@click="autoScroll = !autoScroll"
/>
</div>
</div>

<div
Expand Down Expand Up @@ -100,8 +105,8 @@ import { computed, inject, nextTick, onMounted, Ref, ref, toRef, watch } from 'v
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';

import Button from '~/components/atomic/Button.vue';
import Icon from '~/components/atomic/Icon.vue';
import IconButton from '~/components/atomic/IconButton.vue';
import PipelineStatusIcon from '~/components/repo/pipeline/PipelineStatusIcon.vue';
import useApiClient from '~/compositions/useApiClient';
import useNotifications from '~/compositions/useNotifications';
Expand Down