From 8af1668b615d031f53a29dd6e6d160c6374b07b1 Mon Sep 17 00:00:00 2001 From: Craig Bassett Date: Sat, 27 Mar 2021 11:33:01 -0500 Subject: [PATCH 01/17] chore: add additional file system waits Signed-off-by: Craig Bassett --- src/components/widgets/filesystem/FileSystem.vue | 8 ++++++-- src/globals.ts | 6 +++--- src/mixins/state.ts | 5 +++-- src/socketActions.ts | 14 +++++++++++--- todo.md | 6 ++++-- 5 files changed, 27 insertions(+), 12 deletions(-) diff --git a/src/components/widgets/filesystem/FileSystem.vue b/src/components/widgets/filesystem/FileSystem.vue index 9983dc3624..bafd845f4e 100644 --- a/src/components/widgets/filesystem/FileSystem.vue +++ b/src/components/widgets/filesystem/FileSystem.vue @@ -248,7 +248,11 @@ export default class FileSystem extends Mixins(StateMixin, FilesMixin, ServicesM // Determine if we're waiting for a directory load on our current path. get filesLoading () { - return this.hasWait(`${Waits.onGetDirectory}${this.currentPath}`) + return this.hasWait([ + `${Waits.onUpload}`, + Waits.onFileSystem, + `${Waits.onFileSystem}${this.currentPath}` + ]) } // Get a list of currently active uploads. @@ -459,7 +463,7 @@ export default class FileSystem extends Mixins(StateMixin, FilesMixin, ServicesM ) .then(res => { if (res) { - if (file.type === 'directory') SocketActions.serverFilesDeleteDirectory(`${this.currentPath}/${file.name}`) + if (file.type === 'directory') SocketActions.serverFilesDeleteDirectory(`${this.currentPath}/${file.name}`, true) if (file.type === 'file') SocketActions.serverFilesDeleteFile(`${this.currentPath}/${file.name}`) } }) diff --git a/src/globals.ts b/src/globals.ts index 9208b9d7cf..c8613e0112 100644 --- a/src/globals.ts +++ b/src/globals.ts @@ -236,7 +236,6 @@ export const Waits = Object.freeze({ onPrintCancel: 'onPrintCancel', onPrintResume: 'onPrintResume', onMacro: 'onMacro', - onGetDirectory: 'getDirectory', onSetSpeed: 'onSetSpeed', onSetFlow: 'onSetFlow', onSetFanSpeed: 'onSetFanSpeed', @@ -251,9 +250,10 @@ export const Waits = Object.freeze({ onSetAcceleration: 'onSetAcceleration', onSetDeceleration: 'onSetDeceleration', onSetSCV: 'onSetSCV', - onUpload: 'onUpload', onExtruderChange: 'onExtruderChange', - onLoadLanguage: 'onLoadLanguage' + onLoadLanguage: 'onLoadLanguage', + onFileSystem: 'onFileSystem', + onUpload: 'onUpload' }) export const defaultPlotLayout = Object.freeze({ diff --git a/src/mixins/state.ts b/src/mixins/state.ts index 3ba1e72d3c..2bd4031662 100644 --- a/src/mixins/state.ts +++ b/src/mixins/state.ts @@ -76,9 +76,10 @@ export default class UtilsMixin extends Vue { } /** - * Indicates if we have a valid wait. + * Indicates if we have a valid wait(s). + * Supports a single string or a list of. */ - hasWait (wait: string) { + hasWait (wait: string | string[]) { return this.$store.getters['wait/hasWait'](wait) } diff --git a/src/socketActions.ts b/src/socketActions.ts index ddd0b056a8..3613f7b4a8 100644 --- a/src/socketActions.ts +++ b/src/socketActions.ts @@ -348,7 +348,7 @@ export const SocketActions = { * for brevity. */ async serverFilesGetDirectory (root: string, path: string) { - const wait = `${Waits.onGetDirectory}${path}` + const wait = `${Waits.onFileSystem}${path}` baseEmit( 'server.files.get_directory', { @@ -359,9 +359,11 @@ export const SocketActions = { ) }, async serverFilesMove (source: string, dest: string) { + const wait = Waits.onFileSystem baseEmit( 'server.files.move', { dispatch: 'void', + wait, params: { source, dest @@ -375,9 +377,11 @@ export const SocketActions = { * Root should be included in the path. */ async serverFilesPostDirectory (path: string) { + const wait = Waits.onFileSystem baseEmit( 'server.files.post_directory', { dispatch: 'void', + wait, params: { path } @@ -386,9 +390,11 @@ export const SocketActions = { }, async serverFilesDeleteFile (path: string) { + const wait = Waits.onFileSystem baseEmit( 'server.files.delete_file', { dispatch: 'void', + wait, params: { path } @@ -396,13 +402,15 @@ export const SocketActions = { ) }, - async serverFilesDeleteDirectory (path: string) { + async serverFilesDeleteDirectory (path: string, force = false) { + const wait = Waits.onFileSystem baseEmit( 'server.files.delete_directory', { dispatch: 'void', + wait, params: { path, - force: false + force } } ) diff --git a/todo.md b/todo.md index d4e524339e..e7f685482b 100644 --- a/todo.md +++ b/todo.md @@ -2,12 +2,13 @@ ## Next Up +- hide enabled flag for collapsable card for camera panel on dashboard +- use components instead of plugins with moonraker + - add git history - move versions to configure page - reogranize service restarts / vs klipper firmware restarts -- use components instead of plugins with moonraker - - More macro layout options (categorize macros, ability to define layout in some way, color) - alternate bed mesh scales @@ -26,6 +27,7 @@ - update docs re: output pins - bulk actions to delete or move? +- copy file - move dialog - bulk action move - cleanup card layout stuff From be96c5025530e347c08a353f09e42525d36028b0 Mon Sep 17 00:00:00 2001 From: Craig Bassett Date: Sat, 27 Mar 2021 15:37:31 -0500 Subject: [PATCH 02/17] feat: allow single cams to fill the card space Signed-off-by: Craig Bassett --- src/components/cards/dashboard/CameraCard.vue | 17 ++++- src/components/dialogs/CameraDialog.vue | 2 +- src/components/inputs/FluiddSetting.vue | 23 ++++++- src/components/widgets/camera/Camera.vue | 62 ++++++++++--------- .../widgets/settings/CameraSettings.vue | 23 +++++++ src/locales/en.yaml | 2 + src/store/cameras/actions.ts | 8 +++ src/store/cameras/index.ts | 1 + src/store/cameras/mutations.ts | 7 +++ src/store/cameras/types.ts | 1 + 10 files changed, 113 insertions(+), 33 deletions(-) diff --git a/src/components/cards/dashboard/CameraCard.vue b/src/components/cards/dashboard/CameraCard.vue index 15e326e69f..b5fc595e33 100644 --- a/src/components/cards/dashboard/CameraCard.vue +++ b/src/components/cards/dashboard/CameraCard.vue @@ -15,7 +15,11 @@ :camera="dialogState.camera" > - + + @@ -56,10 +66,15 @@ export default class CameraCard extends Mixins(StateMixin) { collapsed = false get cols () { + if (this.fillSpace) return 12 if (this.cameras.length <= 2) return 6 if (this.cameras.length > 2) return 4 } + get fillSpace (): boolean { + return this.$store.state.cameras.fillSpace && this.cameras.length === 1 + } + get inLayout (): boolean { return (this.$store.state.config.layoutMode) } diff --git a/src/components/dialogs/CameraDialog.vue b/src/components/dialogs/CameraDialog.vue index ff38fe473b..83529f76ad 100644 --- a/src/components/dialogs/CameraDialog.vue +++ b/src/components/dialogs/CameraDialog.vue @@ -2,7 +2,7 @@ {{ title }} -
- +
+ + {{ subTitle }} +
@@ -26,6 +28,12 @@ export default class Setting extends Vue { @Prop({ type: String, default: '' }) title!: string; + @Prop({ type: String }) + subTitle!: string; + + @Prop({ type: String }) + help!: string; + @Prop({ type: Number, default: 6 }) rCols!: number; @@ -38,7 +46,11 @@ export default class Setting extends Vue { } get hasSubTitle () { - return (this.$slots.subtitle || this.$scopedSlots.subtitle) + return ( + this.$slots.subtitle || + this.$scopedSlots.subtitle || + this.subTitle + ) } get classes () { @@ -71,6 +83,11 @@ export default class Setting extends Vue { padding-bottom: 12px; padding-right: 12px; } + + .col.setting-title > .setting-sub-title { + font-size: 0.875rem; + } + .setting__link { cursor: pointer; user-select: none; diff --git a/src/components/widgets/camera/Camera.vue b/src/components/widgets/camera/Camera.vue index b1a5c60a1e..97a6130e84 100644 --- a/src/components/widgets/camera/Camera.vue +++ b/src/components/widgets/camera/Camera.vue @@ -1,33 +1,36 @@