Skip to content

Commit 3c6de89

Browse files
show CVSS vector together in tooltip
1 parent 3362964 commit 3c6de89

File tree

1 file changed

+30
-12
lines changed

1 file changed

+30
-12
lines changed

dojo/templates/dojo/view_finding.html

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
{% load get_endpoint_status %}
99
{% block add_styles %}
1010
{{ block.super }}
11-
.tooltip-inner {
12-
max-width: 650px;
13-
}
1411
{% endblock %}
1512
{% block add_css_before %}
1613
{{ block.super }}
@@ -293,15 +290,10 @@ <h3 class="pull-left finding-title">
293290
<span class="label severity severity-{{ finding.severity }}">
294291
{% if finding.severity %}
295292
{{ finding.severity_display }}
296-
{% if finding.cvssv4_score %}
297-
<i class="no-italics has-popover" font-style="normal" data-toggle="tooltip" data-placement="bottom" data-container="body" title="" href="#"
298-
data-content="{{ finding.cvssv4 }}">
299-
({{ finding.cvssv4_score }}{% if finding.cvssv3_score %},{% else %}){% endif %}</i>
300-
{% endif %}
301-
{% if finding.cvssv3_score %}
302-
<i class="no-italics has-popover" font-style="normal" data-toggle="tooltip" data-placement="bottom" data-container="body" title="" href="#"
303-
data-content="{{ finding.cvssv3 }}">
304-
{% if not finding.cvssv4_score %}({% endif %}{{ finding.cvssv3_score }})</i>
293+
{% if finding.cvssv4_score or finding.cvssv3_score %}
294+
<i class="no-italics has-popover" font-style="normal" data-toggle="tooltip" data-placement="bottom" data-container="body" data-html="true" title="" href="#"
295+
data-content="{% if finding.cvssv4 %}{{ finding.cvssv4 }} ({{ finding.cvssv4_score }}){% endif %}{% if finding.cvssv4 and finding.cvssv3 %}<br/>{% endif %}{% if finding.cvssv3 %}{{ finding.cvssv3 }} ({{ finding.cvssv3_score }}){% endif %}">
296+
({% if finding.cvssv4_score %}{{ finding.cvssv4_score }}{% if finding.cvssv3_score %}, {% endif %}{% endif %}{% if finding.cvssv3_score %}{{ finding.cvssv3_score }}{% endif %})</i>
305297
{% endif %}
306298
{% else %}
307299
Unknown
@@ -1218,6 +1210,32 @@ <h4>Credential
12181210
var i = $($(this).find('i').get(0));
12191211
i.toggleClass('glyphicon-chevron-up').toggleClass('glyphicon-chevron-down');
12201212
})
1213+
1214+
// Configure tooltips for CVSS vectors - try multiple approaches
1215+
$(document).on('shown.bs.tooltip shown.bs.popover', function() {
1216+
$('.tooltip-inner, .popover-content').css({
1217+
'max-width': '1200px !important',
1218+
'white-space': 'nowrap !important',
1219+
'word-wrap': 'normal !important'
1220+
});
1221+
$('.tooltip, .popover').css({
1222+
'max-width': '1200px !important'
1223+
});
1224+
});
1225+
1226+
// Force tooltip configuration
1227+
$('.has-popover').each(function() {
1228+
$(this).on('mouseenter', function() {
1229+
setTimeout(function() {
1230+
$('.tooltip-inner, .popover-content').css({
1231+
'max-width': '1200px',
1232+
'white-space': 'nowrap',
1233+
'word-wrap': 'normal',
1234+
'overflow': 'visible'
1235+
});
1236+
}, 10);
1237+
});
1238+
});
12211239
});
12221240

12231241
// keyboard shortcuts

0 commit comments

Comments
 (0)