all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH backup 2/2] ui: datastore content: show last verify result from a snapshot
Date: Tue, 25 Aug 2020 17:30:28 +0200	[thread overview]
Message-ID: <20200825153028.22466-2-t.lamprecht@proxmox.com> (raw)
In-Reply-To: <20200825153028.22466-1-t.lamprecht@proxmox.com>

Double-click on the verify grid-cell of a specific snapshot (not the
group) opens the relevant task log.

The date of the last verify is shown as tool-tip.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
---

The double-click to open the last verify task log of a snapshot could be more
intuitive if it was a full blown button, or action button - as now one needs to
know/guess that they can double-click that field. Could be definitively
improved.

 www/DataStoreContent.js | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/www/DataStoreContent.js b/www/DataStoreContent.js
index 62e57817..6a5cec0e 100644
--- a/www/DataStoreContent.js
+++ b/www/DataStoreContent.js
@@ -10,6 +10,7 @@ Ext.define('pbs-data-store-snapshots', {
 	},
 	'files',
 	'owner',
+	'verification',
 	{ name: 'size', type: 'int', allowNull: true, },
 	{
 	    name: 'crypt-mode',
@@ -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: [
-- 
2.27.0





  reply	other threads:[~2020-08-25 15:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-25 15:30 [pbs-devel] [PATCH backup 1/2] save last verify result in snapshot manifest Thomas Lamprecht
2020-08-25 15:30 ` Thomas Lamprecht [this message]
2020-08-26  4:30 ` Dietmar Maurer
2020-08-26  6:15   ` Thomas Lamprecht
2020-08-26  5:37 ` [pbs-devel] applied: " Dietmar Maurer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200825153028.22466-2-t.lamprecht@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal