secubox-openwrt/package/secubox/luci-app-mqtt-bridge/htdocs/luci-static/resources/mqtt-bridge/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

36 lines
1019 B
JavaScript

'use strict';
'require baseclass';
'require secubox/nav as SecuNav';
/**
* MQTT Bridge Navigation
* Uses SecuNav.renderCompactTabs() for consistent styling
*/
var tabs = [
{ id: 'overview', icon: '📡', label: _('Overview'), path: ['admin', 'secubox', 'network', 'mqtt-bridge', 'overview'] },
{ id: 'devices', icon: '🔌', label: _('Devices'), path: ['admin', 'secubox', 'network', 'mqtt-bridge', 'devices'] },
{ id: 'settings', icon: '⚙️', label: _('Settings'), path: ['admin', 'secubox', 'network', 'mqtt-bridge', 'settings'] }
];
return baseclass.extend({
getTabs: function() {
return tabs.slice();
},
/**
* Render MQTT Bridge navigation tabs
* Delegates to SecuNav.renderCompactTabs() for consistent styling
*/
renderTabs: function(active) {
return SecuNav.renderCompactTabs(active, this.getTabs(), { className: 'mqtt-nav-tabs' });
},
/**
* Render breadcrumb back to SecuBox
*/
renderBreadcrumb: function() {
return SecuNav.renderBreadcrumb(_('MQTT Bridge'), '📡');
}
});