Version: 1.12.0
Date: 2025-01-14
Status: ? Implemented
The Admin Menu is a dropdown navigation menu that consolidates administrative functions into a single, organized location in the navbar. This improves UI organization and makes it easier for administrators to access configuration and data management tools.
??? Admin (Dropdown)
??? ?? Configuration
? ??? ??? Application Settings
??? ?????????????????????
??? ?? Data Management
??? ??? Device Cleanup
- Icon: ??? Tools icon (yellow color) to indicate administrative functions
- Dark Theme: Dropdown matches navbar dark theme
- Smooth Animation: Slide-down animation on open
- Active Page Highlight: Current page highlighted in dropdown
- Responsive: Works on desktop and mobile devices
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle text-light" href="#" id="adminDropdown">
<i class="fas fa-tools"></i> Admin
</a>
</li>Features:
- Yellow tools icon for visual distinction
- Dropdown arrow indicator
- Hover effect
Configuration Section:
- Header: "Configuration" with gear icon
- Item: Application Settings (sliders icon)
Data Management Section:
- Header: "Data Management" with database icon
- Item: Device Cleanup (trash icon)
Separators:
- Horizontal dividers between sections
/* Dark theme dropdown */
.navbar-dark .dropdown-menu {
background-color: #343a40;
border: 1px solid rgba(255, 255, 255, 0.15);
}
/* Dropdown items */
.navbar-dark .dropdown-menu .dropdown-item {
color: rgba(255, 255, 255, 0.85);
transition: all 0.2s ease-in-out;
}
/* Hover effect */
.navbar-dark .dropdown-menu .dropdown-item:hover {
background-color: rgba(255, 255, 255, 0.1);
color: #ffffff;
}
/* Section headers */
.navbar-dark .dropdown-menu .dropdown-header {
color: rgba(255, 255, 255, 0.5);
font-size: 0.875rem;
text-transform: uppercase;
}
/* Animation */
.dropdown-menu {
animation: slideDown 0.3s ease-out;
}document.addEventListener('DOMContentLoaded', function() {
var currentPath = window.location.pathname;
// Find matching dropdown item
var dropdownItems = document.querySelectorAll(
'#adminDropdown + .dropdown-menu .dropdown-item[data-page]'
);
dropdownItems.forEach(function(item) {
var itemPage = item.getAttribute('data-page');
if (currentPath.indexOf(itemPage) !== -1) {
// Highlight the item
item.classList.add('active');
// Highlight the Admin dropdown toggle
document.getElementById('adminDropdown').classList.add('text-warning');
}
});
});Behavior:
- Checks current page path
- Matches against dropdown items
- Adds
activeclass to matching item - Highlights Admin dropdown toggle in yellow
- Dropdown appears below Admin link
- Full menu visible
- Smooth hover effects
- Menu collapses into hamburger
- Dropdown expands within collapsed menu
- Touch-friendly tap areas
Application Settings:
- Dynamic configuration management
- Database-driven settings
- Requires admin privileges
- Use Case: Update client version, adjust queue settings
Device Cleanup:
- Data management operation
- Can delete inactive devices
- Requires admin privileges
- Use Case: Clean up old/inactive devices
Common Thread: Both features are administrative operations that:
- Modify system state
- Require elevated permissions
- Are used infrequently
- Need careful consideration before execution
- No authentication required (menu visible to all)
- Pages should implement own authorization
-
Add
[Authorize]attributes:[Authorize(Roles = "Admin")] public class IndexModel : PageModel
-
Conditional menu rendering:
@if (User.IsInRole("Admin")) { <li class="nav-item dropdown"> <!-- Admin menu --> </li> }
-
Audit logging:
- Log all admin menu access
- Track setting changes
- Monitor cleanup operations
-
Additional Admin Pages
- User Management
- Role Assignment
- Audit Log Viewer
- System Health Monitor
-
Permissions Granularity
Admin Menu ??? Configuration (Role: ConfigAdmin) ? ??? Application Settings ? ??? Feature Flags (NEW) ??? Data Management (Role: DataAdmin) ? ??? Device Cleanup ? ??? Report Archive (NEW) ??? Security (Role: SecurityAdmin) (NEW) ??? User Management ??? Access Logs -
Visual Enhancements
- Badge counts (e.g., "5 pending cleanups")
- Quick stats in dropdown
- Recent activity feed
-
Keyboard Shortcuts
Alt+A? Open Admin menuAlt+S? Go to SettingsAlt+C? Go to Cleanup
Track admin menu usage for insights:
// Example analytics tracking
document.querySelectorAll('#adminDropdown + .dropdown-menu .dropdown-item')
.forEach(item => {
item.addEventListener('click', function() {
// Track click
analytics.track('Admin Menu Click', {
item: this.textContent.trim(),
user: currentUser,
timestamp: new Date()
});
});
});- Desktop: Menu appears on hover
- Desktop: Menu items clickable
- Desktop: Active page highlighted
- Mobile: Menu appears in collapsed navbar
- Mobile: Touch-friendly tap areas
- Animation: Smooth slide-down
- Icons: All icons display correctly
- Navigation: All links navigate correctly
- Styling: Dark theme consistent
- Accessibility: Keyboard navigation works
-
Locate Admin Menu
- Look for ??? Admin in the navbar
- Icon is yellow/gold color
-
Open Dropdown
- Click on "Admin" link
- Menu slides down with options
-
Select Feature
- Application Settings: Manage system configuration
- Device Cleanup: Remove inactive devices
-
Current Page Indicator
- Active page shows highlighted in dropdown
- Admin icon turns yellow when on admin page
| File | Changes | Lines |
|---|---|---|
_Layout.cshtml |
Added Admin dropdown + JS | +80 |
site.css |
Dropdown styling | +70 |
Total: 2 files, ~150 lines
- Bootstrap 5: Dropdown component
- Font Awesome 6: Icons
- jQuery: Not required (vanilla JS)
- ? Chrome 90+
- ? Firefox 88+
- ? Edge 90+
- ? Safari 14+
- ? IE 11 (not supported)
None - All functionality working as expected
- Application Settings
- Device Cleanup
- Bootstrap 5 Dropdowns: https://getbootstrap.com/docs/5.0/components/dropdowns/
-
Create the page in appropriate folder
-
Add to Admin dropdown:
<li> <a class="dropdown-item" asp-page="/YourPage" data-page="/YourPage"> <i class="fas fa-icon"></i> Your Feature </a> </li>
-
Add authorization to page:
[Authorize(Roles = "Admin")] public class YourPageModel : PageModel { }
-
Test in both desktop and mobile
- Group by function (Configuration, Data, Security, etc.)
- Limit items per section to 3-4 for clarity
- Use clear labels and appropriate icons
- Add dividers between logical groups
- Keep menu height reasonable (avoid scrolling)
? Admin Dropdown Menu
- 2 sections (Configuration, Data Management)
- 2 menu items (Settings, Cleanup)
- Dark theme styling
- Slide-down animation
- Active page detection
- Yellow admin icon
- Responsive design
- Organization: Admin features grouped logically
- Discoverability: Clear visual indicator
- Accessibility: Keyboard and screen reader support
- Consistency: Matches overall dark theme
- Extensibility: Easy to add new admin features
Last Updated: 2025-01-14
Author: Development Team
Status: ? Ready for Production