Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
improves show when no vul
Browse files Browse the repository at this point in the history
  • Loading branch information
FeeiCN committed Aug 5, 2016
1 parent 9b82f30 commit b01a6ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions app/templates/report.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ <h4>扫描统计:</h4>
<div class="col-md-12 column">
<h4>漏洞分布统计</h4>
<div id="vul_distributing" style="height:400px;">

{% if data.vul_count == 0 %}
<h3 style="text-align: center;line-height: 400px;font-weight: bold;color: red;">赞, 未检测到漏洞 :)</h3>
{% endif %}
</div>
</div>
<div class="col-md-12 column">
Expand All @@ -133,7 +135,9 @@ <h4>后缀分布统计</h4>
<h3 class="panel-title"><strong>漏洞列表</strong></h3>
</div>
<div class="panel-body">

{% if data.vul_count == 0 %}
<h3>无漏洞</h3>
{% endif %}
{% for vulnerability in data.vulnerabilities %}
<h4>{{ vulnerability.vul_type }} (总数: {{ vulnerability.data | length }})</h4>
<table class="table table-condensed">
Expand Down Expand Up @@ -178,7 +182,6 @@ <h4>{{ vulnerability.vul_type }} (总数: {{ vulnerability.data | length }})</h4
</div> <!-- .panel panel-default -->
</div>
</div>

<hr>
<!-- Containers -->
<h3>Help</h3>
Expand Down Expand Up @@ -273,9 +276,10 @@ <h4><span>TT Offline?</span> Phone</h4>
}
]
};
{% if data.vul_count != 0 %}
var vul_distributing = echarts.init(document.getElementById('vul_distributing'));
vul_distributing.setOption(option);

{% endif %}

$(function () {
/* Ext Chart */
Expand Down
2 changes: 1 addition & 1 deletion utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def convert_time(seconds):
# 123456 -> 123,456
#
def convert_number(number):
if number is None:
if number is None or number == 0:
return 0
number = int(number)
return '{:20,}'.format(number)
Expand Down

0 comments on commit b01a6ab

Please sign in to comment.