secubox-openwrt/package/secubox/luci-app-media-flow/htdocs/luci-static/resources/media-flow/nav.js
CyberMind-FR c5e22fd08d refactor(nav): Unify navigation component with auto-theme initialization
SecuNav.renderTabs() now automatically initializes theme and loads CSS,
eliminating boilerplate from views. Added renderCompactTabs() for nested
modules and renderBreadcrumb() for back-navigation.

Updated module navs: cdn-cache, client-guardian, crowdsec-dashboard,
media-flow, mqtt-bridge, system-hub. Removed ~1000 lines of duplicate CSS.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 03:42:32 +01:00

38 lines
1.2 KiB
JavaScript

'use strict';
'require baseclass';
'require secubox/nav as SecuNav';
/**
* Media Flow Navigation
* Uses SecuNav.renderCompactTabs() for consistent styling
*/
var tabs = [
{ id: 'dashboard', icon: '📊', label: _('Dashboard'), path: ['admin', 'secubox', 'monitoring', 'mediaflow', 'dashboard'] },
{ id: 'alerts', icon: '🔔', label: _('Alerts'), path: ['admin', 'secubox', 'monitoring', 'mediaflow', 'alerts'] },
{ id: 'clients', icon: '👥', label: _('Clients'), path: ['admin', 'secubox', 'monitoring', 'mediaflow', 'clients'] },
{ id: 'services', icon: '🎬', label: _('Services'), path: ['admin', 'secubox', 'monitoring', 'mediaflow', 'services'] },
{ id: 'history', icon: '📜', label: _('History'), path: ['admin', 'secubox', 'monitoring', 'mediaflow', 'history'] }
];
return baseclass.extend({
getTabs: function() {
return tabs.slice();
},
/**
* Render Media Flow navigation tabs
* Delegates to SecuNav.renderCompactTabs() for consistent styling
*/
renderTabs: function(active) {
return SecuNav.renderCompactTabs(active, this.getTabs(), { className: 'media-flow-nav-tabs' });
},
/**
* Render breadcrumb back to SecuBox
*/
renderBreadcrumb: function() {
return SecuNav.renderBreadcrumb(_('Media Flow'), '🎬');
}
});