]> git.proxmox.com Git - flutter/pve_flutter_frontend.git/commitdiff
adapt storage content renderer for pbs backup
authorTim Marx <t.marx@proxmox.com>
Wed, 9 Sep 2020 14:49:12 +0000 (16:49 +0200)
committerTim Marx <t.marx@proxmox.com>
Wed, 9 Sep 2020 14:49:48 +0000 (16:49 +0200)
Signed-off-by: Tim Marx <t.marx@proxmox.com>
lib/utils/renderers.dart
lib/widgets/pve_file_selector_widget.dart
lib/widgets/pve_guest_backup_widget.dart

index c18a666c7f41465da69f0738b5e92d2ecce83390..80b78abeb0e6ffaf6351f83a4a6ebdce33fa0cc5 100644 (file)
@@ -1,5 +1,6 @@
 import 'package:flutter/material.dart';
 import 'package:font_awesome_flutter/font_awesome_flutter.dart';
+import 'package:proxmox_dart_api_client/proxmox_dart_api_client.dart';
 
 class Renderers {
   static const supportLevelMap = {
@@ -27,8 +28,8 @@ class Renderers {
         "B";
   }
 
-  static String renderStorageContent(String volid) {
-    return volid.replaceAll(RegExp(r"^.*:(.*\/)?"), '');
+  static String renderStorageContent(PveNodesStorageContentModel content) {
+    return content.volid.replaceAll(RegExp(r"^.*?:(.*?\/)?"), '');
   }
 
   static IconData getDefaultResourceIcon(String type, {bool shared = false}) {
index 7aa1d01de889bff27256e690b1e3e593f352ec2b..e7ce2ef0b31eec8c6575791c1b9592938d0b958d 100644 (file)
@@ -387,7 +387,7 @@ class FileSelectorContentView extends StatelessWidget {
                     FractionallySizedBox(
                       widthFactor: 0.8,
                       child: Text(
-                        Renderers.renderStorageContent(content[index].volid),
+                        Renderers.renderStorageContent(content[index]),
                         maxLines: 1,
                         overflow: TextOverflow.ellipsis,
                       ),
@@ -413,7 +413,7 @@ class FileSelectorContentView extends StatelessWidget {
             color: Color.fromARGB(255, 152, 162, 201),
           ),
           title: Text(
-            Renderers.renderStorageContent(content[index].volid),
+            Renderers.renderStorageContent(content[index]),
             maxLines: 2,
             overflow: TextOverflow.ellipsis,
           ),
index a40c29488c77aa430c65a736e575de6ac61b8520..14509abf7edcc52b0a810c05f765ca5d32094aa0 100644 (file)
@@ -213,7 +213,7 @@ class PveGuestBackupContent extends StatelessWidget {
             color: Color.fromARGB(255, 152, 162, 201),
           ),
           title: Text(
-            Renderers.renderStorageContent(content[index].volid),
+            Renderers.renderStorageContent(content[index]),
             maxLines: 2,
             overflow: TextOverflow.ellipsis,
           ),
@@ -368,7 +368,7 @@ class _PveConfigurationDialogState extends State<PveConfigurationDialog> {
         insetPadding: EdgeInsets.all(4),
         title: Text("Configuration"),
         content: snapshot.hasData
-            ? Text(snapshot.data)
+            ? SingleChildScrollView(child: Text(snapshot.data))
             : Center(
                 child: CircularProgressIndicator(),
               ),