Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions emhttp/plugins/dynamix.docker.manager/DockerContainers.page
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ $cpus = cpu_list();
<th><a id="resetsort" class="nohand" onclick="resetSorting()" title="_(Reset sorting)_"><i class="fa fa-th-list"></i></a>_(Application)_</th>
<th>_(Version)_</th>
<th>_(Network)_</th>
<th>_(Container IP)_</th>
<th>_(Container IP)_ <span class="advanced">/ _(MAC)_</span></th>
<th>_(Container Port)_</th>
<th>_(LAN IP:Port)_</th>
<th>_(Volume Mappings)_ <small>(_(App to Host)_)</small></th>
Expand All @@ -46,7 +46,7 @@ $cpus = cpu_list();
<th class="five">_(Uptime)_</th>
</tr>
</thead>
<tbody id="docker_list" class="js-fill-available-height"><tr><td colspan='9'></td></tr></tbody>
<tbody id="docker_list" class="js-fill-available-height"><tr><td colspan='10'></td></tr></tbody>
</table>
</div>

Expand Down
12 changes: 10 additions & 2 deletions emhttp/plugins/dynamix.docker.manager/include/DockerClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,15 +1022,23 @@ public function getDockerContainers() {
$ports = &$info['Config']['ExposedPorts'];
}
foreach($ct['NetworkSettings']['Networks'] as $netName => $netVals) {
$networkDetails = $info['NetworkSettings']['Networks'][$netName] ?? $netVals;
$i = $c['NetworkMode']=='host' ? $host : $netVals['IPAddress'];
$c['Networks'][$netName] = [ 'IPAddress' => $i ];
$c['Networks'][$netName] = [
'IPAddress' => $i,
'MacAddress' => $networkDetails['MacAddress'] ?? ''
];
if ( isset($driver[$netName]) && ($driver[$netName]=='ipvlan' || $driver[$netName]=='macvlan') ) {
if (!isset($c['Ports']['vlan'])) $c['Ports']['vlan'] = [];
$c['Ports']['vlan']["$i"] = $i;
}
}
$networkDetails = $info['NetworkSettings']['Networks'][$c['NetworkMode']] ?? $ct['NetworkSettings']['Networks'][$c['NetworkMode']] ?? [];
$ip = $c['NetworkMode']=='host' ? $host : $ct['NetworkSettings']['Networks'][$c['NetworkMode']]['IPAddress'] ?? null;
$c['Networks'][$c['NetworkMode']] = [ 'IPAddress' => $ip ];
$c['Networks'][$c['NetworkMode']] = [
'IPAddress' => $ip,
'MacAddress' => $networkDetails['MacAddress'] ?? ''
];
$ports = (isset($ports) && is_array($ports)) ? $ports : [];
foreach ($ports as $port => $value) {
if (!isset($info['HostConfig']['PortBindings'][$port])) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
$autostart_file = $dockerManPaths['autostart-file'];

if (!$containers && !$images) {
echo "<tr><td colspan='7' style='text-align:center;padding-top:12px'>"._('No Docker containers installed')."</td></tr>";
echo "<tr><td colspan='10' style='text-align:center;padding-top:12px'>"._('No Docker containers installed')."</td></tr>";
return;
}

Expand Down Expand Up @@ -154,7 +154,9 @@ function my_lang_log($text) {
}
foreach($ct['Networks'] as $netName => $netVals) {
$networks[] = $netName;
$network_ips[] = $running ? $netVals['IPAddress'] : null;
$network_ip = $running ? htmlspecialchars((string)$netVals['IPAddress']) : '';
$network_mac = $running ? htmlspecialchars((string)($netVals['MacAddress'] ?? '')) : '';
$network_ips[] = $network_mac ? "$network_ip<span class='advanced'><br>$network_mac</span>" : $network_ip;
if (isset($ct['Networks']['host'])) {
$ports_external[] = sprintf('%s', $netVals['IPAddress']);
$ports_internal[0] = sprintf('%s', 'all');
Expand Down
Loading