fix double pathsep in ongoing-xfer links

This commit is contained in:
ed 2025-11-30 19:59:57 +00:00
parent 889bd3242a
commit f4d67ff031
2 changed files with 12 additions and 10 deletions

View file

@ -5269,10 +5269,11 @@ class HttpCli(object):
fdone = max(0.001, 1 - rem) fdone = max(0.001, 1 - rem)
td = max(0.1, now - t0) td = max(0.1, now - t0)
rd, fn = vsplit(vp.replace(os.sep, "/")) rd, fn = vsplit(vp.replace(os.sep, "/"))
if not rd: if rd:
rd = "/"
erd = quotep(rd)
rds = rd.replace("/", " / ") rds = rd.replace("/", " / ")
erd = "/%s/" % (quotep(rd),)
else:
erd = rds = "/"
spd = humansize(sz * fdone / td, True) + "/s" spd = humansize(sz * fdone / td, True) + "/s"
eta = s2hms((td / fdone) - td, True) if rem < 1 else "--" eta = s2hms((td / fdone) - td, True) if rem < 1 else "--"
idle = s2hms(now - poke, True) idle = s2hms(now - poke, True)
@ -5299,10 +5300,11 @@ class HttpCli(object):
for t0, t1, sent, sz, vp, dl_id, uname in dl_list: for t0, t1, sent, sz, vp, dl_id, uname in dl_list:
td = max(0.1, now - t0) td = max(0.1, now - t0)
rd, fn = vsplit(vp) rd, fn = vsplit(vp)
if not rd: if rd:
rd = "/"
erd = quotep(rd)
rds = rd.replace("/", " / ") rds = rd.replace("/", " / ")
erd = "/%s/" % (quotep(rd),)
else:
erd = rds = "/"
spd = humansize(sent / td, True) + "/s" spd = humansize(sent / td, True) + "/s"
hsent = humansize(sent, True) hsent = humansize(sent, True)
idle = s2hms(now - t1, True) idle = s2hms(now - t1, True)

View file

@ -42,7 +42,7 @@
<thead><tr><th>%</th><th>speed</th><th>eta</th><th>idle</th><th>dir</th><th>file</th></tr></thead> <thead><tr><th>%</th><th>speed</th><th>eta</th><th>idle</th><th>dir</th><th>file</th></tr></thead>
<tbody> <tbody>
{%- for u in ups %} {%- for u in ups %}
<tr><td>{{ u[0] }}</td><td>{{ u[1] }}</td><td>{{ u[2] }}</td><td>{{ u[3] }}</td><td><a href="{{ r }}/{{ u[4] }}">{{ u[5]|e }}</a></td><td>{{ u[6]|e }}</td></tr> <tr><td>{{ u[0] }}</td><td>{{ u[1] }}</td><td>{{ u[2] }}</td><td>{{ u[3] }}</td><td><a href="{{ r }}{{ u[4] }}">{{ u[5]|e }}</a></td><td>{{ u[6]|e }}</td></tr>
{%- endfor %} {%- endfor %}
</tbody> </tbody>
</table> </table>
@ -54,7 +54,7 @@
<thead><tr><th>%</th><th>sent</th><th>speed</th><th>eta</th><th>idle</th><th></th><th>dir</th><th>file</th></tr></thead> <thead><tr><th>%</th><th>sent</th><th>speed</th><th>eta</th><th>idle</th><th></th><th>dir</th><th>file</th></tr></thead>
<tbody> <tbody>
{%- for u in dls %} {%- for u in dls %}
<tr><td>{{ u[0] }}</td><td>{{ u[1] }}</td><td>{{ u[2] }}</td><td>{{ u[3] }}</td><td>{{ u[4] }}</td><td>{{ u[5] }}</td><td><a href="{{ r }}/{{ u[6] }}">{{ u[7]|e }}</a></td><td>{{ u[8] }}</td></tr> <tr><td>{{ u[0] }}</td><td>{{ u[1] }}</td><td>{{ u[2] }}</td><td>{{ u[3] }}</td><td>{{ u[4] }}</td><td>{{ u[5] }}</td><td><a href="{{ r }}{{ u[6] }}">{{ u[7]|e }}</a></td><td>{{ u[8] }}</td></tr>
{%- endfor %} {%- endfor %}
</tbody> </tbody>
</table> </table>