1 {% extends
"project_descriptors.html" %}
7 <link rel=
"stylesheet" href=
"/static/bower_components/select2/dist/css/select2.min.css">
10 {% block title_header_big %}
12 {% if descriptor_type %}
13 {{ descriptor_type|upper }}
19 {% block left_sidebar %}
20 {% include 'osm/osm_project_left_sidebar.html' %}
23 {% block breadcrumb_body %}
25 <li><a href=
"{% url 'projects:open_project' project_id=project_id %}">{{project_overview_data.name}}
</a></li>
26 <li><a> {% if descriptor_type %}
30 {% endif %} Packages
</a></li>
34 {% block content_body %}
36 {% include 'osm/modal/files_list.html' %}
37 {% include 'modal/instance_create.html' %}
39 {% include
"osm/descriptor/descriptorlist.html" %}
46 {% block resource_block %}
48 <script src=
"/static/bower_components/select2/dist/js/select2.js"></script>
50 function deletePackage(project_id, descriptor_type, package_id) {
51 bootbox.confirm(
"Are you sure want to delete?", function (result) {
53 location.href = '/projects/' + project_id + '/descriptors/' + descriptor_type + '/' + package_id + '/delete'
58 function openModalCreateNS(project_id, descriptor_type, descriptor_id) {
59 select2_groups = $('#vimAccountId').select2({
60 placeholder: 'Select VIM',
62 url: '{% url
"vim:list" %}',
64 processResults: function (data) {
66 if (data['datacenters']){
67 for(d in data['datacenters']){
68 var datacenter = data['datacenters'][d];
69 vims.push({id: datacenter['_id'], text: datacenter['name']})
79 $('#nsdId').val(descriptor_id);
80 $('#modal_new_instance').modal('show');
83 function openPackageContentList(project_id, type, pkg_id) {
84 var dialog = bootbox.dialog({
85 message: '
<div class=
"text-center"><i class=
"fa fa-spin fa-spinner"></i> Loading...
</div>',
89 url: '/projects/' + project_id + '/descriptors/' + type + '/' + pkg_id + '/action/get_package_files_list',
92 contentType:
"application/json;charset=utf-8",
93 success: function (result) {
94 //$('#modal_show_vim_body').empty();
97 build_file_list(
"Files in " + pkg_id, result.files);
99 error: function (result) {
100 dialog.modal('hide');
101 bootbox.alert(
"An error occurred while retrieving the package content.");
107 function build_file_list(title, list) {
108 $('#files_list_tbody').find('tr:gt(
0)').remove();
109 $('#files_list_tbody_title').text(title)
110 for (var i in list) {
111 var template = '
<tr><td>-
</td><td>' + list[i] + '
</td><td><button type=
"button" class=
"btn btn-default" onclick=
"" disabled
><i class=
"fa fa-folder-open"></i></button></td></tr>'
112 $('#files_list_tbody').append(template)
114 $('#modal_files_list').modal('show');
120 {% include
"footer.html" %}