feat: improve UI for timespan inputs on admin page (#726)
* Define Timestamp type * Implement Timestamp utils * Implement Timespan input * Use timestamp input on config page * Add timespan type to config services * Refactor maxExpiration to use timespan type across services and components * Update sessionDuration to use timespan type in config and adjust token expiration logic * Update localized strings
This commit is contained in:
@@ -8,6 +8,8 @@ import {
|
||||
} from "@mantine/core";
|
||||
import { useForm } from "@mantine/form";
|
||||
import { AdminConfig, UpdateConfig } from "../../../types/config.type";
|
||||
import TimespanInput from "../../core/TimespanInput";
|
||||
import { stringToTimespan, timespanToString } from "../../../utils/date.util";
|
||||
import FileSizeInput from "../../core/FileSizeInput";
|
||||
|
||||
const AdminConfigInput = ({
|
||||
@@ -91,6 +93,13 @@ const AdminConfigInput = ({
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{configVariable.type == "timespan" && (
|
||||
<TimespanInput
|
||||
value={stringToTimespan(configVariable.value)}
|
||||
onChange={(timespan) => onValueChange(configVariable, timespanToString(timespan))}
|
||||
w={201}
|
||||
/>
|
||||
)}
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user