From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 04D8F915B7 for ; Thu, 8 Sep 2022 11:56:53 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 03F1E1ADEE for ; Thu, 8 Sep 2022 11:56:02 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Thu, 8 Sep 2022 11:55:54 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 74A0044513 for ; Thu, 8 Sep 2022 11:55:54 +0200 (CEST) From: Dominik Csapak To: pve-devel@lists.proxmox.com Date: Thu, 8 Sep 2022 11:55:41 +0200 Message-Id: <20220908095550.2913416-5-d.csapak@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220908095550.2913416-1-d.csapak@proxmox.com> References: <20220908095550.2913416-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.058 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_2 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_4 0.1 random spam to be learned in bayes SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [config.name, bloc.events] Subject: [pve-devel] [PATCH pve-flutter-frontend 01/10] avoid elements hiding behind Android softnav buttons X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Sep 2022 09:56:53 -0000 From: Aaron Lauterer In a few places we had elements hiding behind the Android soft nav buttons at the bottom. Those were: * Qemu HW overview list * Qemu Power Control menu * LXC and Qemu Options list Placing them within a SafeArea avoids that. Signed-off-by: Aaron Lauterer Signed-off-by: Dominik Csapak --- lib/widgets/pve_lxc_options_widget.dart | 140 ++++---- lib/widgets/pve_qemu_options_widget.dart | 256 +++++++------- lib/widgets/pve_qemu_overview.dart | 319 +++++++++--------- .../pve_qemu_power_settings_widget.dart | 178 +++++----- 4 files changed, 451 insertions(+), 442 deletions(-) diff --git a/lib/widgets/pve_lxc_options_widget.dart b/lib/widgets/pve_lxc_options_widget.dart index 89912dc..70db577 100644 --- a/lib/widgets/pve_lxc_options_widget.dart +++ b/lib/widgets/pve_lxc_options_widget.dart @@ -15,75 +15,77 @@ class PveLxcOptions extends StatelessWidget { builder: (context, state) { final config = state.config; if (config != null) { - return Scaffold( - appBar: AppBar(), - body: SingleChildScrollView( - child: Column( - children: [ - ListTile( - title: Text("Name"), - subtitle: Text(config.hostname ?? 'undefined'), - ), - PveConfigSwitchListTile( - title: Text("Start on boot"), - value: config.onboot, - defaultValue: false, - pending: config.getPending('onboot'), - onChanged: (v) => - lxcBloc!.events.add(UpdateLxcConfigBool('onboot', v)), - onDeleted: () => - lxcBloc!.events.add(RevertPendingLxcConfig('onboot')), - ), - ListTile( - title: Text("Start/Shutdown order"), - subtitle: Text(config.startup ?? "Default (any)"), - ), - ListTile( - title: Text("OS Type"), - subtitle: Text("${config.ostype}"), - ), - ListTile( - title: Text("Architecture"), - subtitle: Text("${config.arch}"), - ), - PveConfigSwitchListTile( - title: Text("/dev/console"), - value: config.console, - defaultValue: true, - pending: config.getPending('console'), - onChanged: (v) => lxcBloc!.events - .add(UpdateLxcConfigBool('console', v)), - onDeleted: () => lxcBloc!.events - .add(RevertPendingLxcConfig('console')), - ), - ListTile( - title: Text("TTY Count"), - subtitle: Text("${config.tty ?? 2}"), - ), - ListTile( - title: Text("Console Mode"), - subtitle: Text(config.cmode?.name ?? 'tty'), - ), - PveConfigSwitchListTile( - title: Text("Protection"), - value: config.protection, - defaultValue: false, - pending: config.getPending('protection'), - onChanged: (v) => lxcBloc!.events - .add(UpdateLxcConfigBool('protection', v)), - onDeleted: () => lxcBloc!.events - .add(RevertPendingLxcConfig('protection')), - ), - ListTile( - title: Text("Unprivileged"), - subtitle: - Text(config.unprivileged ?? false ? 'Yes' : 'No'), - ), - ListTile( - title: Text("Features"), - subtitle: Text(config.features?.toString() ?? 'none'), - ), - ], + return SafeArea( + child: Scaffold( + appBar: AppBar(), + body: SingleChildScrollView( + child: Column( + children: [ + ListTile( + title: Text("Name"), + subtitle: Text(config.hostname ?? 'undefined'), + ), + PveConfigSwitchListTile( + title: Text("Start on boot"), + value: config.onboot, + defaultValue: false, + pending: config.getPending('onboot'), + onChanged: (v) => lxcBloc!.events + .add(UpdateLxcConfigBool('onboot', v)), + onDeleted: () => lxcBloc!.events + .add(RevertPendingLxcConfig('onboot')), + ), + ListTile( + title: Text("Start/Shutdown order"), + subtitle: Text(config.startup ?? "Default (any)"), + ), + ListTile( + title: Text("OS Type"), + subtitle: Text("${config.ostype}"), + ), + ListTile( + title: Text("Architecture"), + subtitle: Text("${config.arch}"), + ), + PveConfigSwitchListTile( + title: Text("/dev/console"), + value: config.console, + defaultValue: true, + pending: config.getPending('console'), + onChanged: (v) => lxcBloc!.events + .add(UpdateLxcConfigBool('console', v)), + onDeleted: () => lxcBloc!.events + .add(RevertPendingLxcConfig('console')), + ), + ListTile( + title: Text("TTY Count"), + subtitle: Text("${config.tty ?? 2}"), + ), + ListTile( + title: Text("Console Mode"), + subtitle: Text(config.cmode?.name ?? 'tty'), + ), + PveConfigSwitchListTile( + title: Text("Protection"), + value: config.protection, + defaultValue: false, + pending: config.getPending('protection'), + onChanged: (v) => lxcBloc!.events + .add(UpdateLxcConfigBool('protection', v)), + onDeleted: () => lxcBloc!.events + .add(RevertPendingLxcConfig('protection')), + ), + ListTile( + title: Text("Unprivileged"), + subtitle: + Text(config.unprivileged ?? false ? 'Yes' : 'No'), + ), + ListTile( + title: Text("Features"), + subtitle: Text(config.features?.toString() ?? 'none'), + ), + ], + ), ), ), ); diff --git a/lib/widgets/pve_qemu_options_widget.dart b/lib/widgets/pve_qemu_options_widget.dart index fb28051..788923d 100644 --- a/lib/widgets/pve_qemu_options_widget.dart +++ b/lib/widgets/pve_qemu_options_widget.dart @@ -18,134 +18,136 @@ class PveQemuOptions extends StatelessWidget { builder: (context, state) { if (state.config != null) { final config = state.config!; - return Scaffold( - appBar: AppBar( - leading: IconButton( - icon: Icon(Icons.close), - onPressed: () => Navigator.of(context).pop(), + return SafeArea( + child: Scaffold( + appBar: AppBar( + leading: IconButton( + icon: Icon(Icons.close), + onPressed: () => Navigator.of(context).pop(), + ), ), - ), - body: SingleChildScrollView( - child: Form( - key: _formKey, - onChanged: () {}, - child: Column( - children: [ - ListTile( - title: Text("Name"), - subtitle: Text(config.name ?? 'VM$guestID'), - ), - PveConfigSwitchListTile( - title: Text("Start on boot"), - value: config.onboot, - defaultValue: false, - pending: config.getPending('onboot'), - onChanged: (v) => - bloc.events.add(UpdateQemuConfigBool('onboot', v)), - onDeleted: () => - bloc.events.add(RevertPendingQemuConfig('onboot')), - ), - ListTile( - title: Text("Start/Shutdown order"), - subtitle: Text(config.startup ?? "Default (any)"), - ), - ListTile( - title: Text("OS Type"), - subtitle: Text( - "${config.ostype!.type} ${config.ostype!.description}"), - ), - //TODO add better ui component e.g. collapseable - ListTile( - title: Text("Boot Device"), - subtitle: Text(config.boot ?? 'Disk, Network, USB'), - ), - PveConfigSwitchListTile( - title: Text("Use tablet for pointer"), - value: config.tablet, - defaultValue: true, - pending: config.getPending('tablet'), - onChanged: (v) => - bloc.events.add(UpdateQemuConfigBool('tablet', v)), - onDeleted: () => - bloc.events.add(RevertPendingQemuConfig('tablet')), - ), - ListTile( - title: Text("Hotplug"), - subtitle: Text(config.hotplug ?? 'disk,network,usb'), - ), - PveConfigSwitchListTile( - title: Text("ACPI support"), - value: config.acpi, - defaultValue: true, - pending: config.getPending('acpi'), - onChanged: (v) => - bloc.events.add(UpdateQemuConfigBool('acpi', v)), - onDeleted: () => - bloc.events.add(RevertPendingQemuConfig('acpi')), - ), - PveConfigSwitchListTile( - title: Text("KVM hardware virtualization"), - value: config.kvm, - defaultValue: true, - pending: config.getPending('kvm'), - onChanged: (v) => - bloc.events.add(UpdateQemuConfigBool('kvm', v)), - onDeleted: () => - bloc.events.add(RevertPendingQemuConfig('kvm')), - ), - PveConfigSwitchListTile( - title: Text("Freeze CPU on startup"), - value: config.freeze, - defaultValue: false, - pending: config.getPending('freeze'), - onChanged: (v) => - bloc.events.add(UpdateQemuConfigBool('freeze', v)), - onDeleted: () => - bloc.events.add(RevertPendingQemuConfig('freeze')), - ), - PveConfigSwitchListTile( - title: Text("Use local time for RTC"), - value: config.localtime, - defaultValue: false, - pending: config.getPending('localtime'), - onChanged: (v) => bloc.events - .add(UpdateQemuConfigBool('localtime', v)), - onDeleted: () => bloc.events - .add(RevertPendingQemuConfig('localtime')), - ), - ListTile( - title: Text("RTC start date"), - subtitle: Text(config.startdate ?? 'now'), - ), - ListTile( - title: Text("SMBIOS settings (type1)"), - subtitle: Text(config.smbios1 ?? ''), - ), - //Todo enhance UI - ListTile( - title: Text("QEMU Guest Agent"), - subtitle: Text(config.agent ?? 'Default (disabled)'), - ), - PveConfigSwitchListTile( - title: Text("Protection"), - value: config.protection, - defaultValue: false, - pending: config.getPending('protection'), - onChanged: (v) => bloc.events - .add(UpdateQemuConfigBool('protection', v)), - onDeleted: () => bloc.events - .add(RevertPendingQemuConfig('protection')), - ), - ListTile( - title: Text("Spice Enhancements"), - subtitle: - Text(config.spiceEnhancements ?? 'No enhancements'), - ), - ListTile( - title: Text("VM State Storage"), - subtitle: Text(config.vmstatestorage ?? 'Automatic'), - ), - ], + body: SingleChildScrollView( + child: Form( + key: _formKey, + onChanged: () {}, + child: Column( + children: [ + ListTile( + title: Text("Name"), + subtitle: Text(config.name ?? 'VM$guestID'), + ), + PveConfigSwitchListTile( + title: Text("Start on boot"), + value: config.onboot, + defaultValue: false, + pending: config.getPending('onboot'), + onChanged: (v) => bloc.events + .add(UpdateQemuConfigBool('onboot', v)), + onDeleted: () => bloc.events + .add(RevertPendingQemuConfig('onboot')), + ), + ListTile( + title: Text("Start/Shutdown order"), + subtitle: Text(config.startup ?? "Default (any)"), + ), + ListTile( + title: Text("OS Type"), + subtitle: Text( + "${config.ostype!.type} ${config.ostype!.description}"), + ), + //TODO add better ui component e.g. collapseable + ListTile( + title: Text("Boot Device"), + subtitle: Text(config.boot ?? 'Disk, Network, USB'), + ), + PveConfigSwitchListTile( + title: Text("Use tablet for pointer"), + value: config.tablet, + defaultValue: true, + pending: config.getPending('tablet'), + onChanged: (v) => bloc.events + .add(UpdateQemuConfigBool('tablet', v)), + onDeleted: () => bloc.events + .add(RevertPendingQemuConfig('tablet')), + ), + ListTile( + title: Text("Hotplug"), + subtitle: Text(config.hotplug ?? 'disk,network,usb'), + ), + PveConfigSwitchListTile( + title: Text("ACPI support"), + value: config.acpi, + defaultValue: true, + pending: config.getPending('acpi'), + onChanged: (v) => + bloc.events.add(UpdateQemuConfigBool('acpi', v)), + onDeleted: () => + bloc.events.add(RevertPendingQemuConfig('acpi')), + ), + PveConfigSwitchListTile( + title: Text("KVM hardware virtualization"), + value: config.kvm, + defaultValue: true, + pending: config.getPending('kvm'), + onChanged: (v) => + bloc.events.add(UpdateQemuConfigBool('kvm', v)), + onDeleted: () => + bloc.events.add(RevertPendingQemuConfig('kvm')), + ), + PveConfigSwitchListTile( + title: Text("Freeze CPU on startup"), + value: config.freeze, + defaultValue: false, + pending: config.getPending('freeze'), + onChanged: (v) => bloc.events + .add(UpdateQemuConfigBool('freeze', v)), + onDeleted: () => bloc.events + .add(RevertPendingQemuConfig('freeze')), + ), + PveConfigSwitchListTile( + title: Text("Use local time for RTC"), + value: config.localtime, + defaultValue: false, + pending: config.getPending('localtime'), + onChanged: (v) => bloc.events + .add(UpdateQemuConfigBool('localtime', v)), + onDeleted: () => bloc.events + .add(RevertPendingQemuConfig('localtime')), + ), + ListTile( + title: Text("RTC start date"), + subtitle: Text(config.startdate ?? 'now'), + ), + ListTile( + title: Text("SMBIOS settings (type1)"), + subtitle: Text(config.smbios1 ?? ''), + ), + //Todo enhance UI + ListTile( + title: Text("QEMU Guest Agent"), + subtitle: Text(config.agent ?? 'Default (disabled)'), + ), + PveConfigSwitchListTile( + title: Text("Protection"), + value: config.protection, + defaultValue: false, + pending: config.getPending('protection'), + onChanged: (v) => bloc.events + .add(UpdateQemuConfigBool('protection', v)), + onDeleted: () => bloc.events + .add(RevertPendingQemuConfig('protection')), + ), + ListTile( + title: Text("Spice Enhancements"), + subtitle: Text( + config.spiceEnhancements ?? 'No enhancements'), + ), + ListTile( + title: Text("VM State Storage"), + subtitle: Text(config.vmstatestorage ?? 'Automatic'), + ), + ], + ), ), ), ), diff --git a/lib/widgets/pve_qemu_overview.dart b/lib/widgets/pve_qemu_overview.dart index df8867e..45f3f66 100644 --- a/lib/widgets/pve_qemu_overview.dart +++ b/lib/widgets/pve_qemu_overview.dart @@ -70,181 +70,184 @@ class PveQemuOverview extends StatelessWidget { final config = state.config; final rrdData = state.rrdData; - return Scaffold( - appBar: AppBar( - //backgroundColor: Colors.transparent, - elevation: 0, - title: Text(config?.name ?? 'VM $guestID'), - ), - backgroundColor: Theme.of(context).colorScheme.background, - body: SingleChildScrollView( - child: Column( - children: [ - PveGuestOverviewHeader( - background: !(status?.template ?? false) - ? PveGuestHeaderRRDPageView( - rrdData: rrdData, - ) - : Center( - child: Text( - "TEMPLATE", - style: TextStyle( - color: Colors.white, - ), - ), - ), - width: width, - guestID: guestID, - guestStatus: status?.getQemuStatus(), - guestName: config?.name ?? 'VM $guestID', - guestNodeID: state.nodeID, - guestType: 'qemu', - ha: status?.ha, - template: status?.template ?? false, - ), - ProxmoxStreamBuilder( - bloc: taskBloc, - builder: (context, taskState) { - if (taskState.tasks != null && - taskState.tasks.isNotEmpty) { - return PveTaskExpansionTile( - headerColor: - Theme.of(context).colorScheme.onBackground, - task: taskState.tasks.first, - showMorePage: Provider( - create: (context) => PveTaskLogBloc( - apiClient: taskBloc.apiClient, - init: PveTaskLogState.init(state.nodeID), + return SafeArea( + child: Scaffold( + appBar: AppBar( + //backgroundColor: Colors.transparent, + elevation: 0, + title: Text(config?.name ?? 'VM $guestID'), + ), + backgroundColor: Theme.of(context).colorScheme.background, + body: SingleChildScrollView( + child: Column( + children: [ + PveGuestOverviewHeader( + background: !(status?.template ?? false) + ? PveGuestHeaderRRDPageView( + rrdData: rrdData, ) - ..events.add( - FilterTasksByGuestID( - guestID: guestID, + : Center( + child: Text( + "TEMPLATE", + style: TextStyle( + color: Colors.white, ), + ), + ), + width: width, + guestID: guestID, + guestStatus: status?.getQemuStatus(), + guestName: config?.name ?? 'VM $guestID', + guestNodeID: state.nodeID, + guestType: 'qemu', + ha: status?.ha, + template: status?.template ?? false, + ), + ProxmoxStreamBuilder( + bloc: taskBloc, + builder: (context, taskState) { + if (taskState.tasks != null && + taskState.tasks.isNotEmpty) { + return PveTaskExpansionTile( + headerColor: + Theme.of(context).colorScheme.onBackground, + task: taskState.tasks.first, + showMorePage: Provider( + create: (context) => PveTaskLogBloc( + apiClient: taskBloc.apiClient, + init: PveTaskLogState.init(state.nodeID), ) - ..events.add(LoadTasks()), - dispose: (context, bloc) => bloc.dispose(), - child: PveTaskLog(), - ), - ); - } - return Container(); - }, - ), - Container( - height: 130, - child: SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - if (!(status?.template ?? false)) - createActionCard( - 'Power Settings', - Icons.power_settings_new, - () => - showPowerMenuBottomSheet(context, bloc)), - if (!(status?.template ?? false)) + ..events.add( + FilterTasksByGuestID( + guestID: guestID, + ), + ) + ..events.add(LoadTasks()), + dispose: (context, bloc) => bloc.dispose(), + child: PveTaskLog(), + ), + ); + } + return Container(); + }, + ), + Container( + height: 130, + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + if (!(status?.template ?? false)) + createActionCard( + 'Power Settings', + Icons.power_settings_new, + () => showPowerMenuBottomSheet( + context, bloc)), + if (!(status?.template ?? false)) + createActionCard( + 'Console', + Icons.queue_play_next, + () => showConsoleMenuBottomSheet( + context, + bloc.apiClient, + guestID, + state.nodeID, + 'qemu', + allowSpice: status?.spice ?? false, + )), createActionCard( - 'Console', - Icons.queue_play_next, - () => showConsoleMenuBottomSheet( - context, - bloc.apiClient, - guestID, - state.nodeID, - 'qemu', - allowSpice: status?.spice ?? false, - )), - createActionCard( - 'Options', - Icons.settings, - () => Navigator.of(context) - .push(_createOptionsRoute(bloc))), - if (!rBloc.latestState.isStandalone) + 'Options', + Icons.settings, + () => Navigator.of(context) + .push(_createOptionsRoute(bloc))), + if (!rBloc.latestState.isStandalone) + createActionCard( + 'Migrate', + FontAwesomeIcons.paperPlane, + () => Navigator.of(context).push( + _createMigrationRoute(guestID, + state.nodeID, bloc.apiClient))), createActionCard( - 'Migrate', - FontAwesomeIcons.paperPlane, + 'Backup', + FontAwesomeIcons.save, () => Navigator.of(context).push( - _createMigrationRoute(guestID, - state.nodeID, bloc.apiClient))), - createActionCard( - 'Backup', - FontAwesomeIcons.save, - () => Navigator.of(context).push( - _createBackupRoute(guestID, state.nodeID, - bloc.apiClient))), - ], + _createBackupRoute(guestID, state.nodeID, + bloc.apiClient))), + ], + ), ), ), - ), - if (config != null) - PveResourceDataCardWidget( - expandable: false, - title: Text( - 'Hardware', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 20, - ), - ), - children: [ - ListTile( - leading: Icon(FontAwesomeIcons.memory), - title: Text('${config.memory}'), - subtitle: Text('Memory'), - dense: true, - ), - ListTile( - leading: Icon(Icons.memory), - title: Text( - '${config.cores} Cores ${config.sockets} Socket'), - subtitle: Text('Processor'), - dense: true, - ), - ListTile( - leading: Icon(FontAwesomeIcons.microchip), - title: Text( - config.bios?.name ?? 'Default (SeaBIOS)'), - subtitle: Text('BIOS'), - dense: true, - ), - ListTile( - leading: Icon(FontAwesomeIcons.cogs), - dense: true, - title: Text(config.machine ?? 'Default (i440fx)'), - subtitle: Text('Machine Type'), - ), - ListTile( - leading: Icon(FontAwesomeIcons.database), - title: Text( - config.scsihw?.name ?? 'Default (i440fx)'), - subtitle: Text('SCSI Controller'), - dense: true, + if (config != null) + PveResourceDataCardWidget( + expandable: false, + title: Text( + 'Hardware', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20, + ), ), - for (var ide in config.ide!) + children: [ ListTile( - leading: Icon(FontAwesomeIcons.compactDisc), - title: Text(ide), - subtitle: Text('CD/DVD Drive'), + leading: Icon(FontAwesomeIcons.memory), + title: Text('${config.memory}'), + subtitle: Text('Memory'), dense: true, ), - for (var scsi in config.scsi!) ListTile( - leading: Icon(FontAwesomeIcons.hdd), - title: Text(scsi), - subtitle: Text('Hard Disk'), + leading: Icon(Icons.memory), + title: Text( + '${config.cores} Cores ${config.sockets} Socket'), + subtitle: Text('Processor'), dense: true, ), - for (var net in config.net!) ListTile( - leading: Icon(FontAwesomeIcons.ethernet), + leading: Icon(FontAwesomeIcons.microchip), + title: Text( + config.bios?.name ?? 'Default (SeaBIOS)'), + subtitle: Text('BIOS'), dense: true, - subtitle: Text('Network Device'), - title: Text(net), - ) - ]), - ], - ))); + ), + ListTile( + leading: Icon(FontAwesomeIcons.cogs), + dense: true, + title: + Text(config.machine ?? 'Default (i440fx)'), + subtitle: Text('Machine Type'), + ), + ListTile( + leading: Icon(FontAwesomeIcons.database), + title: Text( + config.scsihw?.name ?? 'Default (i440fx)'), + subtitle: Text('SCSI Controller'), + dense: true, + ), + for (var ide in config.ide!) + ListTile( + leading: Icon(FontAwesomeIcons.compactDisc), + title: Text(ide), + subtitle: Text('CD/DVD Drive'), + dense: true, + ), + for (var scsi in config.scsi!) + ListTile( + leading: Icon(FontAwesomeIcons.hdd), + title: Text(scsi), + subtitle: Text('Hard Disk'), + dense: true, + ), + for (var net in config.net!) + ListTile( + leading: Icon(FontAwesomeIcons.ethernet), + dense: true, + subtitle: Text('Network Device'), + title: Text(net), + ) + ]), + ], + ))), + ); }), ); } diff --git a/lib/widgets/pve_qemu_power_settings_widget.dart b/lib/widgets/pve_qemu_power_settings_widget.dart index 2d4c496..46c07cc 100644 --- a/lib/widgets/pve_qemu_power_settings_widget.dart +++ b/lib/widgets/pve_qemu_power_settings_widget.dart @@ -18,103 +18,105 @@ class PveQemuPowerSettings extends StatelessWidget { builder: (context, state) { final qemuStatus = state.currentStatus?.getQemuStatus(); final disableShutdown = qemuStatus != PveResourceStatusType.running; - return SingleChildScrollView( - child: Container( - constraints: BoxConstraints( - minHeight: MediaQuery.of(context).size.height / 3), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - if (qemuStatus == PveResourceStatusType.stopped && - !(state.currentStatus!.template ?? false)) - ListTile( - leading: Icon(Icons.play_arrow), - title: Text( - "Start", - style: TextStyle(fontWeight: FontWeight.bold), + return SafeArea( + child: SingleChildScrollView( + child: Container( + constraints: BoxConstraints( + minHeight: MediaQuery.of(context).size.height / 3), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + if (qemuStatus == PveResourceStatusType.stopped && + !(state.currentStatus!.template ?? false)) + ListTile( + leading: Icon(Icons.play_arrow), + title: Text( + "Start", + style: TextStyle(fontWeight: FontWeight.bold), + ), + subtitle: Text("Turn on QEMU virtual machine"), + onTap: () => action( + context, PveClusterResourceAction.start, bloc), ), - subtitle: Text("Turn on QEMU virtual machine"), - onTap: () => - action(context, PveClusterResourceAction.start, bloc), - ), - if ([ - PveResourceStatusType.paused, - PveResourceStatusType.suspended - ].contains(qemuStatus) && - !(state.currentStatus!.template ?? false)) - ListTile( - leading: Icon(Icons.play_arrow), - title: Text( - "Resume", - style: TextStyle(fontWeight: FontWeight.bold), + if ([ + PveResourceStatusType.paused, + PveResourceStatusType.suspended + ].contains(qemuStatus) && + !(state.currentStatus!.template ?? false)) + ListTile( + leading: Icon(Icons.play_arrow), + title: Text( + "Resume", + style: TextStyle(fontWeight: FontWeight.bold), + ), + subtitle: Text("Resume QEMU virtual machine"), + onTap: () => action( + context, PveClusterResourceAction.resume, bloc), ), - subtitle: Text("Resume QEMU virtual machine"), - onTap: () => action( - context, PveClusterResourceAction.resume, bloc), - ), - if (!disableShutdown) ...[ - ListTile( - leading: Icon(Icons.power_settings_new), - title: Text( - "Shutdown", - style: TextStyle(fontWeight: FontWeight.bold), + if (!disableShutdown) ...[ + ListTile( + leading: Icon(Icons.power_settings_new), + title: Text( + "Shutdown", + style: TextStyle(fontWeight: FontWeight.bold), + ), + subtitle: Text("Shutdown QEMU virtual machine"), + onTap: () => action( + context, PveClusterResourceAction.shutdown, bloc), ), - subtitle: Text("Shutdown QEMU virtual machine"), - onTap: () => action( - context, PveClusterResourceAction.shutdown, bloc), - ), - ListTile( - leading: Icon(Icons.autorenew), - title: Text( - "Reboot", - style: TextStyle(fontWeight: FontWeight.bold), + ListTile( + leading: Icon(Icons.autorenew), + title: Text( + "Reboot", + style: TextStyle(fontWeight: FontWeight.bold), + ), + subtitle: Text("Reboot QEMU virtual machine"), + onTap: () => action( + context, PveClusterResourceAction.reboot, bloc), ), - subtitle: Text("Reboot QEMU virtual machine"), - onTap: () => action( - context, PveClusterResourceAction.reboot, bloc), - ), - ListTile( - leading: Icon(Icons.pause), - title: Text( - "Pause", - style: TextStyle(fontWeight: FontWeight.bold), + ListTile( + leading: Icon(Icons.pause), + title: Text( + "Pause", + style: TextStyle(fontWeight: FontWeight.bold), + ), + subtitle: Text("Pause QEMU virtual machine"), + onTap: () => action( + context, PveClusterResourceAction.suspend, bloc), ), - subtitle: Text("Pause QEMU virtual machine"), - onTap: () => action( - context, PveClusterResourceAction.suspend, bloc), - ), - ListTile( - leading: Icon(FontAwesomeIcons.download), - title: Text( - "Hibernate", - style: TextStyle(fontWeight: FontWeight.bold), + ListTile( + leading: Icon(FontAwesomeIcons.download), + title: Text( + "Hibernate", + style: TextStyle(fontWeight: FontWeight.bold), + ), + subtitle: Text("Hibernate QEMU virtual machine"), + onTap: () => action( + context, PveClusterResourceAction.hibernate, bloc), ), - subtitle: Text("Hibernate QEMU virtual machine"), - onTap: () => action( - context, PveClusterResourceAction.hibernate, bloc), - ), - ListTile( - leading: Icon(Icons.stop), - title: Text( - "Stop", - style: TextStyle(fontWeight: FontWeight.bold), + ListTile( + leading: Icon(Icons.stop), + title: Text( + "Stop", + style: TextStyle(fontWeight: FontWeight.bold), + ), + subtitle: Text("Stop QEMU virtual machine"), + onTap: () => action( + context, PveClusterResourceAction.stop, bloc), ), - subtitle: Text("Stop QEMU virtual machine"), - onTap: () => - action(context, PveClusterResourceAction.stop, bloc), - ), - ListTile( - leading: Icon(FontAwesomeIcons.bolt), - title: Text( - "Reset", - style: TextStyle(fontWeight: FontWeight.bold), + ListTile( + leading: Icon(FontAwesomeIcons.bolt), + title: Text( + "Reset", + style: TextStyle(fontWeight: FontWeight.bold), + ), + subtitle: Text("Reset QEMU virtual machine"), + onTap: () => action( + context, PveClusterResourceAction.reset, bloc), ), - subtitle: Text("Reset QEMU virtual machine"), - onTap: () => - action(context, PveClusterResourceAction.reset, bloc), - ), + ], ], - ], + ), ), ), ); -- 2.30.2