diff --git a/dashboard/siro-admin/js/app.js b/dashboard/siro-admin/js/app.js index 240ade71..dd0c1814 100644 --- a/dashboard/siro-admin/js/app.js +++ b/dashboard/siro-admin/js/app.js @@ -862,6 +862,19 @@ subtitle: 'Geofenced demand density', panels: [{ title: 'Heatmap', path: '/Admin/geofence/get_heatmap.php' }], }, + { + id: 'fleet', group: 'Quality', icon: 'ph-steering-wheel', title: 'Fleet Performance', + subtitle: 'Top captains, gift eligibility payouts and per-captain card charges', + panels: [ + { title: 'Best captains', path: '/Admin/driver/getBestDriver.php' }, + { title: 'Card charges per captain', path: '/Admin/getVisaForEachDriver.php' }, + ], + }, + { + id: 'invoices', group: 'Finance', icon: 'ph-receipt', title: 'Invoices', + subtitle: 'Invoice totals recorded against admin accounts', + panels: [{ title: 'Invoice totals', path: '/Admin/adminUser/invoice_total.php' }], + }, { id: 'quality', group: 'Quality', icon: 'ph-prohibit', title: 'Blacklist', subtitle: 'Blocked captains and passengers', @@ -872,6 +885,24 @@ subtitle: 'Behaviour and reliability scoring per captain', panels: [{ title: 'Scorecard', path: '/Admin/v2/quality/driver_scorecard.php' }], }, + { + id: 'monitor', group: 'Realtime & Analytics', icon: 'ph-crosshair', title: 'Ride Monitor', + subtitle: 'Look up the active ride and gift eligibility for a specific phone number', + custom: (host) => renderLookupTools(host, [ + { + title: 'Active ride for a phone number', + path: '/Admin/rides/monitorRide.php', + field: 'phone', + placeholder: 'Passenger or captain phone, e.g. 962798583052', + }, + { + title: 'Gift payment eligibility', + path: '/Admin/driver/getDriverGiftPayment.php', + field: 'phone', + placeholder: 'Captain phone', + }, + ]), + }, { id: 'transit', group: 'Transit', icon: 'ph-bus', title: 'Mawasalati Organisations', subtitle: 'Registered transit organisations and their pending routes', @@ -974,6 +1005,46 @@ })); } + // Endpoints that answer only for a specific record get an input rather than + // an empty panel: they require a parameter, so eagerly calling them would + // just render an error. + function renderLookupTools(host, tools) { + host.innerHTML = tools.map((tool, i) => ` +