]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: add comment/verification columns to backup/content grid
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 12 Nov 2020 15:26:03 +0000 (16:26 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 12 Nov 2020 17:14:53 +0000 (18:14 +0100)
verification column only shows in the backup grid and for
pbs storages

(renderer is mostly copied from proxmox-backup)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/grid/BackupView.js
www/manager6/storage/ContentView.js

index ff8d69ec9599f56a65c4dab87a0a21b65f02f684..a9c6be5ea22ac0009e48913eff504ffde4bfce67 100644 (file)
@@ -99,6 +99,15 @@ Ext.define('PVE.grid.BackupView', {
            allowBlank: false,
            listeners: {
                change: function(f, value) {
+                   let storage = f.getStore().findRecord('storage', value);
+                   if (storage) {
+                       let isPbs = storage.data.type === 'pbs';
+                       me.getColumns().forEach((column) => {
+                           if (column.dataIndex === 'verification') {
+                               column.setHidden(!isPbs);
+                           }
+                       });
+                   }
                    setStorage(value);
                }
            }
@@ -251,6 +260,36 @@ Ext.define('PVE.grid.BackupView', {
                    dataIndex: 'vmid',
                    hidden: true,
                },
+               {
+                   header: gettext('Comment'),
+                   dataIndex: 'comment',
+                   width: 100,
+                   renderer: Ext.htmlEncode,
+               },
+               {
+                   header: gettext('Verify State'),
+                   dataIndex: 'verification',
+                   renderer: function(v) {
+                       let i = (cls, txt) => `<i class="fa fa-fw fa-${cls}"></i> ${txt}`;
+                       if (v === undefined || v === null) {
+                           return i('question-circle-o warning', gettext('None'));
+                       }
+                       let tip = ""
+                       let txt = gettext('Failed');
+                       let iconCls = 'times critical';
+                       if (v.state === 'ok') {
+                           txt = gettext('OK');
+                           iconCls = 'check good';
+                           let now = Date.now() / 1000;
+                           let task = Proxmox.Utils.parse_task_upid(v.upid);
+                           if (now - v.starttime > 30 * 24 * 60 * 60) {
+                               tip = `Last verify task over 30 days ago: ${verify_time}`;
+                               iconCls = 'check warning';
+                           }
+                       }
+                       return `<span data-qtip="${tip}"> ${i(iconCls, txt)} </span>`;
+                   }
+               }
            ]
        });
 
index 194ad42eec40bb874bd8c5df4511c9a6ddcb5140..6b30167aa6ebab62a82a2dcae3e26b440ee4086e 100644 (file)
@@ -609,6 +609,12 @@ Ext.define('PVE.storage.ContentView', {
                    width: 100,
                    renderer: Proxmox.Utils.format_size,
                    dataIndex: 'size'
+               },
+               {
+                   header: gettext('Comment'),
+                   width: 100,
+                   renderer: Ext.htmlEncode,
+                   dataIndex: 'comment',
                }
            ],
            listeners: {
@@ -655,7 +661,7 @@ Ext.define('PVE.storage.ContentView', {
        extend: 'Ext.data.Model',
        fields: [
            'volid', 'content', 'format', 'size', 'used', 'vmid',
-           'channel', 'id', 'lun',
+           'channel', 'id', 'lun', 'comment', 'verification',
            {
                name: 'text',
                convert: function(value, record) {