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