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

52 lines
1 KiB
Vue
Raw Normal View History

2019-12-21 20:55:43 +05:30
<script>
import LogLine from './line.vue';
import LogLineHeader from './line_header.vue';
export default {
name: 'CollpasibleLogSection',
components: {
LogLine,
LogLineHeader,
},
props: {
section: {
type: Object,
required: true,
},
traceEndpoint: {
type: String,
required: true,
},
},
computed: {
badgeDuration() {
return this.section.line && this.section.line.section_duration;
},
},
methods: {
handleOnClickCollapsibleLine(section) {
this.$emit('onClickCollapsibleLine', section);
},
},
};
</script>
<template>
<div>
<log-line-header
:line="section.line"
:duration="badgeDuration"
:path="traceEndpoint"
:is-closed="section.isClosed"
@toggleLine="handleOnClickCollapsibleLine(section)"
/>
<template v-if="!section.isClosed">
<log-line
v-for="line in section.lines"
:key="line.offset"
:line="line"
:path="traceEndpoint"
/>
</template>
</div>
</template>