Skip to content

Commit

Permalink
Update containers.php
Browse files Browse the repository at this point in the history
  • Loading branch information
nzxl101 authored May 18, 2024
1 parent 879c7b8 commit 010c93a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions root/app/www/public/functions/containers.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
----------------------------------
------ Created: 112923 ------
------ Austin Best ------
------ Austin Best ------
----------------------------------
*/

Expand Down Expand Up @@ -104,6 +104,7 @@ function renderContainerRow($nameHash, $return)
$length = implode(' ', $length);

$mountList = '';
$previewMount = '';
if ($process['inspect'][0]['Mounts']) {
$mounts = [];

Expand All @@ -118,11 +119,14 @@ function renderContainerRow($nameHash, $return)
}

$mounts[] = $mount['Destination'] . ' ' . $arrow . ' ' . $mount['Source'] . ($mount['Mode'] ? ':' . $mount['Mode'] : '');
if (!$previewMount) {
$previewMount = truncateEnd($mount['Destination'], 18) . ' ' . $arrow . ' ' . truncateEnd($mount['Source'], 18) . ($mount['Mode'] ? ':' . $mount['Mode'] : '');
}
}

if ($mounts) {
$mountList = '<i class="far fa-minus-square" style="cursor: pointer; display: none;" id="hide-mount-btn-' . $nameHash . '" onclick="hideContainerMounts(\'' . $nameHash . '\')"></i><i class="far fa-plus-square" style="cursor: pointer;" id="show-mount-btn-' . $nameHash . '" onclick="showContainerMounts(\'' . $nameHash . '\')"></i> ';
$mountList .= '<span id="mount-list-preview-' . $nameHash . '">' . truncateMiddle($mounts[0], 37) . '</span><br>';
$mountList .= '<span id="mount-list-preview-' . $nameHash . '">' . $previewMount . '</span><br>';
$mountList .= '<div id="mount-list-full-' . $nameHash . '" style="display: none;">';
$mountList .= implode('<br>', $mounts);
$mountList .= '</div>';
Expand Down Expand Up @@ -324,4 +328,4 @@ function skipContainerActions($container, $containers)
}

return SKIP_OFF;
}
}

0 comments on commit 010c93a

Please sign in to comment.