Browse Source

fix max size unit

Roman 3 years ago
parent
commit
4a52ab2fd7
2 changed files with 3 additions and 2 deletions
  1. 3 2
      fileControlPanel/src/elements/token-list.js
  2. 0 0
      js/files.min.js

+ 3 - 2
fileControlPanel/src/elements/token-list.js

@@ -180,7 +180,7 @@ export function TokenList(props) {
                                onChange={(e) => onPopupChange(e, "maxFiles")}/>
                     </div>
                     <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"}
                                value={popup.maxSize} onChange={(e) => onPopupChange(e, "maxSize")}/>
                     </div>
@@ -257,7 +257,8 @@ export function TokenList(props) {
                 });
             } else if (popup.tokenType === "upload") {
                 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) {
                         pushAlert(res, "Error creating token");
                     } else {

File diff suppressed because it is too large
+ 0 - 0
js/files.min.js


Some files were not shown because too many files changed in this diff