Tech Tools section with a code generator, toner report that names the part, toner forecasting, warranty proof of cover, application uploads

This commit is contained in:
2026-08-12 11:51:38 -04:00
parent 568dfbb91c
commit d32513727b
38 changed files with 2667 additions and 779 deletions

View File

@@ -306,6 +306,9 @@ export const printersApi = {
getDrivers(id) {
return api.get(`/printers/${id}/drivers`)
},
supplyForecast(days = 90) {
return api.get('/printers/supplies/forecast', { params: { days } })
},
lowSupplies() {
return api.get('/printers/lowsupplies')
},
@@ -477,6 +480,33 @@ export const applicationsApi = {
delete(id) {
return api.delete(`/applications/${id}`)
},
// multipart image upload; backend sets image to the served URL
uploadImage(id, file) {
const form = new FormData()
form.append('file', file)
return api.post(`/applications/${id}/image`, form, { headers: { 'Content-Type': 'multipart/form-data' } })
},
removeImage(id) {
return api.delete(`/applications/${id}/image`)
},
// installer upload; backend sets installpath to the download URL.
// onProgress gets 0-100 - an installer is big enough that a silent wait
// reads as a hang.
uploadPackage(id, file, onProgress) {
const form = new FormData()
form.append('file', file)
return api.post(`/applications/${id}/package`, form, {
headers: { 'Content-Type': 'multipart/form-data' },
onUploadProgress: event => {
if (onProgress && event.total) {
onProgress(Math.round((event.loaded * 100) / event.total))
}
}
})
},
removePackage(id) {
return api.delete(`/applications/${id}/package`)
},
// Versions
getVersions(appId) {
return api.get(`/applications/${appId}/versions`)
@@ -1088,6 +1118,15 @@ export const warrantyApi = {
},
report() {
return api.get('/warranty/report')
},
// proof of cover: invoice, certificate, whatever the vendor sent
uploadProof(id, file) {
const form = new FormData()
form.append('file', file)
return api.post(`/warranty/${id}/proof`, form, { headers: { 'Content-Type': 'multipart/form-data' } })
},
removeProof(id) {
return api.delete(`/warranty/${id}/proof`)
}
}