Skip to content

Commit

Permalink
fix stats services and ports
Browse files Browse the repository at this point in the history
  • Loading branch information
Rev3rseSecurity committed Oct 29, 2018
1 parent d591162 commit 581d933
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions views.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,25 +625,31 @@ def index(request, filterservice="", filterportid=""):
allss = ''
allsslabels = ''
allssdata = ''
allssc = 0
for i in sorted(sscount, key=sscount.__getitem__, reverse=True):
if filterservice != i:
allss += '<a href="/report/service/'+html.escape(i)+'/">'+html.escape(i)+'('+str(sscount[i])+')</a>, '
else:
allss += '<span class="tmlabel" style="background-color:#ffcc00;color:#333;">'+html.escape(i)+'</span>, '
if allssc <= 30:
if filterservice != i:
allss += '<a href="/report/service/'+html.escape(i)+'/">'+html.escape(i)+'('+str(sscount[i])+')</a>, '
else:
allss += '<span class="tmlabel" style="background-color:#ffcc00;color:#333;">'+html.escape(i)+'</span>, '

allsslabels += '"'+html.escape(i)+'", '
allssdata += ''+str(sscount[i])+','
allsslabels += '"'+html.escape(i)+'", '
allssdata += ''+str(sscount[i])+','
allssc = (allssc + 1)

allpilabels = ''
allpidata = ''
allpilinks = ''
allpic = 1
for i in sorted(picount, key=picount.__getitem__, reverse=True):
allpilinks += '<a href="/report/portid/'+str(i)+'/">'+str(i)+'</a>, '
if allpic <= 5:
allpilinks += '<a href="/report/portid/'+str(i)+'/">'+str(i)+'</a>, '
allpilabels += '"'+html.escape(i)+'", '
allpidata += ''+str(picount[i])+','
allpic = (allpic + 1)
elif allpic > 5 and allpic <= 10:
allpilinks += '<a href="/report/portid/'+str(i)+'/">'+str(i)+'</a>, '
allpic = (allpic + 1)

allostypelinks = ''
for i in sorted(allostypelist, key=allostypelist.__getitem__, reverse=True):
Expand Down

0 comments on commit 581d933

Please sign in to comment.