diff --git a/archive/community.applications-2023.04.07-x86_64-1.txz b/archive/community.applications-2023.04.07-x86_64-1.txz index 1041dbdc..2b1a9cfc 100644 Binary files a/archive/community.applications-2023.04.07-x86_64-1.txz and b/archive/community.applications-2023.04.07-x86_64-1.txz differ diff --git a/source/community.applications/usr/local/emhttp/plugins/community.applications/Apps.page b/source/community.applications/usr/local/emhttp/plugins/community.applications/Apps.page index d3efc591..0502f15c 100644 --- a/source/community.applications/usr/local/emhttp/plugins/community.applications/Apps.page +++ b/source/community.applications/usr/local/emhttp/plugins/community.applications/Apps.page @@ -679,7 +679,6 @@ $(function(){ openBox('/plugins//scripts/checkForUpdates.sh',tr('Check For Updates'),600,1100,true,"postCheckForUpdates"); }); - $(".multi_installButton").click(function() { if ( $(".multi_installButton").hasClass("actionCenter") ) { updateMulti(); @@ -1159,7 +1158,6 @@ function awesompleteSearch() { } } - function openNewWindow(newURL,target='_self') { saveState(); var popUp = window.open(newURL,target); @@ -1193,27 +1191,43 @@ function closeSidebar(cookie=false,visible=false) { } function installPlugin(pluginURL,update=false,comment="",requires="") { - if ( update && requires ) { - post({action:"checkRequirements",requires:requires},function(data) { - if (! data.met) { - swal({ - title: "", - text: "", - allowOutsideClick: false, - showConfirmButton: true, - showCancelButton: false, - confirmButtonText: "", - type: "error" - },function(isConfirm) { - enableSearch(); + post({action:"checkPluginInProgress"},function(data) { + if (data.inProgress) { + swal({ + title: "", + text: "", + allowOutsideClick: false, + showConfirmButton: true, + showCancelButton: false, + confirmButtonText: "", + type: "error" + },function(isConfirm) { + enableSearch(); + }); + } else { + if ( update && requires ) { + post({action:"checkRequirements",requires:requires},function(data) { + if (! data.met) { + swal({ + title: "", + text: "", + allowOutsideClick: false, + showConfirmButton: true, + showCancelButton: false, + confirmButtonText: "", + type: "error" + },function(isConfirm) { + enableSearch(); + }); + } else { + actuallyInstallPlugin(pluginURL,update,comment); + } }); } else { actuallyInstallPlugin(pluginURL,update,comment); } - }); - } else { - actuallyInstallPlugin(pluginURL,update,comment); - } + } + }); } function actuallyInstallPlugin(pluginURL,update=false,comment="") { type = update ? "update" : "install"; @@ -1275,7 +1289,6 @@ function actuallyInstallPlugin(pluginURL,update=false,comment="") { } ca_openPlugin('plugin '+type+' '+pluginURL,title,'',postFunction); - openBox('/plugins/community.applications/scripts/pluginInstall.php&arg1='+type+'&arg2='+pluginURL,title,600,900,true,postFunction); @@ -1311,7 +1324,6 @@ function hideLanguagePending(language) { }); } - function OpenSidebarAndRefreshDisplay() { post({action:"onStartupScreen"},function(result) { if (result.status) { @@ -1473,30 +1485,45 @@ function removeApp(application, humanName) { function uninstallApp(application,humanName) { closeSidebar(); -// disableSearch(); - swal({ - title: "", - text: sprintf(tr("Are you sure you want to uninstall %s?"),""+humanName+""), - type: "warning", - showCancelButton: true, - showConfirmButton: true, - cancelButtonText: "", - confirmButtonText: "", - closeOnConfirm: true, - showLoaderOnConfirm: false, - allowOutsideClick: true, - html: true - }, function(isConfirm) { - if (isConfirm) { - application = application.basename(); - hidePluginPending(application); - - ca_openPlugin('plugin remove '+application,"",'','postUninstallPlugin'); - - openBox('/plugins/community.applications/scripts/pluginInstall.php&arg1=remove&arg2='+application,"",600,900,true,"postUninstallPlugin"); - + post({action:"checkPluginInProgress"},function(data) { + if (data.inProgress) { + swal({ + title: "", + text: "", + allowOutsideClick: false, + showConfirmButton: true, + showCancelButton: false, + confirmButtonText: "", + type: "error" + },function(isConfirm) { + enableSearch(); + }); } else { - enableSearch(); + swal({ + title: "", + text: sprintf(tr("Are you sure you want to uninstall %s?"),""+humanName+""), + type: "warning", + showCancelButton: true, + showConfirmButton: true, + cancelButtonText: "", + confirmButtonText: "", + closeOnConfirm: true, + showLoaderOnConfirm: false, + allowOutsideClick: true, + html: true + }, function(isConfirm) { + if (isConfirm) { + application = application.basename(); + hidePluginPending(application); + + ca_openPlugin('plugin remove '+application,"",'','postUninstallPlugin'); + + openBox('/plugins/community.applications/scripts/pluginInstall.php&arg1=remove&arg2='+application,"",600,900,true,"postUninstallPlugin"); + + } else { + enableSearch(); + } + }); } }); } diff --git a/source/community.applications/usr/local/emhttp/plugins/community.applications/ca.md5 b/source/community.applications/usr/local/emhttp/plugins/community.applications/ca.md5 index b7f49ce8..afb7a1e9 100644 --- a/source/community.applications/usr/local/emhttp/plugins/community.applications/ca.md5 +++ b/source/community.applications/usr/local/emhttp/plugins/community.applications/ca.md5 @@ -1,8 +1,8 @@ -2649a8917a0518c2531310ae1fab21d8 ./Apps.page +f46a879703bf0c5bc2df1d9e644d4779 ./Apps.page 106b521c1feebda4d7b3f558cc016cda ./CA_notices.page eb1f0ee4148747c0473e73e4e973994f ./ca_settings.page e8d29607ec792ddf9f6832b10ee70fdc ./default.cfg -abd3f1c7896cd807acd78bad94115bcb ./include/exec.php +f08af697fd10fc424f29437b655d735f ./include/exec.php 6a2cd1927d391aff2345233a514d7a87 ./include/helpers.php 8e053d6cd83fbe2202c13b692beabb4f ./include/paths.php 532fffdf939594c143e679da02bd841e ./javascript/libraries.js diff --git a/source/community.applications/usr/local/emhttp/plugins/community.applications/include/exec.php b/source/community.applications/usr/local/emhttp/plugins/community.applications/include/exec.php index 46694d39..803fdb61 100644 --- a/source/community.applications/usr/local/emhttp/plugins/community.applications/include/exec.php +++ b/source/community.applications/usr/local/emhttp/plugins/community.applications/include/exec.php @@ -195,8 +195,8 @@ switch ($_POST['action']) { case 'downloadStatistics': downloadStatistics(); break; - case 'batman': - touch("/boot/config/plugins/community.applications/IamBatman"); + case 'checkPluginInProgress': + checkPluginInProgress(); break; ############################################### # Return an error if the action doesn't exist # @@ -2523,6 +2523,18 @@ function downloadStatistics() { download_json($caPaths['statisticsURL'],$caPaths['statistics']); } +########################################################################### +# Checks to see if a plugin installation or update is already in progress # +########################################################################### +function checkPluginInProgress() { + global $caPaths; + + $pluginsPending = glob("{$caPaths['pluginPending']}/*"); + + postReturn(['inProgress'=>empty($pluginsPending)? "" : "true"]); +} + + ####################################### # Logs Javascript errors being caught # #######################################