|
45 | 45 | </template>
|
46 | 46 |
|
47 | 47 | <template #[`item.handle`]>
|
48 |
| - <app-drag-icon /> |
| 48 | + <app-drag-icon :disabled="jobTotals.withoutFile > 0" /> |
49 | 49 | </template>
|
50 | 50 |
|
51 | 51 | <template #[`item.data-table-icons`]>
|
|
93 | 93 | <template #footer>
|
94 | 94 | <div class="v-data-footer px-3 py-1">
|
95 | 95 | <v-chip
|
| 96 | + v-if="jobTotals.withoutFile > 0" |
96 | 97 | small
|
97 | 98 | class="ma-1"
|
| 99 | + color="warning" |
98 | 100 | >
|
99 |
| - {{ $t('app.job_queue.label.filament') }}: {{ $filters.getReadableLengthString(jobTotals.filament_length) }} / {{ $filters.getReadableWeightString(jobTotals.filament_weight) }} |
| 101 | + {{ $t('app.job_queue.label.unknown_jobs') }}: {{ jobTotals.withoutFile }} |
| 102 | + </v-chip> |
| 103 | + |
| 104 | + <v-chip |
| 105 | + small |
| 106 | + class="ma-1" |
| 107 | + > |
| 108 | + {{ $t('app.job_queue.label.filament') }}: {{ $filters.getReadableLengthString(jobTotals.filamentLength) }} / {{ $filters.getReadableWeightString(jobTotals.filamentWeight) }} |
100 | 109 | </v-chip>
|
101 | 110 | <v-chip
|
102 | 111 | small
|
@@ -128,9 +137,10 @@ import FilesMixin from '@/mixins/files'
|
128 | 137 | import getFilePaths from '@/util/get-file-paths'
|
129 | 138 |
|
130 | 139 | type JobTotals = {
|
131 |
| - filament_length: number, |
132 |
| - filament_weight: number, |
133 |
| - time: number |
| 140 | + filamentLength: number, |
| 141 | + filamentWeight: number, |
| 142 | + time: number, |
| 143 | + withoutFile: number |
134 | 144 | }
|
135 | 145 |
|
136 | 146 | type QueueJobWithKey = QueuedJobWithAppFile & {
|
@@ -180,20 +190,22 @@ export default class JobQueueBrowser extends Mixins(StateMixin, FilesMixin) {
|
180 | 190 | return this.jobs.reduce<JobTotals>((totals, job) => {
|
181 | 191 | if (job.file) {
|
182 | 192 | if ('filament_total' in job.file) {
|
183 |
| - totals.filament_length += job.file.filament_total ?? 0 |
| 193 | + totals.filamentLength += job.file.filament_total ?? 0 |
184 | 194 | }
|
185 | 195 |
|
186 | 196 | if ('filament_weight_total' in job.file) {
|
187 |
| - totals.filament_weight += job.file.filament_weight_total ?? 0 |
| 197 | + totals.filamentWeight += job.file.filament_weight_total ?? 0 |
188 | 198 | }
|
189 | 199 |
|
190 | 200 | if ('estimated_time' in job.file) {
|
191 | 201 | totals.time += job.file.estimated_time ?? 0
|
192 | 202 | }
|
| 203 | + } else { |
| 204 | + totals.withoutFile++ |
193 | 205 | }
|
194 | 206 |
|
195 | 207 | return totals
|
196 |
| - }, { filament_length: 0, filament_weight: 0, time: 0 }) |
| 208 | + }, { filamentLength: 0, filamentWeight: 0, time: 0, withoutFile: 0 }) |
197 | 209 | }
|
198 | 210 |
|
199 | 211 | getFilePaths (filename: string) {
|
|
0 commit comments