From: Dominik Csapak Date: Thu, 12 Nov 2020 15:26:03 +0000 (+0100) Subject: ui: add comment/verification columns to backup/content grid X-Git-Url: https://git.proxmox.com/?p=pve-manager.git;a=commitdiff_plain;h=957a53bd6116fd7177ec39532ea9bd34d8735fec ui: add comment/verification columns to backup/content grid verification column only shows in the backup grid and for pbs storages (renderer is mostly copied from proxmox-backup) Signed-off-by: Dominik Csapak --- 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, + }, + { + header: gettext('Verify State'), + dataIndex: 'verification', + renderer: function(v) { + let i = (cls, txt) => ` ${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 ` ${i(iconCls, txt)} `; + } + } ] }); diff --git a/www/manager6/storage/ContentView.js b/www/manager6/storage/ContentView.js index 194ad42e..6b30167a 100644 --- a/www/manager6/storage/ContentView.js +++ b/www/manager6/storage/ContentView.js @@ -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) {