Compare commits

...

3 Commits

Author SHA1 Message Date
c54838ad6f fix display
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-03-05 20:21:51 -06:00
58fde34cfe Create management portal in Flutter #39 2025-03-05 20:19:42 -06:00
3a72563a5c Create management portal in Flutter #39 2025-03-05 19:59:49 -06:00
2 changed files with 20 additions and 15 deletions

View File

@ -120,10 +120,10 @@ mount(std::vector<const char *> args, std::string data_directory,
std::cout << "Initializing " std::cout << "Initializing "
<< app_config::get_provider_display_name(prov) << app_config::get_provider_display_name(prov)
<< (unique_id.empty() ? "" << (unique_id.empty() ? ""
: (prov == provider_type::s3 || prov == provider_type::sia) : (prov == provider_type::remote)
? " [" + unique_id + ']' ? " [" + remote_host + ':' +
: " [" + remote_host + ':' + std::to_string(remote_port) + ']'
std::to_string(remote_port) + ']') : " [" + unique_id + ']')
<< " Drive" << std::endl; << " Drive" << std::endl;
if (prov == provider_type::remote) { if (prov == provider_type::remote) {
std::uint16_t port{0U}; std::uint16_t port{0U};

View File

@ -18,19 +18,17 @@ class _AddMountWidgetState extends State<AddMountWidget> {
static const _items = <String>['Encrypt', 'Remote', 'S3', 'Sia']; static const _items = <String>['Encrypt', 'Remote', 'S3', 'Sia'];
static const _padding = 15.0; static const _padding = 15.0;
String? _mountType; late String _mountType;
@override
void initState() {
_mountType = widget.mountType;
super.initState();
}
List<Widget> _createTextField( List<Widget> _createTextField(
String title, String title,
String dataName, { String dataName, {
String? value, String? value,
}) { }) {
if (value != null) {
widget.onDataChanged(dataName, value);
}
return [ return [
const SizedBox(height: _padding), const SizedBox(height: _padding),
Text( Text(
@ -42,6 +40,7 @@ class _AddMountWidgetState extends State<AddMountWidget> {
), ),
), ),
TextField( TextField(
autofocus: dataName == 'Name',
decoration: InputDecoration(), decoration: InputDecoration(),
onChanged: (value) => widget.onDataChanged(dataName, value), onChanged: (value) => widget.onDataChanged(dataName, value),
controller: TextEditingController(text: value), controller: TextEditingController(text: value),
@ -51,7 +50,7 @@ class _AddMountWidgetState extends State<AddMountWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final mountTypeLower = _mountType?.toLowerCase(); final mountTypeLower = _mountType.toLowerCase();
return Column( return Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
@ -74,10 +73,10 @@ class _AddMountWidgetState extends State<AddMountWidget> {
DropdownButton<String>( DropdownButton<String>(
value: _mountType, value: _mountType,
onChanged: (value) { onChanged: (value) {
setState(() {
_mountType = value;
});
widget.onDataChanged('Provider', value); widget.onDataChanged('Provider', value);
setState(() {
_mountType = value ?? "";
});
}, },
items: items:
_items.map<DropdownMenuItem<String>>((item) { _items.map<DropdownMenuItem<String>>((item) {
@ -117,4 +116,10 @@ class _AddMountWidgetState extends State<AddMountWidget> {
], ],
); );
} }
@override
void initState() {
_mountType = widget.mountType;
super.initState();
}
} }