email host -> System email host
This commit is contained in:
1 parent
39e8ad4308
commit
f61cb275ff
1 file changed
+33
-28
@@ -58,7 +58,7 @@ const AdvancedSettings = ({ isAdmin }) => {
|
|||||||
const getSettings = async () => {
|
const getSettings = async () => {
|
||||||
const action = await dispatch(getAppSettings({ authToken }));
|
const action = await dispatch(getAppSettings({ authToken }));
|
||||||
if (action.payload.success) {
|
if (action.payload.success) {
|
||||||
parseJWTTTL(action.payload.data)
|
parseJWTTTL(action.payload.data);
|
||||||
setLocalSettings(action.payload.data);
|
setLocalSettings(action.payload.data);
|
||||||
} else {
|
} else {
|
||||||
createToast({ body: "Failed to get settings" });
|
createToast({ body: "Failed to get settings" });
|
||||||
@@ -100,7 +100,7 @@ const AdvancedSettings = ({ isAdmin }) => {
|
|||||||
const id = e.target.value;
|
const id = e.target.value;
|
||||||
const newUnits = unitItems.find((item) => item._id === id).name;
|
const newUnits = unitItems.find((item) => item._id === id).name;
|
||||||
setLocalSettings({ ...localSettings, jwtTTLUnits: newUnits });
|
setLocalSettings({ ...localSettings, jwtTTLUnits: newUnits });
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleBlur = (event) => {
|
const handleBlur = (event) => {
|
||||||
const { value, id } = event.target;
|
const { value, id } = event.target;
|
||||||
@@ -116,7 +116,7 @@ const AdvancedSettings = ({ isAdmin }) => {
|
|||||||
};
|
};
|
||||||
const handleChange = (event) => {
|
const handleChange = (event) => {
|
||||||
const { value, id } = event.target;
|
const { value, id } = event.target;
|
||||||
setLocalSettings({ ...localSettings, [id]: value });
|
setLocalSettings({ ...localSettings, [id]: value });
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSave = async () => {
|
const handleSave = async () => {
|
||||||
@@ -125,12 +125,12 @@ const AdvancedSettings = ({ isAdmin }) => {
|
|||||||
if (hasValidationErrors(localSettings, advancedSettingsValidation, setErrors)) {
|
if (hasValidationErrors(localSettings, advancedSettingsValidation, setErrors)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const action = await dispatch(
|
const action = await dispatch(
|
||||||
updateAppSettings({ settings: localSettings, authToken })
|
updateAppSettings({ settings: localSettings, authToken })
|
||||||
);
|
);
|
||||||
let body = "";
|
let body = "";
|
||||||
if (action.payload.success) {
|
if (action.payload.success) {
|
||||||
parseJWTTTL(action.payload.data)
|
parseJWTTTL(action.payload.data);
|
||||||
setLocalSettings(action.payload.data);
|
setLocalSettings(action.payload.data);
|
||||||
body = "Settings saved successfully";
|
body = "Settings saved successfully";
|
||||||
} else {
|
} else {
|
||||||
@@ -192,7 +192,7 @@ const AdvancedSettings = ({ isAdmin }) => {
|
|||||||
<Field
|
<Field
|
||||||
type="text"
|
type="text"
|
||||||
id="systemEmailHost"
|
id="systemEmailHost"
|
||||||
label="Email host"
|
label="System email host"
|
||||||
name="systemEmailHost"
|
name="systemEmailHost"
|
||||||
value={localSettings.systemEmailHost}
|
value={localSettings.systemEmailHost}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
@@ -238,28 +238,33 @@ const AdvancedSettings = ({ isAdmin }) => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
<Stack gap={theme.spacing(20)}>
|
<Stack gap={theme.spacing(20)}>
|
||||||
<Stack direction="row" gap={theme.spacing(10)} ><Field
|
<Stack
|
||||||
type="number"
|
direction="row"
|
||||||
id="jwtTTLNum"
|
gap={theme.spacing(10)}
|
||||||
label="JWT time to live"
|
>
|
||||||
name="jwtTTLNum"
|
<Field
|
||||||
value={localSettings.jwtTTLNum.toString()}
|
type="number"
|
||||||
onChange={handleChange}
|
id="jwtTTLNum"
|
||||||
onBlur={handleBlur}
|
label="JWT time to live"
|
||||||
error={errors.jwtTTLNum}
|
name="jwtTTLNum"
|
||||||
/>
|
value={localSettings.jwtTTLNum.toString()}
|
||||||
<Select
|
onChange={handleChange}
|
||||||
id="jwtTTLUnits"
|
onBlur={handleBlur}
|
||||||
label="JWT TTL Units"
|
error={errors.jwtTTLNum}
|
||||||
name="jwtTTLUnits"
|
/>
|
||||||
placeholder="Select time"
|
<Select
|
||||||
isHidden={true}
|
id="jwtTTLUnits"
|
||||||
items={unitItems}
|
label="JWT TTL Units"
|
||||||
value={unitItemLookup[localSettings.jwtTTLUnits]}
|
name="jwtTTLUnits"
|
||||||
onChange={handleJWTTTLUnits}
|
placeholder="Select time"
|
||||||
onBlur={handleBlur}
|
isHidden={true}
|
||||||
error={errors.jwtTTLUnits}
|
items={unitItems}
|
||||||
/></Stack>
|
value={unitItemLookup[localSettings.jwtTTLUnits]}
|
||||||
|
onChange={handleJWTTTLUnits}
|
||||||
|
onBlur={handleBlur}
|
||||||
|
error={errors.jwtTTLUnits}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
<Field
|
<Field
|
||||||
type="text"
|
type="text"
|
||||||
id="dbType"
|
id="dbType"
|
||||||
|
|||||||
Reference in new issue
Block a user