faster handling of installed apps section

This commit is contained in:
Squidly271 2021-06-26 15:43:51 -04:00
parent c524b66e4d
commit 47fd32efea
3 changed files with 98 additions and 122 deletions

View File

@ -11,7 +11,7 @@ a9d4cd0e4e1f37cbe3806b952a96ddb1 ./ca_settings.page
6e48a62b91bdd066f023f46c6b491afd ./images/discord-gray.svg
8e7dc33512b8a78f28d7179a972c7c34 ./images/discord-hover.svg
54e46db492ddb033dfeb2827c5efd4a8 ./images/discord-white.svg
80bdc89e71ffd5432cef6c8b46714a38 ./include/exec.php
4d3820a53990726e15e02929d86899ae ./include/exec.php
d7f50413cbaac1c6cb9ceaaef48f270a ./include/helpers.php
8f1129e0cdb994c6d1900192252433d8 ./include/paths.php
eb76c1b6ed3da5e5b393f22d2ec18430 ./javascript/libraries.js

View File

@ -1009,35 +1009,11 @@ function previous_apps() {
# $info contains all installed containers
# now correlate that to a template;
# this section handles containers that have not been renamed from the appfeed
if ( $caSettings['dockerRunning'] ) {
if ( $caSettings['dockerRunning'] ) {
$all_files = glob("{$caPaths['dockerManTemplates']}/*.xml");
$all_files = $all_files ?: array();
if ( $installed == "true" ) {
if ( !$filter || $filter == "docker" ) {
foreach ($info as $installedDocker) {
$installedName = $installedDocker['Name'];
$installedImage = $installedDocker['Image'];
if ( startsWith($installedImage,"library/") ) # official images are in DockerClient as library/mysql eg but template just shows mysql
$installedImage = str_replace("library/","",$installedImage);
foreach ($file as &$template) {
if ( $template['BranchID'] ) continue;
if ( $template['Blacklist'] ) continue;
if ( $installedName == $template['Name'] ) {
if ( startsWith($installedImage,$template['Repository']) ) {
$template['Uninstall'] = true;
$template['InstallPath'] = $template['Path'];
if ( $dockerUpdateStatus[$installedImage]['status'] == "false" || $dockerUpdateStatus[$template['Name']] == "false" ) {
$template['UpdateAvailable'] = true;
}
$template['testrepo'] = $installedImage;
$displayed[] = $template;
break;
}
}
}
}
# handle renamed containers
foreach ($all_files as $xmlfile) {
$o = readXmlFile($xmlfile);
$o['Description'] = fixDescription($o['Description']);
@ -1147,7 +1123,7 @@ if ( $caSettings['dockerRunning'] ) {
}
}
}
}
}
# Now work on plugins
if ( $installed == "true" ) {
if ( ! $filter || $filter == "plugins" ) {