refactor: remove unused TheSidebarPrinterMenu

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>
This commit is contained in:
steadyjaw committed 2021-11-12 21:06:55 +01:00
1 parent 03408a026e
commit 4d6d9dee59
2 files changed
-86

No files matched your search

-2
View File
@@ -104,11 +104,9 @@ import {Mixins} from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import {PrinterStateKlipperConfig} from '@/store/printer/types'
import TheSelectPrinterDialog from '@/components/TheSelectPrinterDialog.vue'
import TheSidebarPrinterMenu from '@/components/TheSidebarPrinterMenu.vue'
@Component({
components: {
TheSidebarPrinterMenu,
TheSelectPrinterDialog
}
})
-84
View File
@@ -1,84 +0,0 @@
<style scoped>
</style>
<template>
<div v-if="displayMenuPoint">
<li :class="currentPage === '/allPrinters' ? 'nav-item active' : 'nav-item '">
<div
class="nav-link "
@click.prevent
@click="switchToPrinters"
role="button"
>
<v-icon>mdi-view-dashboard-outline</v-icon>
<span class="nav-title">{{ $t("App.Printers")}}</span>
<v-menu bottom :offset-x="true">
<template v-slot:activator="{ on, attrs }">
<v-icon class="nav-arrow right" v-bind="attrs" v-on="on" >mdi-chevron-down</v-icon>
</template>
<v-list dense>
<v-list-item two-line v-for="printer in printers" v-bind:key="printer._namespace" @click="changePrinter(printer)" :disabled="!printer.socket.isConnected" link>
<v-list-item-content>
<v-list-item-title>{{ getPrinterName(printer._namespace) }}</v-list-item-title>
<v-list-item-subtitle>{{ getPrinterDescription(printer)}}</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
</v-list>
</v-menu>
</div>
<v-item-group class="v-btn-toggle mx-4 d-block row" name="printers" v-if="false">
<v-btn class="col" color="primary" @click="switchToPrinters">{{ $t("App.Printers")}}</v-btn>
</v-item-group>
</li>
<v-divider class="my-4"></v-divider>
</div>
</template>
<script lang="ts">
import {Component, Mixins} from 'vue-property-decorator'
import BaseMixin from './mixins/base'
import router from '@/plugins/router'
import {FarmPrinterState} from '@/store/farm/printer/types'
@Component
export default class TheSidebarPrinterMenu extends Mixins(BaseMixin) {
get displayMenuPoint() {
return (this.remoteMode && this.countPrinters > 1) || (!this.remoteMode && this.countPrinters)
}
get printers() {
return this.$store.getters['farm/getPrinters']
}
get countPrinters() {
return this.$store.getters['farm/countPrinters']
}
get currentPage() {
return this.$route.fullPath
}
switchToPrinters() {
router.push('/allPrinters')
}
getPrinterName(namespace: string) {
return this.$store.getters['farm/'+namespace+'/getPrinterName']
}
getPrinterDescription(printer: FarmPrinterState) {
return this.$store.getters['farm/'+printer._namespace+'/getStatus']
}
changePrinter(printer: FarmPrinterState) {
if (printer.socket.isConnected) {
this.$store.dispatch('changePrinter', { printer: printer._namespace })
}
}
}
</script>