From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 1659D71BB3; Fri, 9 Apr 2021 10:45:15 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9320F2390F; Fri, 9 Apr 2021 10:44:44 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 0584023890; Fri, 9 Apr 2021 10:44:42 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id C395541FB0; Fri, 9 Apr 2021 10:44:41 +0200 (CEST) From: Fabian Ebner To: pve-devel@lists.proxmox.com, pbs-devel@lists.proxmox.com Date: Fri, 9 Apr 2021 10:44:34 +0200 Message-Id: <20210409084436.2454-6-f.ebner@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210409084436.2454-1-f.ebner@proxmox.com> References: <20210409084436.2454-1-f.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.007 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust 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 v2 manager 5/7] ui: cluster task log: handle warnings like the node task log does X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Apr 2021 08:45:15 -0000 Copied the relevant code from widget-toolkit. Signed-off-by: Fabian Ebner --- Dependency bump for widget-toolkit is needed. Changes from v1: * use new helper www/manager6/dc/Tasks.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/www/manager6/dc/Tasks.js b/www/manager6/dc/Tasks.js index c5075dc3..2ecd61ee 100644 --- a/www/manager6/dc/Tasks.js +++ b/www/manager6/dc/Tasks.js @@ -61,9 +61,15 @@ Ext.define('PVE.dc.Tasks', { getRowClass: function(record, index) { var status = record.get('status'); - if (status && status != 'OK') { - return "proxmox-invalid-row"; + if (status) { + let parsed = Proxmox.Utils.parse_task_status(status); + if (parsed === 'error') { + return "proxmox-invalid-row"; + } else if (parsed === 'warning') { + return "proxmox-warning-row"; + } } + return ''; }, }, sortableColumns: false, @@ -122,11 +128,8 @@ Ext.define('PVE.dc.Tasks', { } return ""; } - if (value == 'OK') { - return 'OK'; - } - // metaData.attr = 'style="color:red;"'; - return Proxmox.Utils.errorText + ': ' + value; + + return Proxmox.Utils.format_task_status(value); }, }, ], -- 2.20.1