Poprack
Features: * Komplettes kabelmanagement auf Rack He Modul Basis
This commit is contained in:
@@ -54,25 +54,53 @@ for ($i = 1; $i <= $rack_he; $i++) : ?>
|
||||
}
|
||||
$portCount = $cable['port_end'] - $cable['port_start'] + 1;
|
||||
$cableWidth = ($portCount / $slots['ports']) * 100;
|
||||
$cableTitle = htmlspecialchars($cable['cable_name'] . ' (Ports ' . $cable['port_start'] . '-' . $cable['port_end'] . ')', ENT_QUOTES);
|
||||
if (!empty($cable['description'])) {
|
||||
$cableTitle .= ' | ' . htmlspecialchars($cable['description'], ENT_QUOTES);
|
||||
|
||||
$popTitle = htmlspecialchars($cable['cable_name'], ENT_QUOTES);
|
||||
$popContent = '<strong>Ports:</strong> ' . $cable['port_start'] . '-' . $cable['port_end'];
|
||||
if (!empty($cable['fiber_start'])) {
|
||||
$popContent .= '<br><strong>Fasern:</strong> ' . $cable['fiber_start'] . '-' . $cable['fiber_end'];
|
||||
}
|
||||
$cellContent .= '<div class="cable-item" title="' . $cableTitle . '" style="width: ' . $cableWidth . '%;" data-cable-id="' . $cable['id'] . '"
|
||||
if (!empty($cable['description'])) {
|
||||
$popContent .= '<br><div class="mt-1 text-muted border-top pt-1 small"><em>' . htmlspecialchars($cable['description'], ENT_QUOTES) . '</em></div>';
|
||||
}
|
||||
|
||||
$narrowClass = ($cableWidth < 12) ? 'narrow' : '';
|
||||
$cellContent .= '<div class="cable-item ' . $narrowClass . '"
|
||||
data-toggle="popover"
|
||||
data-trigger="hover"
|
||||
data-html="true"
|
||||
data-placement="top"
|
||||
data-container="body"
|
||||
title="' . $popTitle . '"
|
||||
data-content="' . htmlspecialchars($popContent, ENT_QUOTES) . '"
|
||||
style="width: ' . $cableWidth . '%;"
|
||||
data-cable-id="' . $cable['id'] . '"
|
||||
data-cable-name="' . htmlspecialchars($cable['cable_name'], ENT_QUOTES) . '"
|
||||
data-port-start="' . $cable['port_start'] . '"
|
||||
data-port-end="' . $cable['port_end'] . '"
|
||||
data-fiber-start="' . ($cable['fiber_start'] ?? '') . '"
|
||||
data-fiber-end="' . ($cable['fiber_end'] ?? '') . '"
|
||||
data-description="' . htmlspecialchars($cable['description'] ?? '', ENT_QUOTES) . '">';
|
||||
$cellContent .= '<span><b>' . $cable['cable_name'] . "</b></span>";
|
||||
|
||||
$fontSize = ($cableWidth < 10) ? '10px' : 'inherit';
|
||||
$cellContent .= '<span style="font-size:'.$fontSize.'; overflow:hidden; text-overflow:ellipsis; max-width:100%; white-space:nowrap;"><b>' . $cable['cable_name'] . "</b></span>";
|
||||
if (!empty($cable['description'])) {
|
||||
$cellContent .= '<span class="cable-description" >' . htmlspecialchars($cable['description'], ENT_QUOTES) . '</span>';
|
||||
$descVisibilityClass = ($cableWidth <= 20) ? 'hide-if-narrow' : '';
|
||||
$cellContent .= '<span class="cable-description ' . $descVisibilityClass . '" >' . htmlspecialchars($cable['description'], ENT_QUOTES) . '</span>';
|
||||
}
|
||||
$cellContent .= '<div class="port-ranges-container" style="display: flex; justify-content: center; width: 100%; font-size: 10px; gap: 8px;">';
|
||||
$cellContent .= '<tool class="port-range">P: ' . $cable['port_start'] . '-' . $cable['port_end'] . '</tool>';
|
||||
$rangesVisibilityClass = ($cableWidth <= 5) ? 'hide-if-narrow' : '';
|
||||
|
||||
$infoSize = '10px';
|
||||
$infoGap = '8px';
|
||||
if ($cableWidth < 8) { $infoSize = '8px'; $infoGap = '1px'; }
|
||||
elseif ($cableWidth < 15) { $infoSize = '9px'; $infoGap = '3px'; }
|
||||
|
||||
$toolStyle = 'font-size: ' . $infoSize . '; white-space: nowrap;';
|
||||
$cellContent .= '<div class="port-ranges-container ' . $rangesVisibilityClass . '" style="display: flex; justify-content: center; width: 100%; line-height: 1.1; gap: ' . $infoGap . ';">';
|
||||
$cellContent .= '<tool class="port-range" style="' . $toolStyle . '">P: ' . $cable['port_start'] . '-' . $cable['port_end'] . '</tool>';
|
||||
|
||||
if (!empty($cable['fiber_start'])) {
|
||||
$cellContent .= '<tool class="fiber-range">F: ' . $cable['fiber_start'] . '-' . $cable['fiber_end'] . "</tool>";
|
||||
$cellContent .= '<tool class="fiber-range" style="' . $toolStyle . '">F: ' . $cable['fiber_start'] . '-' . $cable['fiber_end'] . "</tool>";
|
||||
}
|
||||
$cellContent .= '</div>';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user