2018-08-16 09:36:29 -04:00
|
|
|
<script>
|
2018-11-16 14:29:11 -05:00
|
|
|
import { GlTooltipDirective, GlLink, GlButton } from '@gitlab/ui';
|
2018-10-10 02:23:54 -04:00
|
|
|
import { polyfillSticky } from '~/lib/utils/sticky';
|
|
|
|
import Icon from '~/vue_shared/components/icon.vue';
|
|
|
|
import { numberToHumanSize } from '~/lib/utils/number_utils';
|
|
|
|
import { sprintf } from '~/locale';
|
2018-10-17 06:34:19 -04:00
|
|
|
import scrollDown from '../svg/scroll_down.svg';
|
2018-08-16 09:36:29 -04:00
|
|
|
|
2018-10-10 02:23:54 -04:00
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
Icon,
|
2018-11-02 13:15:56 -04:00
|
|
|
GlLink,
|
|
|
|
GlButton,
|
2018-10-10 02:23:54 -04:00
|
|
|
},
|
|
|
|
directives: {
|
2018-11-02 13:15:56 -04:00
|
|
|
GlTooltip: GlTooltipDirective,
|
2018-10-10 02:23:54 -04:00
|
|
|
},
|
2018-10-17 06:34:19 -04:00
|
|
|
scrollDown,
|
2018-10-10 02:23:54 -04:00
|
|
|
props: {
|
|
|
|
erasePath: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
default: null,
|
2018-08-16 09:36:29 -04:00
|
|
|
},
|
2018-10-10 02:23:54 -04:00
|
|
|
size: {
|
|
|
|
type: Number,
|
|
|
|
required: true,
|
2018-08-16 09:36:29 -04:00
|
|
|
},
|
2018-10-10 02:23:54 -04:00
|
|
|
rawPath: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
default: null,
|
2018-08-16 09:36:29 -04:00
|
|
|
},
|
2018-10-10 02:23:54 -04:00
|
|
|
isScrollTopDisabled: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true,
|
2018-08-16 09:36:29 -04:00
|
|
|
},
|
2018-10-10 02:23:54 -04:00
|
|
|
isScrollBottomDisabled: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true,
|
2018-09-27 07:08:31 -04:00
|
|
|
},
|
2018-10-10 02:23:54 -04:00
|
|
|
isScrollingDown: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true,
|
2018-08-16 09:36:29 -04:00
|
|
|
},
|
2018-10-10 02:23:54 -04:00
|
|
|
isTraceSizeVisible: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
jobLogSize() {
|
|
|
|
return sprintf('Showing last %{size} of log -', {
|
|
|
|
size: numberToHumanSize(this.size),
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
polyfillSticky(this.$el);
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
handleScrollToTop() {
|
|
|
|
this.$emit('scrollJobLogTop');
|
|
|
|
},
|
|
|
|
handleScrollToBottom() {
|
|
|
|
this.$emit('scrollJobLogBottom');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2018-08-16 09:36:29 -04:00
|
|
|
</script>
|
|
|
|
<template>
|
2018-11-05 08:22:25 -05:00
|
|
|
<div class="top-bar">
|
2018-08-16 09:36:29 -04:00
|
|
|
<!-- truncate information -->
|
|
|
|
<div class="js-truncated-info truncated-info d-none d-sm-block float-left">
|
2018-09-27 07:08:31 -04:00
|
|
|
<template v-if="isTraceSizeVisible">
|
|
|
|
{{ jobLogSize }}
|
2018-08-16 09:36:29 -04:00
|
|
|
|
2019-04-11 08:09:21 -04:00
|
|
|
<gl-link
|
|
|
|
v-if="rawPath"
|
|
|
|
:href="rawPath"
|
|
|
|
class="js-raw-link text-plain text-underline prepend-left-5"
|
|
|
|
>
|
2018-11-16 15:07:38 -05:00
|
|
|
{{ s__('Job|Complete Raw') }}
|
2018-11-02 13:15:56 -04:00
|
|
|
</gl-link>
|
2018-09-27 07:08:31 -04:00
|
|
|
</template>
|
2018-08-16 09:36:29 -04:00
|
|
|
</div>
|
|
|
|
<!-- eo truncate information -->
|
|
|
|
|
|
|
|
<div class="controllers float-right">
|
|
|
|
<!-- links -->
|
2018-11-02 13:15:56 -04:00
|
|
|
<gl-link
|
2018-09-27 07:08:31 -04:00
|
|
|
v-if="rawPath"
|
2018-11-02 13:15:56 -04:00
|
|
|
v-gl-tooltip.body
|
2018-08-16 09:36:29 -04:00
|
|
|
:title="s__('Job|Show complete raw')"
|
2018-09-27 07:08:31 -04:00
|
|
|
:href="rawPath"
|
2018-08-16 09:36:29 -04:00
|
|
|
class="js-raw-link-controller controllers-buttons"
|
|
|
|
>
|
|
|
|
<icon name="doc-text" />
|
2018-11-02 13:15:56 -04:00
|
|
|
</gl-link>
|
2018-08-16 09:36:29 -04:00
|
|
|
|
2018-11-02 13:15:56 -04:00
|
|
|
<gl-link
|
2018-09-27 07:08:31 -04:00
|
|
|
v-if="erasePath"
|
2018-11-02 13:15:56 -04:00
|
|
|
v-gl-tooltip.body
|
2018-08-16 09:36:29 -04:00
|
|
|
:title="s__('Job|Erase job log')"
|
2018-09-27 07:08:31 -04:00
|
|
|
:href="erasePath"
|
2018-10-17 06:34:19 -04:00
|
|
|
:data-confirm="__('Are you sure you want to erase this build?')"
|
2018-08-16 09:36:29 -04:00
|
|
|
class="js-erase-link controllers-buttons"
|
2018-09-27 07:08:31 -04:00
|
|
|
data-method="post"
|
2018-08-16 09:36:29 -04:00
|
|
|
>
|
|
|
|
<icon name="remove" />
|
2018-11-02 13:15:56 -04:00
|
|
|
</gl-link>
|
2018-08-16 09:36:29 -04:00
|
|
|
<!-- eo links -->
|
|
|
|
|
|
|
|
<!-- scroll buttons -->
|
2018-11-16 15:07:38 -05:00
|
|
|
<div v-gl-tooltip :title="s__('Job|Scroll to top')" class="controllers-buttons">
|
2018-11-02 13:15:56 -04:00
|
|
|
<gl-button
|
2018-09-27 07:08:31 -04:00
|
|
|
:disabled="isScrollTopDisabled"
|
2018-08-16 09:36:29 -04:00
|
|
|
type="button"
|
|
|
|
class="js-scroll-top btn-scroll btn-transparent btn-blank"
|
|
|
|
@click="handleScrollToTop"
|
|
|
|
>
|
2018-11-02 13:15:56 -04:00
|
|
|
<icon name="scroll_up" />
|
|
|
|
</gl-button>
|
2018-08-16 09:36:29 -04:00
|
|
|
</div>
|
|
|
|
|
2018-11-16 15:07:38 -05:00
|
|
|
<div v-gl-tooltip :title="s__('Job|Scroll to bottom')" class="controllers-buttons">
|
2018-11-02 13:15:56 -04:00
|
|
|
<gl-button
|
2018-09-27 07:08:31 -04:00
|
|
|
:disabled="isScrollBottomDisabled"
|
2018-08-16 09:36:29 -04:00
|
|
|
class="js-scroll-bottom btn-scroll btn-transparent btn-blank"
|
2018-09-27 07:08:31 -04:00
|
|
|
:class="{ animate: isScrollingDown }"
|
2018-08-16 09:36:29 -04:00
|
|
|
@click="handleScrollToBottom"
|
2018-10-17 06:34:19 -04:00
|
|
|
v-html="$options.scrollDown"
|
2018-11-02 13:15:56 -04:00
|
|
|
/>
|
2018-08-16 09:36:29 -04:00
|
|
|
</div>
|
|
|
|
<!-- eo scroll buttons -->
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|