d6ee9373297337fa90b597755b5496ea86fa9ad0
1 function deletePackage(descriptor_type
, package_id
) {
2 var dialog
= bootbox
.dialog({
3 message
: '<div class="text-center"><i class="fa fa-spin fa-spinner"></i> Loading...</div>',
6 bootbox
.confirm("Are you sure want to delete?", function (result
) {
10 url
: '/projects/descriptors/' + descriptor_type
+ '/' + package_id
+ '/delete',
13 contentType
: "application/json;charset=utf-8",
14 success: function (result
) {
18 error: function (result
) {
20 bootbox
.alert("An error occurred.");
28 function openPackageContentList(type
, pkg_id
) {
29 var dialog
= bootbox
.dialog({
30 message
: '<div class="text-center"><i class="fa fa-spin fa-spinner"></i> Loading...</div>',
34 url
: '/projects/descriptors/' + type
+ '/' + pkg_id
+ '/action/get_package_files_list',
37 contentType
: "application/json;charset=utf-8",
38 success: function (result
) {
39 //$('#modal_show_vim_body').empty();
41 build_file_list("Files in " + pkg_id
, result
.files
);
43 error: function (result
) {
45 bootbox
.alert("An error occurred while retrieving the package content.");
51 function build_file_list(title
, list
) {
52 $('#files_list_tbody').find('tr:gt(0)').remove();
53 $('#files_list_tbody_title').text(title
)
55 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>'
56 $('#files_list_tbody').append(template
)
58 $('#modal_files_list').modal('show');