On index page only available storage is shown.
This commit is contained in:
parent
6b8a7dffc7
commit
59e0629597
@ -48,12 +48,10 @@ func (h *UploadHandlers) Index(w http.ResponseWriter, r *http.Request) {
|
||||
var storCapacity int64 = h.limitStorage << 20
|
||||
var fMaxSize int64 = h.limitFileSize << 20
|
||||
|
||||
_, _, capStr := utils.ConvertFileSize(storCapacity)
|
||||
_, _, usedStr := utils.ConvertFileSize(*h.uploadDirSize)
|
||||
_, _, availStr := utils.ConvertFileSize(storCapacity - *h.uploadDirSize)
|
||||
_, _, fMaxSzStr := utils.ConvertFileSize(fMaxSize)
|
||||
|
||||
web.Index(utils.MainSite(r.Host), storCapacity, *h.uploadDirSize, h.keepForHours, fMaxSzStr, usedStr, capStr, availStr, w)
|
||||
web.Index(utils.MainSite(r.Host), h.keepForHours, fMaxSzStr, availStr, w)
|
||||
}
|
||||
|
||||
func (h *UploadHandlers) Upload(w http.ResponseWriter, r *http.Request) {
|
||||
|
@ -91,15 +91,6 @@ h2 {
|
||||
|
||||
small { font-size: .8rem; }
|
||||
|
||||
progress {
|
||||
background-color: var(--secondary-color);
|
||||
border: none;
|
||||
color: var(--primary-color);
|
||||
height: 1.1rem;
|
||||
width: 30%; }
|
||||
|
||||
progress::-moz-progress-bar { background-color: var(--primary-color); }
|
||||
|
||||
.center { text-align: center; }
|
||||
|
||||
html { margin-left: calc(100vw - 100%); }
|
||||
@ -147,8 +138,6 @@ nav h1 {
|
||||
|
||||
section { margin-top: 1rem; }
|
||||
|
||||
#occupied-space div span { margin: 0 .2rem; }
|
||||
|
||||
footer {
|
||||
font-size: .8rem;
|
||||
text-align: center;
|
||||
|
@ -4,27 +4,23 @@ block header
|
||||
h1 Upload
|
||||
|
||||
block body
|
||||
:go:func Index(mainSite string, storageCapacity, storageUsed int64, keepForHours int, fileMaxSize, storageUsedStr, storageCapacityStr, storageAvailableStr string)
|
||||
:go:func Index(mainSite string, keepForHours int, fileMaxSize, storageAvailableStr string)
|
||||
section#rules.center
|
||||
h2 Rules
|
||||
p Maximum file size is #[b #{fileMaxSize}] and it will be kept for #[b #{keepForHours}] hours.
|
||||
p Content you upload should comply with Russian Federation's law. Generally speaking, anything illegal, like CP, extremist literature, and so on is forbidden.
|
||||
section#occupied-space.center
|
||||
h2 Occupied space
|
||||
div
|
||||
span #{storageUsedStr}
|
||||
progress(value=storageUsed max=storageCapacity)
|
||||
span #{storageCapacityStr}
|
||||
div
|
||||
| #{storageAvailableStr}
|
||||
section#upload.center
|
||||
h2 Upload
|
||||
form(action="/" method="POST" enctype="multipart/form-data")
|
||||
input(type="file" name="file" multiple=false)
|
||||
button(type="submit") Upload
|
||||
section.center
|
||||
h2 Space left
|
||||
p #{storageAvailableStr}
|
||||
section.center
|
||||
p You can use cURL to upload a file: #[code curl -F 'file=@somefile.ext' https://upload.arav.su]
|
||||
p Over I2P: #[code curl --proxy 127.0.0.1:4444 -F 'file=@somefile.ext' http://upload.arav.i2p]
|
||||
p Same for Tor, just set #[code --proxy] and replace a domain.
|
||||
p A resulted link looks like this: #[code /base64rawURL(salted SHA-256)/filename.ext].
|
||||
section.center
|
||||
h2 Delete
|
||||
|
Loading…
Reference in New Issue
Block a user