limitations under the License.
*/
+function openModalCreatePDU(args) {
+ var select2_groups = $('#pdu_vim_accounts').select2({
+ placeholder: 'Select Vims',
+ width: '100%',
+ ajax: {
+ url: args.vim_list_url,
+ dataType: 'json',
+ processResults: function (data) {
+ vims = [];
+ if (data['datacenters']) {
+ for (d in data['datacenters']) {
+ var datacenter = data['datacenters'][d];
+ vims.push({ id: datacenter['_id'], text: datacenter['name'] })
+ }
+ }
+ return {
+ results: vims
+ };
+ }
+ }
+ });
+
+ $('#modal_new_pdu').modal('show');
+}
function openModalCreateNS(args) {
// load vim account list
if (data['datacenters']) {
for (d in data['datacenters']) {
var datacenter = data['datacenters'][d];
- vims.push({id: datacenter['_id'], text: datacenter['name']})
+ vims.push({ id: datacenter['_id'], text: datacenter['name'] })
}
}
if (data['descriptors']) {
for (d in data['descriptors']) {
var nsd = data['descriptors'][d];
- nsd_list.push({id: nsd['_id'], text: nsd['name']})
+ nsd_list.push({ id: nsd['_id'], text: nsd['name'] })
}
}
}
});
- if(args.descriptor_id){
+ if (args.descriptor_id) {
// Set the value, creating a new option if necessary
if ($('#nsdId').find("option[value='" + args.descriptor_id + "']").length) {
$('#nsdId').val(args.descriptor_id).trigger('change');