Tier LB rules: Add load balancing multi-edit

This commit is contained in:
Brian Federle 2013-05-15 14:28:41 -07:00
parent f985e11c28
commit a4fc86ece9
1 changed files with 116 additions and 0 deletions

View File

@ -297,6 +297,7 @@
// Internal load balancers
tierLoadBalancers: {
listView: {
id: 'ipAddresses',
fields: {
ipaddress: { label: 'label.ip.address' },
type: { label: 'label.type' }
@ -349,6 +350,121 @@
}
}
}
},
detailView: {
isMaximized: true,
tabs: {
loadBalancing: {
title: 'label.load.balancing',
custom: function(args) {
var context = args.context;
var $multi = $('<div>').addClass('loadBalancer');
$multi.multiEdit({
context: context,
listView: $.extend(true, {}, cloudStack.sections.instances, {
listView: {
fields: {
name: { label: 'label.name' },
displayname: { label: 'label.display.name' },
zonename: { label: 'label.zone.name' },
state: {
label: 'label.state',
indicator: {
'Running': 'on',
'Stopped': 'off',
'Destroyed': 'off',
'Error': 'off'
}
}
},
filters: false,
dataProvider: function(args) {
args.response.success({ data: [] });
}
}
}),
multipleAdd: true,
fields: {
'name': { edit: true, label: 'label.name', isEditable: true },
'publicport': { edit: true, label: 'label.public.port' },
'privateport': { edit: true, label: 'label.private.port' },
'algorithm': {
label: 'label.algorithm',
isEditable: true,
select: function(args) {
args.response.success({
data: [
{ id: 'roundrobin', name: 'roundrobin', description: _l('label.round.robin') },
{ id: 'leastconn', name: 'leastconn', description: _l('label.least.connections') },
{ id: 'source', name: 'source', description: _l('label.source') }
]
});
}
},
'sticky': {
label: 'label.stickiness',
custom: {
buttonLabel: 'label.configure',
action: cloudStack.lbStickyPolicy.dialog()
}
},
'add-vm': {
label: 'label.add.vms',
addButton: true
}
},
tags: cloudStack.api.tags({ resourceType: 'LoadBalancer', contextId: 'multiRule' }),
add: {
label: 'label.add.vms',
action: function(args) {
args.response.success();
}
},
actions: {
edit: {
label: 'label.edit',
action: function(args) {
args.response.success();
}
},
destroy: {
label: 'label.action.delete.load.balancer',
action: function(args) {
args.response.success();
}
}
},
itemActions: {
add: {
label: 'label.add.vms.to.lb',
action: function(args) {
args.response.success();
}
},
destroy: {
label: 'label.remove.vm.from.lb',
action: function(args) {
args.response.success();
}
}
},
dataProvider: function(args) {
args.respons.success({ data: [] });
}
});
return $multi;
}
}
}
}
}
},