Fixed: Headers already sent warning when updating container thru CA

This commit is contained in:
Squidly271 2022-04-19 12:54:27 -04:00
parent 6df9a5e193
commit f11dd375f2
4 changed files with 16 additions and 5 deletions

View File

@ -12,7 +12,7 @@ ff03c8ebd7f4acd3a664933cf6a1c20a ./include/paths.php
07684bde8ccd13523f62c69bb492fc27 ./scripts/installMulti.php 07684bde8ccd13523f62c69bb492fc27 ./scripts/installMulti.php
be74e770cdc8938200fc29580be4e3a1 ./scripts/installMultiPlugin.php be74e770cdc8938200fc29580be4e3a1 ./scripts/installMultiPlugin.php
524afab04ca930f59117a846f819fb2f ./scripts/installPluginUpdate.sh 524afab04ca930f59117a846f819fb2f ./scripts/installPluginUpdate.sh
5319e550a7b7a1c216eda8c7f2f0f4ef ./scripts/installUpdate.php afa5771f344d0600a7b3bbc40bd32d29 ./scripts/installUpdate.php
5846421e95b475e1156c3f68164ccc4f ./scripts/languageInstall.sh 5846421e95b475e1156c3f68164ccc4f ./scripts/languageInstall.sh
d4770cba925e913500e0085b79267d3e ./scripts/notices.php d4770cba925e913500e0085b79267d3e ./scripts/notices.php
a1401a0bed89c182b69f0c7508282c1f ./scripts/pluginInstall.php a1401a0bed89c182b69f0c7508282c1f ./scripts/pluginInstall.php
@ -21,4 +21,4 @@ da3b4f9b73c5c3bf65be6c42d68b51f9 ./scripts/showStatistics.php
34554a56611dfe625889c82afd5138de ./scripts/updatePluginSupport.php 34554a56611dfe625889c82afd5138de ./scripts/updatePluginSupport.php
0254b0a66007c3f6e32e7d259e8ee443 ./skins/Narrow/css.php 0254b0a66007c3f6e32e7d259e8ee443 ./skins/Narrow/css.php
0bdefa4e915c02ed3310c39eb5a1cef5 ./skins/Narrow/skin.html 0bdefa4e915c02ed3310c39eb5a1cef5 ./skins/Narrow/skin.html
c23b1771106700f37171894f29975ccb ./skins/Narrow/skin.php acd6d0c6e62684521709c1f8daa43f5a ./skins/Narrow/skin.php

View File

@ -10,6 +10,11 @@
.logLine{color:black !important;} .logLine{color:black !important;}
</style> </style>
<? <?
$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: "/usr/local/emhttp";
$_SERVER['REQUEST_URI'] = "docker/apps";
@require_once "$docroot/plugins/dynamix/include/Translations.php";
require_once "/usr/local/emhttp/plugins/dynamix/include/Helpers.php"; require_once "/usr/local/emhttp/plugins/dynamix/include/Helpers.php";
$_GET['updateContainer'] = "true"; $_GET['updateContainer'] = "true";

View File

@ -142,6 +142,8 @@ function my_display_apps($file,$pageNumber=1,$selectedApps=false,$startup=false)
if ( $dockerUpdateStatus[$tmpRepo]['status'] == "false" ) { if ( $dockerUpdateStatus[$tmpRepo]['status'] == "false" ) {
$template['UpdateAvailable'] = true; $template['UpdateAvailable'] = true;
$actionsContext[] = array("icon"=>"ca_fa-update","text"=>tr("Update"),"action"=>"updateDocker('$name');"); $actionsContext[] = array("icon"=>"ca_fa-update","text"=>tr("Update"),"action"=>"updateDocker('$name');");
} else {
$template['UpdateAvailable'] = false;
} }
if ( $caSettings['defaultReinstall'] == "true" && ! $template['Blacklist']) { if ( $caSettings['defaultReinstall'] == "true" && ! $template['Blacklist']) {
if ( $template['ID'] !== false ) { # don't allow 2nd if there's not a "default" within CA if ( $template['ID'] !== false ) { # don't allow 2nd if there's not a "default" within CA
@ -166,7 +168,7 @@ function my_display_apps($file,$pageNumber=1,$selectedApps=false,$startup=false)
$actionsContext[] = array("icon"=>"ca_fa-install","text"=>tr("Reinstall"),"action"=>"popupInstallXML('".addslashes($template['InstallPath'])."','user','','".portsUsed($userTemplate)."');"); $actionsContext[] = array("icon"=>"ca_fa-install","text"=>tr("Reinstall"),"action"=>"popupInstallXML('".addslashes($template['InstallPath'])."','user','','".portsUsed($userTemplate)."');");
$actionsContext[] = array("divider"=>true); $actionsContext[] = array("divider"=>true);
} }
$actionsContext[] = array("icon"=>"ca_fa-delete","text"=>tr("Remove from Previous Apps"),"action"=>"removeApp('{$template['InstallPath']}','{$template['Name']}');"); $actionsContext[] = array("icon"=>"ca_fa-delete","text"=>tr("Remove from Previous Apps"),"alternate"=>tr("Remove"),"action"=>"removeApp('{$template['InstallPath']}','{$template['Name']}');");
} else { } else {
if ( ! $template['BranchID'] ) { if ( ! $template['BranchID'] ) {
if ( is_file("{$caPaths['dockerManTemplates']}/my-{$template['Name']}.xml") ) { if ( is_file("{$caPaths['dockerManTemplates']}/my-{$template['Name']}.xml") ) {
@ -191,6 +193,8 @@ function my_display_apps($file,$pageNumber=1,$selectedApps=false,$startup=false)
@copy($caPaths['pluginTempDownload'],"/tmp/plugins/$pluginName"); @copy($caPaths['pluginTempDownload'],"/tmp/plugins/$pluginName");
$template['UpdateAvailable'] = true; $template['UpdateAvailable'] = true;
$actionsContext[] = array("icon"=>"ca_fa-update","text"=>tr("Update"),"action"=>"installPlugin('$pluginName',true);"); $actionsContext[] = array("icon"=>"ca_fa-update","text"=>tr("Update"),"action"=>"installPlugin('$pluginName',true);");
} else {
$template['UpdateAvailable'] = false;
} }
$pluginSettings = ($pluginName == "community.applications.plg") ? "ca_settings" : plugin("launch","/var/log/plugins/$pluginName"); $pluginSettings = ($pluginName == "community.applications.plg") ? "ca_settings" : plugin("launch","/var/log/plugins/$pluginName");
if ( $pluginSettings ) { if ( $pluginSettings ) {
@ -1073,8 +1077,10 @@ function displayCard($template) {
"; ";
if ( $actionsContext ) { if ( $actionsContext ) {
if ( count($actionsContext) == 1) if ( count($actionsContext) == 1) {
$card .= "<div class='actionsButton' onclick={$actionsContext[0]['action']}>{$actionsContext[0]['text']}</div>"; $dispText = $actionsContext[0]['alternate'] ?: $actionsContext[0]['text'];
$card .= "<div class='actionsButton' onclick={$actionsContext[0]['action']}>$dispText</div>";
}
else else
$card .= "<div class='actionsButton actionsButtonContext' id='actions".preg_replace("/[^a-zA-Z0-9]+/", "",$Name)."$ID' data-context='".json_encode($actionsContext,JSON_HEX_QUOT | JSON_HEX_APOS)."'>".tr("Actions")."</div>"; $card .= "<div class='actionsButton actionsButtonContext' id='actions".preg_replace("/[^a-zA-Z0-9]+/", "",$Name)."$ID' data-context='".json_encode($actionsContext,JSON_HEX_QUOT | JSON_HEX_APOS)."'>".tr("Actions")."</div>";
} }