2020-08-15 15:31:56 +00:00
|
|
|
<template>
|
2020-08-31 18:01:21 +00:00
|
|
|
<div class="d-flex h-100 p-0 align-items-start">
|
|
|
|
<textarea v-model="formattedLogs" class="h-100" readonly></textarea>
|
|
|
|
<b-button size="sm" @click="getLogs">↻</b-button>
|
2020-07-02 18:05:20 +00:00
|
|
|
</div>
|
2020-08-15 15:31:56 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { Component, Vue } from 'vue-property-decorator';
|
|
|
|
import { namespace } from 'vuex-class';
|
2021-08-28 09:39:03 +00:00
|
|
|
import { LogLine } from '@/types';
|
|
|
|
import { BotStoreGetters } from '@/store/modules/ftbot';
|
2020-08-15 15:31:56 +00:00
|
|
|
|
|
|
|
const ftbot = namespace('ftbot');
|
|
|
|
|
|
|
|
@Component({})
|
|
|
|
export default class LogViewer extends Vue {
|
2021-08-28 09:39:03 +00:00
|
|
|
@ftbot.Getter [BotStoreGetters.lastLogs]!: LogLine[];
|
2020-08-15 15:31:56 +00:00
|
|
|
|
|
|
|
@ftbot.Action getLogs;
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
this.getLogs();
|
|
|
|
}
|
|
|
|
|
|
|
|
get formattedLogs() {
|
|
|
|
let result = '';
|
|
|
|
for (let i = 0, len = this.lastLogs.length; i < len; i += 1) {
|
|
|
|
const log = this.lastLogs[i];
|
|
|
|
result += `${log[0]} - ${log[2]} - ${log[3]} - ${log[4]}\n`;
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2020-09-04 15:04:09 +00:00
|
|
|
<style lang="scss" scoped>
|
2020-08-15 15:31:56 +00:00
|
|
|
textarea {
|
|
|
|
width: 100%;
|
|
|
|
min-height: 6em;
|
2020-08-31 18:01:21 +00:00
|
|
|
resize: none;
|
2020-09-04 15:04:09 +00:00
|
|
|
font-size: $fontsize-small;
|
2020-08-15 15:31:56 +00:00
|
|
|
}
|
|
|
|
</style>
|