2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-12 18:25:26 +00:00

Adds new setting to control whether HTTPs is "strict" or not

- "non strict" allows use of self-signed server certificates for example
This commit is contained in:
Oliver Walters
2022-04-02 20:01:07 +11:00
parent eeb707a955
commit 38652cdba3
4 changed files with 43 additions and 13 deletions

View File

@ -29,6 +29,7 @@ class _InvenTreeAppSettingsState extends State<InvenTreeAppSettingsWidget> {
bool stockShowHistory = false;
bool reportErrors = true;
bool strictHttps = false;
@override
void initState() {
@ -50,6 +51,7 @@ class _InvenTreeAppSettingsState extends State<InvenTreeAppSettingsWidget> {
stockShowHistory = await InvenTreeSettingsManager().getValue(INV_STOCK_SHOW_HISTORY, false) as bool;
reportErrors = await InvenTreeSettingsManager().getValue(INV_REPORT_ERRORS, true) as bool;
strictHttps = await InvenTreeSettingsManager().getValue(INV_STRICT_HTTPS, false) as bool;
setState(() {
});
@ -163,15 +165,29 @@ class _InvenTreeAppSettingsState extends State<InvenTreeAppSettingsWidget> {
Divider(height: 1),
ListTile(
title: Text(
L10().errorReporting,
L10().appSettings,
style: TextStyle(fontWeight: FontWeight.bold),
),
leading: FaIcon(FontAwesomeIcons.bug),
leading: FaIcon(FontAwesomeIcons.mobile),
),
ListTile(
title: Text(L10().strictHttps),
subtitle: Text(L10().strictHttpsDetails),
leading: FaIcon(FontAwesomeIcons.lock),
trailing: Switch(
value: strictHttps,
onChanged: (bool value) {
InvenTreeSettingsManager().setValue(INV_STRICT_HTTPS, value);
setState(() {
strictHttps = value;
});
},
),
),
ListTile(
title: Text(L10().errorReportUpload),
subtitle: Text(L10().errorReportUploadDetails),
leading: FaIcon(FontAwesomeIcons.cloudUploadAlt),
leading: FaIcon(FontAwesomeIcons.bug),
trailing: Switch(
value: reportErrors,
onChanged: (bool value) {