@fdm-monster/client-next 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.all-contributorsrc +57 -0
- package/.browserslistrc +4 -0
- package/.editorconfig +5 -0
- package/.env +1 -0
- package/.eslintrc-auto-import.json +73 -0
- package/.eslintrc.js +126 -0
- package/.github/FUNDING.yml +3 -0
- package/.github/workflows/release-client.yml +94 -0
- package/.github/workflows/vue-publish.yml +26 -0
- package/.prettierignore +15 -0
- package/.prettierrc.cjs +7 -0
- package/.whitesource +12 -0
- package/.yarn/releases/yarn-4.5.1.cjs +934 -0
- package/.yarnrc.yml +3 -0
- package/CODE_OF_CONDUCT.md +46 -0
- package/README.md +93 -0
- package/RELEASE_NOTES.MD +11 -0
- package/index.html +16 -0
- package/package.default.json +42 -0
- package/package.json +26 -0
- package/public/favicon.ico +0 -0
- package/public/img/DavidZwart.jpg +0 -0
- package/public/img/OIG.JYDC2RaWdz7g9.jpg +0 -0
- package/public/img/OIG.jpg +0 -0
- package/public/img/icons/android-chrome-192x192.png +0 -0
- package/public/img/icons/android-chrome-256x256.png +0 -0
- package/public/img/icons/android-chrome-384x384.png +0 -0
- package/public/img/icons/android-chrome-512x512.png +0 -0
- package/public/img/icons/favicon.svg +1 -0
- package/public/img/logo.png +0 -0
- package/public/img/logo.svg +1 -0
- package/public/img/manifest.webmanifest +33 -0
- package/public/img/octoprint-tentacle.svg +144 -0
- package/public/img/thumbail_unknown.jpg +0 -0
- package/public/img/vbanner.jpg +0 -0
- package/public/index.html +17 -0
- package/public/robots.txt +2 -0
- package/renovate.json +30 -0
- package/src/App.vue +60 -0
- package/src/AppLoader.vue +383 -0
- package/src/assets/adjectives.json +1468 -0
- package/src/assets/android-chrome-192x192.png +0 -0
- package/src/assets/logo.png +0 -0
- package/src/assets/logo.svg +6 -0
- package/src/assets/nouns.json +4309 -0
- package/src/auto-imports.d.ts +139 -0
- package/src/backend/app.service.ts +39 -0
- package/src/backend/auth.service.ts +56 -0
- package/src/backend/base.service.ts +57 -0
- package/src/backend/batch.service.ts +37 -0
- package/src/backend/camera-stream.service.ts +33 -0
- package/src/backend/custom-gcode.service.ts +11 -0
- package/src/backend/dto/octoprint-settings.dto.ts +168 -0
- package/src/backend/first-time-setup.service.ts +17 -0
- package/src/backend/floor.service.ts +84 -0
- package/src/backend/index.ts +4 -0
- package/src/backend/print-completions.service.ts +11 -0
- package/src/backend/printer-file.service.ts +91 -0
- package/src/backend/printer-group.service.ts +62 -0
- package/src/backend/printer-job.service.ts +20 -0
- package/src/backend/printer-settings.service.ts +28 -0
- package/src/backend/printers.service.ts +136 -0
- package/src/backend/server-private.service.ts +55 -0
- package/src/backend/server.api.ts +132 -0
- package/src/backend/settings.service.ts +85 -0
- package/src/backend/user.service.ts +51 -0
- package/src/components/AboutHelp/AboutView.vue +164 -0
- package/src/components/CameraGrid/CameraGridView.vue +111 -0
- package/src/components/FirstTimeSetup/FirstTimeSetupView.vue +354 -0
- package/src/components/Generic/Actions/PrinterConnectionAction.vue +56 -0
- package/src/components/Generic/Actions/PrinterCreateAction.vue +22 -0
- package/src/components/Generic/Actions/PrinterDeleteAction.vue +29 -0
- package/src/components/Generic/Actions/PrinterQuickStopAction.vue +35 -0
- package/src/components/Generic/Actions/PrinterSettingsAction.vue +35 -0
- package/src/components/Generic/Actions/PrinterUrlAction.vue +24 -0
- package/src/components/Generic/Actions/RefreshFilesAction.vue +50 -0
- package/src/components/Generic/Actions/SyncPrinterNameAction.vue +36 -0
- package/src/components/Generic/Dialogs/AddOrUpdateCameraStreamDialog.vue +131 -0
- package/src/components/Generic/Dialogs/AddOrUpdateFloorDialog.vue +141 -0
- package/src/components/Generic/Dialogs/AddOrUpdatePrinterDialog.vue +303 -0
- package/src/components/Generic/Dialogs/BaseDialog.vue +81 -0
- package/src/components/Generic/Dialogs/BatchJsonCreateDialog.vue +109 -0
- package/src/components/Generic/Dialogs/BatchReprintDialog.vue +190 -0
- package/src/components/Generic/Dialogs/PrinterChecksPanel.vue +37 -0
- package/src/components/Generic/Dialogs/PrinterControlDialog.vue +202 -0
- package/src/components/Generic/Dialogs/PrinterMaintenanceDialog.vue +130 -0
- package/src/components/Generic/Dialogs/YamlImportExportDialog.vue +186 -0
- package/src/components/Generic/Dialogs/dialog.constants.ts +19 -0
- package/src/components/Generic/FileExplorerSideNav.vue +734 -0
- package/src/components/Generic/Loaders/GridLoader.vue +68 -0
- package/src/components/Generic/NavigationDrawer.vue +69 -0
- package/src/components/Generic/PrintJobsMenu.vue +148 -0
- package/src/components/Generic/Snackbars/AppErrorSnackbar.vue +64 -0
- package/src/components/Generic/Snackbars/AppInfoSnackbar.vue +63 -0
- package/src/components/Generic/Snackbars/AppProgressSnackbar.vue +158 -0
- package/src/components/Generic/Vuetify/TooltipButton.vue +47 -0
- package/src/components/HelpOverlay/HelpOverlay.vue +57 -0
- package/src/components/Login/LoginForm.vue +206 -0
- package/src/components/Login/LoginView.spec.ts +64 -0
- package/src/components/Login/LoginView.vue +65 -0
- package/src/components/Login/Logo.vue +13 -0
- package/src/components/Login/PermissionDenied.vue +109 -0
- package/src/components/Login/RegistrationForm.vue +207 -0
- package/src/components/Login/RegistrationView.vue +17 -0
- package/src/components/Login/__snapshots__/LoginView.spec.ts.snap +1051 -0
- package/src/components/NotFound/NotFoundView.vue +39 -0
- package/src/components/PrintStatistics/PrintStatistics.vue +168 -0
- package/src/components/PrintStatistics/PrintStatisticsView.vue +15 -0
- package/src/components/PrinterGrid/HomeToolbar.vue +90 -0
- package/src/components/PrinterGrid/PrinterGrid.vue +164 -0
- package/src/components/PrinterGrid/PrinterGridTile.vue +438 -0
- package/src/components/PrinterGrid/PrinterGridView.vue +210 -0
- package/src/components/PrinterList/FileControlList.vue +40 -0
- package/src/components/PrinterList/PrinterDetails.vue +91 -0
- package/src/components/PrinterList/PrintersView.vue +492 -0
- package/src/components/Settings/AccountSettings.vue +163 -0
- package/src/components/Settings/DiagnosticsSettings.vue +137 -0
- package/src/components/Settings/EmergencyCommands.vue +265 -0
- package/src/components/Settings/FloorSettings.vue +276 -0
- package/src/components/Settings/GridSettings.vue +127 -0
- package/src/components/Settings/OctoPrintSettings.vue +188 -0
- package/src/components/Settings/ServerProtectionSettings.vue +370 -0
- package/src/components/Settings/SettingsView.vue +73 -0
- package/src/components/Settings/SoftwareUpgradeSettings.vue +297 -0
- package/src/components/Settings/UserManagementSettings.vue +257 -0
- package/src/components/TopBar.vue +147 -0
- package/src/components.d.ts +70 -0
- package/src/directives/file-upload.directive.ts +117 -0
- package/src/directives/printer-drop-position.directive.ts +92 -0
- package/src/env.d.ts +6 -0
- package/src/main.ts +76 -0
- package/src/models/batch/reprint.dto.ts +79 -0
- package/src/models/batch.model.ts +11 -0
- package/src/models/camera-streams/camera-stream.ts +19 -0
- package/src/models/floors/floor.model.ts +30 -0
- package/src/models/octoprint/connection-options.model.ts +8 -0
- package/src/models/plugins/firmware-updates/prusa-firmware-release.model.ts +57 -0
- package/src/models/print-completions/print-completions.model.ts +49 -0
- package/src/models/printers/crud/create-printer.model.ts +26 -0
- package/src/models/printers/file-upload-commands.model.ts +4 -0
- package/src/models/printers/gcode/gcode-analysis.model.ts +30 -0
- package/src/models/printers/printer-current-job.model.ts +90 -0
- package/src/models/printers/printer-file.model.ts +48 -0
- package/src/models/printers/printer.model.ts +18 -0
- package/src/models/server/client-releases.model.ts +27 -0
- package/src/models/server/export-yaml.model.ts +11 -0
- package/src/models/server/features.model.ts +37 -0
- package/src/models/server/github-rate-limit.model.ts +21 -0
- package/src/models/server/version.model.ts +14 -0
- package/src/models/settings/printer-file-clean-settings.model.ts +5 -0
- package/src/models/settings/server-settings.dto.ts +19 -0
- package/src/models/settings/settings.model.ts +57 -0
- package/src/models/socketio-messages/socketio-message.model.ts +53 -0
- package/src/models/uploads/queued-upload.model.ts +12 -0
- package/src/models/user.model.ts +15 -0
- package/src/plugins/README.md +3 -0
- package/src/plugins/index.ts +17 -0
- package/src/plugins/vuetify.ts +53 -0
- package/src/router/index.ts +192 -0
- package/src/router/route-names.ts +14 -0
- package/src/router/utils.ts +23 -0
- package/src/shared/alert.events.ts +14 -0
- package/src/shared/app.constants.ts +23 -0
- package/src/shared/auth.constants.ts +34 -0
- package/src/shared/dialog.composable.ts +41 -0
- package/src/shared/drag.constants.ts +19 -0
- package/src/shared/experimental.constants.ts +1 -0
- package/src/shared/http-client.ts +162 -0
- package/src/shared/noun-adjectives.data.ts +24 -0
- package/src/shared/printer-grid.constants.ts +5 -0
- package/src/shared/printer-state.constants.ts +194 -0
- package/src/shared/snackbar.composable.ts +66 -0
- package/src/shared/socketio.service.ts +104 -0
- package/src/store/auth.store.ts +255 -0
- package/src/store/connection.store.ts +66 -0
- package/src/store/dialog.store.ts +114 -0
- package/src/store/features.store.ts +57 -0
- package/src/store/floor.store.ts +173 -0
- package/src/store/grid.store.ts +10 -0
- package/src/store/index.ts +4 -0
- package/src/store/printer-state.store.ts +246 -0
- package/src/store/printer.store.ts +236 -0
- package/src/store/profile.store.ts +25 -0
- package/src/store/settings.store.ts +64 -0
- package/src/store/test-printer.store.ts +70 -0
- package/src/store/uploads.store.ts +75 -0
- package/src/styles/README.md +3 -0
- package/src/styles/settings.scss +10 -0
- package/src/types/global.d.ts +15 -0
- package/src/utils/array.utils.ts +15 -0
- package/src/utils/date.utils.ts +5 -0
- package/src/utils/download-file.util.ts +25 -0
- package/src/utils/error.utils.ts +3 -0
- package/src/utils/file-size.util.ts +11 -0
- package/src/utils/id.type.ts +1 -0
- package/src/utils/sentry.util.ts +8 -0
- package/src/utils/test.util.ts +30 -0
- package/src/utils/time.utils.ts +2 -0
- package/src/utils/uploads-state.utils.ts +58 -0
- package/src/utils/validation.utils.ts +14 -0
- package/src/vite-env.d.ts +7 -0
- package/test/setup-axios-mock.ts +15 -0
- package/tsconfig.json +47 -0
- package/tsconfig.node.json +9 -0
- package/vite.config.mts +106 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-col :cols="cols">
|
|
3
|
+
<strong> Checks: </strong>
|
|
4
|
+
<v-alert
|
|
5
|
+
v-for="(item, index) of getEvents()"
|
|
6
|
+
:key="index"
|
|
7
|
+
:type="item.color"
|
|
8
|
+
density="compact"
|
|
9
|
+
>
|
|
10
|
+
<small> {{ item.label }} {{ item.text }} </small>
|
|
11
|
+
</v-alert>
|
|
12
|
+
</v-col>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script lang="ts" setup>
|
|
16
|
+
import { useTestPrinterStore } from '@/store/test-printer.store'
|
|
17
|
+
|
|
18
|
+
const errorCol = 'error'
|
|
19
|
+
const successCol = 'success'
|
|
20
|
+
const testPrinterStore = useTestPrinterStore()
|
|
21
|
+
const cols = ref(4)
|
|
22
|
+
|
|
23
|
+
function getEvents() {
|
|
24
|
+
return testPrinterStore.getEvents().map((e) => {
|
|
25
|
+
return {
|
|
26
|
+
label: e.event,
|
|
27
|
+
text: e.payload,
|
|
28
|
+
color: (e.failure ? errorCol : successCol) as
|
|
29
|
+
| 'success'
|
|
30
|
+
| 'error'
|
|
31
|
+
| 'warning'
|
|
32
|
+
| 'info'
|
|
33
|
+
| undefined
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
</script>
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<BaseDialog
|
|
3
|
+
:id="dialog.dialogId"
|
|
4
|
+
:max-width="'700px'"
|
|
5
|
+
@escape="closeDialog()"
|
|
6
|
+
>
|
|
7
|
+
<v-card>
|
|
8
|
+
<v-card-title> Printer Controls </v-card-title>
|
|
9
|
+
<v-card-text>
|
|
10
|
+
<v-container v-if="printer">
|
|
11
|
+
<v-row>
|
|
12
|
+
<v-col :cols="12">
|
|
13
|
+
Printer: {{ printer?.name }}
|
|
14
|
+
<br />
|
|
15
|
+
<v-chip color="primary">
|
|
16
|
+
{{ printerTemps?.actual }}C / {{ printerTemps?.target }}C
|
|
17
|
+
</v-chip>
|
|
18
|
+
</v-col>
|
|
19
|
+
</v-row>
|
|
20
|
+
<v-row>
|
|
21
|
+
<v-col :cols="8">
|
|
22
|
+
X/Y
|
|
23
|
+
<br />
|
|
24
|
+
<v-btn
|
|
25
|
+
class="bg-primary"
|
|
26
|
+
variant="outlined"
|
|
27
|
+
size="x-large"
|
|
28
|
+
@click="jogPrinterHead(-1, 1, 0)"
|
|
29
|
+
>
|
|
30
|
+
<v-icon>north_west</v-icon>
|
|
31
|
+
</v-btn>
|
|
32
|
+
<v-btn
|
|
33
|
+
class="bg-primary"
|
|
34
|
+
variant="outlined"
|
|
35
|
+
size="x-large"
|
|
36
|
+
@click="jogPrinterHead(0, 1, 0)"
|
|
37
|
+
>
|
|
38
|
+
<v-icon>north</v-icon>
|
|
39
|
+
</v-btn>
|
|
40
|
+
<v-btn
|
|
41
|
+
class="bg-primary"
|
|
42
|
+
variant="outlined"
|
|
43
|
+
size="x-large"
|
|
44
|
+
@click="jogPrinterHead(1, 1, 0)"
|
|
45
|
+
>
|
|
46
|
+
<v-icon>north_east</v-icon>
|
|
47
|
+
</v-btn>
|
|
48
|
+
<br />
|
|
49
|
+
<v-btn
|
|
50
|
+
class="bg-primary"
|
|
51
|
+
variant="outlined"
|
|
52
|
+
size="x-large"
|
|
53
|
+
@click="jogPrinterHead(-1, 0, 0)"
|
|
54
|
+
>
|
|
55
|
+
<v-icon>west</v-icon>
|
|
56
|
+
</v-btn>
|
|
57
|
+
<v-btn
|
|
58
|
+
class="bg-primary"
|
|
59
|
+
variant="outlined"
|
|
60
|
+
size="x-large"
|
|
61
|
+
@click="homeAxes(['x', 'y'])"
|
|
62
|
+
>
|
|
63
|
+
<v-icon>home</v-icon>
|
|
64
|
+
</v-btn>
|
|
65
|
+
<v-btn
|
|
66
|
+
class="bg-primary"
|
|
67
|
+
variant="outlined"
|
|
68
|
+
size="x-large"
|
|
69
|
+
@click="jogPrinterHead(1, 0, 0)"
|
|
70
|
+
>
|
|
71
|
+
<v-icon>east</v-icon>
|
|
72
|
+
</v-btn>
|
|
73
|
+
<br />
|
|
74
|
+
<v-btn
|
|
75
|
+
class="bg-primary"
|
|
76
|
+
variant="outlined"
|
|
77
|
+
size="x-large"
|
|
78
|
+
@click="jogPrinterHead(-1, -1, 0)"
|
|
79
|
+
>
|
|
80
|
+
<v-icon>south_west</v-icon>
|
|
81
|
+
</v-btn>
|
|
82
|
+
<v-btn
|
|
83
|
+
class="bg-primary"
|
|
84
|
+
variant="outlined"
|
|
85
|
+
size="x-large"
|
|
86
|
+
@click="jogPrinterHead(0, -1, 0)"
|
|
87
|
+
>
|
|
88
|
+
<v-icon>south</v-icon>
|
|
89
|
+
</v-btn>
|
|
90
|
+
<v-btn
|
|
91
|
+
class="bg-primary"
|
|
92
|
+
variant="outlined"
|
|
93
|
+
size="x-large"
|
|
94
|
+
@click="jogPrinterHead(1, -1, 0)"
|
|
95
|
+
>
|
|
96
|
+
<v-icon>south_east</v-icon>
|
|
97
|
+
</v-btn>
|
|
98
|
+
</v-col>
|
|
99
|
+
<v-col cols="4">
|
|
100
|
+
Z
|
|
101
|
+
<br />
|
|
102
|
+
<v-btn
|
|
103
|
+
class="bg-primary"
|
|
104
|
+
variant="outlined"
|
|
105
|
+
size="x-large"
|
|
106
|
+
@click="jogPrinterHead(0, 0, 1)"
|
|
107
|
+
>
|
|
108
|
+
<v-icon>north</v-icon>
|
|
109
|
+
</v-btn>
|
|
110
|
+
<br />
|
|
111
|
+
<v-btn
|
|
112
|
+
class="bg-primary"
|
|
113
|
+
variant="outlined"
|
|
114
|
+
size="x-large"
|
|
115
|
+
@click="homeAxes(['z'])"
|
|
116
|
+
>
|
|
117
|
+
<v-icon>home</v-icon>
|
|
118
|
+
</v-btn>
|
|
119
|
+
<br />
|
|
120
|
+
<v-btn
|
|
121
|
+
class="bg-primary"
|
|
122
|
+
variant="outlined"
|
|
123
|
+
size="x-large"
|
|
124
|
+
@click="jogPrinterHead(1, 0, 1)"
|
|
125
|
+
>
|
|
126
|
+
<v-icon>south</v-icon>
|
|
127
|
+
</v-btn>
|
|
128
|
+
</v-col>
|
|
129
|
+
</v-row>
|
|
130
|
+
<v-row>
|
|
131
|
+
<v-col cols="12">
|
|
132
|
+
<v-btn-toggle v-model="multiplier">
|
|
133
|
+
<v-btn :value="0.1"> 0.1 </v-btn>
|
|
134
|
+
<v-btn :value="1"> 1 </v-btn>
|
|
135
|
+
<v-btn :value="10"> 10 </v-btn>
|
|
136
|
+
<v-btn :value="100"> 100 </v-btn>
|
|
137
|
+
</v-btn-toggle>
|
|
138
|
+
</v-col>
|
|
139
|
+
</v-row>
|
|
140
|
+
</v-container>
|
|
141
|
+
</v-card-text>
|
|
142
|
+
<v-card-actions>
|
|
143
|
+
<v-spacer />
|
|
144
|
+
<v-btn
|
|
145
|
+
variant="text"
|
|
146
|
+
@click="closeDialog()"
|
|
147
|
+
>
|
|
148
|
+
Close
|
|
149
|
+
</v-btn>
|
|
150
|
+
</v-card-actions>
|
|
151
|
+
</v-card>
|
|
152
|
+
</BaseDialog>
|
|
153
|
+
</template>
|
|
154
|
+
|
|
155
|
+
<script lang="ts" setup>
|
|
156
|
+
import { useDialog } from '@/shared/dialog.composable'
|
|
157
|
+
import { DialogName } from '@/components/Generic/Dialogs/dialog.constants'
|
|
158
|
+
import { computed, ref } from 'vue'
|
|
159
|
+
import { usePrinterStore } from '@/store/printer.store'
|
|
160
|
+
import { IdType } from '@/utils/id.type'
|
|
161
|
+
import { usePrinterStateStore } from '@/store/printer-state.store'
|
|
162
|
+
import { PrintersService } from '@/backend'
|
|
163
|
+
|
|
164
|
+
const dialog = useDialog<{ printerId: IdType }>(DialogName.PrinterControlDialog)
|
|
165
|
+
const printerStore = usePrinterStore()
|
|
166
|
+
const printerStateStore = usePrinterStateStore()
|
|
167
|
+
const printerId = computed(() => dialog.context()?.printerId)
|
|
168
|
+
const printer = computed(() => {
|
|
169
|
+
if (!printerId.value) return
|
|
170
|
+
|
|
171
|
+
return printerStore.printer(printerId.value)
|
|
172
|
+
})
|
|
173
|
+
|
|
174
|
+
const multiplier = ref<number>(10)
|
|
175
|
+
|
|
176
|
+
const printerTemps = computed(() => {
|
|
177
|
+
const events = printerStateStore.printerEventsById[printerId.value]
|
|
178
|
+
if (
|
|
179
|
+
events?.current?.payload?.temps?.length &&
|
|
180
|
+
events?.current?.payload?.temps[0]?.tool0?.actual
|
|
181
|
+
) {
|
|
182
|
+
return events?.current?.payload?.temps[0]?.tool0
|
|
183
|
+
}
|
|
184
|
+
return null
|
|
185
|
+
})
|
|
186
|
+
|
|
187
|
+
const jogPrinterHead = async (x: number, y: number, z: number) => {
|
|
188
|
+
await PrintersService.sendPrinterJogCommand(printerId.value, {
|
|
189
|
+
x: x * multiplier.value,
|
|
190
|
+
y: y * multiplier.value,
|
|
191
|
+
z: z * multiplier.value
|
|
192
|
+
})
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const homeAxes = async (axes: string[]) => {
|
|
196
|
+
await PrintersService.sendPrinterHomeCommand(printerId.value, axes)
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const closeDialog = () => {
|
|
200
|
+
dialog.closeDialog()
|
|
201
|
+
}
|
|
202
|
+
</script>
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<BaseDialog
|
|
3
|
+
:id="dialog.dialogId"
|
|
4
|
+
:max-width="'700px'"
|
|
5
|
+
@escape="closeDialog()"
|
|
6
|
+
>
|
|
7
|
+
<v-card class="pa-4">
|
|
8
|
+
<v-card-title>
|
|
9
|
+
<span class="text-h5">
|
|
10
|
+
Mark '{{ printer?.name }}' for maintenance
|
|
11
|
+
</span>
|
|
12
|
+
</v-card-title>
|
|
13
|
+
<v-alert color="secondary">
|
|
14
|
+
Keep this info clear and stick to convention
|
|
15
|
+
</v-alert>
|
|
16
|
+
<v-card-text>
|
|
17
|
+
<v-row>
|
|
18
|
+
<v-col cols="12">
|
|
19
|
+
<v-select
|
|
20
|
+
v-model="selectedQuickItems"
|
|
21
|
+
:chips="true"
|
|
22
|
+
:items="quickItems"
|
|
23
|
+
:menu-props="{
|
|
24
|
+
closeOnBack: true,
|
|
25
|
+
closeOnContentClick: true
|
|
26
|
+
}"
|
|
27
|
+
clearable
|
|
28
|
+
color="primary"
|
|
29
|
+
multiple
|
|
30
|
+
placeholder="Quick select reason"
|
|
31
|
+
@update:model-value="updateText()"
|
|
32
|
+
/>
|
|
33
|
+
<v-textarea
|
|
34
|
+
v-model="formData.disabledReason"
|
|
35
|
+
data-vv-validate-on="change|blur"
|
|
36
|
+
>
|
|
37
|
+
<template #label>
|
|
38
|
+
<div>Type the reason*</div>
|
|
39
|
+
</template>
|
|
40
|
+
</v-textarea>
|
|
41
|
+
</v-col>
|
|
42
|
+
</v-row>
|
|
43
|
+
</v-card-text>
|
|
44
|
+
<v-card-actions>
|
|
45
|
+
<em class="text-red"> * indicates required field </em>
|
|
46
|
+
<v-spacer />
|
|
47
|
+
<v-btn
|
|
48
|
+
variant="text"
|
|
49
|
+
@click="closeDialog()"
|
|
50
|
+
>
|
|
51
|
+
Close
|
|
52
|
+
</v-btn>
|
|
53
|
+
<v-btn
|
|
54
|
+
color="blue-darken-1"
|
|
55
|
+
variant="text"
|
|
56
|
+
@click="submit()"
|
|
57
|
+
>
|
|
58
|
+
Save
|
|
59
|
+
</v-btn>
|
|
60
|
+
</v-card-actions>
|
|
61
|
+
</v-card>
|
|
62
|
+
</BaseDialog>
|
|
63
|
+
</template>
|
|
64
|
+
|
|
65
|
+
<script lang="ts" setup>
|
|
66
|
+
import { computed, ref } from 'vue'
|
|
67
|
+
import { PrintersService } from '@/backend'
|
|
68
|
+
import { usePrinterStore } from '@/store/printer.store'
|
|
69
|
+
import { DialogName } from '@/components/Generic/Dialogs/dialog.constants'
|
|
70
|
+
import { useDialog } from '@/shared/dialog.composable'
|
|
71
|
+
|
|
72
|
+
const selectedQuickItems = ref([])
|
|
73
|
+
const quickItems = [
|
|
74
|
+
'Broken part',
|
|
75
|
+
'Blob',
|
|
76
|
+
'Maxtemp',
|
|
77
|
+
'Preheat error',
|
|
78
|
+
'Cable USB ',
|
|
79
|
+
'Bed thermal runaway',
|
|
80
|
+
'Thermistor Heatbed',
|
|
81
|
+
'Thermistor Heatblock',
|
|
82
|
+
'Thermal Runaway',
|
|
83
|
+
'Mintemp Nozzle',
|
|
84
|
+
'Mintemp Heatbed',
|
|
85
|
+
'Nozzle',
|
|
86
|
+
'Nozzle Clog',
|
|
87
|
+
'Fan Hotend',
|
|
88
|
+
'Fan Part cooling',
|
|
89
|
+
'Extruder rattle',
|
|
90
|
+
'Extruder',
|
|
91
|
+
'Z Axis',
|
|
92
|
+
'X Axis',
|
|
93
|
+
'Y Axis',
|
|
94
|
+
'Rented',
|
|
95
|
+
'Motherboard',
|
|
96
|
+
'Other',
|
|
97
|
+
'Clean'
|
|
98
|
+
]
|
|
99
|
+
const formData = ref<{
|
|
100
|
+
disabledReason?: string
|
|
101
|
+
}>({})
|
|
102
|
+
const printersStore = usePrinterStore()
|
|
103
|
+
const dialog = useDialog(DialogName.PrinterMaintenanceDialog)
|
|
104
|
+
const printer = computed(() => printersStore.maintenanceDialogPrinter)
|
|
105
|
+
|
|
106
|
+
const updateText = () => {
|
|
107
|
+
formData.value.disabledReason = selectedQuickItems.value.join(', ')
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const submit = async () => {
|
|
111
|
+
const printerId = printer.value?.id
|
|
112
|
+
if (!printerId) {
|
|
113
|
+
formData.value = {}
|
|
114
|
+
closeDialog()
|
|
115
|
+
return
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const disabledReason = formData.value.disabledReason
|
|
119
|
+
await PrintersService.updatePrinterMaintenance(printerId, disabledReason)
|
|
120
|
+
|
|
121
|
+
formData.value = {}
|
|
122
|
+
closeDialog()
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const closeDialog = () => {
|
|
126
|
+
selectedQuickItems.value = []
|
|
127
|
+
dialog.closeDialog()
|
|
128
|
+
printersStore.setMaintenanceDialogPrinter()
|
|
129
|
+
}
|
|
130
|
+
</script>
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<BaseDialog
|
|
3
|
+
:id="dialog.dialogId"
|
|
4
|
+
max-width="700px"
|
|
5
|
+
@before-opened="onBeforeDialogOpened"
|
|
6
|
+
@escape="closeDialog()"
|
|
7
|
+
>
|
|
8
|
+
<v-card class="pa-4">
|
|
9
|
+
<v-card-title>
|
|
10
|
+
<span class="text-h5"> YAML export and import </span>
|
|
11
|
+
</v-card-title>
|
|
12
|
+
<v-card-text>
|
|
13
|
+
<div>Choose mode:</div>
|
|
14
|
+
<v-row>
|
|
15
|
+
<br />
|
|
16
|
+
<v-radio-group
|
|
17
|
+
v-model="selectedMode"
|
|
18
|
+
class="ml-3"
|
|
19
|
+
inline
|
|
20
|
+
>
|
|
21
|
+
<v-radio
|
|
22
|
+
:value="0"
|
|
23
|
+
label="Import YAML"
|
|
24
|
+
/>
|
|
25
|
+
<v-radio
|
|
26
|
+
:value="1"
|
|
27
|
+
label="Export YAML"
|
|
28
|
+
/>
|
|
29
|
+
</v-radio-group>
|
|
30
|
+
</v-row>
|
|
31
|
+
|
|
32
|
+
<div>
|
|
33
|
+
<div
|
|
34
|
+
v-if="isImportMode"
|
|
35
|
+
class="pl-2"
|
|
36
|
+
>
|
|
37
|
+
<v-file-input
|
|
38
|
+
v-model="importFile"
|
|
39
|
+
accept=".yaml"
|
|
40
|
+
label="Select a YAML file for import *"
|
|
41
|
+
/>
|
|
42
|
+
</div>
|
|
43
|
+
<div v-else>
|
|
44
|
+
<v-checkbox
|
|
45
|
+
v-model="exportFloors"
|
|
46
|
+
class="pa-0 ma-0 mt-2 ml-2"
|
|
47
|
+
label="Include floors"
|
|
48
|
+
/>
|
|
49
|
+
<v-checkbox
|
|
50
|
+
v-model="exportGroups"
|
|
51
|
+
:disabled="disableExportGroups"
|
|
52
|
+
class="pa-0 ma-0 mt-2 ml-2"
|
|
53
|
+
label="Include groups"
|
|
54
|
+
/>
|
|
55
|
+
<v-checkbox
|
|
56
|
+
v-model="exportPrinters"
|
|
57
|
+
class="pa-0 ma-0 ml-2"
|
|
58
|
+
label="Include printers"
|
|
59
|
+
/>
|
|
60
|
+
<v-checkbox
|
|
61
|
+
v-model="exportFloorGrid"
|
|
62
|
+
class="pa-0 ma-0 ml-2"
|
|
63
|
+
label="Include grid positions (auto-includes printers)"
|
|
64
|
+
/>
|
|
65
|
+
|
|
66
|
+
Include notes (for yourself):
|
|
67
|
+
<v-textarea
|
|
68
|
+
v-model="notes"
|
|
69
|
+
rows="1"
|
|
70
|
+
/>
|
|
71
|
+
</div>
|
|
72
|
+
<v-btn
|
|
73
|
+
v-if="!isImportMode"
|
|
74
|
+
@click="downloadExportYamlFile()"
|
|
75
|
+
>
|
|
76
|
+
<v-icon>download</v-icon>
|
|
77
|
+
Export YAML file
|
|
78
|
+
</v-btn>
|
|
79
|
+
<v-btn
|
|
80
|
+
v-if="isImportMode"
|
|
81
|
+
:disabled="!isFileProvided"
|
|
82
|
+
@click="uploadAndImportYamlFile()"
|
|
83
|
+
>
|
|
84
|
+
<v-icon>upload</v-icon>
|
|
85
|
+
Import YAML data
|
|
86
|
+
</v-btn>
|
|
87
|
+
</div>
|
|
88
|
+
</v-card-text>
|
|
89
|
+
<v-card-actions>
|
|
90
|
+
<em class="text-red"> * indicates required field </em>
|
|
91
|
+
<v-spacer />
|
|
92
|
+
<v-btn
|
|
93
|
+
variant="text"
|
|
94
|
+
@click="closeDialog()"
|
|
95
|
+
>
|
|
96
|
+
Close
|
|
97
|
+
</v-btn>
|
|
98
|
+
</v-card-actions>
|
|
99
|
+
</v-card>
|
|
100
|
+
</BaseDialog>
|
|
101
|
+
</template>
|
|
102
|
+
|
|
103
|
+
<script lang="ts" setup>
|
|
104
|
+
import { DialogName } from '@/components/Generic/Dialogs/dialog.constants'
|
|
105
|
+
import { ServerPrivateService } from '@/backend/server-private.service'
|
|
106
|
+
import { useDialog } from '@/shared/dialog.composable'
|
|
107
|
+
import { useSnackbar } from '@/shared/snackbar.composable'
|
|
108
|
+
import { useFeatureStore } from '@/store/features.store'
|
|
109
|
+
|
|
110
|
+
const featureStore = useFeatureStore()
|
|
111
|
+
const dialog = useDialog(DialogName.YamlImportExport)
|
|
112
|
+
const snackbar = useSnackbar()
|
|
113
|
+
|
|
114
|
+
const errorMessage = ref('')
|
|
115
|
+
const errorDetailedMessage = ref('')
|
|
116
|
+
const selectedMode = ref(0)
|
|
117
|
+
const exportFloors = ref(true)
|
|
118
|
+
const exportFloorGrid = ref(true)
|
|
119
|
+
const exportGroups = ref(true)
|
|
120
|
+
const exportPrinters = ref(true)
|
|
121
|
+
const importFile = ref(undefined)
|
|
122
|
+
const notes = ref('')
|
|
123
|
+
|
|
124
|
+
const disableExportGroups = computed(() => {
|
|
125
|
+
return !featureStore.hasFeature('printerGroupsApi')
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
const isFileProvided = computed(() => {
|
|
129
|
+
return !!importFile.value
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
const isImportMode = computed(() => {
|
|
133
|
+
return selectedMode.value === 0
|
|
134
|
+
})
|
|
135
|
+
|
|
136
|
+
const onBeforeDialogOpened = async () => {
|
|
137
|
+
await featureStore.loadFeatures()
|
|
138
|
+
exportGroups.value = featureStore.hasFeature('printerGroupsApi')
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const downloadExportYamlFile = async () => {
|
|
142
|
+
if (exportFloorGrid.value) {
|
|
143
|
+
exportPrinters.value = true
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
await ServerPrivateService.downloadYamlExport({
|
|
147
|
+
exportPrinters: exportPrinters.value,
|
|
148
|
+
exportGroups: exportGroups.value,
|
|
149
|
+
exportFloorGrid: exportFloorGrid.value,
|
|
150
|
+
printerComparisonStrategiesByPriority: ['name', 'url'],
|
|
151
|
+
exportFloors: exportFloors.value,
|
|
152
|
+
floorComparisonStrategiesByPriority: 'floor',
|
|
153
|
+
notes: notes.value
|
|
154
|
+
})
|
|
155
|
+
snackbar.openInfoMessage({
|
|
156
|
+
title: 'Downloaded the YAML file'
|
|
157
|
+
})
|
|
158
|
+
notes.value = ''
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const uploadAndImportYamlFile = async () => {
|
|
162
|
+
errorMessage.value = ''
|
|
163
|
+
errorDetailedMessage.value = ''
|
|
164
|
+
if (!importFile.value) {
|
|
165
|
+
errorMessage.value = 'The import file was not specified'
|
|
166
|
+
return
|
|
167
|
+
}
|
|
168
|
+
try {
|
|
169
|
+
await ServerPrivateService.uploadAndImportYaml(importFile.value)
|
|
170
|
+
importFile.value = undefined
|
|
171
|
+
snackbar.openInfoMessage({
|
|
172
|
+
title: 'Imported the YAML file'
|
|
173
|
+
})
|
|
174
|
+
closeDialog()
|
|
175
|
+
} catch (e) {
|
|
176
|
+
errorMessage.value = 'An error occurred uring import'
|
|
177
|
+
errorDetailedMessage.value = (e as Error).message.toString()
|
|
178
|
+
importFile.value = undefined
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const closeDialog = () => {
|
|
183
|
+
importFile.value = undefined
|
|
184
|
+
dialog.closeDialog()
|
|
185
|
+
}
|
|
186
|
+
</script>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export enum DialogName {
|
|
2
|
+
// The JSON import dialog, which is used to import a JSON file with a printer array into the application.
|
|
3
|
+
BatchJsonCreate = 'BatchJsonCreate',
|
|
4
|
+
// Stateful dialog meant for verifying the last printed file of each selected printer
|
|
5
|
+
BatchReprintDialog = 'BatchReprintDialog',
|
|
6
|
+
// 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.
|
|
7
|
+
// This YAML is for internal backup and restore only and is not compatible with external projects.
|
|
8
|
+
YamlImportExport = 'YamlImportExport',
|
|
9
|
+
// The printer create dialog, which is used to create a new or update a printer.
|
|
10
|
+
AddOrUpdatePrinterDialog = 'AddOrUpdatePrinterDialog',
|
|
11
|
+
// The floor create dialog, which is used to create a new floor where printers can be placed.
|
|
12
|
+
AddOrUpdateFloorDialog = 'AddOrUpdateFloorDialog',
|
|
13
|
+
// The printer repair dialog, which is used to mark a printer as maintenance mode.
|
|
14
|
+
PrinterMaintenanceDialog = 'PrinterMaintenanceDialog',
|
|
15
|
+
// The camera create dialog, which is used to create a new or update a camera.
|
|
16
|
+
AddOrUpdateCameraDialog = 'AddOrUpdateCameraDialog',
|
|
17
|
+
// Dialog for moving print head, homing, or retracting/extruding filament
|
|
18
|
+
PrinterControlDialog = 'PrinterControlDialog'
|
|
19
|
+
}
|