Compare commits
No commits in common. "fe51811b39f9a73824394e6225e560a065fdac0d" and "5ed74aa5af7730226c1992b94e121a29cd87e0da" have entirely different histories.
fe51811b39
...
5ed74aa5af
@ -1,30 +1,31 @@
|
|||||||
import 'package:collection/collection.dart';
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
|
|
||||||
typedef Validator = bool Function(String);
|
String formatMountName(String type, String name) {
|
||||||
|
if (type == 'remote') {
|
||||||
|
return name.replaceAll('_', ':');
|
||||||
|
}
|
||||||
|
|
||||||
bool containsRestrictedChar(String value) {
|
return name;
|
||||||
const invalidChars = [
|
}
|
||||||
'!',
|
|
||||||
'"',
|
String getBaseUri() {
|
||||||
'\$',
|
if (kDebugMode || !kIsWeb) {
|
||||||
'&',
|
return 'http://127.0.0.1:30000';
|
||||||
'\'',
|
}
|
||||||
'(',
|
|
||||||
')',
|
return Uri.base.origin;
|
||||||
'*',
|
}
|
||||||
';',
|
|
||||||
'<',
|
String initialCaps(String txt) {
|
||||||
'>',
|
if (txt.isEmpty) {
|
||||||
'?',
|
return txt;
|
||||||
'[',
|
}
|
||||||
']',
|
|
||||||
'`',
|
if (txt.length == 1) {
|
||||||
'{',
|
return txt[0].toUpperCase();
|
||||||
'}',
|
}
|
||||||
'|',
|
|
||||||
];
|
return txt[0].toUpperCase() + txt.substring(1).toLowerCase();
|
||||||
return invalidChars.firstWhereOrNull((char) => value.contains(char)) != null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> createDefaultSettings(String mountType) {
|
Map<String, dynamic> createDefaultSettings(String mountType) {
|
||||||
@ -51,7 +52,7 @@ Map<String, dynamic> createDefaultSettings(String mountType) {
|
|||||||
return {
|
return {
|
||||||
'HostConfig': {
|
'HostConfig': {
|
||||||
'ApiPassword': '',
|
'ApiPassword': '',
|
||||||
'ApiPort': 9980,
|
'ApiPort': '9980',
|
||||||
'HostNameOrIp': 'localhost',
|
'HostNameOrIp': 'localhost',
|
||||||
},
|
},
|
||||||
'SiaConfig': {'Bucket': 'default'},
|
'SiaConfig': {'Bucket': 'default'},
|
||||||
@ -60,100 +61,3 @@ Map<String, dynamic> createDefaultSettings(String mountType) {
|
|||||||
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
String formatMountName(String type, String name) {
|
|
||||||
if (type == 'remote') {
|
|
||||||
return name.replaceAll('_', ':');
|
|
||||||
}
|
|
||||||
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
String getBaseUri() {
|
|
||||||
if (kDebugMode || !kIsWeb) {
|
|
||||||
return 'http://127.0.0.1:30000';
|
|
||||||
}
|
|
||||||
|
|
||||||
return Uri.base.origin;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Validator> getSettingValidators(String settingPath) {
|
|
||||||
switch (settingPath) {
|
|
||||||
case 'EncryptConfig.EncryptionToken':
|
|
||||||
return [(value) => value.isNotEmpty];
|
|
||||||
case 'EncryptConfig.Path':
|
|
||||||
return [
|
|
||||||
(value) => value.trim().isNotEmpty,
|
|
||||||
(value) => !containsRestrictedChar(value),
|
|
||||||
];
|
|
||||||
case 'HostConfig.ApiPassword':
|
|
||||||
return [(value) => value.isNotEmpty];
|
|
||||||
case 'HostConfig.ApiPort':
|
|
||||||
return [
|
|
||||||
(value) {
|
|
||||||
int? intValue = int.tryParse(value);
|
|
||||||
if (intValue == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (intValue > 0 && intValue < 65536);
|
|
||||||
},
|
|
||||||
(value) => Uri.tryParse('http://localhost:$value/') != null,
|
|
||||||
];
|
|
||||||
case 'HostConfig.HostNameOrIp':
|
|
||||||
return [
|
|
||||||
(value) => value.trim().isNotEmpty,
|
|
||||||
(value) => Uri.tryParse('http://$value:9000/') != null,
|
|
||||||
];
|
|
||||||
case 'HostConfig.Protocol':
|
|
||||||
return [(value) => value == "http" || value == "https"];
|
|
||||||
case 'S3Config.AccessKey':
|
|
||||||
return [(value) => value.isNotEmpty];
|
|
||||||
case 'S3Config.Bucket':
|
|
||||||
return [(value) => value.trim().isNotEmpty];
|
|
||||||
case 'S3Config.SecretKey':
|
|
||||||
return [(value) => value.isNotEmpty];
|
|
||||||
case 'S3Config.URL':
|
|
||||||
return [(value) => Uri.tryParse(value) != null];
|
|
||||||
case 'SiaConfig.Bucket':
|
|
||||||
return [(value) => value.trim().isNotEmpty];
|
|
||||||
}
|
|
||||||
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
String initialCaps(String txt) {
|
|
||||||
if (txt.isEmpty) {
|
|
||||||
return txt;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (txt.length == 1) {
|
|
||||||
return txt[0].toUpperCase();
|
|
||||||
}
|
|
||||||
|
|
||||||
return txt[0].toUpperCase() + txt.substring(1).toLowerCase();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool validateSettings(
|
|
||||||
Map<String, dynamic> settings,
|
|
||||||
List<String> failed, {
|
|
||||||
String? rootKey,
|
|
||||||
}) {
|
|
||||||
settings.forEach((key, value) {
|
|
||||||
if (value is Map) {
|
|
||||||
validateSettings(
|
|
||||||
value as Map<String, dynamic>,
|
|
||||||
failed,
|
|
||||||
rootKey: rootKey == null ? key : '$rootKey.$key',
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
for (var validator in getSettingValidators(key)) {
|
|
||||||
if (!validator(value.toString())) {
|
|
||||||
failed.add(rootKey == null ? key : '$rootKey.$key');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return failed.isEmpty;
|
|
||||||
}
|
|
||||||
|
@ -121,17 +121,11 @@ class _AddMountScreenState extends State<AddMountScreen> {
|
|||||||
if (_mount != null)
|
if (_mount != null)
|
||||||
ElevatedButton.icon(
|
ElevatedButton.icon(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
List<String> failed = [];
|
|
||||||
if (!validateSettings(_settings[_mountType]!, failed)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Provider.of<MountList>(context, listen: false).add(
|
Provider.of<MountList>(context, listen: false).add(
|
||||||
_mountType,
|
_mountType,
|
||||||
_mountNameController.text,
|
_mountNameController.text,
|
||||||
_settings[_mountType]!,
|
_settings[_mountType]!,
|
||||||
);
|
);
|
||||||
|
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
},
|
},
|
||||||
label: const Text('Add'),
|
label: const Text('Add'),
|
||||||
|
@ -2,7 +2,6 @@ import 'package:collection/collection.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:repertory/constants.dart';
|
import 'package:repertory/constants.dart';
|
||||||
import 'package:repertory/helpers.dart' show Validator, getSettingValidators;
|
|
||||||
import 'package:repertory/models/mount.dart';
|
import 'package:repertory/models/mount.dart';
|
||||||
import 'package:settings_ui/settings_ui.dart';
|
import 'package:settings_ui/settings_ui.dart';
|
||||||
|
|
||||||
@ -49,14 +48,7 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _addIntSetting(
|
void _addIntSetting(list, root, key, value, isAdvanced) {
|
||||||
list,
|
|
||||||
root,
|
|
||||||
key,
|
|
||||||
value,
|
|
||||||
isAdvanced, {
|
|
||||||
List<Validator> validators = const [],
|
|
||||||
}) {
|
|
||||||
if (!isAdvanced || widget.showAdvanced) {
|
if (!isAdvanced || widget.showAdvanced) {
|
||||||
list.add(
|
list.add(
|
||||||
SettingsTile.navigation(
|
SettingsTile.navigation(
|
||||||
@ -77,15 +69,6 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
TextButton(
|
TextButton(
|
||||||
child: Text('OK'),
|
child: Text('OK'),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
final result = validators.firstWhereOrNull(
|
|
||||||
(validator) => !validator(updatedValue),
|
|
||||||
);
|
|
||||||
if (result != null) {
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
|
||||||
SnackBar(content: Text("'$key' is not valid")),
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setState(() {
|
setState(() {
|
||||||
root[key] = int.parse(updatedValue);
|
root[key] = int.parse(updatedValue);
|
||||||
widget.onChanged?.call(widget.settings);
|
widget.onChanged?.call(widget.settings);
|
||||||
@ -193,15 +176,7 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _addStringSetting(
|
void _addStringSetting(list, root, key, value, icon, isAdvanced) {
|
||||||
list,
|
|
||||||
root,
|
|
||||||
key,
|
|
||||||
value,
|
|
||||||
icon,
|
|
||||||
isAdvanced, {
|
|
||||||
List<Validator> validators = const [],
|
|
||||||
}) {
|
|
||||||
if (!isAdvanced || widget.showAdvanced) {
|
if (!isAdvanced || widget.showAdvanced) {
|
||||||
list.add(
|
list.add(
|
||||||
SettingsTile.navigation(
|
SettingsTile.navigation(
|
||||||
@ -222,15 +197,6 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
TextButton(
|
TextButton(
|
||||||
child: Text('OK'),
|
child: Text('OK'),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
final result = validators.firstWhereOrNull(
|
|
||||||
(validator) => !validator(updatedValue),
|
|
||||||
);
|
|
||||||
if (result != null) {
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
|
||||||
SnackBar(content: Text("'$key' is not valid")),
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setState(() {
|
setState(() {
|
||||||
root[key] = updatedValue;
|
root[key] = updatedValue;
|
||||||
widget.onChanged?.call(widget.settings);
|
widget.onChanged?.call(widget.settings);
|
||||||
@ -268,14 +234,7 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
if (key == 'ApiAuth') {
|
if (key == 'ApiAuth') {
|
||||||
_addPasswordSetting(commonSettings, widget.settings, key, value, true);
|
_addPasswordSetting(commonSettings, widget.settings, key, value, true);
|
||||||
} else if (key == 'ApiPort') {
|
} else if (key == 'ApiPort') {
|
||||||
_addIntSetting(
|
_addIntSetting(commonSettings, widget.settings, key, value, true);
|
||||||
commonSettings,
|
|
||||||
widget.settings,
|
|
||||||
key,
|
|
||||||
value,
|
|
||||||
true,
|
|
||||||
validators: getSettingValidators(key),
|
|
||||||
);
|
|
||||||
} else if (key == 'ApiUser') {
|
} else if (key == 'ApiUser') {
|
||||||
_addStringSetting(
|
_addStringSetting(
|
||||||
commonSettings,
|
commonSettings,
|
||||||
@ -284,7 +243,6 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
value,
|
value,
|
||||||
Icons.person,
|
Icons.person,
|
||||||
true,
|
true,
|
||||||
validators: getSettingValidators(key),
|
|
||||||
);
|
);
|
||||||
} else if (key == 'DatabaseType') {
|
} else if (key == 'DatabaseType') {
|
||||||
_addListSetting(
|
_addListSetting(
|
||||||
@ -297,14 +255,7 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
} else if (key == 'DownloadTimeoutSeconds') {
|
} else if (key == 'DownloadTimeoutSeconds') {
|
||||||
_addIntSetting(
|
_addIntSetting(commonSettings, widget.settings, key, value, true);
|
||||||
commonSettings,
|
|
||||||
widget.settings,
|
|
||||||
key,
|
|
||||||
value,
|
|
||||||
true,
|
|
||||||
validators: getSettingValidators(key),
|
|
||||||
);
|
|
||||||
} else if (key == 'EnableDownloadTimeout') {
|
} else if (key == 'EnableDownloadTimeout') {
|
||||||
_addBooleanSetting(commonSettings, widget.settings, key, value, true);
|
_addBooleanSetting(commonSettings, widget.settings, key, value, true);
|
||||||
} else if (key == 'EnableDriveEvents') {
|
} else if (key == 'EnableDriveEvents') {
|
||||||
@ -320,43 +271,15 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
} else if (key == 'EvictionDelayMinutes') {
|
} else if (key == 'EvictionDelayMinutes') {
|
||||||
_addIntSetting(
|
_addIntSetting(commonSettings, widget.settings, key, value, true);
|
||||||
commonSettings,
|
|
||||||
widget.settings,
|
|
||||||
key,
|
|
||||||
value,
|
|
||||||
true,
|
|
||||||
validators: getSettingValidators(key),
|
|
||||||
);
|
|
||||||
} else if (key == 'EvictionUseAccessedTime') {
|
} else if (key == 'EvictionUseAccessedTime') {
|
||||||
_addBooleanSetting(commonSettings, widget.settings, key, value, true);
|
_addBooleanSetting(commonSettings, widget.settings, key, value, true);
|
||||||
} else if (key == 'MaxCacheSizeBytes') {
|
} else if (key == 'MaxCacheSizeBytes') {
|
||||||
_addIntSetting(
|
_addIntSetting(commonSettings, widget.settings, key, value, false);
|
||||||
commonSettings,
|
|
||||||
widget.settings,
|
|
||||||
key,
|
|
||||||
value,
|
|
||||||
false,
|
|
||||||
validators: getSettingValidators(key),
|
|
||||||
);
|
|
||||||
} else if (key == 'MaxUploadCount') {
|
} else if (key == 'MaxUploadCount') {
|
||||||
_addIntSetting(
|
_addIntSetting(commonSettings, widget.settings, key, value, true);
|
||||||
commonSettings,
|
|
||||||
widget.settings,
|
|
||||||
key,
|
|
||||||
value,
|
|
||||||
true,
|
|
||||||
validators: getSettingValidators(key),
|
|
||||||
);
|
|
||||||
} else if (key == 'OnlineCheckRetrySeconds') {
|
} else if (key == 'OnlineCheckRetrySeconds') {
|
||||||
_addIntSetting(
|
_addIntSetting(commonSettings, widget.settings, key, value, true);
|
||||||
commonSettings,
|
|
||||||
widget.settings,
|
|
||||||
key,
|
|
||||||
value,
|
|
||||||
true,
|
|
||||||
validators: getSettingValidators(key),
|
|
||||||
);
|
|
||||||
} else if (key == 'PreferredDownloadType') {
|
} else if (key == 'PreferredDownloadType') {
|
||||||
_addListSetting(
|
_addListSetting(
|
||||||
commonSettings,
|
commonSettings,
|
||||||
@ -368,14 +291,7 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
} else if (key == 'RetryReadCount') {
|
} else if (key == 'RetryReadCount') {
|
||||||
_addIntSetting(
|
_addIntSetting(commonSettings, widget.settings, key, value, true);
|
||||||
commonSettings,
|
|
||||||
widget.settings,
|
|
||||||
key,
|
|
||||||
value,
|
|
||||||
true,
|
|
||||||
validators: getSettingValidators(key),
|
|
||||||
);
|
|
||||||
} else if (key == 'RingBufferFileSize') {
|
} else if (key == 'RingBufferFileSize') {
|
||||||
_addIntListSetting(
|
_addIntListSetting(
|
||||||
commonSettings,
|
commonSettings,
|
||||||
@ -405,7 +321,6 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
subValue,
|
subValue,
|
||||||
Icons.folder,
|
Icons.folder,
|
||||||
false,
|
false,
|
||||||
validators: getSettingValidators('$key.$subKey'),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -419,7 +334,6 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
subValue,
|
subValue,
|
||||||
Icons.support_agent,
|
Icons.support_agent,
|
||||||
true,
|
true,
|
||||||
validators: getSettingValidators('$key.$subKey'),
|
|
||||||
);
|
);
|
||||||
} else if (subKey == 'ApiPassword') {
|
} else if (subKey == 'ApiPassword') {
|
||||||
_addPasswordSetting(
|
_addPasswordSetting(
|
||||||
@ -436,7 +350,6 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
subKey,
|
subKey,
|
||||||
subValue,
|
subValue,
|
||||||
false,
|
false,
|
||||||
validators: getSettingValidators('$key.$subKey'),
|
|
||||||
);
|
);
|
||||||
} else if (subKey == 'ApiUser') {
|
} else if (subKey == 'ApiUser') {
|
||||||
_addStringSetting(
|
_addStringSetting(
|
||||||
@ -446,7 +359,6 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
subValue,
|
subValue,
|
||||||
Icons.person,
|
Icons.person,
|
||||||
true,
|
true,
|
||||||
validators: getSettingValidators('$key.$subKey'),
|
|
||||||
);
|
);
|
||||||
} else if (subKey == 'HostNameOrIp') {
|
} else if (subKey == 'HostNameOrIp') {
|
||||||
_addStringSetting(
|
_addStringSetting(
|
||||||
@ -465,7 +377,6 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
subValue,
|
subValue,
|
||||||
Icons.route,
|
Icons.route,
|
||||||
true,
|
true,
|
||||||
validators: getSettingValidators('$key.$subKey'),
|
|
||||||
);
|
);
|
||||||
} else if (subKey == 'Protocol') {
|
} else if (subKey == 'Protocol') {
|
||||||
_addListSetting(
|
_addListSetting(
|
||||||
@ -484,7 +395,6 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
subKey,
|
subKey,
|
||||||
subValue,
|
subValue,
|
||||||
true,
|
true,
|
||||||
validators: getSettingValidators('$key.$subKey'),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -497,7 +407,6 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
subKey,
|
subKey,
|
||||||
subValue,
|
subValue,
|
||||||
false,
|
false,
|
||||||
validators: getSettingValidators('$key.$subKey'),
|
|
||||||
);
|
);
|
||||||
} else if (subKey == 'EncryptionToken') {
|
} else if (subKey == 'EncryptionToken') {
|
||||||
_addPasswordSetting(
|
_addPasswordSetting(
|
||||||
@ -515,7 +424,6 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
subValue,
|
subValue,
|
||||||
Icons.computer,
|
Icons.computer,
|
||||||
false,
|
false,
|
||||||
validators: getSettingValidators('$key.$subKey'),
|
|
||||||
);
|
);
|
||||||
} else if (subKey == 'MaxConnections') {
|
} else if (subKey == 'MaxConnections') {
|
||||||
_addIntSetting(
|
_addIntSetting(
|
||||||
@ -524,7 +432,6 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
subKey,
|
subKey,
|
||||||
subValue,
|
subValue,
|
||||||
true,
|
true,
|
||||||
validators: getSettingValidators('$key.$subKey'),
|
|
||||||
);
|
);
|
||||||
} else if (subKey == 'ReceiveTimeoutMs') {
|
} else if (subKey == 'ReceiveTimeoutMs') {
|
||||||
_addIntSetting(
|
_addIntSetting(
|
||||||
@ -533,7 +440,6 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
subKey,
|
subKey,
|
||||||
subValue,
|
subValue,
|
||||||
true,
|
true,
|
||||||
validators: getSettingValidators('$key.$subKey'),
|
|
||||||
);
|
);
|
||||||
} else if (subKey == 'SendTimeoutMs') {
|
} else if (subKey == 'SendTimeoutMs') {
|
||||||
_addIntSetting(
|
_addIntSetting(
|
||||||
@ -542,7 +448,6 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
subKey,
|
subKey,
|
||||||
subValue,
|
subValue,
|
||||||
true,
|
true,
|
||||||
validators: getSettingValidators('$key.$subKey'),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -565,7 +470,6 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
subKey,
|
subKey,
|
||||||
subValue,
|
subValue,
|
||||||
false,
|
false,
|
||||||
validators: getSettingValidators('$key.$subKey'),
|
|
||||||
);
|
);
|
||||||
} else if (subKey == 'ClientPoolSize') {
|
} else if (subKey == 'ClientPoolSize') {
|
||||||
_addIntSetting(
|
_addIntSetting(
|
||||||
@ -574,7 +478,6 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
subKey,
|
subKey,
|
||||||
subValue,
|
subValue,
|
||||||
true,
|
true,
|
||||||
validators: getSettingValidators('$key.$subKey'),
|
|
||||||
);
|
);
|
||||||
} else if (subKey == 'EncryptionToken') {
|
} else if (subKey == 'EncryptionToken') {
|
||||||
_addPasswordSetting(
|
_addPasswordSetting(
|
||||||
@ -604,7 +507,6 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
subValue,
|
subValue,
|
||||||
Icons.folder,
|
Icons.folder,
|
||||||
false,
|
false,
|
||||||
validators: getSettingValidators('$key.$subKey'),
|
|
||||||
);
|
);
|
||||||
} else if (subKey == 'EncryptionToken') {
|
} else if (subKey == 'EncryptionToken') {
|
||||||
_addPasswordSetting(
|
_addPasswordSetting(
|
||||||
@ -622,7 +524,6 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
subValue,
|
subValue,
|
||||||
Icons.map,
|
Icons.map,
|
||||||
false,
|
false,
|
||||||
validators: getSettingValidators('$key.$subKey'),
|
|
||||||
);
|
);
|
||||||
} else if (subKey == 'SecretKey') {
|
} else if (subKey == 'SecretKey') {
|
||||||
_addPasswordSetting(
|
_addPasswordSetting(
|
||||||
@ -639,7 +540,6 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
subKey,
|
subKey,
|
||||||
subValue,
|
subValue,
|
||||||
true,
|
true,
|
||||||
validators: getSettingValidators('$key.$subKey'),
|
|
||||||
);
|
);
|
||||||
} else if (subKey == 'URL') {
|
} else if (subKey == 'URL') {
|
||||||
_addStringSetting(
|
_addStringSetting(
|
||||||
@ -649,7 +549,6 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
subValue,
|
subValue,
|
||||||
Icons.http,
|
Icons.http,
|
||||||
false,
|
false,
|
||||||
validators: getSettingValidators('$key.$subKey'),
|
|
||||||
);
|
);
|
||||||
} else if (subKey == 'UsePathStyle') {
|
} else if (subKey == 'UsePathStyle') {
|
||||||
_addBooleanSetting(
|
_addBooleanSetting(
|
||||||
@ -679,7 +578,6 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
subValue,
|
subValue,
|
||||||
Icons.folder,
|
Icons.folder,
|
||||||
false,
|
false,
|
||||||
validators: getSettingValidators('$key.$subKey'),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user