fix #5106: ui: ceph status: make column wrap the summary text on expand

with this the title is now completely visible when the column is
expanded, even if it's originally too narrow.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Fiona Ebner <f.ebner@proxmox.com>
 [TL: fix eslint warning for missing space after comma ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Dominik Csapak 2023-12-07 14:35:58 +01:00 committed by Thomas Lamprecht
parent 7304254a76
commit 6e7cef4923
2 changed files with 20 additions and 0 deletions

View File

@ -750,3 +750,7 @@ table.osds td:first-of-type {
.pmx-tag-tooltip .proxmox-tags-full > span { .pmx-tag-tooltip .proxmox-tags-full > span {
margin: 0px; margin: 0px;
} }
.pmx-column-wrapped > div {
white-space: pre-wrap;
}

View File

@ -82,6 +82,16 @@ Ext.define('PVE.node.CephStatus', {
stateId: 'ceph-status-warnings', stateId: 'ceph-status-warnings',
viewConfig: { viewConfig: {
enableTextSelection: true, enableTextSelection: true,
listeners: {
collapsebody: function(rowNode, record) {
record.set('expanded', false);
record.commit();
},
expandbody: function(rowNode, record) {
record.set('expanded', true);
record.commit();
},
},
}, },
// we load the store manually, to show an emptyText specify an empty intermediate store // we load the store manually, to show an emptyText specify an empty intermediate store
store: { store: {
@ -139,6 +149,12 @@ Ext.define('PVE.node.CephStatus', {
{ {
dataIndex: 'summary', dataIndex: 'summary',
header: gettext('Summary'), header: gettext('Summary'),
renderer: function(value, metaData, record, rI, cI, store, view) {
if (record.get('expanded')) {
metaData.tdCls = 'pmx-column-wrapped';
}
return value;
},
flex: 1, flex: 1,
}, },
{ {