diff --git a/package.json b/package.json index 823c34d1..b0ddb397 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fdm-monster/client", - "version": "1.5.0-rc6", + "version": "1.5.0-rc7", "author": "David Zwart", "license": "AGPL-3.0-or-later", "repository": { diff --git a/public/img/thumbail_unknown.jpg b/public/img/thumbail_unknown.jpg new file mode 100644 index 00000000..391cd188 Binary files /dev/null and b/public/img/thumbail_unknown.jpg differ diff --git a/src/App.vue b/src/App.vue index f23f3537..b654de6b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -25,6 +25,7 @@ + @@ -42,6 +43,7 @@ import { useSettingsStore } from "./store/settings.store"; import { useDialogsStore } from "@/store/dialog.store"; import BatchJsonCreateDialog from "@/components/Generic/Dialogs/BatchJsonCreateDialog.vue"; import YamlImportExportDialog from "@/components/Generic/Dialogs/YamlImportExportDialog.vue"; +import BatchReprintDialog from "@/components/Generic/Dialogs/BatchReprintDialog.vue"; import { useFeatureStore } from "./store/features.store"; import { useSnackbar } from "./shared/snackbar.composable"; import AppProgressSnackbar from "./components/Generic/Snackbars/AppProgressSnackbar.vue"; @@ -71,6 +73,7 @@ export default defineComponent({ PrinterMaintenanceDialog, FileExplorerSideNav, BatchJsonCreateDialog, + BatchReprintDialog, }, setup: () => { return { diff --git a/src/backend/batch.service.ts b/src/backend/batch.service.ts index 9694598e..d91dbffe 100644 --- a/src/backend/batch.service.ts +++ b/src/backend/batch.service.ts @@ -1,5 +1,7 @@ import { BaseService } from "./base.service"; import { IdType } from "@/utils/id.type"; +import { ServerApi } from "@/backend/server.api"; +import { ReprintFileDto } from "@/models/batch/reprint.dto"; export class BatchService extends BaseService { static async batchConnectUsb(printerIds: IdType[]) { @@ -13,4 +15,14 @@ export class BatchService extends BaseService { static async batchToggleEnabled(printerIds: IdType[], enabled: boolean) { return await this.postApi(`api/batch/toggle-enabled`, { printerIds, enabled }); } + + static async batchGetLastPrintedFiles(printerIds: IdType[]) { + const path = ServerApi.batchGetLastPrintedFilesRoute; + return await this.postApi(path, { printerIds }); + } + + static async batchReprintFiles(prints: { printerId: IdType; path: string }[]) { + const path = ServerApi.batchReprintFilesRoute; + return await this.postApi(path, { prints }); + } } diff --git a/src/backend/printer-file.service.ts b/src/backend/printer-file.service.ts index 81be590c..ac3653d5 100644 --- a/src/backend/printer-file.service.ts +++ b/src/backend/printer-file.service.ts @@ -23,11 +23,6 @@ export class PrinterFileService extends BaseService { return (await this.getApi(path)) as PrinterFileDto[]; } - static async batchReprintFiles(printerIds: IdType[]) { - const path = ServerApi.printerFilesBatchReprintRoute; - return await this.postApi(path, { printerIds }); - } - static async selectAndPrintFile(printerId: IdType, filePath: string, print = true) { const path = ServerApi.printerFilesSelectAndPrintRoute(printerId); return await this.postApi(path, { filePath, print }); diff --git a/src/backend/server.api.ts b/src/backend/server.api.ts index 3b54a793..4ff7e783 100644 --- a/src/backend/server.api.ts +++ b/src/backend/server.api.ts @@ -14,10 +14,14 @@ export class ServerApi { static floorRoute = `${ServerApi.base}/floor`; + static batchRoute = `${ServerApi.base}/batch`; + static batchGetLastPrintedFilesRoute = `${ServerApi.batchRoute}/reprint/list`; + static batchReprintFilesRoute = `${ServerApi.batchRoute}/reprint/execute`; + static printCompletionRoute = `${ServerApi.base}/print-completion`; static printerFilesRoute = `${ServerApi.base}/printer-files`; - static printerFilesBatchReprintRoute = `${ServerApi.printerFilesRoute}/batch/reprint-files`; + static printerFilesPurgeRoute = `${ServerApi.printerFilesRoute}/purge`; static customGCodeRoute = `${ServerApi.base}/custom-gcode`; diff --git a/src/components/AboutHelp/AboutView.vue b/src/components/AboutHelp/AboutView.vue index b14bf9ef..aa36ff88 100644 --- a/src/components/AboutHelp/AboutView.vue +++ b/src/components/AboutHelp/AboutView.vue @@ -108,30 +108,18 @@ - diff --git a/src/components/Generic/Actions/PrinterCreateAction.vue b/src/components/Generic/Actions/PrinterCreateAction.vue index db25777c..3f96c0d6 100644 --- a/src/components/Generic/Actions/PrinterCreateAction.vue +++ b/src/components/Generic/Actions/PrinterCreateAction.vue @@ -26,7 +26,7 @@ export default defineComponent({ computed: {}, methods: { openCreatePrinterDialog() { - this.dialogsStore.openDialog(DialogName.AddOrUpdatePrinterDialog); + this.dialogsStore.openDialogWithContext(DialogName.AddOrUpdatePrinterDialog); }, }, }); diff --git a/src/components/Generic/Dialogs/BaseDialog.vue b/src/components/Generic/Dialogs/BaseDialog.vue index 8601339c..19284d60 100644 --- a/src/components/Generic/Dialogs/BaseDialog.vue +++ b/src/components/Generic/Dialogs/BaseDialog.vue @@ -9,65 +9,64 @@ - diff --git a/src/components/Generic/Dialogs/BatchReprintDialog.ts b/src/components/Generic/Dialogs/BatchReprintDialog.ts new file mode 100644 index 00000000..41c6a9be --- /dev/null +++ b/src/components/Generic/Dialogs/BatchReprintDialog.ts @@ -0,0 +1,5 @@ +import { IdType } from "@/utils/id.type"; + +interface ReprintPrinterIds { + printerIds: IdType[]; +} diff --git a/src/components/Generic/Dialogs/BatchReprintDialog.vue b/src/components/Generic/Dialogs/BatchReprintDialog.vue new file mode 100644 index 00000000..02a9ce99 --- /dev/null +++ b/src/components/Generic/Dialogs/BatchReprintDialog.vue @@ -0,0 +1,153 @@ + + diff --git a/src/components/Generic/Dialogs/dialog.constants.ts b/src/components/Generic/Dialogs/dialog.constants.ts index da8cf04d..978f58f4 100644 --- a/src/components/Generic/Dialogs/dialog.constants.ts +++ b/src/components/Generic/Dialogs/dialog.constants.ts @@ -1,6 +1,8 @@ export enum DialogName { // The JSON import dialog, which is used to import a JSON file with a printer array into the application. BatchJsonCreate = "BatchJsonCreate", + // Stateful dialog meant for verifying the last printed file of each selected printer + BatchReprintDialog = "BatchReprintDialog", // The YAML import and export dialog, which is used to import and export a YAML file with a printer array into and from the application. // This YAML is for internal backup and restore only and is not compatible with external projects. YamlImportExport = "YamlImportExport", diff --git a/src/components/Generic/FileExplorerSideNav.vue b/src/components/Generic/FileExplorerSideNav.vue index 4ffb644c..86deefa7 100644 --- a/src/components/Generic/FileExplorerSideNav.vue +++ b/src/components/Generic/FileExplorerSideNav.vue @@ -553,7 +553,7 @@ export default defineComponent({ } this.printersStore.setMaintenanceDialogPrinter(this.storedSideNavPrinter); - this.dialogsStore.openDialog(DialogName.PrinterMaintenanceDialog); + this.dialogsStore.openDialogWithContext(DialogName.PrinterMaintenanceDialog); this.closeDrawer(); }, async refreshFiles() { @@ -599,7 +599,7 @@ export default defineComponent({ clickSettings() { if (!this.storedSideNavPrinter) return; this.printersStore.setUpdateDialogPrinter(this.storedSideNavPrinter); - this.dialogsStore.openDialog(DialogName.AddOrUpdatePrinterDialog); + this.dialogsStore.openDialogWithContext(DialogName.AddOrUpdatePrinterDialog); this.closeDrawer(); }, async clickPrintFile(file: PrinterFileDto) { diff --git a/src/components/PrinterGrid/HomeToolbar.vue b/src/components/PrinterGrid/HomeToolbar.vue index 92c60a56..e3fb4256 100644 --- a/src/components/PrinterGrid/HomeToolbar.vue +++ b/src/components/PrinterGrid/HomeToolbar.vue @@ -14,13 +14,13 @@ - + You have no printers. Click here to start! - + warning - {{ floorStore.floorlessPrinters.length }} unplaced printer(s)! + {{ floorStore.floorlessPrinters.length }} unplaced printer(s)! +
@@ -51,41 +51,25 @@ - diff --git a/src/components/PrinterGrid/PrinterGrid.vue b/src/components/PrinterGrid/PrinterGrid.vue index b2d5ab25..8c4a0375 100644 --- a/src/components/PrinterGrid/PrinterGrid.vue +++ b/src/components/PrinterGrid/PrinterGrid.vue @@ -76,8 +76,8 @@ -