| lombardof | dd73c0c | 2018-05-09 10:46:49 +0200 | [diff] [blame^] | 1 | /* |
| 2 | Copyright 2018 CNIT - Consorzio Nazionale Interuniversitario per le Telecomunicazioni |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | |
| 18 | function openModalCreateNS(args) { |
| 19 | |
| 20 | // load vim account list |
| 21 | select2_groups = $('#vimAccountId').select2({ |
| 22 | placeholder: 'Select VIM', |
| 23 | ajax: { |
| 24 | url: args.vim_list_url, |
| 25 | dataType: 'json', |
| 26 | processResults: function (data) { |
| 27 | vims = []; |
| 28 | if (data['datacenters']) { |
| 29 | for (d in data['datacenters']) { |
| 30 | var datacenter = data['datacenters'][d]; |
| 31 | vims.push({id: datacenter['_id'], text: datacenter['name']}) |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | return { |
| 36 | results: vims |
| 37 | }; |
| 38 | } |
| 39 | } |
| 40 | }); |
| 41 | /* |
| 42 | // load nsd list |
| 43 | select2_groups = $('#nsdId').select2({ |
| 44 | placeholder: 'Select NSD', |
| 45 | ajax: { |
| 46 | url: args.nsd_list_url, |
| 47 | dataType: 'json', |
| 48 | processResults: function (data) { |
| 49 | nsd_list = []; |
| 50 | if (data['nsd_list']) { |
| 51 | for (d in data['nsd_list']) { |
| 52 | var nsd = data['nsd_list'][d]; |
| 53 | nsd_list.push({id: nsd['_id'], text: nsd['name']}) |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | return { |
| 58 | results: nsd_list |
| 59 | }; |
| 60 | } |
| 61 | } |
| 62 | }); |
| 63 | */ |
| 64 | $('#nsdId').val(args.descriptor_id); |
| 65 | $('#modal_new_instance').modal('show'); |
| 66 | } |