Added Progress bars for Suggestion Scores and alike.

This commit is contained in:
jyamihud 2022-04-16 09:30:50 +03:00
parent cc442ba07a
commit 079c922b73
3 changed files with 42 additions and 4 deletions

View file

@ -22,5 +22,14 @@
1650046892.7005703, 1650046892.7005703,
1650046895.821551, 1650046895.821551,
1650049035.9363937, 1650049035.9363937,
1650050029.5476623 1650050029.5476623,
1650083891.6949275,
1650083898.9622037,
1650083924.1528506,
1650087590.964061,
1650088654.4191213,
1650090012.933084,
1650090481.4744847,
1650090521.486587,
1650090584.648241
] ]

View file

@ -255,12 +255,12 @@ def suggestions(page, json):
page = page +""" page = page +"""
<hr> <br><br>
<!-- ================================================================== --> <!-- ================================================================== -->
""" """
page = page + "<br>Suggestion score: " + str(frac) + "%" page = progress(page, frac/100, "Suggestion score: " + str(frac) + "%")
page = html(page, i[-1]) page = html(page, i[-1])
if more: if more:
@ -350,4 +350,32 @@ def source_code_link(page):
return page
def progress(page, frac, text=""):
# This will output a progress bar
page = page + """
<!-- In order for this to work with any CSS file, the
style of the little progress bar should be defined
inline. -->
<style>
.back_progress {background-color: #543ba3;
width: 100%;
height: 7}
.front_progress {background-color: #96bbe8;
height: 7}
</style>
<!-- Then we are going to use two divs -->
<div class="back_progress">
<div class="front_progress" style="width:"""+str(frac*100)+"""%">
</div>
</div>
&nbsp;&nbsp;"""+str(text)+"""
"""
return page return page

View file

@ -218,7 +218,8 @@ class handler(BaseHTTPRequestHandler):
page = page + "</div>" page = page + "</div>"
page = page + '<div class="side_found">' page = page + '<div class="side_found">'
page = page +"Search match: "+ str(int(match*100))+"%"
page = render.progress(page, match, "Search match: "+ str(int(match*100))+"%")
# Let's add the found software to the page # Let's add the found software to the page
page = render.html(page, software_data) page = render.html(page, software_data)
page = page + "</div>" page = page + "</div>"