public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH pve_flutter_frontend v5 0/3] fix: enable noVNC console view in iOS and refactor console view implementation
@ 2025-08-18 10:01 Shan Shaji
  2025-08-18 10:01 ` [pve-devel] [PATCH pve_flutter_frontend v5 1/3] ui: ios: enable noVNC console support Shan Shaji
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Shan Shaji @ 2025-08-18 10:01 UTC (permalink / raw)
  To: pve-devel

On iOS the noVNC console option was not available this patch series
includes the changes to enable the console view. Also seperate the onTap
implementation to a seperate function as the current implementation is
repeating.

Additionaly the console view was hard to be dismissible in iOS, to fix
it add an AppBar with back button.

History: 

changes since v4: https://lore.proxmox.com/pve-devel/20250814093219.75803-1-s.shaji@proxmox.com/
- Move all changes into seperate patches. 
- Remove unncessary formatting. 

changes since v3:
- Remove dart formatting changes. 
- Updated commit message. 

changes since v2:
- Set `resizeToAvoidBottomInset` to false to avoid the scaffold body 
   to resize automatically when the keyboard pops up. 
- Update commit message. 

changes since v1:
- Rebased with master. 
- Updated commit message. 

Shan Shaji (3):
  ui: ios: enable noVNC console support
  refactor: noVNC: seperate duplicate onTap implementation
  fix: ui: make noVNC console dismissible and prevent body resize

 lib/widgets/pve_console_menu_widget.dart | 56 +++++++++---------------
 1 file changed, 20 insertions(+), 36 deletions(-)

-- 
2.50.1



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] [PATCH pve_flutter_frontend v5 1/3] ui: ios: enable noVNC console support
  2025-08-18 10:01 [pve-devel] [PATCH pve_flutter_frontend v5 0/3] fix: enable noVNC console view in iOS and refactor console view implementation Shan Shaji
@ 2025-08-18 10:01 ` Shan Shaji
  2025-08-18 10:01 ` [pve-devel] [PATCH pve_flutter_frontend v5 2/3] refactor: noVNC: seperate duplicate onTap implementation Shan Shaji
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Shan Shaji @ 2025-08-18 10:01 UTC (permalink / raw)
  To: pve-devel

The noVNC console was disabled in iOS and was only available in android

To fix the issue, add additional platform check for iOS and enabled the
noVNC console option.

Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---
 lib/widgets/pve_console_menu_widget.dart | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/lib/widgets/pve_console_menu_widget.dart b/lib/widgets/pve_console_menu_widget.dart
index 473595d..6de2c0b 100644
--- a/lib/widgets/pve_console_menu_widget.dart
+++ b/lib/widgets/pve_console_menu_widget.dart
@@ -97,7 +97,7 @@ class PveConsoleMenu extends StatelessWidget {
                   }
                 },
               ),
-            if (Platform.isAndroid) // web_view is only available for mobile :(
+            if (Platform.isAndroid || Platform.isIOS) // web_view is only available for mobile :(
               ListTile(
                 title: const Text(
                   //type == "qemu" ? "noVNC Console" : "xterm.js Console",
@@ -106,7 +106,6 @@ class PveConsoleMenu extends StatelessWidget {
                 ),
                 subtitle: const Text("Open console view"),
                 onTap: () async {
-                  if (Platform.isAndroid) {
                     if (['qemu', 'lxc'].contains(type)) {
                       SystemChrome.setEnabledSystemUIMode(
                           SystemUiMode.immersive);
@@ -134,9 +133,6 @@ class PveConsoleMenu extends StatelessWidget {
                             ]);
                       });
                     }
-                  } else {
-                    print('not implemented for current platform');
-                  }
                 },
               ),
           ],
-- 
2.50.1



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] [PATCH pve_flutter_frontend v5 2/3] refactor: noVNC: seperate duplicate onTap implementation
  2025-08-18 10:01 [pve-devel] [PATCH pve_flutter_frontend v5 0/3] fix: enable noVNC console view in iOS and refactor console view implementation Shan Shaji
  2025-08-18 10:01 ` [pve-devel] [PATCH pve_flutter_frontend v5 1/3] ui: ios: enable noVNC console support Shan Shaji
@ 2025-08-18 10:01 ` Shan Shaji
  2025-08-18 10:01 ` [pve-devel] [PATCH pve_flutter_frontend v5 3/3] fix: ui: make noVNC console dismissible and prevent body resize Shan Shaji
  2025-09-04  7:33 ` [pve-devel] [PATCH pve_flutter_frontend v5 0/3] fix: enable noVNC console view in iOS and refactor console view implementation Shan Shaji
  3 siblings, 0 replies; 5+ messages in thread
From: Shan Shaji @ 2025-08-18 10:01 UTC (permalink / raw)
  To: pve-devel

The noVNC console opening implementation was the same for all guests.
However, the code in this section was duplicated. To fix this, extract
the duplicate logic into a single function and use that function as
the `onTap` callback.

Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---
 lib/widgets/pve_console_menu_widget.dart | 43 ++++++++----------------
 1 file changed, 14 insertions(+), 29 deletions(-)

diff --git a/lib/widgets/pve_console_menu_widget.dart b/lib/widgets/pve_console_menu_widget.dart
index 6de2c0b..66a852c 100644
--- a/lib/widgets/pve_console_menu_widget.dart
+++ b/lib/widgets/pve_console_menu_widget.dart
@@ -105,35 +105,7 @@ class PveConsoleMenu extends StatelessWidget {
                   style: TextStyle(fontWeight: FontWeight.bold),
                 ),
                 subtitle: const Text("Open console view"),
-                onTap: () async {
-                    if (['qemu', 'lxc'].contains(type)) {
-                      SystemChrome.setEnabledSystemUIMode(
-                          SystemUiMode.immersive);
-                      Navigator.of(context)
-                          .push(_createHTMLConsoleRoute())
-                          .then((completion) {
-                        SystemChrome.setEnabledSystemUIMode(
-                            SystemUiMode.edgeToEdge,
-                            overlays: [
-                              SystemUiOverlay.top,
-                              SystemUiOverlay.bottom
-                            ]);
-                      });
-                    } else if (type == 'node') {
-                      SystemChrome.setEnabledSystemUIMode(
-                          SystemUiMode.immersive);
-                      Navigator.of(context)
-                          .push(_createHTMLConsoleRoute())
-                          .then((completion) {
-                        SystemChrome.setEnabledSystemUIMode(
-                            SystemUiMode.edgeToEdge,
-                            overlays: [
-                              SystemUiOverlay.top,
-                              SystemUiOverlay.bottom
-                            ]);
-                      });
-                    }
-                },
+                onTap: () => _openNoVncConsole(context, type),
               ),
           ],
         ),
@@ -141,6 +113,19 @@ class PveConsoleMenu extends StatelessWidget {
     );
   }
 
+  Future<void> _openNoVncConsole(BuildContext context, String type) async {
+    if(!['lxc', 'node', 'qemu'].contains(type)) return;
+    SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive);
+    await Navigator.push(context, _createHTMLConsoleRoute());
+    SystemChrome.setEnabledSystemUIMode(
+      SystemUiMode.edgeToEdge,
+      overlays: [
+        SystemUiOverlay.top,
+        SystemUiOverlay.bottom,
+      ],
+    );
+  }
+
   void showTextDialog(BuildContext context, String title, String content) {
     showDialog(
       context: context,
-- 
2.50.1



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] [PATCH pve_flutter_frontend v5 3/3] fix: ui: make noVNC console dismissible and prevent body resize
  2025-08-18 10:01 [pve-devel] [PATCH pve_flutter_frontend v5 0/3] fix: enable noVNC console view in iOS and refactor console view implementation Shan Shaji
  2025-08-18 10:01 ` [pve-devel] [PATCH pve_flutter_frontend v5 1/3] ui: ios: enable noVNC console support Shan Shaji
  2025-08-18 10:01 ` [pve-devel] [PATCH pve_flutter_frontend v5 2/3] refactor: noVNC: seperate duplicate onTap implementation Shan Shaji
@ 2025-08-18 10:01 ` Shan Shaji
  2025-09-04  7:33 ` [pve-devel] [PATCH pve_flutter_frontend v5 0/3] fix: enable noVNC console view in iOS and refactor console view implementation Shan Shaji
  3 siblings, 0 replies; 5+ messages in thread
From: Shan Shaji @ 2025-08-18 10:01 UTC (permalink / raw)
  To: pve-devel

On iOS it's difficult to close the console view as there is no navigation
bar like in Android. To fix the issue add `PveAppBar` which includes the
back button that allow users to close the noVNC console view.

Additionally, set `resizeToAvoidBottomInset` to false to avoid the
Scaffold body from resizing automatically when the keyboard appears.

Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---
 lib/widgets/pve_console_menu_widget.dart | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/widgets/pve_console_menu_widget.dart b/lib/widgets/pve_console_menu_widget.dart
index 66a852c..8228a48 100644
--- a/lib/widgets/pve_console_menu_widget.dart
+++ b/lib/widgets/pve_console_menu_widget.dart
@@ -9,6 +9,7 @@ import 'package:proxmox_dart_api_client/proxmox_dart_api_client.dart';
 import 'package:proxmox_login_manager/proxmox_general_settings_model.dart';
 import 'package:flutter_inappwebview/flutter_inappwebview.dart';
 import 'package:crypto/crypto.dart';
+import 'package:pve_flutter_frontend/widgets/pve_app_bar.dart';
 
 class PveConsoleMenu extends StatelessWidget {
   static const platform =
@@ -213,8 +214,10 @@ class PVEWebConsoleState extends State<PVEWebConsole> {
           value: ticket,
         ),
         builder: (context, snapshot) {
-          return SafeArea(
-            child: InAppWebView(
+          return Scaffold(
+            resizeToAvoidBottomInset: false,
+            appBar: PveAppBar(),
+            body: InAppWebView(
               onReceivedServerTrustAuthRequest: (controller, challenge) async {
                 final cert = challenge.protectionSpace.sslCertificate;
                 final certBytes = cert?.x509Certificate?.encoded;
-- 
2.50.1



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [pve-devel] [PATCH pve_flutter_frontend v5 0/3] fix: enable noVNC console view in iOS and refactor console view implementation
  2025-08-18 10:01 [pve-devel] [PATCH pve_flutter_frontend v5 0/3] fix: enable noVNC console view in iOS and refactor console view implementation Shan Shaji
                   ` (2 preceding siblings ...)
  2025-08-18 10:01 ` [pve-devel] [PATCH pve_flutter_frontend v5 3/3] fix: ui: make noVNC console dismissible and prevent body resize Shan Shaji
@ 2025-09-04  7:33 ` Shan Shaji
  3 siblings, 0 replies; 5+ messages in thread
From: Shan Shaji @ 2025-09-04  7:33 UTC (permalink / raw)
  To: Shan Shaji, pve-devel

Ping


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-09-04  7:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-18 10:01 [pve-devel] [PATCH pve_flutter_frontend v5 0/3] fix: enable noVNC console view in iOS and refactor console view implementation Shan Shaji
2025-08-18 10:01 ` [pve-devel] [PATCH pve_flutter_frontend v5 1/3] ui: ios: enable noVNC console support Shan Shaji
2025-08-18 10:01 ` [pve-devel] [PATCH pve_flutter_frontend v5 2/3] refactor: noVNC: seperate duplicate onTap implementation Shan Shaji
2025-08-18 10:01 ` [pve-devel] [PATCH pve_flutter_frontend v5 3/3] fix: ui: make noVNC console dismissible and prevent body resize Shan Shaji
2025-09-04  7:33 ` [pve-devel] [PATCH pve_flutter_frontend v5 0/3] fix: enable noVNC console view in iOS and refactor console view implementation Shan Shaji

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal