Skip to content

Commit

Permalink
feat: add download log buttons to configuration page
Browse files Browse the repository at this point in the history
  • Loading branch information
cadriel committed Dec 19, 2020
1 parent 4ac441b commit 939e9a8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 5 deletions.
26 changes: 26 additions & 0 deletions src/components/cards/configuration/LogsCard.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<template>
<collapsable-card
title="Printer Logs"
icon="$download">
<v-card-text>
<v-btn block color="secondary" @click="getKlippyLog()" class="me-2 mb-2"><v-icon left small>$download</v-icon> Klippy.log</v-btn>
<v-btn block color="secondary" @click="getMoonrakerLog()" class="me-2 mb-2"><v-icon left small>$download</v-icon>Moonraker.log</v-btn>
</v-card-text>
</collapsable-card>
</template>

<script lang="ts">
import { Component, Mixins } from 'vue-property-decorator'
import UtilsMixin from '@/mixins/utils'
@Component({})
export default class LogsCard extends Mixins(UtilsMixin) {
getKlippyLog () {
this.download('klippy.log', '')
}
getMoonrakerLog () {
this.download('moonraker.log', '')
}
}
</script>
13 changes: 8 additions & 5 deletions src/views/Configuration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
<v-col cols="12" md="7" class="pt-0">
<klippy-disconnected-card></klippy-disconnected-card>
<bed-mesh-card v-if="supportsBedMesh && klippyConnected"></bed-mesh-card>
<v-row v-if="klippyConnected">
<v-row>
<v-col cols="12" sm="6" class="pt-0">
<end-stops-card v-if="klippyConnected"></end-stops-card>
<logs-card></logs-card>
</v-col>
<v-col cols="12" sm="6" class="pt-0">
<runout-sensors-card v-if="klippyConnected && supportsRunoutSensors"></runout-sensors-card>
<v-col cols="12" sm="6" class="pt-0" v-if="klippyConnected">
<end-stops-card></end-stops-card>
<runout-sensors-card v-if="supportsRunoutSensors"></runout-sensors-card>
</v-col>
</v-row>
</v-col>
Expand All @@ -36,6 +37,7 @@ import RunoutSensorsCard from '@/components/cards/configuration/RunoutSensorsCar
import FileSystemCard from '@/components/cards/FileSystemCard.vue'
import KlippyDisconnectedCard from '@/components/cards/KlippyDisconnectedCard.vue'
import BedMeshCard from '@/components/cards/configuration/BedMeshCard.vue'
import LogsCard from '@/components/cards/configuration/LogsCard.vue'
const BedMeshWidget = () => import(/* webpackChunkName: "bedmesh", webpackPrefetch: true */ '@/components/widgets/configuration/BedMeshWidget.vue')
Expand All @@ -46,7 +48,8 @@ const BedMeshWidget = () => import(/* webpackChunkName: "bedmesh", webpackPrefet
EndStopsCard,
RunoutSensorsCard,
FileSystemCard,
KlippyDisconnectedCard
KlippyDisconnectedCard,
LogsCard
}
})
export default class Configuration extends Mixins(UtilsMixin) {
Expand Down

0 comments on commit 939e9a8

Please sign in to comment.