integrate TextInput into advanced settings page
This commit is contained in:
1 parent
f81b5957e7
commit
74e9f19bd7
2 files changed
+32
-21
No files matched your search
@@ -3,7 +3,6 @@ import TabPanel from "@mui/lab/TabPanel";
|
|||||||
import { Button, ButtonGroup, Stack, Typography } from "@mui/material";
|
import { Button, ButtonGroup, Stack, Typography } from "@mui/material";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import TextInput from "../../Inputs/TextInput";
|
import TextInput from "../../Inputs/TextInput";
|
||||||
import Field from "../../Inputs/Field";
|
|
||||||
import { credentials } from "../../../Validation/validation";
|
import { credentials } from "../../../Validation/validation";
|
||||||
import { networkService } from "../../../main";
|
import { networkService } from "../../../main";
|
||||||
import { createToast } from "../../../Utils/toastUtils";
|
import { createToast } from "../../../Utils/toastUtils";
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { Box, Stack, Typography } from "@mui/material";
|
import { Box, Stack, Typography } from "@mui/material";
|
||||||
|
import TextInput from "../../Components/Inputs/TextInput";
|
||||||
import Field from "../../Components/Inputs/Field";
|
import Field from "../../Components/Inputs/Field";
|
||||||
import Link from "../../Components/Link";
|
import Link from "../../Components/Link";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
@@ -160,13 +161,14 @@ const AdvancedSettings = ({ isAdmin }) => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
<Stack gap={theme.spacing(20)}>
|
<Stack gap={theme.spacing(20)}>
|
||||||
<Field
|
<TextInput
|
||||||
id="apiBaseUrl"
|
id="apiBaseUrl"
|
||||||
label="API URL Host"
|
label="API URL Host"
|
||||||
value={localSettings.apiBaseUrl}
|
value={localSettings.apiBaseUrl}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
onBlur={handleBlur}
|
onBlur={handleBlur}
|
||||||
error={errors.apiBaseUrl}
|
error={errors.apiBaseUrl ? true : false}
|
||||||
|
helperText={errors.apiBaseUrl}
|
||||||
/>
|
/>
|
||||||
<Select
|
<Select
|
||||||
id="logLevel"
|
id="logLevel"
|
||||||
@@ -189,7 +191,7 @@ const AdvancedSettings = ({ isAdmin }) => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
<Stack gap={theme.spacing(20)}>
|
<Stack gap={theme.spacing(20)}>
|
||||||
<Field
|
<TextInput
|
||||||
type="text"
|
type="text"
|
||||||
id="systemEmailHost"
|
id="systemEmailHost"
|
||||||
label="System email host"
|
label="System email host"
|
||||||
@@ -197,9 +199,10 @@ const AdvancedSettings = ({ isAdmin }) => {
|
|||||||
value={localSettings.systemEmailHost}
|
value={localSettings.systemEmailHost}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
onBlur={handleBlur}
|
onBlur={handleBlur}
|
||||||
error={errors.systemEmailHost}
|
error={errors.systemEmailHost ? true : false}
|
||||||
|
helperText={errors.systemEmailHost}
|
||||||
/>
|
/>
|
||||||
<Field
|
<TextInput
|
||||||
type="number"
|
type="number"
|
||||||
id="systemEmailPort"
|
id="systemEmailPort"
|
||||||
label="System email port"
|
label="System email port"
|
||||||
@@ -207,18 +210,21 @@ const AdvancedSettings = ({ isAdmin }) => {
|
|||||||
value={localSettings.systemEmailPort?.toString()}
|
value={localSettings.systemEmailPort?.toString()}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
onBlur={handleBlur}
|
onBlur={handleBlur}
|
||||||
error={errors.systemEmailPort}
|
error={errors.systemEmailPort ? true : false}
|
||||||
|
helperText={errors.systemEmailPort}
|
||||||
/>
|
/>
|
||||||
<Field
|
<TextInput
|
||||||
type="email"
|
type="email"
|
||||||
id="systemEmailAddress"
|
id="systemEmailAddress"
|
||||||
label="System email address"
|
label="System email address"
|
||||||
name="systemEmailAddress"
|
name="systemEmailAddress"
|
||||||
value={localSettings.systemEmailAddress}
|
value={localSettings.systemEmailAddress}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
error={errors.systemEmailAddress}
|
onBlur={handleBlur}
|
||||||
|
error={errors.systemEmailAddress ? true : false}
|
||||||
|
helperText={errors.systemEmailAddress}
|
||||||
/>
|
/>
|
||||||
<Field
|
<TextInput
|
||||||
type="text"
|
type="text"
|
||||||
id="systemEmailPassword"
|
id="systemEmailPassword"
|
||||||
label="System email password"
|
label="System email password"
|
||||||
@@ -226,7 +232,8 @@ const AdvancedSettings = ({ isAdmin }) => {
|
|||||||
value={localSettings.systemEmailPassword}
|
value={localSettings.systemEmailPassword}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
onBlur={handleBlur}
|
onBlur={handleBlur}
|
||||||
error={errors.systemEmailPassword}
|
error={errors.systemEmailPassword ? true : false}
|
||||||
|
helperText={errors.systemEmailPassword}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</ConfigBox>
|
</ConfigBox>
|
||||||
@@ -242,7 +249,7 @@ const AdvancedSettings = ({ isAdmin }) => {
|
|||||||
direction="row"
|
direction="row"
|
||||||
gap={theme.spacing(10)}
|
gap={theme.spacing(10)}
|
||||||
>
|
>
|
||||||
<Field
|
<TextInput
|
||||||
type="number"
|
type="number"
|
||||||
id="jwtTTLNum"
|
id="jwtTTLNum"
|
||||||
label="JWT time to live"
|
label="JWT time to live"
|
||||||
@@ -250,7 +257,8 @@ const AdvancedSettings = ({ isAdmin }) => {
|
|||||||
value={localSettings.jwtTTLNum.toString()}
|
value={localSettings.jwtTTLNum.toString()}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
onBlur={handleBlur}
|
onBlur={handleBlur}
|
||||||
error={errors.jwtTTLNum}
|
error={errors.jwtTTLNum ? true : false}
|
||||||
|
helperText={errors.jwtTTLNum}
|
||||||
/>
|
/>
|
||||||
<Select
|
<Select
|
||||||
id="jwtTTLUnits"
|
id="jwtTTLUnits"
|
||||||
@@ -265,7 +273,7 @@ const AdvancedSettings = ({ isAdmin }) => {
|
|||||||
error={errors.jwtTTLUnits}
|
error={errors.jwtTTLUnits}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Field
|
<TextInput
|
||||||
type="text"
|
type="text"
|
||||||
id="dbType"
|
id="dbType"
|
||||||
label="Database type"
|
label="Database type"
|
||||||
@@ -273,9 +281,10 @@ const AdvancedSettings = ({ isAdmin }) => {
|
|||||||
value={localSettings.dbType}
|
value={localSettings.dbType}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
onBlur={handleBlur}
|
onBlur={handleBlur}
|
||||||
error={errors.dbType}
|
error={errors.dbType ? true : false}
|
||||||
|
helperText={errors.dbType}
|
||||||
/>
|
/>
|
||||||
<Field
|
<TextInput
|
||||||
type="text"
|
type="text"
|
||||||
id="redisHost"
|
id="redisHost"
|
||||||
label="Redis host"
|
label="Redis host"
|
||||||
@@ -283,9 +292,10 @@ const AdvancedSettings = ({ isAdmin }) => {
|
|||||||
value={localSettings.redisHost}
|
value={localSettings.redisHost}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
onBlur={handleBlur}
|
onBlur={handleBlur}
|
||||||
error={errors.redisHost}
|
error={errors.redisHost ? true : false}
|
||||||
|
helperText={errors.redisHost}
|
||||||
/>
|
/>
|
||||||
<Field
|
<TextInput
|
||||||
type="number"
|
type="number"
|
||||||
id="redisPort"
|
id="redisPort"
|
||||||
label="Redis port"
|
label="Redis port"
|
||||||
@@ -293,9 +303,10 @@ const AdvancedSettings = ({ isAdmin }) => {
|
|||||||
value={localSettings.redisPort?.toString()}
|
value={localSettings.redisPort?.toString()}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
onBlur={handleBlur}
|
onBlur={handleBlur}
|
||||||
error={errors.redisPort}
|
error={errors.redisPort ? true : false}
|
||||||
|
helperText={errors.redisPort}
|
||||||
/>
|
/>
|
||||||
<Field
|
<TextInput
|
||||||
type="text"
|
type="text"
|
||||||
id="pagespeedApiKey"
|
id="pagespeedApiKey"
|
||||||
label="PageSpeed API key"
|
label="PageSpeed API key"
|
||||||
@@ -303,7 +314,8 @@ const AdvancedSettings = ({ isAdmin }) => {
|
|||||||
value={localSettings.pagespeedApiKey}
|
value={localSettings.pagespeedApiKey}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
onBlur={handleBlur}
|
onBlur={handleBlur}
|
||||||
error={errors.pagespeedApiKey}
|
error={errors.pagespeedApiKey ? true : false}
|
||||||
|
helperText={errors.pagespeedApiKey}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</ConfigBox>
|
</ConfigBox>
|
||||||
|
|||||||
Reference in new issue
Block a user