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:
Aaron
2024-12-31 15:25:49 +01:00
committed by GitHub
parent b58dcdba0b
commit 53c05518df
35 changed files with 151 additions and 125 deletions

View File

@@ -8,6 +8,7 @@ import {
} from "@mantine/core";
import { useForm } from "@mantine/form";
import { AdminConfig, UpdateConfig } from "../../../types/config.type";
import FileSizeInput from "../../core/FileSizeInput";
const AdminConfigInput = ({
configVariable,
@@ -71,6 +72,15 @@ const AdminConfigInput = ({
{...form.getInputProps("numberValue")}
placeholder={configVariable.defaultValue}
onChange={(number) => onValueChange(configVariable, number)}
w={201}
/>
)}
{configVariable.type == "filesize" && (
<FileSizeInput
{...form.getInputProps("numberValue")}
value={parseInt(configVariable.value ?? configVariable.defaultValue)}
onChange={(bytes) => onValueChange(configVariable, bytes)}
w={201}
/>
)}
{configVariable.type == "boolean" && (