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 [IPv6:2a01:7e0:0:424::9])
	by lore.proxmox.com (Postfix) with ESMTPS id 8862F1FF15E
	for <inbox@lore.proxmox.com>; Tue,  3 Jun 2025 16:57:26 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id 70C4F1CE91;
	Tue,  3 Jun 2025 16:57:45 +0200 (CEST)
From: Shan Shaji <s.shaji@proxmox.com>
To: pve-devel@lists.proxmox.com
Date: Tue,  3 Jun 2025 16:56:43 +0200
Message-Id: <20250603145643.243019-3-s.shaji@proxmox.com>
X-Mailer: git-send-email 2.39.5
In-Reply-To: <20250603145643.243019-1-s.shaji@proxmox.com>
References: <20250603145643.243019-1-s.shaji@proxmox.com>
MIME-Version: 1.0
X-SPAM-LEVEL: Spam detection results:  0
 AWL -0.945 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
 ENA_SUBJ_ODD_CASE         2.6 Subject has odd case
 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 1/1] fix: add missing
 `prelaunch` value to `PveResourceStatusType`
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>

Updates the `PveResourceStatusType` enum with `prelaunch` option. Also
adds the status checks in `getStatus` and `getQemuStatus` functions.
The changes are necessary inorder to show the `prelaunch`
status in the qemu overview page and in the resources tab view.

Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---
 lib/src/models/pve_cluster_resources_model.dart | 3 +++
 lib/src/models/pve_nodes_qemu_status_model.dart | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/lib/src/models/pve_cluster_resources_model.dart b/lib/src/models/pve_cluster_resources_model.dart
index 16e18df..51ea8fa 100644
--- a/lib/src/models/pve_cluster_resources_model.dart
+++ b/lib/src/models/pve_cluster_resources_model.dart
@@ -69,6 +69,8 @@ abstract class PveClusterResourcesModel
       return PveResourceStatusType.stopped;
     }
 
+    if(status == 'prelaunch') return PveResourceStatusType.prelaunch;
+
     return PveResourceStatusType.unknown;
   }
 }
@@ -110,6 +112,7 @@ class PveResourceStatusType extends EnumClass {
   static const PveResourceStatusType suspending = _$suspending;
   static const PveResourceStatusType suspended = _$suspended;
   static const PveResourceStatusType unknown = _$unknown;
+  static const PveResourceStatusType prelaunch = _$prelaunch;
 
   const PveResourceStatusType._(super.name);
 
diff --git a/lib/src/models/pve_nodes_qemu_status_model.dart b/lib/src/models/pve_nodes_qemu_status_model.dart
index ae82802..3b2d7a8 100644
--- a/lib/src/models/pve_nodes_qemu_status_model.dart
+++ b/lib/src/models/pve_nodes_qemu_status_model.dart
@@ -42,6 +42,8 @@ abstract class PveQemuStatusModel
           return PveResourceStatusType.running;
         case 'paused':
           return PveResourceStatusType.paused;
+        case 'prelaunch':
+          return PveResourceStatusType.prelaunch;
         default:
           if (lock == 'suspending') {
             return PveResourceStatusType.suspending;
-- 
2.39.5



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