mirror of https://github.com/apache/cloudstack.git
UI: Better load balancer / multi-edit item naming
Currently, the items listed under the load balancer always use .name as the field to display for the VM name. Since 'instancename' is now used for the user-friendly name field, _itemName metadata attribute can be specified in the rule's data provider to tell which field should be rendered as the name field in the list.
This commit is contained in:
parent
5333ee1549
commit
a1099e34c2
|
|
@ -2078,15 +2078,12 @@
|
|||
});
|
||||
|
||||
$.extend(item, {
|
||||
_itemData: $.map(lbInstances, function(instance) {
|
||||
return $.extend(instance, {
|
||||
name: instance.instancename
|
||||
});
|
||||
}),
|
||||
_itemName: 'instancename',
|
||||
_itemData: lbInstances,
|
||||
_maxLength: {
|
||||
name: 7
|
||||
},
|
||||
sticky: stickyData
|
||||
sticky: stickyData,
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -514,8 +514,9 @@
|
|||
|
||||
itemRow: function(item, itemActions, multiRule, $tbody) {
|
||||
var $tr = $('<tr>');
|
||||
var itemName = multiRule._itemName ? item[multiRule._itemName] : item.name;
|
||||
|
||||
$tr.append($('<td></td>').appendTo($tr).html(_s(item.name)));
|
||||
$tr.append($('<td></td>').appendTo($tr).html(_s(itemName)));
|
||||
|
||||
if (itemActions) {
|
||||
var $itemActions = $('<td>').addClass('actions item-actions');
|
||||
|
|
|
|||
Loading…
Reference in New Issue