public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Dominik Csapak <d.csapak@proxmox.com>
Subject: [pve-devel] applied: [PATCH manager 1/1] ui: add comment/verification columns to backup/content grid
Date: Thu, 12 Nov 2020 18:38:51 +0100	[thread overview]
Message-ID: <9b50e217-9cf8-be8e-5213-4cfa7b09dcc6@proxmox.com> (raw)
In-Reply-To: <20201112152603.8106-4-d.csapak@proxmox.com>

On 12.11.20 16:26, Dominik Csapak wrote:
> verification column only shows in the backup grid and for
> pbs storages
> 
> (renderer is mostly copied from proxmox-backup)

missing some crucial parts (see below)

> 
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>  www/manager6/grid/BackupView.js     | 39 +++++++++++++++++++++++++++++
>  www/manager6/storage/ContentView.js |  8 +++++-
>  2 files changed, 46 insertions(+), 1 deletion(-)
> 
> diff --git a/www/manager6/grid/BackupView.js b/www/manager6/grid/BackupView.js
> index ff8d69ec..a9c6be5e 100644
> --- a/www/manager6/grid/BackupView.js
> +++ b/www/manager6/grid/BackupView.js
> @@ -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,
> +		},

re-ordered that column as second, like PBS does it.

> +		{
> +		    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);

.                           ^^^~ ununsed

> +			    if (now - v.starttime > 30 * 24 * 60 * 60) {
> +				tip = `Last verify task over 30 days ago: ${verify_time}`;

.                                                                     ^^^^^^^^^^~ undefined

fixed up in followup, adding also the missing tip in the non outdated case.

We really need to get pve-manager also eslint ready, as then such mistakes
can get caught easily.





      reply	other threads:[~2020-11-12 17:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-12 15:26 [pve-devel] [PATCH storage/manager] show comment/verification info for backups Dominik Csapak
2020-11-12 15:26 ` [pve-devel] [PATCH storage 1/2] api2/storage/content: add comment and verification fields to content listing Dominik Csapak
2020-11-12 16:42   ` [pve-devel] applied: " Thomas Lamprecht
2020-11-12 15:26 ` [pve-devel] [PATCH storage 2/2] Storage/Plugin: read .comment files for comments Dominik Csapak
2020-11-12 16:50   ` Thomas Lamprecht
2020-11-12 15:26 ` [pve-devel] [PATCH manager 1/1] ui: add comment/verification columns to backup/content grid Dominik Csapak
2020-11-12 17:38   ` Thomas Lamprecht [this message]

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=9b50e217-9cf8-be8e-5213-4cfa7b09dcc6@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=d.csapak@proxmox.com \
    --cc=pve-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal