show inf when displaying storage limit and there is no limit
This commit is contained in:
@@ -117,6 +117,7 @@ func HomeHandler(pages *Pages, cfg config.Config) http.HandlerFunc {
|
||||
}
|
||||
|
||||
if cfg.DisplayStorageLimit {
|
||||
data["DisplayStorageLimit"] = true
|
||||
data["StorageLimit"] = humanize.Bytes(uint64(cfg.MaxStorageUsage))
|
||||
}
|
||||
if cfg.DisplayStorageUsage {
|
||||
|
||||
@@ -23,7 +23,7 @@ goals:
|
||||
- [ ] on startup
|
||||
- [ ] on upload failure
|
||||
- [ ] on admin action
|
||||
- [ ] display inf/unlimited/∞ on the home page when 0
|
||||
- [x] display inf/unlimited/∞ on the home page when 0
|
||||
- [ ] size based expiry
|
||||
- exclusions if below a certain size (like 5mb)
|
||||
- [ ] prometheus metrics
|
||||
|
||||
@@ -30,7 +30,15 @@
|
||||
<label for="type-paste">paste</label>
|
||||
{{if or .StorageUsage .StorageLimit}}
|
||||
<span class="muted" style="margin-left: auto; width: fit-content;">
|
||||
{{.StorageUsage}}{{if .StorageLimit}} / {{.StorageLimit}}{{end}} used
|
||||
<!-- geez this looks so ugly -->
|
||||
{{.StorageUsage}}
|
||||
{{if .DisplayStorageLimit}} /
|
||||
{{if .StorageLimit}}
|
||||
inf
|
||||
{{else}}
|
||||
{{.StorageLimit}}
|
||||
{{end}}
|
||||
{{end}} used
|
||||
</span>
|
||||
{{end}}
|
||||
<div class="file-panel">
|
||||
|
||||
Reference in New Issue
Block a user