mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-24 03:55:15 +00:00
46 lines
1.1 KiB
Vue
46 lines
1.1 KiB
Vue
<template>
|
|
<div class="d-flex h-100 p-0 align-items-start">
|
|
<textarea v-model="formattedLogs" class="h-100" readonly></textarea>
|
|
<b-button id="refresh-logs" size="sm" @click="botStore.activeBot.getLogs">↻</b-button>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { useBotStore } from '@/stores/ftbotwrapper';
|
|
import { defineComponent, onMounted, computed } from 'vue';
|
|
|
|
export default defineComponent({
|
|
name: 'LogViewer',
|
|
setup() {
|
|
const botStore = useBotStore();
|
|
|
|
onMounted(async () => {
|
|
botStore.activeBot.getLogs();
|
|
});
|
|
|
|
const formattedLogs = computed(() => {
|
|
let result = '';
|
|
for (let i = 0, len = botStore.activeBot.lastLogs.length; i < len; i += 1) {
|
|
const log = botStore.activeBot.lastLogs[i];
|
|
result += `${log[0]} - ${log[2]} - ${log[3]} - ${log[4]}\n`;
|
|
}
|
|
return result;
|
|
});
|
|
|
|
return {
|
|
botStore,
|
|
formattedLogs,
|
|
};
|
|
},
|
|
});
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
textarea {
|
|
width: 100%;
|
|
min-height: 6em;
|
|
resize: none;
|
|
font-size: $fontsize-small;
|
|
}
|
|
</style>
|