mirror of
https://github.com/unraid/webgui.git
synced 2026-05-19 12:49:33 -05:00
Merge pull request #1022 from shayne/master
Always show "WebUI" for user specified URLs
This commit is contained in:
@@ -305,8 +305,14 @@ class DockerTemplates {
|
||||
}
|
||||
if ($ct['Running']) {
|
||||
$port = &$ct['Ports'][0];
|
||||
$ip = ($ct['NetworkMode']=='host'||$port['NAT'] ? $host : $port['IP']);
|
||||
$tmp['url'] = $ip ? (strpos($tmp['url'],$ip)!==false ? $tmp['url'] : $this->getControlURL($ct, $ip)) : $tmp['url'];
|
||||
$webui = $this->getTemplateValue($ct['Image'], 'WebUI');
|
||||
if (strlen($webui) > 0 && !preg_match("%\[(IP|PORT:(\d+))\]%", $webui)) {
|
||||
// non-templated webui, user specified
|
||||
$tmp['url'] = $webui;
|
||||
} else {
|
||||
$ip = ($ct['NetworkMode']=='host'||$port['NAT'] ? $host : $port['IP']);
|
||||
$tmp['url'] = $ip ? (strpos($tmp['url'],$ip)!==false ? $tmp['url'] : $this->getControlURL($ct, $ip)) : $tmp['url'];
|
||||
}
|
||||
$tmp['shell'] = $tmp['shell'] ?? $this->getTemplateValue($image, 'Shell');
|
||||
}
|
||||
$tmp['registry'] = $tmp['registry'] ?? $this->getTemplateValue($image, 'Registry');
|
||||
|
||||
Reference in New Issue
Block a user