ui: factor out not found rendering to common helper

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2023-01-21 14:30:54 +01:00
parent 8686ba103f
commit 04389e49d6
7 changed files with 9 additions and 7 deletions

View File

@ -393,6 +393,8 @@ Ext.define('PVE.Utils', {
'efidisk but no OMVF BIOS': gettext('EFI Disk without OMVF BIOS'),
},
renderNotFound: what => Ext.String.format(gettext("No {0} found"), what),
get_kvm_osinfo: function(value) {
var info = { base: 'Other' }; // default
if (value) {

View File

@ -86,7 +86,7 @@ Ext.define('PVE.node.LVMList', {
},
},
emptyText: gettext('No Volume Groups found'),
emptyText: PVE.Utils.renderNotFound('VGs'),
stateful: true,
stateId: 'grid-node-lvm',

View File

@ -91,7 +91,7 @@ Ext.define('PVE.node.LVMThinList', {
},
},
emptyText: gettext('No thinpools found'),
emptyText: PVE.Utils.renderNotFound('Thin-Pool'),
stateful: true,
stateId: 'grid-node-lvmthin',

View File

@ -16,7 +16,7 @@ Ext.define('PVE.storage.IScsiScan', {
flex: 1,
},
],
emptyText: gettext('No iSCSI target found'),
emptyText: PVE.Utils.renderNotFound(gettext('iSCSI Target')),
},
config: {

View File

@ -13,7 +13,7 @@ Ext.define('PVE.storage.VgSelector', {
flex: 1,
},
],
emptyText: gettext('No volume groups found'),
emptyText: PVE.Utils.renderNotFound('VGs'),
},
config: {
@ -130,7 +130,7 @@ Ext.define('PVE.storage.LunSelector', {
},
],
},
emptyText: me.listConfig?.emptyText ?? gettext('Nothing found'),
emptyText: me.listConfig?.emptyText ?? PVE.Utils.renderNotFound(gettext('Volume')),
});
}

View File

@ -9,7 +9,7 @@ Ext.define('PVE.storage.TPoolSelector', {
allowBlank: false,
listConfig: {
emptyText: gettext("No thinpool found"),
emptyText: PVE.Utils.renderNotFound('Thin-Pool'),
columns: [
{
dataIndex: 'lv',

View File

@ -14,7 +14,7 @@ Ext.define('PVE.storage.ZFSPoolSelector', {
flex: 1,
},
],
emptyText: gettext('No ZFS Pools found'),
emptyText: PVE.Utils.renderNotFound(gettext('ZFS Pool')),
},
config: {