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

Performance improvement - htmx #59

Open
stalpers opened this issue Jul 22, 2024 · 1 comment
Open

Performance improvement - htmx #59

stalpers opened this issue Jul 22, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@stalpers
Copy link

Thank you for implementing the custom RSS feeds.

I have another idea which might improve the speed of the vulnerability results while reducing the size of the results page. To include all necessary information, you have added a drop down to view the JSON drop down which is implemented by rendering all JSON in the returned HTML.
Instead, it would be more performant to load only the data the user is interested in. Although traditionally APIs would be used an easier and more intuitive solution is available htmx

Unfortunately, I am really bad at Flask and cannot directly create a Pull request, but you could create a new template vuln_detail.html which does the same als line 38-393 in vulnerabilities.html the view for vuln_detail.html should accept the vuln-id as a parameter & display the details - without the master template.

The JSON could be loaded like this (untested) - see also here https://htmx.org/examples/lazy-load/

<a role="button" hx-get="/vuln_details?{{vulnerability_id}}" hx-trigger="load" hx-target="#collapse_div" class="btn btn-primary" data-bs-toggle="collapse" data-bs-target="#collapseJson{{vulnerability_id}}" aria-expanded="false" aria-controls="collapseJson{{vulnerability_id}}">

htmx is also great when it comes to searching https://htmx.org/examples/active-search/ or CRUD operations

@cedricbonhomme
Copy link
Collaborator

Thank you for the information, I'll have a loot at this. Actually one of the next development is to improve the vuln view. The goal is to display more relevant information for each sources of vulnerabilities, with the same level of detail when possible.
For the moment the view is very light.

@cedricbonhomme cedricbonhomme added the enhancement New feature or request label Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants