Skip to content

Commit 3c3b743

Browse files
committed
Merge branch 'fix/s3-region-full-url'
2 parents 1438dfa + 05939bc commit 3c3b743

4 files changed

Lines changed: 89 additions & 48 deletions

File tree

internal/api/ui/index.html

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -78,46 +78,51 @@ <h1 class="auth-title">AutoAR</h1>
7878
<span>Monitor</span>
7979
</div>
8080

81-
<div class="nav-item" id="nav-targets" data-label="Targets">
82-
<span class="nav-icon"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="6"/><circle cx="12" cy="12" r="2"/></svg></span>
83-
<span>Targets</span>
84-
</div>
85-
86-
<div class="nav-item" id="nav-programs" data-label="Programs">
87-
<span class="nav-icon"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M22 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/></svg></span>
88-
<span>Programs</span>
81+
<div class="nav-group">
82+
<div class="nav-item nav-group-head" id="nav-group-assets" data-label="Asset Management" aria-expanded="false">
83+
<span class="nav-icon"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 2 7 12 12 22 7 12 2"/><polyline points="2 17 12 22 22 17"/><polyline points="2 12 12 17 22 12"/></svg></span>
84+
<span>Asset Management</span>
85+
<svg class="nav-caret" xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>
86+
</div>
87+
<div class="nav-subitems" id="assets-subnav" role="menu">
88+
<div class="nav-subitem" id="nav-targets" data-label="Targets" role="menuitem">Targets</div>
89+
<div class="nav-subitem" id="nav-programs" data-label="Programs" role="menuitem">Programs</div>
90+
</div>
8991
</div>
9092

9193
<div class="nav-item" id="nav-keyhacks" data-label="Keyhacks">
9294
<span class="nav-icon"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m21 2-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0 3 3L22 7l-3-3m-3.5 3.5L19 4"/></svg></span>
9395
<span>Keyhacks</span>
9496
</div>
9597

96-
<div class="nav-item" id="nav-apkauditor" data-label="APK Auditor">
97-
<span class="nav-icon"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="5" y="2" width="14" height="20" rx="2" ry="2"/><path d="M12 18h.01"/></svg></span>
98-
<span>APK Auditor</span>
99-
</div>
100-
<div class="nav-item" id="nav-ipaauditor" data-label="IPA Auditor">
101-
<span class="nav-icon"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20.94c1.5 0 2.75 1.06 4 1.06 3 0 6-8 6-12.22A4.91 4.91 0 0 0 17 5c-2.22 0-4 1.44-5 2-1-.56-2.78-2-5-2a4.9 4.9 0 0 0-5 4.78C2 13 5 21 8 21c1.25 0 2.5-1.06 4-1.06z"/><path d="M10 2c0 2.5 2 4 2 4s2-1.5 2-4"/></svg></span>
102-
<span>IPA Auditor</span>
103-
</div>
104-
<div class="nav-item" id="nav-adbauditor" data-label="ADB Auditor">
105-
<span class="nav-icon"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="13 17 18 12 13 7"/><polyline points="6 17 11 12 6 7"/></svg></span>
106-
<span>ADB Auditor</span>
107-
</div>
108-
<div class="nav-item nav-group-head" id="nav-securitylab" data-label="Security Lab" aria-expanded="false">
109-
<span class="nav-icon"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5h0c-1.4 0-2.5-1.1-2.5-2.5V2"/><path d="M8.5 2h7"/><path d="M14.5 16h-5"/></svg></span>
110-
<span>Security Lab</span>
111-
<svg class="nav-caret" xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>
98+
<div class="nav-group">
99+
<div class="nav-item nav-group-head" id="nav-group-mobile" data-label="Mobile" aria-expanded="false">
100+
<span class="nav-icon"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="5" y="2" width="14" height="20" rx="2" ry="2"/><line x1="12" y1="18" x2="12.01" y2="18"/></svg></span>
101+
<span>Mobile</span>
102+
<svg class="nav-caret" xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>
103+
</div>
104+
<div class="nav-subitems" id="mobile-subnav" role="menu">
105+
<div class="nav-subitem" id="nav-apkauditor" data-label="APK Auditor" role="menuitem">APK Auditor</div>
106+
<div class="nav-subitem" id="nav-ipaauditor" data-label="IPA Auditor" role="menuitem">IPA Auditor</div>
107+
<div class="nav-subitem" id="nav-adbauditor" data-label="ADB Auditor" role="menuitem">ADB Auditor</div>
108+
</div>
112109
</div>
113-
<div class="nav-subitems" id="securitylab-subnav" role="menu">
114-
<div class="nav-subitem" data-sltab="jwt" role="menuitem">JWT Analyzer</div>
115-
<div class="nav-subitem" data-sltab="regex" role="menuitem">Regex Workbench</div>
116-
<div class="nav-subitem" data-sltab="depconf" role="menuitem">Dependency Confusion</div>
117-
<div class="nav-subitem" data-sltab="ssrf" role="menuitem">SSRF Payloads</div>
118-
<div class="nav-subitem" data-sltab="xss" role="menuitem">XSS Cheat Sheet</div>
119-
<div class="nav-subitem" data-sltab="dorks" role="menuitem">Recon Dorks</div>
120-
<div class="nav-subitem" data-sltab="takeover" role="menuitem">Takeover Reference</div>
110+
111+
<div class="nav-group">
112+
<div class="nav-item nav-group-head" id="nav-securitylab" data-label="Security Lab" aria-expanded="false">
113+
<span class="nav-icon"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5h0c-1.4 0-2.5-1.1-2.5-2.5V2"/><path d="M8.5 2h7"/><path d="M14.5 16h-5"/></svg></span>
114+
<span>Security Lab</span>
115+
<svg class="nav-caret" xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>
116+
</div>
117+
<div class="nav-subitems" id="securitylab-subnav" role="menu">
118+
<div class="nav-subitem" data-sltab="jwt" role="menuitem">JWT Analyzer</div>
119+
<div class="nav-subitem" data-sltab="regex" role="menuitem">Regex Workbench</div>
120+
<div class="nav-subitem" data-sltab="depconf" role="menuitem">Dependency Confusion</div>
121+
<div class="nav-subitem" data-sltab="ssrf" role="menuitem">SSRF Payloads</div>
122+
<div class="nav-subitem" data-sltab="xss" role="menuitem">XSS Cheat Sheet</div>
123+
<div class="nav-subitem" data-sltab="dorks" role="menuitem">Recon Dorks</div>
124+
<div class="nav-subitem" data-sltab="takeover" role="menuitem">Takeover Reference</div>
125+
</div>
121126
</div>
122127

123128
<div class="nav-item" id="nav-r2" data-label="R2 Browser">

internal/api/ui/pages/router-navigation.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@
5353
}
5454
}
5555

56+
// Reset group-head "contains the active view" markers; recomputed in the loop below.
57+
document.querySelectorAll('.nav-group-head').forEach((h) => h.classList.remove('has-active-child'));
58+
5659
(window.VIEWS || []).forEach((v) => {
5760
const el = document.getElementById(`view-${v}`);
5861
const nav = document.getElementById(`nav-${v}`);
@@ -63,7 +66,20 @@
6366
el.style.display = isActive ? 'flex' : 'none';
6467
}
6568
}
66-
if (nav) nav.classList.toggle('active', v === view);
69+
if (nav) {
70+
const navActive = v === view;
71+
nav.classList.toggle('active', navActive);
72+
// If the active view lives inside a collapsible group (Mobile / Asset Management),
73+
// expand that group so the highlighted item is visible.
74+
if (navActive && nav.classList.contains('nav-subitem')) {
75+
const head = nav.closest('.nav-group')?.querySelector('.nav-group-head');
76+
if (head) {
77+
head.classList.add('expanded');
78+
head.setAttribute('aria-expanded', 'true');
79+
head.classList.add('has-active-child'); // surfaces active state when collapsed
80+
}
81+
}
82+
}
6783
});
6884

6985
document.getElementById('topbar-title').textContent = window.viewTitle(view);

internal/api/ui/pages/shell-wiring.js

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,42 @@
55

66
(window.VIEWS || []).forEach((v) => {
77
const el = document.getElementById(`nav-${v}`);
8-
if (el) {
8+
// A group head that is also a view (Security Lab) must NOT navigate on click —
9+
// it only opens its submenu (handled by the group-toggle wiring below); its
10+
// sub-items do the navigating. Binding navigate here too would double-fire.
11+
if (el && !el.classList.contains('nav-group-head')) {
912
el.addEventListener('click', () => window.navigateTo(v));
1013
}
1114
});
1215

13-
// Security Lab is an expandable group: clicking the head toggles its tool list
14-
// (it still navigates via the handler above); each sub-item deep-links to one tool.
15-
const slHead = document.getElementById('nav-securitylab');
16-
if (slHead) {
17-
slHead.addEventListener('click', () => {
18-
const expanded = slHead.classList.toggle('expanded');
19-
slHead.setAttribute('aria-expanded', expanded ? 'true' : 'false');
16+
// Expandable nav groups (Asset Management, Mobile, Security Lab): clicking a group
17+
// head toggles its submenu. Security Lab's head is also a real view, so it still
18+
// navigates via the VIEWS loop above; the Mobile / Asset Management heads are pure
19+
// toggles whose sub-items (real views) navigate via the VIEWS loop too.
20+
document.querySelectorAll('.nav-group-head').forEach((head) => {
21+
head.addEventListener('click', () => {
22+
// In icon-only (collapsed) mode the submenu is hidden, so expand the sidebar
23+
// first — otherwise the grouped views would be unreachable. Then open the group.
24+
const sidebar = document.getElementById('app-sidebar');
25+
if (sidebar && sidebar.classList.contains('collapsed')) {
26+
sidebar.classList.remove('collapsed');
27+
try { localStorage.setItem('autoar.sidebar.collapsed', 'false'); } catch (e) { /* ignore */ }
28+
head.classList.add('expanded');
29+
head.setAttribute('aria-expanded', 'true');
30+
return;
31+
}
32+
const expanded = head.classList.toggle('expanded');
33+
head.setAttribute('aria-expanded', expanded ? 'true' : 'false');
2034
});
21-
}
35+
});
36+
37+
// Security Lab sub-items are tabs within the single Security Lab view — deep-link to them.
2238
document.querySelectorAll('#securitylab-subnav .nav-subitem').forEach((el) => {
2339
el.addEventListener('click', (e) => {
2440
e.stopPropagation();
2541
const tab = el.dataset.sltab;
2642
document.querySelectorAll('#securitylab-subnav .nav-subitem').forEach((x) => x.classList.remove('active'));
2743
el.classList.add('active');
28-
if (slHead) {
29-
slHead.classList.add('expanded');
30-
slHead.setAttribute('aria-expanded', 'true');
31-
}
3244
window.state._securityLabTab = tab;
3345
window.navigateTo('securitylab');
3446
});

internal/api/ui/styles.css

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ input, select, textarea { font-family: inherit; }
275275
flex-shrink: 0;
276276
}
277277

278-
/* Expandable nav group (Security Lab) */
278+
/* Expandable nav groups (Asset Management, Mobile, Security Lab) */
279279
.nav-caret {
280280
margin-left: auto;
281281
flex-shrink: 0;
@@ -321,9 +321,17 @@ input, select, textarea { font-family: inherit; }
321321
.nav-subitem:hover { background: var(--bg-card); color: var(--text-primary); }
322322
.nav-subitem.active { color: var(--accent-cyan); background: var(--accent-cyan-dim); }
323323
.nav-subitem.active::before { opacity: 1; }
324-
/* Collapsed (icon-only) sidebar: hide the caret and the whole submenu. */
324+
/* Collapsed (icon-only) sidebar: hide the caret and submenus. Grouped views stay
325+
reachable because clicking a group icon while collapsed expands the sidebar first
326+
(handled in shell-wiring.js), rather than relying on a flyout that the sidebar's
327+
overflow:hidden would clip. */
325328
.sidebar.collapsed .nav-caret,
326329
.sidebar.collapsed .nav-subitems { display: none; }
330+
/* When collapsed, the active sub-item is hidden, so highlight its group icon instead. */
331+
.sidebar.collapsed .nav-group-head.has-active-child {
332+
background: var(--accent-cyan-dim);
333+
color: var(--accent-cyan);
334+
}
327335

328336
.nav-badge {
329337
margin-left: auto;

0 commit comments

Comments
 (0)