feat(UI): improve filesize input and use it in settings (#721)
* Improve file size input component layout * Fix filesize input value not getting set * Allow arbitrary props on filesize input * Update config variables to support filesize type and integrate FileSizeInput component * Update i18n entries * WARNING GUESSES: Update translation descriptions for max size and chunk size in multiple languages * Fix config service not being aware of filesize type * Fix backend config service not being aware of filesize type * Move FileSizeInput component to core
This commit is contained in:
@@ -57,7 +57,7 @@ const configVariables: ConfigVariables = {
|
||||
secret: false,
|
||||
},
|
||||
maxSize: {
|
||||
type: "number",
|
||||
type: "filesize",
|
||||
defaultValue: "1000000000",
|
||||
secret: false,
|
||||
},
|
||||
@@ -66,7 +66,7 @@ const configVariables: ConfigVariables = {
|
||||
defaultValue: "9",
|
||||
},
|
||||
chunkSize: {
|
||||
type: "number",
|
||||
type: "filesize",
|
||||
defaultValue: "10000000",
|
||||
secret: false,
|
||||
},
|
||||
|
||||
@@ -30,8 +30,10 @@ export class ConfigService extends EventEmitter {
|
||||
|
||||
const value = configVariable.value ?? configVariable.defaultValue;
|
||||
|
||||
if (configVariable.type == "number") return parseInt(value);
|
||||
if (configVariable.type == "boolean") return value == "true";
|
||||
if (configVariable.type == "number" || configVariable.type == "filesize")
|
||||
return parseInt(value);
|
||||
if (configVariable.type == "boolean")
|
||||
return value == "true";
|
||||
if (configVariable.type == "string" || configVariable.type == "text")
|
||||
return value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user