added file size

This commit is contained in:
ston1th 2022-10-05 20:35:15 +02:00
commit 055e9db8e2
5 changed files with 33 additions and 2 deletions

View file

@ -59,6 +59,7 @@ type file struct {
Name template.HTML
URI template.HTML
Anchor string
Size string
Status int
Prio int
Errc int
@ -122,6 +123,7 @@ func (r *responseInterceptor) GetPaths(path string, fs *fs.FS, relative bool) (d
Name: name,
URI: uri,
Anchor: anchor(p),
Size: fs.FileSize(full),
Status: fs.CacheStatus(full),
})
}

View file

@ -17,7 +17,7 @@
<tr class="listitem">
<td class="listpath"><a id="{{$s.Anchor}}" href="{{$s.URI}}">{{$s.Name}}</a></td>
<td class="listoptions">
{{if ge $s.Status 0}}<span>{{$s.Status}}%</span>{{end}}<a href="{{$s.URI}}?o=v">[v]</a>
{{if ge $s.Status 0}}<span>{{$s.Status}}%</span>{{end}}<span>{{$s.Size}}</span><a href="{{$s.URI}}?o=v">[v]</a>
</td>
</tr>
<tr class="spacer"><td colspan="2">

View file

@ -20,7 +20,7 @@
<tr class="listitem">
<td class="listpath"><a id="{{$s.Anchor}}" href="{{$s.URI}}">{{$s.Name}}</a></td>
<td class="listoptions">
{{if ge $s.Status 0}}<span>{{$s.Status}}%</span>{{end}}<a href="{{$s.URI}}?o=v">[v]</a><a href="{{$s.URI}}?o=n">[n]</a><a href="{{$s.URI}}?o=p">[p]</a>
{{if ge $s.Status 0}}<span>{{$s.Status}}%</span>{{end}}<span>{{$s.Size}}</span><a href="{{$s.URI}}?o=v">[v]</a><a href="{{$s.URI}}?o=n">[n]</a><a href="{{$s.URI}}?o=p">[p]</a>
</td>
</tr>
<tr class="spacer"><td colspan="2">

View file

@ -24,6 +24,7 @@ Quota: {{.QuotaCur}} / {{.QuotaMax}} GiB
<span class="status-yellow">[queued]</span>
{{end -}}
{{end -}}
<span>{{$s.Size}}</span>
<span>{{$s.Prio}}</span><a href="{{$s.URI}}?o=v">[v]</a><a href="{{$s.Name}}?o=s&r=preloads">[s]</a><a href="{{$s.Name}}?o=i&r=preloads">[+]</a><a href="{{$s.Name}}?o=d&r=preloads">[-]</a>
</td>
</tr>