Compare commits
No commits in common. "23de275e1160124ca5f522cf8c6272358e880502" and "d3070ffee1033c97d76d168c7d27191ac25492f7" have entirely different histories.
23de275e11
...
d3070ffee1
@ -62,13 +62,7 @@ Map<String, dynamic> createDefaultSettings(String mountType) {
|
|||||||
'EncryptConfig': {'EncryptionToken': '', 'Path': ''},
|
'EncryptConfig': {'EncryptionToken': '', 'Path': ''},
|
||||||
};
|
};
|
||||||
case 'Remote':
|
case 'Remote':
|
||||||
return {
|
return {'EventLevel': 'info'};
|
||||||
'RemoteConfig': {
|
|
||||||
'ApiPort': 20000,
|
|
||||||
'EncryptionToken': '',
|
|
||||||
'HostNameOrIp': '',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
case 'S3':
|
case 'S3':
|
||||||
return {
|
return {
|
||||||
'S3Config': {
|
'S3Config': {
|
||||||
|
@ -2,6 +2,7 @@ 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';
|
||||||
@ -17,7 +18,6 @@ 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 && _mountType != 'Remote')
|
if (_mountType.isNotEmpty)
|
||||||
const SizedBox(height: constants.padding),
|
const SizedBox(height: constants.padding),
|
||||||
if (_mountType.isNotEmpty && _mountType != 'Remote')
|
if (_mountType.isNotEmpty)
|
||||||
Card(
|
Card(
|
||||||
margin: EdgeInsets.all(0.0),
|
margin: EdgeInsets.all(0.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
@ -181,9 +181,7 @@ class _AddMountScreenState extends State<AddMountScreen> {
|
|||||||
|
|
||||||
await mountList.add(
|
await mountList.add(
|
||||||
_mountType,
|
_mountType,
|
||||||
_mountType == 'Remote'
|
_mountNameController.text,
|
||||||
? '${_settings[_mountType]!['RemoteConfig']['HostNameOrIp']}_${_settings[_mountType]!['RemoteConfig']['ApiPort']}'
|
|
||||||
: _mountNameController.text,
|
|
||||||
_settings[_mountType]!,
|
_settings[_mountType]!,
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -208,9 +206,7 @@ class _AddMountScreenState extends State<AddMountScreen> {
|
|||||||
final changed = _mountType != mountType;
|
final changed = _mountType != mountType;
|
||||||
|
|
||||||
_mountType = mountType;
|
_mountType = mountType;
|
||||||
if (_mountType == 'Remote') {
|
if (changed) {
|
||||||
_mountNameController.text = 'remote';
|
|
||||||
} else if (changed) {
|
|
||||||
_mountNameController.text = mountType == 'Sia' ? 'default' : '';
|
_mountNameController.text = mountType == 'Sia' ? 'default' : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@ 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:
|
||||||
@ -23,7 +22,7 @@ class MountListWidget extends StatelessWidget {
|
|||||||
? 0.0
|
? 0.0
|
||||||
: constants.padding,
|
: constants.padding,
|
||||||
),
|
),
|
||||||
child: MountWidget(),
|
child: const MountWidget(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user