feat: add executive kiosk dashboard for TV display
- Created /kiosk route with full-screen display - Added API endpoints for stats and activity feed - Built cycling KPI display with 12 metrics - Added scrolling ticker for ticket activity - Implemented UI-configurable cycle interval (3-15s, default 7s) - Focus on critical tickets and business metrics - Added navigation link from dashboard - Dark theme optimized for TV viewing
This commit is contained in:
parent
4d531b2f2d
commit
20a0785ec3
9 changed files with 692 additions and 0 deletions
44
app/api/kiosk/activity/route.ts
Normal file
44
app/api/kiosk/activity/route.ts
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { postgresClient } from '@/lib/services/postgres-client';
|
||||
|
||||
export async function GET(request: NextRequest) {
|
||||
try {
|
||||
// Get recent ticket activity for ticker feed
|
||||
const activityResult = await postgresClient.query(
|
||||
`SELECT
|
||||
t.ticket_number,
|
||||
t.title,
|
||||
t.priority,
|
||||
t.status,
|
||||
t.create_date,
|
||||
t.last_activity_date,
|
||||
c.company_name,
|
||||
s.label as status_label
|
||||
FROM tickets t
|
||||
LEFT JOIN companies c ON t.company_id = c.id
|
||||
LEFT JOIN statuses s ON t.status = s.value
|
||||
WHERE t.completed_date IS NULL
|
||||
ORDER BY t.last_activity_date DESC NULLS LAST
|
||||
LIMIT 50`
|
||||
);
|
||||
|
||||
const activities = activityResult.rows.map((row: any) => ({
|
||||
ticketNumber: row.ticket_number,
|
||||
title: row.title,
|
||||
priority: row.priority,
|
||||
status: row.status,
|
||||
statusLabel: row.status_label,
|
||||
companyName: row.company_name,
|
||||
createDate: row.create_date,
|
||||
lastActivityDate: row.last_activity_date,
|
||||
}));
|
||||
|
||||
return NextResponse.json({ activities });
|
||||
} catch (error) {
|
||||
console.error('Error fetching kiosk activity:', error);
|
||||
return NextResponse.json(
|
||||
{ error: 'Failed to fetch kiosk activity' },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue