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>
36 lines
1019 B
JavaScript
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'), '📡');
|
|
}
|
|
});
|