-
Couldn't load subscription status.
- Fork 574
feat: filters for component view (HTML report) #1840
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
d634b46
feat: filters for component view (HTML report)
b31ngd3v 97f2b0c
fix: cve count
b31ngd3v 626f02b
fix: cve count
b31ngd3v a88a697
Merge branch 'main' into 1614
b31ngd3v 4089e01
test: rerun
b31ngd3v 8256104
Merge branch 'main' into 1614
b31ngd3v c7f4d5f
Merge branch 'main' into 1614
b31ngd3v 0715ef8
docs: update docs
b31ngd3v 57a578c
docs: update docs
b31ngd3v 2a38bb1
fix: merge conflict
b31ngd3v 66ebaec
Merge branch 'main' into 1614
b31ngd3v d915a09
fix: conflict
b31ngd3v 50c52c0
fix: formatting
b31ngd3v 43b44e2
fix: test
b31ngd3v ee33078
fix: test
b31ngd3v 37bc42c
Merge branch 'main' into 1614
b31ngd3v f600ebd
Merge branch 'main' into 1614
b31ngd3v 6def2dc
refactor: refactor
b31ngd3v 63ddc8d
Merge branch 'main' into 1614
b31ngd3v 42268a2
fix: flake8
b31ngd3v File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,40 +1,112 @@ | ||
| function searchProductsScanned() { | ||
| let input = document.getElementById('searchInput'); | ||
| let filter = input.value.toLowerCase(); | ||
| let ul = document.getElementById('listProducts'); | ||
| let input = document.getElementById('searchInput') | ||
| let filter = input.value.toLowerCase() | ||
| let ul = document.getElementById('listProducts') | ||
| let li = ul.getElementsByClassName('list-group-item-action') | ||
|
|
||
| for (let i = 0; i < li.length; i++) { | ||
| let txtValue = li[i].textContent || li[i].innerText; | ||
| let txtValue = li[i].textContent || li[i].innerText | ||
| if (txtValue.toLowerCase().indexOf(filter) > -1) { | ||
| li[i].style.display = ""; | ||
| li[i].style.display = '' | ||
| } else { | ||
| li[i].style.display = "none"; | ||
| li[i].style.display = 'none' | ||
| } | ||
| } | ||
| } | ||
|
|
||
| function analysisShadowToggle(ele) { | ||
| ele.classList.toggle("shadow-lg"); | ||
| ele.classList.toggle('shadow-lg') | ||
| } | ||
|
|
||
| function resizeGraph(ele) { | ||
| setTimeout(() => { | ||
| let modalId = ele.getAttribute('data-bs-target').substr(1); | ||
| let modalId = ele.getAttribute('data-bs-target').substr(1) | ||
| eval(document.getElementById(modalId).querySelector('script').innerHTML) | ||
| }, 240); | ||
| }, 240) | ||
| } | ||
|
|
||
| function modeInteractive(){ | ||
| var div_interactive = document.getElementById("interactive_mode"); | ||
| var div_print = document.getElementById("print_mode") | ||
| div_interactive.style.display = "block"; | ||
| div_print.style.display = "none"; | ||
| function modeInteractive() { | ||
| var div_interactive = document.getElementById('interactive_mode') | ||
| var div_print = document.getElementById('print_mode') | ||
| div_interactive.style.display = 'block' | ||
| div_print.style.display = 'none' | ||
| } | ||
|
|
||
| function modePrint(){ | ||
| var div_interactive = document.getElementById("interactive_mode"); | ||
| var div_print = document.getElementById("print_mode") | ||
| div_interactive.style.display = "none"; | ||
| div_print.style.display = "block"; | ||
| } | ||
| function modePrint() { | ||
| var div_interactive = document.getElementById('interactive_mode') | ||
| var div_print = document.getElementById('print_mode') | ||
| div_interactive.style.display = 'none' | ||
| div_print.style.display = 'block' | ||
| } | ||
|
|
||
| function handleActive(key, id) { | ||
| document | ||
| .getElementById(id) | ||
| .getElementsByClassName('active')[0] | ||
| .classList.remove('active') | ||
| document.getElementById(id).children[key].classList.add('active') | ||
| } | ||
|
|
||
| function filterCVEs(remark, id) { | ||
| const classes = ['new', 'confirmed', 'mitigated', 'unexplored', 'ignored'] | ||
| for (let i = 0; i < 5; i++) { | ||
| let ele = document | ||
| .getElementById(`listCVE${id}`) | ||
| .getElementsByClassName(classes[i])[0] | ||
| if (remark == 'all' || classes[i] === remark) ele.style.display = '' | ||
| else ele.style.display = 'none' | ||
| } | ||
| } | ||
|
|
||
| function filterByRemark(key, id) { | ||
| const classes = [ | ||
| 'all', | ||
| 'new', | ||
| 'confirmed', | ||
| 'mitigated', | ||
| 'unexplored', | ||
| 'ignored', | ||
| ] | ||
| handleActive(key, `list-cve${id}`) | ||
| filterCVEs(classes[key], id) | ||
| } | ||
|
|
||
| function updateCount(ele, remark) { | ||
| if (remark === 'all') { | ||
| ele.getElementsByClassName('cve-count')[0].innerHTML = ele | ||
| .getElementsByClassName('cve-count')[0] | ||
| .getAttribute('total-cve-count') | ||
| return | ||
| } | ||
| ele.getElementsByClassName('cve-count')[0].innerHTML = | ||
| ele.nextElementSibling.getElementsByClassName(remark)[0].childElementCount | ||
| } | ||
|
|
||
| function filterProducts(remark) { | ||
| let ul = document.getElementById('listProducts') | ||
| let li = ul.getElementsByClassName('list-group-item-action') | ||
|
|
||
| for (let i = 0; i < li.length; i++) { | ||
| let remarks = li[i].getAttribute('remarks') | ||
| if (remarks === null) continue | ||
| if (remark === 'all' || remarks.indexOf(remark) > -1) { | ||
| li[i].style.display = '' | ||
| updateCount(li[i], remark) | ||
| } else { | ||
| li[i].style.display = 'none' | ||
| } | ||
| } | ||
| } | ||
|
|
||
| function filterProductsByRemark(key) { | ||
| const classes = [ | ||
| 'all', | ||
| 'new', | ||
| 'confirmed', | ||
| 'mitigated', | ||
| 'unexplored', | ||
| 'ignored', | ||
| ] | ||
| handleActive(key, 'filter-products') | ||
| filterProducts(classes[key]) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.