From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pve-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
	by lore.proxmox.com (Postfix) with ESMTPS id D26E91FF15E
	for <inbox@lore.proxmox.com>; Tue, 20 May 2025 10:05:52 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id 9FE5916DF3;
	Tue, 20 May 2025 10:05:51 +0200 (CEST)
From: Shan Shaji <s.shaji@proxmox.com>
To: pve-devel@lists.proxmox.com
Date: Tue, 20 May 2025 10:05:27 +0200
Message-Id: <20250520080527.37594-3-s.shaji@proxmox.com>
X-Mailer: git-send-email 2.39.5 (Apple Git-154)
In-Reply-To: <20250520080527.37594-1-s.shaji@proxmox.com>
References: <20250520080527.37594-1-s.shaji@proxmox.com>
MIME-Version: 1.0
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.351 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DMARC_MISSING             0.1 Missing DMARC policy
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
Subject: [pve-devel] [PATCH proxmox_dart_api_client 2/2] fix: ui: add
 missing `paused` status check
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: pve-devel-bounces@lists.proxmox.com
Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com>

The `getStatus` function was not returning the corresponding
`PveResourceStatusType` when the status was `paused`. This commit adds
the missing status check.

Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---
 .../models/pve_cluster_resources_model.dart   | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/lib/src/models/pve_cluster_resources_model.dart b/lib/src/models/pve_cluster_resources_model.dart
index 1f69213..19986f1 100644
--- a/lib/src/models/pve_cluster_resources_model.dart
+++ b/lib/src/models/pve_cluster_resources_model.dart
@@ -11,30 +11,49 @@ abstract class PveClusterResourcesModel
       _$pveClusterResourcesModelSerializer;
 
   String get id;
+
   String get type;
 
   double? get cpu;
+
   int? get disk;
+
   String? get hastate;
+
   String? get level;
+
   double? get maxcpu;
+
   int? get maxdisk;
+
   int? get maxmem;
+
   int? get mem;
+
   String? get name;
+
   String? get node;
+
   String? get pool;
+
   String? get status;
+
   bool? get shared;
+
   String? get storage;
+
   int? get uptime;
+
   int? get vmid;
+
   String? get lock;
+
   bool? get template;
 
   factory PveClusterResourcesModel(
           [void Function(PveClusterResourcesModelBuilder)? updates]) =
       _$PveClusterResourcesModel;
+
   PveClusterResourcesModel._();
 
   String get displayName {
@@ -69,6 +88,8 @@ abstract class PveClusterResourcesModel
       return PveResourceStatusType.stopped;
     }
 
+    if (status == 'paused') return PveResourceStatusType.paused;
+
     return PveResourceStatusType.unkown;
   }
 }
@@ -82,6 +103,7 @@ class PveClusterResourceType extends EnumClass {
   const PveClusterResourceType._(super.name);
 
   static BuiltSet<PveClusterResourceType> get values => _$pcrtValues;
+
   static PveClusterResourceType valueOf(String name) => _$pcrtValueOf(name);
 }
 
@@ -99,6 +121,7 @@ class PveClusterResourceAction extends EnumClass {
 
   static BuiltSet<PveClusterResourceAction> get values =>
       _$pveClusterResourceActionValues;
+
   static PveClusterResourceAction valueOf(String name) =>
       _$pveClusterResourceActionValueOf(name);
 }
@@ -114,6 +137,7 @@ class PveResourceStatusType extends EnumClass {
   const PveResourceStatusType._(super.name);
 
   static BuiltSet<PveResourceStatusType> get values => _$pqsTValues;
+
   static PveResourceStatusType valueOf(String name) => _$pqsTValueOf(name);
 
   static Serializer<PveResourceStatusType> get serializer =>
-- 
2.39.5 (Apple Git-154)



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