debian-mirror-gitlab/app/assets/javascripts/jobs/components/log/line_header.vue

62 lines
1.2 KiB
Vue
Raw Normal View History

2019-12-04 20:38:33 +05:30
<script>
2020-11-24 15:15:51 +05:30
import { GlIcon } from '@gitlab/ui';
2019-12-04 20:38:33 +05:30
import DurationBadge from './duration_badge.vue';
2021-03-11 19:13:27 +05:30
import LineNumber from './line_number.vue';
2019-12-04 20:38:33 +05:30
export default {
components: {
2020-11-24 15:15:51 +05:30
GlIcon,
2019-12-04 20:38:33 +05:30
LineNumber,
DurationBadge,
},
props: {
line: {
type: Object,
required: true,
},
isClosed: {
type: Boolean,
required: true,
},
path: {
type: String,
required: true,
},
duration: {
type: String,
required: false,
default: '',
},
},
computed: {
iconName() {
return this.isClosed ? 'angle-right' : 'angle-down';
},
},
methods: {
handleOnClick() {
this.$emit('toggleLine');
},
},
};
</script>
<template>
<div
2019-12-21 20:55:43 +05:30
class="log-line collapsible-line d-flex justify-content-between ws-normal"
2019-12-04 20:38:33 +05:30
role="button"
@click="handleOnClick"
>
2020-11-24 15:15:51 +05:30
<gl-icon :name="iconName" class="arrow position-absolute" />
2019-12-04 20:38:33 +05:30
<line-number :line-number="line.lineNumber" :path="path" />
2019-12-21 20:55:43 +05:30
<span
v-for="(content, i) in line.content"
:key="i"
2020-11-24 15:15:51 +05:30
class="line-text w-100 gl-white-space-pre-wrap"
2019-12-21 20:55:43 +05:30
:class="content.style"
>{{ content.text }}</span
>
2019-12-04 20:38:33 +05:30
<duration-badge v-if="duration" :duration="duration" />
</div>
</template>