]> git.proxmox.com Git - proxmox-backup.git/commitdiff
fix #4260: ui: fallback to note of last snapshot for backup group comment
authorPhilipp Hufnagl <p.hufnagl@proxmox.com>
Fri, 13 Oct 2023 14:37:55 +0000 (16:37 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 13 Oct 2023 14:58:06 +0000 (16:58 +0200)
When there is no comment for a backup group, the comment of the last
(most recent) snapshot in this group will be shown as dimmed text, as
long as the back group is collapsed.

Signed-off-by: Philipp Hufnagl <p.hufnagl@proxmox.com>
www/css/ext6-pbs.css
www/datastore/Content.js

index 5fd65d258368b77f430c0e4b1f5c3e4a95449174..95a655cf15b3441158d8db85095600b2928d689b 100644 (file)
@@ -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;
 }
index 9fc07d49f61478c82498424c937267106adafeda..6006201cdea1f47d24989ce53df14ea0970cd636 100644 (file)
@@ -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 `<span class="snapshot-comment-column">${v}</span>
+               return `<span class="snapshot-comment-column ${additionalClasses}">${v}</span>
                    <i data-qtip="${gettext('Edit')}" style="float: right; margin: 0px;" class="${icon}"></i>`;
            },
            listeners: {