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

Fixed #360 #362

Merged
merged 2 commits into from
Mar 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions app/controller/backend/index.py
Expand Up @@ -99,7 +99,7 @@ def main():

# time type
time_type = request.args.get('tt')
if time_type not in ['w', 'm', 'q']:
if time_type not in ['w', 'm', 'q', 'a']:
# default tt
time_type = 'w'

Expand Down Expand Up @@ -225,6 +225,9 @@ def main():
if ct_count is None:
ct_count = 0
trend_scan[k].append(ct_count)
if time_type == 'a':
day_first = '1997-10-10'
day_last = time.strftime('%Y-%m-%d', time.localtime())

# Vulnerability Data (VD)
fixed_amount = db.session.query(
Expand Down Expand Up @@ -418,7 +421,8 @@ def main():
time_type_desc = {
'w': '周',
'm': '月',
'q': '季度'
'q': '季度',
'a': '全部'
}
ttd = time_type_desc[time_type]
comment_scan = '本{ttd}扫描数据各指标都比较平稳,无明显波动!'.format(ttd=ttd)
Expand Down
4 changes: 2 additions & 2 deletions app/controller/front/route.py
Expand Up @@ -486,7 +486,7 @@ def vulnerabilities_detail():
mode = mode_mime[ext.lower()]

if os.path.isfile(file_path) is not True:
code_content = '// There is no code snippet for this type of file'
code_content = '// File does not exist'
line_trigger = 1
line_start = 1
c_author = 'Not support'
Expand Down Expand Up @@ -518,7 +518,7 @@ def vulnerabilities_detail():
try:
jsonify(data=code_content)
except Exception as e:
code_content = '// The encoding type code is not supported'
code_content = '// The file encoding type is not supported'
line_trigger = 1
line_start = 1

Expand Down
1 change: 1 addition & 0 deletions app/templates/backend/index/overview.html
Expand Up @@ -19,6 +19,7 @@
<a type="button" href="?tt=w" class="ce apn {% if data.time_type == 'w' %}active{% endif %}">周报(Weekly)</a>
<a type="button" href="?tt=m" class="ce apn {% if data.time_type == 'm' %}active{% endif %}">月报(Monthly)</a>
<a type="button" href="?tt=q" class="ce apn {% if data.time_type == 'q' %}active{% endif %}">季报(Quarterly)</a>
<a type="button" href="?tt=a" class="ce apn {% if data.time_type == 'a' %}active{% endif %}">全部(All)</a>
</div>
</div>
</div>
Expand Down