Poll Zabbix for toner levels on a schedule and email/webhook on a downward crossing. Warning fires at or below the warning threshold (default 5%), critical at the critical threshold (default 0%); both thresholds are settings. State lives in printersupplyalerts so an alert fires once per crossing and re-arms after a refill. Recipients mirror the printedparts pattern: plugin-scoped shopdb users + roles + free-text emails (falling back to the site alert_recipients), and a chosen support team's webhook (falling back to the site alert_webhook_url). - PrinterSupplyAlert model + migration printers0002supplyalerts - alerttier(remaining, warning, critical) + check_supplies poller - flask printers check-toner-alerts CLI (run via scheduled task/cron) - printers alert settings + Low-Toner Alerts settings page - 7 tests: tier boundaries, once-per-crossing + re-arm, toner-only scope, custom thresholds, support-team webhook routing
82 lines
2.2 KiB
JavaScript
82 lines
2.2 KiB
JavaScript
/**
|
|
* Printers plugin routes
|
|
*/
|
|
export default [
|
|
{
|
|
path: 'reports/toner',
|
|
name: 'toner-report',
|
|
component: () => import('./views/TonerReport.vue'),
|
|
meta: { plugin: 'printers' }
|
|
},
|
|
{
|
|
path: 'settings/printertypes',
|
|
name: 'printer-types',
|
|
component: () => import('./views/PrinterTypesList.vue'),
|
|
meta: { requiresAuth: true, requiresAdmin: true, plugin: 'printers' }
|
|
},
|
|
{
|
|
path: 'settings/zabbix',
|
|
name: 'zabbix-settings',
|
|
component: () => import('./views/ZabbixSettings.vue'),
|
|
meta: { requiresAuth: true, requiresAdmin: true, plugin: 'printers' }
|
|
},
|
|
{
|
|
path: 'settings/printer-alerts',
|
|
name: 'printer-alerts',
|
|
component: () => import('./views/PrinterAlertsSettings.vue'),
|
|
meta: { requiresAuth: true, requiresAdmin: true, plugin: 'printers' }
|
|
},
|
|
{
|
|
path: 'printers',
|
|
name: 'printers',
|
|
component: () => import('./views/PrintersList.vue'),
|
|
meta: { plugin: 'printers' }
|
|
},
|
|
{
|
|
path: 'printers/new',
|
|
name: 'printer-new',
|
|
component: () => import('./views/PrinterForm.vue'),
|
|
meta: { requiresAuth: true, plugin: 'printers' }
|
|
},
|
|
{
|
|
path: 'printers/:id',
|
|
name: 'printer-detail',
|
|
component: () => import('./views/PrinterDetail.vue'),
|
|
meta: { plugin: 'printers' }
|
|
},
|
|
{
|
|
path: 'printers/:id/edit',
|
|
name: 'printer-edit',
|
|
component: () => import('./views/PrinterForm.vue'),
|
|
meta: { requiresAuth: true, plugin: 'printers' }
|
|
},
|
|
// printer-specific settings
|
|
{
|
|
path: 'settings/modelsupplies',
|
|
name: 'model-supplies',
|
|
component: () => import('./views/ModelSuppliesList.vue'),
|
|
meta: { requiresAuth: true, plugin: 'printers' }
|
|
},
|
|
{
|
|
path: 'settings/printerdrivers',
|
|
name: 'printer-drivers',
|
|
component: () => import('./views/PrinterDriversList.vue'),
|
|
meta: { requiresAuth: true, requiresAdmin: true, plugin: 'printers' }
|
|
}
|
|
]
|
|
|
|
export const toplevel = [
|
|
{
|
|
path: '/print/printer-qr',
|
|
name: 'print-printer-qr-batch',
|
|
component: () => import('./views/PrinterQRBatch.vue'),
|
|
meta: { plugin: 'printers' }
|
|
},
|
|
{
|
|
path: '/print/printer-qr/:id',
|
|
name: 'print-printer-qr-single',
|
|
component: () => import('./views/PrinterQRSingle.vue'),
|
|
meta: { plugin: 'printers' }
|
|
}
|
|
]
|