Skip to content

Commit

Permalink
chg: [website] Automatically open the tab-pane related to the sightin…
Browse files Browse the repository at this point in the history
…gs when loading sightings from the backend.
  • Loading branch information
cedricbonhomme committed Oct 18, 2024
1 parent 30167e0 commit 6f8c32a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
11 changes: 11 additions & 0 deletions website/web/templates/vuln.html
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,17 @@ <h5>Tags</h5>
drawBarChart(result.data);
document.getElementById("sightingsChartContainer").style.display = 'block';
document.getElementById("chart-detailed-legend").style.display = 'block';

// show the tab-pane related to the sightings
var tabPane = document.getElementById("sightings");
tabPane.classList.add("show", "active");
// ensure other tab panes are hidden, remove the classes from them
var otherTabPanes = document.querySelectorAll('.tab-pane');
otherTabPanes.forEach(function(pane) {
if (pane !== tabPane) {
pane.classList.remove("show", "active");
}
});
}
})
.catch((error) => {
Expand Down
14 changes: 7 additions & 7 deletions website/web/templates/vulnerability_templates.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
Sighting {{ render_icon('chevron-down') }}
</button>
<ul id="sighting-list" class="dropdown-menu" aria-labelledby="btnGroupDropSighting{{vulnerability_id}}">
<li><a class="dropdown-item" title="Seen" aria-label="Seen" value="seen" href="#">Seen</a></li>
<li><a class="dropdown-item" title="Confirmed" aria-label="Confirmed" value="confirmed" href="#">Confirmed</a></li>
<li><a class="dropdown-item" title="Exploited" aria-label="Exploited" value="exploited" href="#">Exploited</a></li>
<li><a class="dropdown-item" title="Patched" aria-label="Patched" value="patched" href="#">Patched</a></li>
<li><a class="dropdown-item" title="Not exploited" aria-label="Not exploited" value="not-exploited" href="#">Not exploited</a></li>
<li><a class="dropdown-item" title="Not confirmed" aria-label="Not confirmed" value="not-confirmed" href="#">Not confirmed</a></li>
<li><a class="dropdown-item" title="Not patched" aria-label="Not patched" value="not-patched" href="#">Not patched</a></li>
<li><a class="dropdown-item" title="Seen" aria-label="Seen" value="seen" href="#sightings">Seen</a></li>
<li><a class="dropdown-item" title="Confirmed" aria-label="Confirmed" value="confirmed" href="#sightings">Confirmed</a></li>
<li><a class="dropdown-item" title="Exploited" aria-label="Exploited" value="exploited" href="#sightings">Exploited</a></li>
<li><a class="dropdown-item" title="Patched" aria-label="Patched" value="patched" href="#sightings">Patched</a></li>
<li><a class="dropdown-item" title="Not exploited" aria-label="Not exploited" value="not-exploited" href="#sightings">Not exploited</a></li>
<li><a class="dropdown-item" title="Not confirmed" aria-label="Not confirmed" value="not-confirmed" href="#sightings">Not confirmed</a></li>
<li><a class="dropdown-item" title="Not patched" aria-label="Not patched" value="not-patched" href="#sightings">Not patched</a></li>
</ul>
</div>
{% endif %}
Expand Down

0 comments on commit 6f8c32a

Please sign in to comment.