diff --git a/package/secubox/luci-app-secubox-portal/htdocs/luci-static/resources/secubox-portal/portal.js b/package/secubox/luci-app-secubox-portal/htdocs/luci-static/resources/secubox-portal/portal.js index f4015ec9..e7f0e564 100644 --- a/package/secubox/luci-app-secubox-portal/htdocs/luci-static/resources/secubox-portal/portal.js +++ b/package/secubox/luci-app-secubox-portal/htdocs/luci-static/resources/secubox-portal/portal.js @@ -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 } }, diff --git a/package/secubox/luci-app-secubox-portal/htdocs/luci-static/resources/view/secubox-portal/index.js b/package/secubox/luci-app-secubox-portal/htdocs/luci-static/resources/view/secubox-portal/index.js index 1f1cb71f..d425cf74 100644 --- a/package/secubox/luci-app-secubox-portal/htdocs/luci-static/resources/view/secubox-portal/index.js +++ b/package/secubox/luci-app-secubox-portal/htdocs/luci-static/resources/view/secubox-portal/index.js @@ -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); } }, [