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 3 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
### capa explorer IDA Pro plugin

### Development
- capa Explorer Web: improve navigation in capa Explorer Web
fariss marked this conversation as resolved.
Show resolved Hide resolved

### Raw diffs

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