C
CA Lei

Call Center Gamification Dashboard

Bootstrap Call Center dashboard presents agent provision cards with progress bars and earned badges. Built with Blazor and Bootstrap classes; uses timer-driven real-time updates and simple CSS hover effects.

LIVE DEMO
Generated using Instruct UI - An AI for Blazor UI Generation
## What's implemented - Responsive grid of agent cards using Bootstrap row/col and card components. - Per-agent progress bars with dynamic percentage labels and conditional coloring. - Earned badge list per agent rendered as Bootstrap badges with Font Awesome icons. - Real-time demo updates via a System.Timers.Timer that mutates in-memory model and invokes StateHasChanged. - Visual indicators for target achieved (card footer and border). - Page-scoped CSS for hover transform and progress text color adjustments. ## Key components - Razor page directives and lifecycle: @page, OnInitialized, Dispose. - Data model classes: AgentProvisionViewModel, BadgeViewModel. - Timer-driven update method: System.Timers.Timer and UpdateProvisions async call with InvokeAsync(StateHasChanged). - Bootstrap UI elements: .container, .row, .col-*, .card, .progress, .badge. - Utility methods: GetProgressBarClass(double) for mapping percentage to Bootstrap bg-* classes. - Static demo logic: Random updates, UpdateProvision, CheckForNewBadges. ## How it works - Agents are seeded in OnInitialized into a List<AgentProvisionViewModel> and badges are evaluated once. - A System.Timers.Timer fires every 3 seconds and calls UpdateProvisions which randomly increases selected agents' CurrentProvision. - Model mutations call InvokeAsync(StateHasChanged) to ensure UI updates on the Blazor render thread. - Badge awarding is computed by comparing CurrentProvision / ProvisionTarget to badge thresholds; progress percentage is capped. - The component implements IDisposable to stop and dispose the timer on navigation. ## Styling - Layout relies on Bootstrap utility classes (container, row, col-md-6, col-lg-4) for responsiveness. - Visuals use Bootstrap cards, progress bars (.progress, .progress-bar) and badges (.badge, bg-warning). - Font Awesome supplies avatar and badge icons (fa- classes used in markup). - Page-scoped CSS (CallCenterDashboardPage.razor.css) adds hover transform, shadow, and progress text color rules. ## Reuse steps 1. Add the Razor page and copy AgentProvisionViewModel and BadgeViewModel into the project's Models or appropriate namespace. 2. Ensure Bootstrap CSS and JS are included (default Blazor templates include Bootstrap). Add Font Awesome for icons. 3. Copy the page-scoped .razor.css file or adapt to global styles for theme consistency. 4. Replace the demo random update logic with production data: wire an API or SignalR hub for live server pushes. 5. Move timer and update logic into a service (inject via DI) if shared state or testing is required. 6. Add authentication/authorization and backend persistence to connect agent data to real systems. ## Limitations & next steps - This single-page demo uses in-memory seed data and random updates; it is not connected to a backend. - Timer-based polling is a demo pattern; prefer SignalR or server-push for production real-time updates and scalability. - Move models into a named namespace and add DTOs/validation for API integration. - Add accessibility improvements (ARIA labels for progress, semantic headings), localization, and unit/ UI tests. - Consider throttling UI updates or batching when integrating with high-frequency live data.