ui: ceph warnings: code cleanups

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2023-10-10 08:24:09 +02:00
parent 459b6c3136
commit feb192207a

View File

@ -149,14 +149,18 @@ Ext.define('PVE.node.CephStatus', {
iconCls: 'x-fa fa-files-o', iconCls: 'x-fa fa-files-o',
tooltip: gettext('Copy summary'), tooltip: gettext('Copy summary'),
handler: function(grid, rowindex, colindex, item, e, record) { handler: function(grid, rowindex, colindex, item, e, record) {
navigator.clipboard.writeText(record.data.summary); navigator.clipboard
.writeText(record.data.summary)
.catch(err => Ext.Msg.alert(gettext('Error'), err));
}, },
}, },
{ {
iconCls: 'x-fa fa-clipboard', iconCls: 'x-fa fa-clipboard',
tooltip: gettext('Copy details'), tooltip: gettext('Copy details'),
handler: function(grid, rowindex, colindex, item, e, record) { handler: function(grid, rowindex, colindex, item, e, record) {
navigator.clipboard.writeText(record.data.detail); navigator.clipboard
.writeText(record.data.detail)
.catch(err => Ext.Msg.alert(gettext('Error'), err));
}, },
}, },
], ],
@ -164,10 +168,9 @@ Ext.define('PVE.node.CephStatus', {
], ],
listeners: { listeners: {
itemdblclick: function(view, record, row, rowIdx, e) { itemdblclick: function(view, record, row, rowIdx, e) {
// inspired by RowExpander.js // inspired by Ext.grid.plugin.RowExpander, but for double click
let rowNode = view.getNode(rowIdx);
let rowNode = view.getNode(rowIdx); let let normalRow = Ext.fly(rowNode);
normalRow = Ext.fly(rowNode);
let collapsedCls = view.rowBodyFeature.rowCollapsedCls; let collapsedCls = view.rowBodyFeature.rowCollapsedCls;