mirror of
https://github.com/unraid/webgui.git
synced 2026-03-11 05:20:44 -05:00
Merge pull request #520 from Squidly271/dockerIcon
dockerMan: Redownload Icon if URL changes
This commit is contained in:
@@ -85,6 +85,17 @@ if (isset($_POST['contName'])) {
|
||||
if (!is_dir($userTmplDir)) mkdir($userTmplDir, 0777, true);
|
||||
if ($Name) {
|
||||
$filename = sprintf('%s/my-%s.xml', $userTmplDir, $Name);
|
||||
if ( is_file($filename) ) {
|
||||
$oldXML = simplexml_load_file($filename);
|
||||
if ($oldXML->Icon != $_POST['contIcon']) {
|
||||
if (! strpos($Repository,":")) {
|
||||
$Repository .= ":latest";
|
||||
}
|
||||
$iconPath = $DockerTemplates->getIcon($Repository);
|
||||
@unlink("$docroot/$iconPath");
|
||||
@unlink("{$dockerManPaths['images']}/".basename($iconPath));
|
||||
}
|
||||
}
|
||||
file_put_contents($filename, $postXML);
|
||||
}
|
||||
// Run dry
|
||||
@@ -137,7 +148,8 @@ if (isset($_POST['contName'])) {
|
||||
}
|
||||
if ($startContainer) $cmd = str_replace('/docker create ', '/docker run -d ', $cmd);
|
||||
execCommand($cmd);
|
||||
echo '<div style="text-align:center"><button type="button" onclick="done()">Done</button></div><br>';
|
||||
|
||||
echo '<div style="text-align:center"><button type="button" onclick="done()">Done</button></div><br>';
|
||||
goto END;
|
||||
}
|
||||
|
||||
@@ -371,11 +383,11 @@ button[type=button]{margin:0 20px 0 0}
|
||||
}
|
||||
return newConfig.prop('outerHTML');
|
||||
}
|
||||
|
||||
|
||||
function escapeQuote(string) {
|
||||
return string.replace(new RegExp('"','g'),""");
|
||||
}
|
||||
|
||||
|
||||
function makeAllocations(container,current) {
|
||||
var html = [];
|
||||
for (var i=0,ct; ct=container[i]; i++) {
|
||||
|
||||
Reference in New Issue
Block a user