Skip to content

Commit

Permalink
fix: moves estop to floating button in mobile view
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Bassett <[email protected]>
  • Loading branch information
cadriel committed May 1, 2021
1 parent 28364df commit 0d0cb68
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 46 deletions.
21 changes: 21 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@
:timeout="flashMessage.timeout"
/>

<v-btn
v-if="isMobile"
x-small
fab
fixed
bottom left
color="error"
@click="emergencyStop()"
>
<v-icon>$estop</v-icon>
</v-btn>

<v-main>
<router-view v-if="socketConnected" />
<socket-disconnected v-if="!socketConnected"></socket-disconnected>
Expand All @@ -38,6 +50,7 @@ import { Component, Mixins } from 'vue-property-decorator'
import { EventBus, FlashMessage } from '@/eventBus'
import StateMixin from './mixins/state'
import { Waits } from './globals'
import { SocketActions } from './socketActions'
@Component({})
export default class App extends Mixins(StateMixin) {
Expand All @@ -62,6 +75,10 @@ export default class App extends Mixins(StateMixin) {
return progress
}
get isMobile () {
return this.$vuetify.breakpoint.mobile
}
get pageTitle () {
const instanceName = this.$store.state.config.uiSettings.general.instanceName || ''
const pageName = this.$route.name
Expand Down Expand Up @@ -136,6 +153,10 @@ export default class App extends Mixins(StateMixin) {
})
}
emergencyStop () {
SocketActions.printerEmergencyStop()
}
handleToolsDrawerChange () {
this.toolsdrawer = !this.toolsdrawer
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/SystemPrinters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<script lang="ts">
import { Component, Mixins } from 'vue-property-decorator'
import consola from 'consola'
import { InitConfig, InstanceConfig, ApiConfig } from '@/store/config/types'
import { InitConfig, InstanceConfig } from '@/store/config/types'
import StateMixin from '@/mixins/state'
import { appInit } from '@/init'
import { Waits } from '@/globals'
Expand Down
7 changes: 6 additions & 1 deletion src/components/layout/AppBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@
</div>

<div class="toolbar-suplimental">
<v-tooltip bottom v-if="socketConnected">
<v-tooltip bottom v-if="socketConnected && !isMobile">
<template v-slot:activator="{ on, attrs }">
<app-btn
v-if="!isMobile"
:disabled="!klippyReady"
icon
class="ml-4"
Expand Down Expand Up @@ -115,6 +116,10 @@ export default class AppBar extends Mixins(StateMixin) {
return this.$store.getters['config/getTheme']
}
get isMobile () {
return this.$vuetify.breakpoint.mobile
}
emergencyStop () {
SocketActions.printerEmergencyStop()
}
Expand Down
69 changes: 32 additions & 37 deletions src/components/widgets/status/ReprintMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,43 +19,38 @@
<v-icon small class="ml-1" dense :class="{ 'rotate-180': value }">$chevronDown</v-icon>
</app-btn>
</template>

<v-card flat>
<v-card-text class="pa-2">
<div class="file-system">
<v-simple-table dense>
<tbody>
<tr
v-for="job in history"
:key="job.job_id"
@click="$emit('print', job.filename)"
class="row-select">
<td class="text-no-wrap">
<v-icon
v-if="!job.metadata.thumbnails || !job.metadata.thumbnails.length"
small
color="grey darken-2">
$fileDocument
</v-icon>
<img
v-if="job.metadata.thumbnails && job.metadata.thumbnails.length"
class="file-icon-thumb"
:src="getThumbUrl(job.metadata.thumbnails, getFilePaths(job.filename).path)"
:width="16"
/>
</td>
<td class="grey--text">
<span>
<job-history-item-status :job="job" dense></job-history-item-status>
{{ getFilePaths(job.filename).filename }}
</span>
</td>
</tr>
</tbody>
</v-simple-table>
</div>
</v-card-text>
</v-card>
<div class="file-system">
<v-simple-table dense>
<tbody>
<tr
v-for="job in history"
:key="job.job_id"
@click="$emit('print', job.filename)"
class="row-select">
<td class="text-no-wrap">
<v-icon
v-if="!job.metadata.thumbnails || !job.metadata.thumbnails.length"
small
color="grey darken-2">
$fileDocument
</v-icon>
<img
v-if="job.metadata.thumbnails && job.metadata.thumbnails.length"
class="file-icon-thumb"
:src="getThumbUrl(job.metadata.thumbnails, getFilePaths(job.filename).path)"
:width="16"
/>
</td>
<td class="grey--text">
<span>
<job-history-item-status :job="job" dense></job-history-item-status>
{{ getFilePaths(job.filename).filename }}
</span>
</td>
</tr>
</tbody>
</v-simple-table>
</div>
</v-menu>
</template>

Expand Down
1 change: 0 additions & 1 deletion src/mixins/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Vue from 'vue'
import { Component } from 'vue-property-decorator'
import { getThumb } from '@/store/helpers'
import { AxiosRequestConfig, CancelTokenSource } from 'axios'
import consola from 'consola'

@Component
export default class FilesMixin extends Vue {
Expand Down
3 changes: 1 addition & 2 deletions src/store/config/getters.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { GetterTree } from 'vuex'
import vuetify from '@/plugins/vuetify'
import { AppTableConfiguredHeaders, ConfigState, TemperaturePreset, ThemeConfig } from './types'
import { ConfigState, TemperaturePreset, ThemeConfig } from './types'
import { RootState } from '../types'
import { Heater, Fan } from '../printer/types'
import tinycolor from '@ctrl/tinycolor'
import { AppTableHeader } from '@/types'
import { filter } from 'vue/types/umd'
import { AppTablePartialHeader } from '@/types/tableheaders'

export const getters: GetterTree<ConfigState, RootState> = {
Expand Down
3 changes: 1 addition & 2 deletions src/store/config/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ import { MutationTree } from 'vuex'
import { ConfigState, UiSettings, SaveByPath, InstanceConfig, InitConfig } from './types'
import { defaultState } from './index'
import { Globals } from '@/globals'
import { merge, set, cloneDeep } from 'lodash-es'
import { merge, set } from 'lodash-es'
import { v4 as uuidv4 } from 'uuid'
import { AppTableHeader } from '@/types'
import { AppTablePartialHeader } from '@/types/tableheaders'
import consola from 'consola'

export const mutations: MutationTree<ConfigState> = {
/**
Expand Down
2 changes: 0 additions & 2 deletions src/store/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { FileChangeItem, FilePaths, AppFile, AppFileWithMeta, KlipperFile, Klipp
import { SocketActions } from '@/socketActions'
import store from '@/store'
import { KlipperMesh, ProcessedMesh } from './mesh/types'
import { AppTableHeader } from '@/types'
import { AppTablePartialHeader } from '@/types/tableheaders'

export const isOfType = <T>(
varToBeChecked: any,
Expand Down
1 change: 1 addition & 0 deletions todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Next Up

- Update mesh box to center on mesh center if no relative index set
- Power on graph toggles back off on a klipper restart
- Authorization
- add cpu time / resource monitoring
Expand Down
1 change: 1 addition & 0 deletions vue.config.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0d0cb68

Please sign in to comment.