[pve-devel] [RFC PATCH manager] ui: render 'protected' column as icon and enable sorting
Dominik Csapak
d.csapak at proxmox.com
Tue Nov 16 12:20:36 CET 2021
instead of 'Yes' and 'No', render the same icon as in pbs for protected
backups, and leave the column empty otherwise
this makes the difference much more visible and is more consistent with
how we present that flag in pbs
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
i initially wanted to add it to the text, but that seemed a bit weird.
i'd let people convince me though, if there is a strong argument..
www/manager6/grid/BackupView.js | 3 ++-
www/manager6/storage/ContentView.js | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/www/manager6/grid/BackupView.js b/www/manager6/grid/BackupView.js
index fdc385a8..eb023d08 100644
--- a/www/manager6/grid/BackupView.js
+++ b/www/manager6/grid/BackupView.js
@@ -344,7 +344,8 @@ Ext.define('PVE.grid.BackupView', {
{
header: gettext('Protected'),
width: 100,
- renderer: Proxmox.Utils.format_boolean,
+ renderer: (value) => value ? '<i class="fa fa-shield"></i>' : '',
+ sorter: (a, b) => (b.data.protected || 0) - (a.data.protected || 0),
dataIndex: 'protected',
},
{
diff --git a/www/manager6/storage/ContentView.js b/www/manager6/storage/ContentView.js
index efbd209d..6080baea 100644
--- a/www/manager6/storage/ContentView.js
+++ b/www/manager6/storage/ContentView.js
@@ -163,7 +163,8 @@ Ext.define('PVE.storage.ContentView', {
'protected': {
header: gettext('Protected'),
width: 100,
- renderer: Proxmox.Utils.format_boolean,
+ renderer: (value) => value ? '<i class="fa fa-shield"></i>' : '',
+ sorter: (a, b) => (b.data.protected || 0) - (a.data.protected || 0),
dataIndex: 'protected',
},
'date': {
--
2.30.2
More information about the pve-devel
mailing list