Finish code for deleting private application

Also fixed adding from dockerhub searches not taking you back to apps
tab when clicking done
pull/2/head
Squidly271 2017-10-22 10:00:25 -04:00
parent 5cb416bcb3
commit 8875ea3893
3 changed files with 30 additions and 8 deletions

View File

@ -954,7 +954,7 @@ function dockerConvert(dockerID) {
$.post(URL,{action:'convert_docker',ID:dockerID},function(data) {
if (data) {
myCloseAlert();
templateURL = "AddContainer?xmlTemplate=default:" + myTrim(data);
templateURL = "Apps/AddContainer?xmlTemplate=default:" + myTrim(data);
window.open(templateURL,"<?=$tabMode?>");
$("#Total").html(totalDisplayed);
}
@ -1064,12 +1064,12 @@ function uninstallApp(application,humanName) {
},
function() {
swal("Uninstalling "+humanName,"","info");
$.post(URL,{action:'uninstall_application',application:application}, function(data) {
if (data) {
swal("","Uninstalled","success");
previousApps("InstalledApps",true);
}
});
$.post(URL,{action:'uninstall_application',application:application}, function(data) {
if (data) {
swal("","Uninstalled","success");
previousApps("InstalledApps",true);
}
});
});
}
}
@ -1087,6 +1087,15 @@ function deletePrivateApp(path,name,author) {
closeOnConfirm: false,
showLoaderOnConfirm: true,
html: true
},
function() {
swal("Removing "+name,"","info");
$.post(URL,{action:'removePrivateApp',path:path},function(data) {
if (data) {
swal("","Removed","success");
location.reload();
}
});
});
}

View File

@ -596,7 +596,7 @@ function my_display_apps($viewMode,$file,$pageNumber=1,$officialFlag=false,$sele
}
} else {
if ( $template['Private'] == "true" ) {
$template['display_Uninstall'] = "<img class='ca_tooltip' src='{$communityPaths['deleteIcon']}' title='Remove Private Application' style='width:20px;height:20px;cursor:pointer' onclick='deletePrivateApp(&quot;{$template['Path']}&quot;,&quot;{$template['SortName']}&quot;,&quot;{$template['Author']}&quot;);'>";
$template['display_Uninstall'] = "<img class='ca_tooltip' src='{$communityPaths['deleteIcon']}' title='Remove Private Application' style='width:20px;height:20px;cursor:pointer' onclick='deletePrivateApp(&quot;{$template['Path']}&quot;,&quot;{$template['SortName']}&quot;,&quot;{$template['SortAuthor']}&quot;);'>";
}
}
$template['display_removable'] = $template['Removable'] ? "<img class='ca_tooltip' src='{$communityPaths['deleteIcon']}' title='Remove Application From List' style='width:20px;height:20px;cursor:pointer' onclick='removeApp(&quot;".$template['MyPath']."&quot;,&quot;".$template['Name']."&quot;);'>" : "";
@ -2037,5 +2037,18 @@ case 'checkStale':
echo "false";
}
break;
#######################################
# #
# Removes a private app from the list #
# #
#######################################
case 'removePrivateApp':
$path = getPost("path",false);
if ( path ) {
@unlink($path);
}
echo "done";
break;
}
?>