When the default property was selected inside the realm
of the web UI, the app's login page was not showing the
default realm instead, it was always showing PAM.

Add `default` property and a getter boolean that internally
checks if the realm is default. This boolean is used inside
`pve_login_form.dart`, which is part of pve_login_manager.

Also the `default` property is named as `defaultValue` as `default` is
a keyword [0] in dart.

- [0] https://dart.dev/language/keywords

Signed-off-by: Shan Shaji <s.sh...@proxmox.com>
---
 
 changes since v2:
 * remove "This commit" from the commit message. 

 lib/src/models/pve_access_domain_model.dart | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/src/models/pve_access_domain_model.dart 
b/lib/src/models/pve_access_domain_model.dart
index 81cb7a4..6298bbe 100644
--- a/lib/src/models/pve_access_domain_model.dart
+++ b/lib/src/models/pve_access_domain_model.dart
@@ -9,6 +9,11 @@ abstract class PveAccessDomainModel
   String get realm;
   String? get comment;
   String? get tfa;
+  @BuiltValueField(wireName: 'default')
+  int? get defaultValue;
+
+  bool get isDefaultRealm => defaultValue == 1;
+
   PveAccessDomainModel._();
 
   factory PveAccessDomainModel(
-- 
2.39.5



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

Reply via email to