]> git.proxmox.com Git - flutter/proxmox_login_manager.git/commitdiff
inform user about unsupported pve version
authorTim Marx <t.marx@proxmox.com>
Wed, 23 Sep 2020 11:13:38 +0000 (13:13 +0200)
committerTim Marx <t.marx@proxmox.com>
Wed, 23 Sep 2020 11:13:38 +0000 (13:13 +0200)
Signed-off-by: Tim Marx <t.marx@proxmox.com>
lib/proxmox_login_form.dart

index 8ee5c123c277f81b8213faca090f30dfa4710b43..3115ffdca79873983dfe4f3ea8ce3771014240a0 100644 (file)
@@ -440,12 +440,29 @@ class _ProxmoxLoginPageState extends State<ProxmoxLoginPage> {
       Navigator.of(context).pop(client);
     } on proxclient.ProxmoxApiException catch (e) {
       print(e);
-      showDialog(
-        context: context,
-        builder: (context) => ProxmoxApiErrorDialog(
-          exception: e,
-        ),
-      );
+      if (e.message.contains('No ticket')) {
+        showDialog(
+          context: context,
+          builder: (context) => AlertDialog(
+            title: Text('Version Error'),
+            content: Text(
+                'Proxmox VE version not supported, please update your instance to use this app.'),
+            actions: [
+              FlatButton(
+                onPressed: () => Navigator.of(context).pop(),
+                child: Text('Close'),
+              ),
+            ],
+          ),
+        );
+      } else {
+        showDialog(
+          context: context,
+          builder: (context) => ProxmoxApiErrorDialog(
+            exception: e,
+          ),
+        );
+      }
     } catch (e, trace) {
       print(e);
       print(trace);
@@ -483,7 +500,6 @@ class _ProxmoxLoginPageState extends State<ProxmoxLoginPage> {
       response =
           await proxclient.accessDomains(apiBaseUrl, settings.sslValidation);
     } on proxclient.ProxmoxApiException catch (e) {
-      print(e);
       showDialog(
         context: context,
         builder: (context) => ProxmoxApiErrorDialog(