Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

capa Explorer Web: improve url navigation #2425

Merged
merged 6 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@
- replace tabulate, tqdm, and termcolor with rich #2374 @s-ff
- dynamic: emit complete features for A/W APIs #2409 @mike-hunhoff

### capa explorer IDA Pro plugin
### capa Explorer Web
- improve navigation in capa Explorer Web @s-ff #2425

### capa Explorer IDA Pro plugin
mr-tz marked this conversation as resolved.
Show resolved Hide resolved

### Development

Expand Down
18 changes: 13 additions & 5 deletions web/explorer/src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,20 @@ const router = createRouter({
name: "analysis",
component: AnalysisView,
beforeEnter: (to, from, next) => {
if (rdocStore.data.value === null) {
// No rdoc loaded, redirect to home page
next({ name: "home" });
} else {
// rdoc is loaded, proceed to analysis page
// check if rdoc is loaded
if (rdocStore.data.value !== null) {
// rdocStore.data already contains the rdoc json - continue
next();
} else {
// rdoc is not loaded, check if the rdoc query param is set in the URL
const rdocUrl = to.query.rdoc;
if (rdocUrl) {
// query param is set - try to load the rdoc from the homepage
next({ name: "home", query: { rdoc: rdocUrl } });
} else {
// no query param is set - go back home
next({ name: "home" });
}
}
}
},
Expand Down
Loading