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

42 lines
1.1 KiB
Vue
Raw Normal View History

2019-12-04 20:38:33 +05:30
<script>
import { mapState, mapActions } from 'vuex';
2019-12-21 20:55:43 +05:30
import CollpasibleLogSection from './collapsible_section.vue';
2019-12-04 20:38:33 +05:30
import LogLine from './line.vue';
export default {
components: {
2019-12-21 20:55:43 +05:30
CollpasibleLogSection,
2019-12-04 20:38:33 +05:30
LogLine,
},
computed: {
...mapState(['traceEndpoint', 'trace', 'isTraceComplete']),
},
methods: {
...mapActions(['toggleCollapsibleLine']),
handleOnClickCollapsibleLine(section) {
this.toggleCollapsibleLine(section);
},
},
};
</script>
<template>
<code class="job-log d-block">
<template v-for="(section, index) in trace">
2019-12-21 20:55:43 +05:30
<collpasible-log-section
v-if="section.isHeader"
:key="`collapsible-${index}`"
:section="section"
:trace-endpoint="traceEndpoint"
@onClickCollapsibleLine="handleOnClickCollapsibleLine"
/>
2019-12-04 20:38:33 +05:30
<log-line v-else :key="section.offset" :line="section" :path="traceEndpoint" />
</template>
<div v-if="!isTraceComplete" class="js-log-animation loader-animation pt-3 pl-3">
<div class="dot"></div>
<div class="dot"></div>
<div class="dot"></div>
</div>
</code>
</template>