Compare commits
4 Commits
d3070ffee1
...
23de275e11
Author | SHA1 | Date | |
---|---|---|---|
23de275e11 | |||
28cfcc0344 | |||
30a91e1cb2 | |||
b2d4baa903 |
@ -62,7 +62,13 @@ Map<String, dynamic> createDefaultSettings(String mountType) {
|
||||
'EncryptConfig': {'EncryptionToken': '', 'Path': ''},
|
||||
};
|
||||
case 'Remote':
|
||||
return {'EventLevel': 'info'};
|
||||
return {
|
||||
'RemoteConfig': {
|
||||
'ApiPort': 20000,
|
||||
'EncryptionToken': '',
|
||||
'HostNameOrIp': '',
|
||||
},
|
||||
};
|
||||
case 'S3':
|
||||
return {
|
||||
'S3Config': {
|
||||
|
@ -2,7 +2,6 @@ import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:repertory/constants.dart' as constants;
|
||||
import 'package:repertory/helpers.dart';
|
||||
import 'package:repertory/models/mount_list.dart';
|
||||
import 'package:repertory/types/mount_config.dart';
|
||||
@ -18,6 +17,7 @@ class Mount with ChangeNotifier {
|
||||
}
|
||||
|
||||
String? get bucket => mountConfig.bucket;
|
||||
String get id => '${type}_$name';
|
||||
String get name => mountConfig.name;
|
||||
String get path => mountConfig.path;
|
||||
IconData? get state => mountConfig.state;
|
||||
|
@ -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(
|
||||
@ -181,7 +181,9 @@ class _AddMountScreenState extends State<AddMountScreen> {
|
||||
|
||||
await mountList.add(
|
||||
_mountType,
|
||||
_mountNameController.text,
|
||||
_mountType == 'Remote'
|
||||
? '${_settings[_mountType]!['RemoteConfig']['HostNameOrIp']}_${_settings[_mountType]!['RemoteConfig']['ApiPort']}'
|
||||
: _mountNameController.text,
|
||||
_settings[_mountType]!,
|
||||
);
|
||||
|
||||
@ -206,7 +208,9 @@ class _AddMountScreenState extends State<AddMountScreen> {
|
||||
final changed = _mountType != mountType;
|
||||
|
||||
_mountType = mountType;
|
||||
if (changed) {
|
||||
if (_mountType == 'Remote') {
|
||||
_mountNameController.text = 'remote';
|
||||
} else if (changed) {
|
||||
_mountNameController.text = mountType == 'Sia' ? 'default' : '';
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,7 @@ class MountListWidget extends StatelessWidget {
|
||||
itemBuilder: (context, idx) {
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => mountList.items[idx],
|
||||
key: ValueKey(mountList.items[idx].id),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
bottom:
|
||||
@ -22,7 +23,7 @@ class MountListWidget extends StatelessWidget {
|
||||
? 0.0
|
||||
: constants.padding,
|
||||
),
|
||||
child: const MountWidget(),
|
||||
child: MountWidget(),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user