fix max size unit

This commit is contained in:
Roman 2021-03-31 20:40:46 +02:00
parent dc884b17f8
commit 4a52ab2fd7
2 changed files with 4 additions and 3 deletions

@ -180,7 +180,7 @@ export function TokenList(props) {
onChange={(e) => onPopupChange(e, "maxFiles")}/> onChange={(e) => onPopupChange(e, "maxFiles")}/>
</div> </div>
<div className={"form-group"}> <div className={"form-group"}>
<label>Max. Size per file in MB (0 = unlimited):</label> <label>Max. Size per file in MiB (0 = unlimited):</label>
<input type={"number"} min={0} max={10} className={"form-control"} <input type={"number"} min={0} max={10} className={"form-control"}
value={popup.maxSize} onChange={(e) => onPopupChange(e, "maxSize")}/> value={popup.maxSize} onChange={(e) => onPopupChange(e, "maxSize")}/>
</div> </div>
@ -257,7 +257,8 @@ export function TokenList(props) {
}); });
} else if (popup.tokenType === "upload") { } else if (popup.tokenType === "upload") {
let parentId = popup.directory === 0 ? null : popup.directory; let parentId = popup.directory === 0 ? null : popup.directory;
api.createUploadToken(durability, parentId, popup.maxFiles, popup.maxSize, popup.extensions).then((res) => { let maxSize = Math.round(popup.maxSize * 1024 * 1024);
api.createUploadToken(durability, parentId, popup.maxFiles, maxSize, popup.extensions).then((res) => {
if (!res.success) { if (!res.success) {
pushAlert(res, "Error creating token"); pushAlert(res, "Error creating token");
} else { } else {

2
js/files.min.js vendored

File diff suppressed because one or more lines are too long