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 87DF89A54A for ; Fri, 13 Oct 2023 16:38:01 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5D8381FFD6 for ; Fri, 13 Oct 2023 16:38:01 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (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 for ; Fri, 13 Oct 2023 16:38:00 +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 6A6DC48F33 for ; Fri, 13 Oct 2023 16:38:00 +0200 (CEST) From: Philipp Hufnagl To: pbs-devel@lists.proxmox.com Date: Fri, 13 Oct 2023 16:37:55 +0200 Message-Id: <20231013143755.2549025-1-p.hufnagl@proxmox.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.079 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: [pbs-devel] [PATCH proxmox-backup v7] ui: fix #4260: add dynamic notes in backup group comment X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2023 14:38:01 -0000 When there is no comment for a backup group, the comment of the last snapshot in this group will be shown slightly grayed out as long as the group is collapsed. Signed-off-by: Philipp Hufnagl --- Changes since v1: * code quality improvements * remove unused variable www/css/ext6-pbs.css | 4 ++++ www/datastore/Content.js | 14 +++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/www/css/ext6-pbs.css b/www/css/ext6-pbs.css index 5fd65d25..95a655cf 100644 --- a/www/css/ext6-pbs.css +++ b/www/css/ext6-pbs.css @@ -227,6 +227,10 @@ span.snapshot-comment-column { width: calc(100% - 18px); } +.pmx-faded { + opacity: 0.7; +} + .x-action-col-icon.good:before { color: #21BF4B; } diff --git a/www/datastore/Content.js b/www/datastore/Content.js index 9fc07d49..6006201c 100644 --- a/www/datastore/Content.js +++ b/www/datastore/Content.js @@ -287,6 +287,7 @@ Ext.define('PBS.DataStoreContent', { if (item["backup-time"] > last_backup && item.size !== null) { last_backup = item["backup-time"]; group["backup-time"] = last_backup; + group["last-comment"] = item.comment; group.files = item.files; group.size = item.size; group.owner = item.owner; @@ -903,13 +904,20 @@ Ext.define('PBS.DataStoreContent', { if (!data || data.leaf || data.root) { return ''; } - if (v === undefined || v === null) { - v = ''; + + let additionalClasses = ""; + if (!v) { + if (!data.expanded) { + v = data['last-comment'] ?? ''; + additionalClasses = "pmx-faded"; + } else { + v = ''; + } } v = Ext.String.htmlEncode(v); let icon = 'x-action-col-icon fa fa-fw fa-pencil pointer'; - return `${v} + return `${v} `; }, listeners: { -- 2.39.2