feat: restore option to cache and optimize images locally (#2964)

pull/2966/head
Ryan Cohen 2 years ago committed by GitHub
parent 29ab178fb0
commit 507227aa49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -133,6 +133,7 @@ const SettingsMain = () => {
originalLanguage: data?.originalLanguage, originalLanguage: data?.originalLanguage,
partialRequestsEnabled: data?.partialRequestsEnabled, partialRequestsEnabled: data?.partialRequestsEnabled,
trustProxy: data?.trustProxy, trustProxy: data?.trustProxy,
cacheImages: data?.cacheImages,
}} }}
enableReinitialize enableReinitialize
validationSchema={MainSettingsSchema} validationSchema={MainSettingsSchema}
@ -148,6 +149,7 @@ const SettingsMain = () => {
originalLanguage: values.originalLanguage, originalLanguage: values.originalLanguage,
partialRequestsEnabled: values.partialRequestsEnabled, partialRequestsEnabled: values.partialRequestsEnabled,
trustProxy: values.trustProxy, trustProxy: values.trustProxy,
cacheImages: values.cacheImages,
}); });
mutate('/api/v1/settings/public'); mutate('/api/v1/settings/public');
mutate('/api/v1/status'); mutate('/api/v1/status');
@ -306,6 +308,27 @@ const SettingsMain = () => {
</Tooltip> </Tooltip>
</div> </div>
</div> </div>
<div className="form-row">
<label htmlFor="csrfProtection" className="checkbox-label">
<span className="mr-2">
{intl.formatMessage(messages.cacheImages)}
</span>
<SettingsBadge badgeType="experimental" />
<span className="label-tip">
{intl.formatMessage(messages.cacheImagesTip)}
</span>
</label>
<div className="form-input-area">
<Field
type="checkbox"
id="cacheImages"
name="cacheImages"
onChange={() => {
setFieldValue('cacheImages', !values.cacheImages);
}}
/>
</div>
</div>
<div className="form-row"> <div className="form-row">
<label htmlFor="locale" className="text-label"> <label htmlFor="locale" className="text-label">
{intl.formatMessage(messages.locale)} {intl.formatMessage(messages.locale)}

Loading…
Cancel
Save