Skip to content

Commit

Permalink
Only show time reimaining if not finished
Browse files Browse the repository at this point in the history
  • Loading branch information
CoolCat467 committed May 17, 2024
1 parent dea3530 commit ec92a89
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions src/sanescansrv/generate_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,14 @@ def generate_scan_status_get() -> str:
),
block=False,
),
htmlgen.wrap_tag(
"p",
f"Scan is estimated to be done in {estimate}.",
htmlgen.jinja_if_block(
{
"not is_done": htmlgen.wrap_tag(
"p",
f"Scan is estimated to be done in {estimate}.",
block=False,
),
},
block=False,
),
),
Expand Down
2 changes: 1 addition & 1 deletion src/sanescansrv/templates/scan-status_get.html.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<h1>{% if just_started %}Just Started Scanning{% else %}Scan Is In Progress{% endif %}</h1>
<div class="box">
<p>{% if just_started %}Just Started.{% elif progress[0] == progress[1] %}Just finished, saving file...{% else %}<strong>{{ (progress[0] / progress[1] * 100)|round(2) }}%</strong> Complete{% endif %}</p>
<p>Scan is estimated to be done in <strong>{{ estimated_wait }}</strong>.</p>
{% if not is_done %}<p>Scan is estimated to be done in <strong>{{ estimated_wait }}</strong>.</p>{% endif %}
</div>
<hr>
<i>This page will automatically refresh after {{ refreshes_after }} second{% if refreshes_after > 1 %}s{% elif refreshes_after == 0 %}s{% endif %}.</i>
Expand Down

0 comments on commit ec92a89

Please sign in to comment.