]> git.proxmox.com Git - proxmox-backup.git/blobdiff - www/DataStoreContent.js
ui: DataStoreContent: improve encrypted column
[proxmox-backup.git] / www / DataStoreContent.js
index 62e57817587adf5741b367a358826f25a6d7ab04..21623020d07915e9cf685e1e1878ee538d8320f5 100644 (file)
@@ -10,6 +10,7 @@ Ext.define('pbs-data-store-snapshots', {
        },
        'files',
        'owner',
+       'verification',
        { name: 'size', type: 'int', allowNull: true, },
        {
            name: 'crypt-mode',
@@ -29,8 +30,8 @@ Ext.define('pbs-data-store-snapshots', {
                    let mode = PBS.Utils.cryptmap.indexOf(file['crypt-mode']);
                    if (mode !== -1) {
                        crypt[file['crypt-mode']]++;
+                       crypt.count++;
                    }
-                   crypt.count++;
                });
 
                return PBS.Utils.calculateCryptMode(crypt);
@@ -209,6 +210,10 @@ Ext.define('PBS.DataStoreContent', {
                        group.size = item.size;
                        group.owner = item.owner;
                    }
+                   if (item.verification &&
+                      (!group.verification || group.verification.state !== 'failed')) {
+                       group.verification = item.verification;
+                   }
 
                }
                group.count = group.children.length;
@@ -563,6 +568,41 @@ Ext.define('PBS.DataStoreContent', {
                return (iconTxt + PBS.Utils.cryptText[v]) || Proxmox.Utils.unknownText
            }
        },
+       {
+           header: gettext('Verify State'),
+           sortable: true,
+           dataIndex: 'verification',
+           renderer: (v, meta, record) => {
+               if (v === undefined || v === null || !v.state) {
+                   //meta.tdCls = "x-grid-row-loading";
+                   return record.data.leaf ? '' : gettext('None');
+               }
+               let task = Proxmox.Utils.parse_task_upid(v.upid);
+               let verify_time = Proxmox.Utils.render_timestamp(task.starttime);
+               let iconCls = v.state === 'ok' ? 'check good' : 'times critical';
+               let tip = `Verify task started on ${verify_time}`;
+               if (record.parentNode.id === 'root') {
+                   tip = v.state === 'ok'
+                       ? 'All verification OK in backup group'
+                       : 'At least one failed verification in backup group!';
+               }
+               return `<span data-qtip="${tip}">
+                   <i class="fa fa-fw fa-${iconCls}"></i> ${v.state}
+               </span>`;
+           },
+           listeners: {
+               dblclick: function(view, el, row, col, ev, rec) {
+                   let data = rec.data || {};
+                   let verify = data.verification;
+                   if (verify && verify.upid && rec.parentNode.id !== 'root') {
+                       let win = Ext.create('Proxmox.window.TaskViewer', {
+                           upid: verify.upid,
+                       });
+                       win.show();
+                   }
+               },
+           },
+       },
     ],
 
     tbar: [