From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id C2A8D69321 for ; Thu, 12 Nov 2020 18:39:22 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id AF056136DE for ; Thu, 12 Nov 2020 18:38:52 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 2EB24136D3 for ; Thu, 12 Nov 2020 18:38:52 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id CA4B242335 for ; Thu, 12 Nov 2020 18:38:51 +0100 (CET) To: Proxmox VE development discussion , Dominik Csapak References: <20201112152603.8106-1-d.csapak@proxmox.com> <20201112152603.8106-4-d.csapak@proxmox.com> From: Thomas Lamprecht Message-ID: <9b50e217-9cf8-be8e-5213-4cfa7b09dcc6@proxmox.com> Date: Thu, 12 Nov 2020 18:38:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:83.0) Gecko/20100101 Thunderbird/83.0 MIME-Version: 1.0 In-Reply-To: <20201112152603.8106-4-d.csapak@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL -0.096 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] applied: [PATCH manager 1/1] ui: add comment/verification columns to backup/content grid X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2020 17:39:22 -0000 On 12.11.20 16:26, Dominik Csapak wrote: > verification column only shows in the backup grid and for > pbs storages >=20 > (renderer is mostly copied from proxmox-backup) missing some crucial parts (see below) >=20 > Signed-off-by: Dominik Csapak > --- > www/manager6/grid/BackupView.js | 39 +++++++++++++++++++++++++++++= > www/manager6/storage/ContentView.js | 8 +++++- > 2 files changed, 46 insertions(+), 1 deletion(-) >=20 > diff --git a/www/manager6/grid/BackupView.js b/www/manager6/grid/Backup= View.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 =3D f.getStore().findRecord('storage', value); > + if (storage) { > + let isPbs =3D storage.data.type =3D=3D=3D 'pbs'; > + me.getColumns().forEach((column) =3D> { > + if (column.dataIndex =3D=3D=3D '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 =3D (cls, txt) =3D> ` ${t= xt}`; > + if (v =3D=3D=3D undefined || v =3D=3D=3D null) { > + return i('question-circle-o warning', gettext('None')); > + } > + let tip =3D "" > + let txt =3D gettext('Failed'); > + let iconCls =3D 'times critical'; > + if (v.state =3D=3D=3D 'ok') { > + txt =3D gettext('OK'); > + iconCls =3D 'check good'; > + let now =3D Date.now() / 1000; > + let task =3D Proxmox.Utils.parse_task_upid(v.upid); =2E ^^^~ ununsed > + if (now - v.starttime > 30 * 24 * 60 * 60) { > + tip =3D `Last verify task over 30 days ago: ${verify_time}`; =2E ^= ^^^^^^^^^~ undefined fixed up in followup, adding also the missing tip in the non outdated cas= e. We really need to get pve-manager also eslint ready, as then such mistake= s can get caught easily.