remote mount provider support

This commit is contained in:
Scott E. Graves 2025-03-15 21:52:01 -05:00
parent d3070ffee1
commit b2d4baa903
2 changed files with 15 additions and 4 deletions

View File

@ -62,7 +62,13 @@ Map<String, dynamic> createDefaultSettings(String mountType) {
'EncryptConfig': {'EncryptionToken': '', 'Path': ''},
};
case 'Remote':
return {'EventLevel': 'info'};
return {
'RemoteConfig': {
'ApiPort': 1,
'EncryptionToken': '',
'HostNameOrIp': '',
},
};
case 'S3':
return {
'S3Config': {

View File

@ -84,9 +84,9 @@ class _AddMountScreenState extends State<AddMountScreen> {
),
),
),
if (_mountType.isNotEmpty)
if (_mountType.isNotEmpty && _mountType != "Remote")
const SizedBox(height: constants.padding),
if (_mountType.isNotEmpty)
if (_mountType.isNotEmpty && _mountType != "Remote")
Card(
margin: EdgeInsets.all(0.0),
child: Padding(
@ -206,7 +206,12 @@ class _AddMountScreenState extends State<AddMountScreen> {
final changed = _mountType != mountType;
_mountType = mountType;
if (changed) {
if (_mountType == 'Remote') {
_mountNameController.text =
(_settings[_mountType]?['HostNameOrIp'].toString() ?? '') +
'_' +
(_settings[_mountType]?['ApiPort'].toString() ?? '');
} else if (changed) {
_mountNameController.text = mountType == 'Sia' ? 'default' : '';
}