diff options
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/settings/settings/EditSettingsForm.tsx | 61 |
1 files changed, 59 insertions, 2 deletions
diff --git a/src/components/settings/settings/EditSettingsForm.tsx b/src/components/settings/settings/EditSettingsForm.tsx index 70887af0f..226dbac76 100644 --- a/src/components/settings/settings/EditSettingsForm.tsx +++ b/src/components/settings/settings/EditSettingsForm.tsx | |||
@@ -15,6 +15,7 @@ import Infobox from '../../ui/Infobox'; | |||
15 | import { H1, H2, H3, H5 } from '../../ui/headline'; | 15 | import { H1, H2, H3, H5 } from '../../ui/headline'; |
16 | import { | 16 | import { |
17 | ferdiumVersion, | 17 | ferdiumVersion, |
18 | userDataCertsPath, | ||
18 | userDataPath, | 19 | userDataPath, |
19 | userDataRecipesPath, | 20 | userDataRecipesPath, |
20 | } from '../../../environment-remote'; | 21 | } from '../../../environment-remote'; |
@@ -262,6 +263,20 @@ const messages = defineMessages({ | |||
262 | id: 'settings.app.form.splitColumns', | 263 | id: 'settings.app.form.splitColumns', |
263 | defaultMessage: 'Number of columns', | 264 | defaultMessage: 'Number of columns', |
264 | }, | 265 | }, |
266 | warningSelfSignedCertificates: { | ||
267 | id: 'settings.app.warningSelfSignedCertificates', | ||
268 | defaultMessage: | ||
269 | 'WARNING: Only enable this feature if you know what you are doing. Enabling this is a security risk and should only be used for testing purposes.', | ||
270 | }, | ||
271 | infoOpenCertificatesFolder: { | ||
272 | id: 'settings.app.infoOpenCertificatesFolder', | ||
273 | defaultMessage: | ||
274 | 'To install a certificate, click the button below to open the certificates folder and copy it into the folder. After that you can refresh the service (CTRL/CMD + R). To remove/uninstall, simply delete the certificate file and restart Ferdium.', | ||
275 | }, | ||
276 | buttonOpenFerdiumCertsFolder: { | ||
277 | id: 'settings.app.buttonOpenFerdiumCertsFolder', | ||
278 | defaultMessage: 'Open certificates folder', | ||
279 | }, | ||
265 | }); | 280 | }); |
266 | 281 | ||
267 | const Hr = (): ReactElement => ( | 282 | const Hr = (): ReactElement => ( |
@@ -387,8 +402,12 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
387 | updateButtonLabelMessage = messages.updateStatusAvailable; | 402 | updateButtonLabelMessage = messages.updateStatusAvailable; |
388 | } | 403 | } |
389 | 404 | ||
390 | const { lockingFeatureEnabled, scheduledDNDEnabled, reloadAfterResume } = | 405 | const { |
391 | window['ferdium'].stores.settings.all.app; | 406 | lockingFeatureEnabled, |
407 | scheduledDNDEnabled, | ||
408 | reloadAfterResume, | ||
409 | useSelfSignedCertificates, | ||
410 | } = window['ferdium'].stores.settings.all.app; | ||
392 | 411 | ||
393 | let cacheSize; | 412 | let cacheSize; |
394 | let notCleared; | 413 | let notCleared; |
@@ -411,6 +430,7 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
411 | 430 | ||
412 | const profileFolder = userDataPath(); | 431 | const profileFolder = userDataPath(); |
413 | const recipeFolder = userDataRecipesPath(); | 432 | const recipeFolder = userDataRecipesPath(); |
433 | const certsFolder = userDataCertsPath(); | ||
414 | 434 | ||
415 | return ( | 435 | return ( |
416 | <div className="settings__main"> | 436 | <div className="settings__main"> |
@@ -947,6 +967,43 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
947 | {intl.formatMessage(messages.appRestartRequired)} | 967 | {intl.formatMessage(messages.appRestartRequired)} |
948 | </p> | 968 | </p> |
949 | 969 | ||
970 | <Toggle {...form.$('useSelfSignedCertificates').bind()} /> | ||
971 | |||
972 | {useSelfSignedCertificates && ( | ||
973 | <div className="settings__settings-group"> | ||
974 | <p | ||
975 | style={{ | ||
976 | padding: '0rem 0rem 1rem 0rem', | ||
977 | textAlign: 'justify', | ||
978 | fontSize: '1.1rem', | ||
979 | }} | ||
980 | > | ||
981 | {intl.formatMessage(messages.infoOpenCertificatesFolder)} | ||
982 | </p> | ||
983 | <div className="settings__open-settings-cache-container"> | ||
984 | <Button | ||
985 | buttonType="secondary" | ||
986 | label={intl.formatMessage( | ||
987 | messages.buttonOpenFerdiumCertsFolder, | ||
988 | )} | ||
989 | className="settings__open-settings-file-button" | ||
990 | onClick={() => openPath(certsFolder)} | ||
991 | /> | ||
992 | </div> | ||
993 | </div> | ||
994 | )} | ||
995 | |||
996 | <p | ||
997 | className="settings__help" | ||
998 | style={{ | ||
999 | padding: useSelfSignedCertificates | ||
1000 | ? '1rem 0rem 0rem 0rem' | ||
1001 | : undefined, | ||
1002 | }} | ||
1003 | > | ||
1004 | {intl.formatMessage(messages.warningSelfSignedCertificates)} | ||
1005 | </p> | ||
1006 | |||
950 | <Hr /> | 1007 | <Hr /> |
951 | 1008 | ||
952 | <Input | 1009 | <Input |