Fixed minor issues

parent db317279
......@@ -30,6 +30,8 @@ class DatabaseRepository extends \Repositories\Model\Repository\DatabaseReposito
return $this->mysql->host;
}
if(!$this->_containerUtility->containerExists($this->mysql->host)) return $this->mysql->host;
$hostIp = $this->_containerUtility->getContainerIp($this->mysql->host);
if(empty($hostIp)) {
return $this->mysql->host;
......
......@@ -77,12 +77,15 @@ class ComposeConfigUtility {
* @return array
*/
public function getContainerNames(): array {
global $cfg;
$containers = [];
$config = $this->getComposeConfiguration();
foreach ($config['services'] as $name => $value) {
$containers[] = isset($value['container_name']) ? $value['container_name']:$name;
if(isset($value['container_name'])) $containers[] = $value['container_name'];
}
if(empty($containers)) return $cfg['docker']['containers'];
return $containers;
}
......@@ -115,6 +118,10 @@ class ComposeConfigUtility {
$list[ $container ] = $domains;
}
if(empty($list)) {
return $cfg['docker']['domains'];
}
return $list;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment