<template>
  <div class="app-container">
    <h3 style="overflow:hidden;">
      console
    </h3>
    <pre
      style="border:1px solid #ccc; border-top:none;border-bottom:none; padding: 10px; white-space: pre-wrap;word-wrap: break-word;"
      v-html="logs"/>
  </div>
</template>

<style>
pre{
font-family:Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
}
</style>
<script>
import { getLogs } from '@/api/pipeline'

export default {
  data() {
    return {
      id: '',
      start: 1,
      end: 200,
      logs: ''
    }
  },
  created() {
    this.getLogs()
  },
  methods: {
    getLogs() {
      this.id = this.$route.query.detailId
      this.status = this.$route.query.status
      getLogs(this.id, this.start, this.end).then(res => {
        this.listLoading = false
        this.logs = res.data
      }
      ).catch(() => {
        this.listLoading = false
      })
    }
  }
}
</script>
