[pve-devel] [PATCH widget-toolkit] grid/DiskList: restore info about ceph
Dominik Csapak
d.csapak at proxmox.com
Wed Nov 25 16:37:07 CET 2020
previously we printed this ceph info, but it got lost during
refactoring to widget-toolkit, restore a slightly modified
version of the code
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
src/grid/DiskList.js | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/src/grid/DiskList.js b/src/grid/DiskList.js
index 4d8ef1b..54f58f8 100644
--- a/src/grid/DiskList.js
+++ b/src/grid/DiskList.js
@@ -3,7 +3,7 @@ Ext.define('pmx-disk-list', {
fields: [
'devpath', 'used',
{ name: 'size', type: 'number' },
- { name: 'osdid', type: 'number' },
+ { name: 'osdid', type: 'number', defaultValue: -1 },
{
name: 'status',
convert: function(value, rec) {
@@ -169,7 +169,28 @@ Ext.define('Proxmox.DiskList', {
header: gettext('Usage'),
width: 150,
sortable: false,
- renderer: v => v || Proxmox.Utils.noText,
+ renderer: function(v, metaData, rec) {
+ let extendedInfo = ' ';
+ if (rec) {
+ let types = [];
+ if (rec.data.osdid !== undefined && rec.data.osdid >= 0) {
+ types.push(`OSD.${rec.data.osdid.toString()}`);
+ }
+ if (rec.data.journals > 0) {
+ types.push('Journal');
+ }
+ if (rec.data.db > 0) {
+ types.push('DB');
+ }
+ if (rec.data.wal > 0) {
+ types.push('WAL');
+ }
+ if (types.length > 0) {
+ extendedInfo = `, Ceph (${types.join(', ')})`;
+ }
+ }
+ return v ? `${v}${extendedInfo}` : Proxmox.Utils.noText;
+ },
dataIndex: 'used',
},
{
--
2.20.1
More information about the pve-devel
mailing list