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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 lines
1.2 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 {
2020-07-28 23:09:34 +05:30
name: 'CollapsibleLogSection',
2019-12-21 20:55:43 +05:30
components: {
LogLine,
LogLineHeader,
},
props: {
section: {
type: Object,
required: true,
},
2021-11-18 22:05:49 +05:30
jobLogEndpoint: {
2019-12-21 20:55:43 +05:30
type: String,
required: true,
},
2022-08-13 15:12:31 +05:30
searchResults: {
type: Array,
required: false,
default: () => [],
},
2019-12-21 20:55:43 +05:30
},
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"
2021-11-18 22:05:49 +05:30
:path="jobLogEndpoint"
2019-12-21 20:55:43 +05:30
:is-closed="section.isClosed"
@toggleLine="handleOnClickCollapsibleLine(section)"
/>
<template v-if="!section.isClosed">
2022-08-13 15:12:31 +05:30
<log-line
v-for="line in section.lines"
:key="line.offset"
:line="line"
:path="jobLogEndpoint"
:search-results="searchResults"
/>
2019-12-21 20:55:43 +05:30
</template>
</div>
</template>