pull/11/head
Squidly271 2021-07-09 10:28:38 -04:00
parent 3054d56877
commit aef79c3484
4 changed files with 37 additions and 33 deletions

View File

@ -263,7 +263,8 @@ $(function(){
$('.mainArea').on("click",".dockerUpdate",function() { $('.mainArea').on("click",".dockerUpdate",function() {
if ( popupVisible(this) ) return; if ( popupVisible(this) ) return;
var container = $(this).attr("data-name"); var container = $(this).attr("data-name");
updateContainer(container); var docker = [container];
openBox('/plugins/community.applications/scripts/installMulti.php&upgrade=true&docker='+container,"<?tr('Update Container')?>",600,900,true,"refreshDisplay");
}); });
$('.mainArea').on("click",".ca_href",function() { $('.mainArea').on("click",".ca_href",function() {

View File

@ -1,6 +1,6 @@
767d6f2203fed9541daeb57bbf7b58b3 ./Apps.page 767d6f2203fed9541daeb57bbf7b58b3 ./Apps.page
83b3f89cd42e8601c7c217d5b4889c81 ./CA_notices.page 83b3f89cd42e8601c7c217d5b4889c81 ./CA_notices.page
1b0c503ba117ce02c544f64bbbb226b1 ./CommunityApps.page a1d4483fcfb8794def67cafab1cd4a06 ./CommunityApps.page
6db73582f22dab13d329e862067ee84e ./PluginAPI.page 6db73582f22dab13d329e862067ee84e ./PluginAPI.page
b398273cf7daa62ab00d2de2336ca25f ./README.md b398273cf7daa62ab00d2de2336ca25f ./README.md
a9d4cd0e4e1f37cbe3806b952a96ddb1 ./ca_settings.page a9d4cd0e4e1f37cbe3806b952a96ddb1 ./ca_settings.page
@ -19,7 +19,7 @@ e29c13353bc1277fc2c3597782d7c954 ./skins/Narrow/css.php
adc2d62d429accb264cedad58e6ef7a5 ./skins/Narrow/skin.html adc2d62d429accb264cedad58e6ef7a5 ./skins/Narrow/skin.html
cea67529c80395912bbca3f522921d48 ./skins/Narrow/skin.php cea67529c80395912bbca3f522921d48 ./skins/Narrow/skin.php
430966e5646376b62905b63a30de7102 ./scripts/PluginAPI.php 430966e5646376b62905b63a30de7102 ./scripts/PluginAPI.php
e474ec681bf833969bffcf19baed2b0c ./scripts/installMulti.php 195dd26d8a21d879aafad0e20851b8d3 ./scripts/installMulti.php
ce2c904b6a40c4677a3ff3484776959e ./scripts/installMultiPlugin.sh ce2c904b6a40c4677a3ff3484776959e ./scripts/installMultiPlugin.sh
524afab04ca930f59117a846f819fb2f ./scripts/installPluginUpdate.sh 524afab04ca930f59117a846f819fb2f ./scripts/installPluginUpdate.sh
5846421e95b475e1156c3f68164ccc4f ./scripts/languageInstall.sh 5846421e95b475e1156c3f68164ccc4f ./scripts/languageInstall.sh

View File

@ -26,7 +26,8 @@ echo "<script>$javascript</script>";
if ( $_GET['docker'] ) { if ( $_GET['docker'] ) {
echo "<div id='output'>"; echo "<div id='output'>";
$dockers = explode(",",$_GET['docker']); $dockers = explode(",",$_GET['docker']);
echo sprintf(tr("Installing docker applications %s"),str_replace(",",", ",$_GET['docker']))."<br>"; $msg = $_GET['upgrade'] ? "Upgrading docker application %s" : "Installing docker applications %s";
echo sprintf(tr($msg)),str_replace(",",", ",$_GET['docker']))."<br>";
$_GET['updateContainer'] = true; $_GET['updateContainer'] = true;
$_GET['ct'] = $dockers; $_GET['ct'] = $dockers;
$_GET['communityApplications'] = true; $_GET['communityApplications'] = true;
@ -69,38 +70,40 @@ function addCloseButton() {
} }
</script> </script>
<? <?
foreach ($dockers as $docker) { if ( ! $_GET['upgrade'] ) {
echo sprintf(tr("Starting %s"),"<span class='ca_bold'>$docker</span>")."<br>"; foreach ($dockers as $docker) {
unset($output); echo sprintf(tr("Starting %s"),"<span class='ca_bold'>$docker</span>")."<br>";
exec("docker start $docker 2>&1",$output,$retval); unset($output);
if ($retval) { exec("docker start $docker 2>&1",$output,$retval);
$failFlag = true; if ($retval) {
echo sprintf(tr("%s failed to start. You should install it by itself to fix the errors"),"<span class='ca_bold'>$docker</span>")."<br>"; $failFlag = true;
foreach ($output as $line) { echo sprintf(tr("%s failed to start. You should install it by itself to fix the errors"),"<span class='ca_bold'>$docker</span>")."<br>";
echo "<tt>$line</tt><br>"; foreach ($output as $line) {
echo "<tt>$line</tt><br>";
}
echo "<br>";
} }
echo "<br>";
} }
} echo "<br>".tr("Setting installed applications to autostart")."<br>";
echo "<br>".tr("Setting installed applications to autostart")."<br>"; $autostartFile = @file("/var/lib/docker/unraid-autostart",FILE_IGNORE_NEW_LINES);
$autostartFile = @file("/var/lib/docker/unraid-autostart",FILE_IGNORE_NEW_LINES); if ( ! $autostartFile ) {
if ( ! $autostartFile ) { $autostartFile = array();
$autostartFile = array(); }
} foreach ($autostartFile as $line) {
foreach ($autostartFile as $line) { $autostart[$line] = true;
$autostart[$line] = true; }
} foreach ($dockers as $docker) {
foreach ($dockers as $docker) { $autostart[$docker] = true;
$autostart[$docker] = true; }
} $autostartFile = implode("\n",array_keys($autostart));
$autostartFile = implode("\n",array_keys($autostart)); file_put_contents("/var/lib/docker/unraid-autostart",$autostartFile);
file_put_contents("/var/lib/docker/unraid-autostart",$autostartFile);
if ( $failFlag || !$_GET['plugin']) { if ( $failFlag || !$_GET['plugin']) {
echo "<br>".tr("Docker Application Installation finished")."<br><script>addCloseButton();</script>"; echo "<br>".tr("Docker Application Installation finished")."<br><script>addCloseButton();</script>";
} else { } else {
echo "<script>top.Shadowbox.close();</script>"; echo "<script>top.Shadowbox.close();</script>";
}
@unlink("/tmp/community.applications/tempFiles/newCreateDocker.php");
} }
@unlink("/tmp/community.applications/tempFiles/newCreateDocker.php");
} }
?> ?>