ui: restore flat top-level rail (drop nested PineAP sub-entries)
This commit is contained in:
@@ -29,16 +29,7 @@ const App = (() => {
|
||||
|
||||
const railItems = [
|
||||
{ key: 'dashboard', label: 'Dashboard', hash: '#/dashboard', icon: 'dashboard' },
|
||||
{
|
||||
key: 'pineap', label: 'PineAP', hash: '#/pineap', icon: 'pineap', children: [
|
||||
{ key: 'pineap_evilwpa', label: 'Evil WPA', hash: '#/pineap/evilwpa', icon: 'attack' },
|
||||
{ key: 'pineap_open', label: 'Evil Open', hash: '#/pineap/open', icon: 'wifi' },
|
||||
{ key: 'pineap_enterprise', label: 'Evil Enterprise', hash: '#/pineap/enterprise', icon: 'record' },
|
||||
{ key: 'pineap_impersonation', label: 'Impersonation', hash: '#/pineap/impersonation', icon: 'place' },
|
||||
{ key: 'pineap_clients', label: 'Clients', hash: '#/pineap/clients', icon: 'pager' },
|
||||
{ key: 'pineap_filtering', label: 'Filtering', hash: '#/pineap/filtering', icon: 'settings' }
|
||||
]
|
||||
},
|
||||
{ key: 'pineap', label: 'PineAP', hash: '#/pineap', icon: 'pineap' },
|
||||
{ key: 'recon', label: 'Recon', hash: '#/recon', icon: 'recon' },
|
||||
{ key: 'logging', label: 'Logging', hash: '#/logging', icon: 'logging' },
|
||||
{ key: 'modules', label: 'Payloads', hash: '#/modules', icon: 'modules' },
|
||||
@@ -71,13 +62,6 @@ const App = (() => {
|
||||
rail.appendChild(d);
|
||||
}
|
||||
rail.appendChild(railEntry(it));
|
||||
if (it.children) {
|
||||
it.children.forEach((sub) => {
|
||||
const s = railEntry(sub);
|
||||
s.classList.add('sub');
|
||||
rail.appendChild(s);
|
||||
});
|
||||
}
|
||||
});
|
||||
const foot = document.createElement('div');
|
||||
foot.className = 'rail-footer';
|
||||
@@ -129,13 +113,9 @@ const App = (() => {
|
||||
currentView = views[name](els.content);
|
||||
}
|
||||
const key = keyOf(hash);
|
||||
const subs = els.rail.querySelectorAll('.entry.sub');
|
||||
const subActive = Array.prototype.some.call(subs, (s) => s.getAttribute('href') === hash);
|
||||
Array.prototype.forEach.call(els.rail.querySelectorAll('.entry'), (a) => {
|
||||
const href = a.getAttribute('href');
|
||||
const exact = !!href && href === hash;
|
||||
const groupActive = !subActive && !!href && keyOf(href) === key;
|
||||
a.classList.toggle('active', exact || groupActive);
|
||||
a.classList.toggle('active', !!href && (href === hash || keyOf(href) === key));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user