feat: Add Portal, Hub, Admin sections to portal navigation

Update portal.js sections to include:
- Portal (home page)
- Hub (SecuBox dashboard)
- Admin (Admin Control Panel)
- Security, Network, Monitoring, System (existing)

Update index.js to render Portal/Hub/Admin as links to separate
pages while keeping Security/Network/Monitoring/System as tabs.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
CyberMind-FR 2026-01-09 16:48:38 +01:00
parent 3e86952d48
commit 229afecffb
2 changed files with 41 additions and 8 deletions

View File

@ -190,35 +190,54 @@ return baseclass.extend({
// Section definitions
sections: {
'dashboard': {
id: 'dashboard',
name: 'Dashboard',
'portal': {
id: 'portal',
name: 'Portal',
icon: '\ud83c\udfe0',
path: 'admin/secubox/portal',
order: 1
},
'hub': {
id: 'hub',
name: 'Hub',
icon: '\ud83d\ude80',
path: 'admin/secubox/dashboard',
order: 2
},
'admin': {
id: 'admin',
name: 'Admin',
icon: '\ud83c\udfdb\ufe0f',
path: 'admin/secubox/admin/dashboard',
order: 3
},
'security': {
id: 'security',
name: 'Security',
icon: '\ud83d\udee1\ufe0f',
order: 2
path: 'admin/secubox/security',
order: 4
},
'network': {
id: 'network',
name: 'Network',
icon: '\ud83c\udf10',
order: 3
path: 'admin/secubox/network',
order: 5
},
'monitoring': {
id: 'monitoring',
name: 'Monitoring',
icon: '\ud83d\udcca',
order: 4
path: 'admin/secubox/monitoring',
order: 6
},
'system': {
id: 'system',
name: 'System',
icon: '\u2699\ufe0f',
order: 5
path: 'admin/secubox/system',
order: 7
}
},

View File

@ -116,6 +116,9 @@ return view.extend({
renderHeader: function() {
var self = this;
var sections = portal.getSections();
// Sections that link to other pages vs tabs within portal
var linkSections = ['portal', 'hub', 'admin'];
var tabSections = ['security', 'network', 'monitoring', 'system'];
return E('div', { 'class': 'sb-portal-header' }, [
// Brand
@ -127,8 +130,19 @@ return view.extend({
// Navigation
E('nav', { 'class': 'sb-portal-nav' },
sections.map(function(section) {
// Portal, Hub, Admin are links to other pages
if (linkSections.indexOf(section.id) !== -1) {
return E('a', {
'class': 'sb-portal-nav-item' + (section.id === 'portal' ? ' active' : ''),
'href': L.url(section.path)
}, [
E('span', { 'class': 'sb-portal-nav-icon' }, section.icon),
section.name
]);
}
// Security, Network, Monitoring, System are tabs within portal
return E('button', {
'class': 'sb-portal-nav-item' + (section.id === 'dashboard' ? ' active' : ''),
'class': 'sb-portal-nav-item',
'data-section': section.id,
'click': function() { self.switchSection(section.id); }
}, [