Poprack
Features: * Komplettes kabelmanagement auf Rack He Modul Basis
This commit is contained in:
@@ -24,8 +24,8 @@
|
||||
|
||||
.rack-color-lwl {
|
||||
background: rgb(159, 255, 96);
|
||||
background: linear-gradient(180deg, rgb(129 237 58) 0%, rgb(92 211 15) 100%);
|
||||
font-weight: 500;
|
||||
background: linear-gradient(180deg, rgb(129 223 68) 0%, rgb(62 155 3) 100%);
|
||||
color: #000000;
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
@@ -97,12 +97,177 @@
|
||||
background-color: #d7d7d7;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.switch-rack-side {
|
||||
margin-right: 8px;
|
||||
margin-top: 2px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.cable-container {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
align-items: stretch;
|
||||
color: #000;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.cable-item {
|
||||
border-right: 1px solid #797979;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 12px;
|
||||
line-height: 1.1;
|
||||
color: #333;
|
||||
background-color: #e1ffdf;
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
padding: 1px 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.cable-item .port-range, .cable-item .fiber-range {
|
||||
font-size: 12px;
|
||||
color: #040404;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.cable-item:hover {
|
||||
background-color: #cfffc8;
|
||||
}
|
||||
|
||||
.cable-item:last-child {
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.cable-free {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.context-menu {
|
||||
display: none;
|
||||
position: absolute;
|
||||
z-index: 1000;
|
||||
width: 180px;
|
||||
background-color: #fff;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.context-menu ul {
|
||||
list-style: none;
|
||||
padding: 5px 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.context-menu ul li {
|
||||
padding: 8px 15px;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.context-menu ul li:hover {
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
|
||||
.context-menu ul li i {
|
||||
margin-right: 10px;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
#cable-context-menu {
|
||||
position: absolute; /* Popper setzt top/left */
|
||||
z-index: 20000;
|
||||
transform: none !important; /* falls doch mal ein transform reingeschummelt wird */
|
||||
}
|
||||
|
||||
.dropdown-menu[x-placement^=left], .dropdown-menu[x-placement^=right], .dropdown-menu[x-placement^=top] {
|
||||
top: unset;
|
||||
-webkit-animation: none !important;
|
||||
animation: none !important;
|
||||
}
|
||||
|
||||
.context-span {
|
||||
min-width: 25px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.dropdown-item {
|
||||
padding: .3rem 1.2rem;
|
||||
}
|
||||
|
||||
.w-10 {
|
||||
width: 10% !important;
|
||||
}
|
||||
|
||||
.cable-highlight {
|
||||
background-color: #e6ff00 !important;
|
||||
border: 2px solid #e0a800 !important;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/* NEU: Animation für das "Aufblinken" */
|
||||
.cable-flash {
|
||||
/*animation: flash-animation 1s;*/
|
||||
}
|
||||
|
||||
@keyframes flash-animation {
|
||||
0% {
|
||||
transform: scale(1);
|
||||
}
|
||||
25% {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
50% {
|
||||
transform: scale(1);
|
||||
}
|
||||
75% {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
100% {
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Sorgt dafür, dass die Autocomplete-Vorschläge über anderen Elementen liegen */
|
||||
.ui-autocomplete {
|
||||
z-index: 2000;
|
||||
}
|
||||
|
||||
.module-highlight {
|
||||
/*box-shadow: inset 0 0 0 3px #007bff !important; !* Ein auffälliger, blauer Innen-Rahmen *!*/
|
||||
/*transition: box-shadow 0.3s ease-in-out;*/
|
||||
}
|
||||
|
||||
.rack-color-lwl-planned {
|
||||
background: rgb(255, 0, 0);
|
||||
background: linear-gradient(180deg, rgba(255, 0, 0, 1) 0%, rgba(196, 0, 0, 1) 100%);
|
||||
font-weight: 500;
|
||||
padding-top: 2px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.port-info {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
|
||||
|
||||
}
|
||||
.cable-description
|
||||
{
|
||||
font-size: 12px;
|
||||
font-style: italic;
|
||||
color: #000000;
|
||||
white-space: normal;
|
||||
line-height: 1.2;
|
||||
font-weight: 400;
|
||||
}
|
||||
</style>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@@ -130,9 +295,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$plugs[1] = "LC";
|
||||
$plugs[2] = "SC";
|
||||
$plugs[3] = "E2000";
|
||||
$plugs[1] = "LC/APC";
|
||||
$plugs[2] = "SC/APC";
|
||||
$plugs[3] = "E2000/APC";
|
||||
|
||||
$vlans = "";
|
||||
|
||||
@@ -183,11 +348,15 @@ if (!empty(trim($pops->vlan_ipv6)))
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-nowrap">Dokustand | Status</th>
|
||||
<td><?= ($pops->doku_date) ? date("d.m.Y",$pops->doku_date) : '-' ?><span class="ml-2 mr-2">|</span><?= ($pops->state) ? $stateArray[$pops->state] : '-' ?> </td>
|
||||
<td><?= ($pops->doku_date) ? date("d.m.Y", $pops->doku_date) : '-' ?><span
|
||||
class="ml-2 mr-2">|</span><?= ($pops->state) ? $stateArray[$pops->state] : '-' ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-nowrap">Fotospeicherort</th>
|
||||
<td><?php if ($pops->folder_link): ?> <a href="file://<?= $pops->folder_link ?>"><?= $pops->folder_link ?></a><?php endif; ?></td>
|
||||
<td><?php if ($pops->folder_link): ?> <a
|
||||
href="file://<?= $pops->folder_link ?>"><?= $pops->folder_link ?></a><?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-nowrap">Interne Notiz</th>
|
||||
@@ -341,123 +510,138 @@ if (!empty(trim($pops->vlan_ipv6)))
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group row " id="module-slot-div" style="display:none">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="module-slot">19 Zoll Position</label>
|
||||
<div class="col-lg-3">
|
||||
<input type="hidden" value="front" id="module-side" name="module-side"/>
|
||||
<select required="required" id="module-slot" name="module-slot"
|
||||
class="form-control">
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
<option value="4">4</option>
|
||||
</select>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="form-group row " id="module-slot-div" style="display:none">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="module-slot">19 Zoll Position</label>
|
||||
<div class="col-lg-3">
|
||||
<input type="hidden" value="front" id="module-side" name="module-side"/>
|
||||
<select required="required" id="module-slot" name="module-slot"
|
||||
class="form-control">
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
<option value="4">4</option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="module-type">Modul Typ*</label>
|
||||
<div class="col-lg-6">
|
||||
<select required="required" id="module-type" name="module-type"
|
||||
class="form-control">
|
||||
<option value="0">LWL Patch Panel</option>
|
||||
<option value="1">Device</option>
|
||||
<option value="2">Rangierpanel</option>
|
||||
<option value="4">CU Patch Panel</option>
|
||||
<option value="3">Infrastruktur</option>
|
||||
<option value="5">Geblockt</option>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="module-type">Modul Typ*</label>
|
||||
<div class="col-lg-6">
|
||||
<select required="required" id="module-type" name="module-type"
|
||||
class="form-control">
|
||||
<option value="0">LWL Patch Panel</option>
|
||||
<option value="1">Device</option>
|
||||
<option value="2">Rangierpanel</option>
|
||||
<option value="4">CU Patch Panel</option>
|
||||
<option value="3">Infrastruktur</option>
|
||||
<option value="5">Geblockt</option>
|
||||
|
||||
</select>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="module-name-div">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="module-name">Modul Name*</label>
|
||||
<div class="col-lg-6">
|
||||
<input required="required" type="text" id="module-name" name="module-name"
|
||||
class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="module-device-div">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="module-device-id">Device*</label>
|
||||
<div class="col-lg-6">
|
||||
<select required="required" id="module-device-id" name="module-type"
|
||||
class="form-control">
|
||||
<?php foreach ($devices as $device): ?>
|
||||
<option value="<?= $device->id ?>"><?= $device->name ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<label class="col-form-label" id="module-device-text"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="module-status-div" style="display: none;">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="module-status">Status*</label>
|
||||
<div class="col-lg-6">
|
||||
<select required="required" id="module-status" name="module-status"
|
||||
class="form-control">
|
||||
<option value="productive">Produktiv</option>
|
||||
<option value="planned">Geplant</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="module-name-div">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="module-name">Modul Name*</label>
|
||||
<div class="col-lg-6">
|
||||
<input required="required" type="text" id="module-name" name="module-name"
|
||||
class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="module-device-div">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="module-device-id">Device*</label>
|
||||
<div class="col-lg-6">
|
||||
<select required="required" id="module-device-id" name="module-type"
|
||||
class="form-control">
|
||||
<?php foreach ($devices as $device): ?>
|
||||
<option value="<?= $device->id ?>"><?= $device->name ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<label class="col-form-label" id="module-device-text"></label>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="module-ports-div">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="module-ports">Ports</label>
|
||||
<div class="col-lg-6">
|
||||
<select required="required" id="module-ports" name="module-ports"
|
||||
class="form-control">
|
||||
<option value="96" data-plugs="1;2">96</option>
|
||||
<option selected="selected" value="48" data-plugs="1;2">48</option>
|
||||
<option value="24" data-plugs="2;3">24</option>
|
||||
<option value="12" data-plugs="2;3">12</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="module-ports-div">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="module-ports">Ports</label>
|
||||
<div class="col-lg-6">
|
||||
<select required="required" id="module-ports" name="module-ports"
|
||||
class="form-control">
|
||||
<option value="96" data-plugs="1;2">96</option>
|
||||
<option selected="selected" value="48" data-plugs="1;2">48</option>
|
||||
<option value="24" data-plugs="2;3">24</option>
|
||||
<option value="12" data-plugs="2;3">12</option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="module-plug-div">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="module-plug">Stecker</label>
|
||||
<div class="col-lg-6">
|
||||
<select required="required" id="module-plug" name="module-plug"
|
||||
class="form-control">
|
||||
<option value="1">LC/APC</option>
|
||||
<option value="2">SC/APC</option>
|
||||
<option style="display: none" value="3">E2000/APC</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="module-plug-div">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="module-plug">Stecker</label>
|
||||
<div class="col-lg-6">
|
||||
<select required="required" id="module-plug" name="module-plug"
|
||||
class="form-control">
|
||||
<option value="1">LC/APC</option>
|
||||
<option value="2">SC/APC</option>
|
||||
<option style="display: none" value="3">E2000/APC</option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="he-start">Start HE*</label>
|
||||
<div class="col-lg-3" id="he-start-div">
|
||||
<div class="form-group row">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="he-start">Start HE*</label>
|
||||
<div class="col-lg-3" id="he-start-div">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="he-count">Anzahl HE*</label>
|
||||
<div class="col-lg-3" id="he-count-div">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="">Größe</label>
|
||||
<div class="col-lg-4">
|
||||
<select required="required" id="module-width" name="module-width"
|
||||
class="form-control">
|
||||
<option value="12">19 Zoll</option>
|
||||
<option value="6">1/2 19 Zoll</option>
|
||||
<option value="4">1/3 19 Zoll</option>
|
||||
<option value="3">1/4 19 Zoll</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="module-position-div" style="display: none">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="">Position</label>
|
||||
<div class="col-lg-4">
|
||||
<select required="required" id="module-position" name="module-position"
|
||||
class="form-control">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="alert alert-danger text-center" role="alert" style="display: none"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="he-count">Anzahl HE*</label>
|
||||
<div class="col-lg-3" id="he-count-div">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="">Größe</label>
|
||||
<div class="col-lg-4">
|
||||
<select required="required" id="module-width" name="module-width"
|
||||
class="form-control">
|
||||
<option value="12">19 Zoll</option>
|
||||
<option value="6">1/2 19 Zoll</option>
|
||||
<option value="4">1/3 19 Zoll</option>
|
||||
<option value="3">1/4 19 Zoll</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="module-position-div" style="display: none">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="">Position</label>
|
||||
<div class="col-lg-4">
|
||||
<select required="required" id="module-position" name="module-position"
|
||||
class="form-control">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="alert alert-danger text-center" role="alert" style="display: none"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button id="module-add" type="button" class="btn btn-primary">Modul hinzufügen</button>
|
||||
@@ -471,17 +655,30 @@ if (!empty(trim($pops->vlan_ipv6)))
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="pop-rack-div" style="display:none">
|
||||
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 card-border">
|
||||
<div>
|
||||
<h4>Schränke </h4>
|
||||
<div class="row align-items-center mb-2">
|
||||
<div class="col-md-2">
|
||||
<h4>Schränke</h4>
|
||||
</div>
|
||||
<div class="col-md-3 justify-content-center">
|
||||
<div class="">
|
||||
<label for="cable-search" class="mr-2">Kabelsuche:</label>
|
||||
<select id="cable-search" class="form-control form-select">
|
||||
<option></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="sortracklist" class="row" data-popid="<?= $pops->id ?>">
|
||||
<?php foreach ($popracks as $poprack) : ?>
|
||||
<div class="col-lg-3 col-12 list-group-item-move mb-3">
|
||||
<div class="col-lg-4 col-12 list-group-item-move mb-3">
|
||||
<table class="w-100 p-0 font-13"
|
||||
style="max-width: 100%; box-shadow: 2px 2px 5px 2px rgba(0,0,0,0.31);border-radius: 5px 5px 5px 5px;">
|
||||
<thead>
|
||||
@@ -491,8 +688,10 @@ if (!empty(trim($pops->vlan_ipv6)))
|
||||
data-rackhe="<?= $poprack['rack']['he'] ?>"
|
||||
data-rackid="<?= $poprack['rack']['id']; ?>"><span
|
||||
class="rack-name"><i
|
||||
class="fa-regular fa-arrows-up-down-left-right move-handle float-left"></i><?= $poprack['rack']['name']; ?> <span class="rack-side-indicator font-weight-normal">- Vorderseite</span></span>
|
||||
<i class="fas fa-sync-alt float-right switch-rack-side" title="Seite wechseln"></i>
|
||||
class="fa-regular fa-arrows-up-down-left-right move-handle float-left"></i><?= $poprack['rack']['name']; ?> <span
|
||||
class="rack-side-indicator font-weight-normal">- Vorderseite</span></span>
|
||||
<i class="fas fa-sync-alt float-right switch-rack-side"
|
||||
title="Seite wechseln"></i>
|
||||
|
||||
<i class="far fa-edit float-right" title="Bearbeiten"
|
||||
data-toggle="modal" data-target="#rackModal"></i>
|
||||
@@ -501,117 +700,10 @@ if (!empty(trim($pops->vlan_ipv6)))
|
||||
</thead>
|
||||
<tbody id="rack-body-<?= $poprack['rack']['id'] ?>" data-side="front">
|
||||
<?php
|
||||
$cellwidth = 227;
|
||||
$blocktd = 0;
|
||||
for ($i = 1; $i <= $poprack['rack']['he']; $i++) : ?>
|
||||
<tr>
|
||||
<td class="border-right w-15 p-0 pl-1 pr-1 border-bottom font-13 rack-he user-select-none"
|
||||
data-toggle="modal" data-target="#rackModuleModal"
|
||||
style="cursor: pointer" data-he="<?= $i; ?>">He<?= $i; ?></td>
|
||||
<?php
|
||||
$modules_to_render = $poprack['modules']['front'] ?? [];
|
||||
foreach ($modules_to_render as $module) {
|
||||
|
||||
if ($module['start_he'] == $i) {
|
||||
$modulestart = 1;
|
||||
|
||||
$modulelenght = $module['end_he'] - $module['start_he'] + 1;
|
||||
$position = 1;
|
||||
$slotcounter = 0;
|
||||
$calcwidth = 0;
|
||||
$extText = "";
|
||||
$extTextspan = "";
|
||||
foreach ($module['slots'] as $slots) {
|
||||
var_dump();
|
||||
$extText = "";
|
||||
$title = $slots['modulname'];
|
||||
if ($slots['type'] == '0') {
|
||||
$color = '#9fff6e';
|
||||
$colorclass = "rack-color-lwl";
|
||||
if ($slots['plug']) {
|
||||
$extText = " (" . $plugs[$slots['plug']] . "/" . $slots['ports'] . "P)";
|
||||
$extTextspan = "<span style='font-size: 12px;font-weight: 400'>" . $extText . "</span>";
|
||||
}
|
||||
} else if ($slots['type'] == '1') {
|
||||
$slots['modulname'] = '<a style="color: #000000;text-decoration: underline;" target="_self" href="' . self::getUrl("Device", "detail", ["id" => $slots['device_id']]) . '">' . $slots['modulname'] . '</a>';
|
||||
?>
|
||||
<script>
|
||||
$("#module-device-id option[value='<?= $slots['device_id'] ?>']").remove();
|
||||
</script>
|
||||
<?php
|
||||
$color = '#b6c6ff';
|
||||
$colorclass = "rack-color-device";
|
||||
} else if ($slots['type'] == '2') {
|
||||
$color = '#ff8100';
|
||||
$colorclass = "rack-color-rpanel";
|
||||
} else if ($slots['type'] == '3') {
|
||||
$color = '#ffad59';
|
||||
$colorclass = "rack-color-infra";
|
||||
} else if ($slots['type'] == '4') {
|
||||
$color = '#96f3de';
|
||||
$colorclass = "rack-color-panel";
|
||||
} else if ($slots['type'] == '5') {
|
||||
$color = '#96f3de';
|
||||
$colorclass = "rack-color-blocked";
|
||||
}
|
||||
if ($slots['width'] == "12") {
|
||||
$width = "85%";
|
||||
$maxwidth = $cellwidth;
|
||||
} else if ($slots['width'] == "6") {
|
||||
$width = "42%";
|
||||
$maxwidth = intval($cellwidth / 2);
|
||||
} else if ($slots['width'] == "4") {
|
||||
$width = "28%";
|
||||
$maxwidth = intval($cellwidth / 3);
|
||||
} else if ($slots['width'] == "3") {
|
||||
$width = "21%";
|
||||
$maxwidth = intval($cellwidth / 4);
|
||||
}
|
||||
if ($slots['width'] < 12 && $position != $slots['position']) {
|
||||
echo '<td colspan="' . $slots['width'] . '" style="width: ' . $width . ';" class="text-center border-top border-bottom border-right pl-1 pr-1" rowspan="' . $modulelenght . '">frei</td>';
|
||||
$position++;
|
||||
$calcwidth = $calcwidth + $slots['width'];
|
||||
|
||||
}
|
||||
if ($slots['width'] < 12 && $position != $slots['position']) {
|
||||
echo '<td colspan="' . $slots['width'] . '" style="width: ' . $width . ';" class="text-center border-top border-bottom border-right pl-1 pr-1" rowspan="' . $modulelenght . '">frei</td>';
|
||||
$position++;
|
||||
$calcwidth = $calcwidth + $slots['width'];
|
||||
}
|
||||
if ($slots['width'] < 12 && $position != $slots['position']) {
|
||||
echo '<td colspan="' . $slots['width'] . '" style="width: ' . $width . ';" class="text-center border-top border-bottom border-right pl-1 pr-1" rowspan="' . $modulelenght . '">frei</td>';
|
||||
$position++;
|
||||
$calcwidth = $calcwidth + $slots['width'];
|
||||
}
|
||||
echo '<td title="' . $title . $extText . '" colspan="' . $slots['width'] . '" class="text-center border-top border-bottom border-right pl-1 pr-1 ' . $colorclass . '" data-id="' . $slots['moduleid'] . '" data-type="' . $slots['type'] . '" data-name="' . $title . '" data-starthe="' . $module['start_he'] . '" data-ports="' . $slots['ports'] . '" data-plug="' . $slots['plug'] . '" rowspan="' . $modulelenght . '" style="width: ' . $width . '; background-color: ' . $color . ';border-color: #797979 !important; max-width: ' . $maxwidth . 'px;"><span></span> ' . $slots['modulname'] . $extTextspan . '</td>';
|
||||
$position++;
|
||||
$calcwidth = $calcwidth + $slots['width'];
|
||||
}
|
||||
if ($calcwidth != 12) {
|
||||
echo '<td colspan="' . $slots['width'] . '" style="width: ' . $width . ';" class="text-center border-top border-bottom border-right pl-1 pr-1" rowspan="' . $modulelenght . '">frei</td>';
|
||||
$calcwidth = $calcwidth + $slots['width'];
|
||||
}
|
||||
if ($calcwidth != 12) {
|
||||
echo '<td colspan="' . $slots['width'] . '" style="width: ' . $width . ';" class="text-center border-top border-bottom border-right pl-1 pr-1" rowspan="' . $modulelenght . '">frei</td>';
|
||||
$calcwidth = $calcwidth + $slots['width'];
|
||||
}
|
||||
if ($calcwidth != 12) {
|
||||
echo '<td colspan="' . $slots['width'] . '" style="width: ' . $width . ';" class="text-center border-top border-bottom border-right pl-1 pr-1" rowspan="' . $modulelenght . '">frei</td>';
|
||||
$calcwidth = $calcwidth + $slots['width'];
|
||||
}
|
||||
|
||||
$blocktd = $modulelenght + $i;
|
||||
|
||||
}
|
||||
}
|
||||
if ($i >= $blocktd) {
|
||||
echo '<td colspan="12" style="background-color: #fff;" class="text-center he-free" ><span></span> frei</td>';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tr>
|
||||
<?php endfor; ?>
|
||||
$modules_to_render = $poprack['modules']['front'] ?? [];
|
||||
$rack_he = $poprack['rack']['he'];
|
||||
include('_rack_body.php');
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -627,6 +719,158 @@ if (!empty(trim($pops->vlan_ipv6)))
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
<div class="modal fade" id="cableModal" tabindex="-1" role="dialog" aria-labelledby="cableModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="cableModalLabel">Kabel auf Patch Panel legen</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<input type="hidden" id="cable-poprackmodule-id" name="poprackmodule_id">
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="cable-name">Kabel-Name*</label>
|
||||
<div class="col-lg-6">
|
||||
<input required="required" type="text" id="cable-name" name="cable-name"
|
||||
class="form-control"
|
||||
placeholder="z.B. K001"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="port-start">Start-Port*</label>
|
||||
<div class="col-lg-3">
|
||||
<input required="required" type="number" min="1" id="port-start" name="port-start"
|
||||
class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="port-end">End-Port*</label>
|
||||
<div class="col-lg-3">
|
||||
<input required="required" type="number" min="1" id="port-end" name="port-end"
|
||||
class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="fiber-start">Faser von</label>
|
||||
<div class="col-lg-3">
|
||||
<input type="number" min="1" id="fiber-start" name="fiber-start" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="fiber-end">Faser bis</label>
|
||||
<div class="col-lg-3">
|
||||
<input type="number" min="1" id="fiber-end" name="fiber-end" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="cable-description">Beschreibung</label>
|
||||
<div class="col-lg-6">
|
||||
<textarea id="cable-description" name="cable-description" class="form-control" rows="3"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="alert alert-danger text-center" role="alert" style="display: none"
|
||||
id="cable-modal-alert"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button id="cable-add-button" type="button" class="btn btn-primary">Kabel hinzufügen</button>
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Abbrechen</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="cableEditModal" tabindex="-1" role="dialog" aria-labelledby="cableEditModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="cableEditModalLabel">Kabel bearbeiten</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
|
||||
aria-hidden="true">×</span></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<input type="hidden" id="edit-cable-id">
|
||||
<div class="form-group row">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="edit-cable-name">Kabel-Name*</label>
|
||||
<div class="col-lg-6">
|
||||
<input required="required" type="text" id="edit-cable-name" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="edit-port-start">Start-Port*</label>
|
||||
<div class="col-lg-3">
|
||||
<input required="required" type="number" min="1" id="edit-port-start"
|
||||
class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="edit-port-end">End-Port*</label>
|
||||
<div class="col-lg-3">
|
||||
<input required="required" type="number" min="1" id="edit-port-end"
|
||||
class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="edit-fiber-start">Faser von</label>
|
||||
<div class="col-lg-3">
|
||||
<input type="number" min="1" id="edit-fiber-start" name="fiber-start"
|
||||
class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="edit-fiber-end">Faser bis</label>
|
||||
<div class="col-lg-3">
|
||||
<input type="number" min="1" id="edit-fiber-end" name="fiber-end" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-lg-1"></div>
|
||||
<label class="col-lg-4 col-form-label" for="cable-description">Beschreibung</label>
|
||||
<div class="col-lg-6">
|
||||
<textarea id="edit-cable-description" name="cable-description" class="form-control" rows="3"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="alert alert-danger text-center" role="alert" style="display: none"
|
||||
id="cable-edit-modal-alert"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button id="cable-update-button" type="button" class="btn btn-primary">Änderungen speichern</button>
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Abbrechen</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="cable-context-menu" class="dropdown-menu" style="display:none;">
|
||||
<a class="dropdown-item" href="#" data-action="view"><span class="context-span"><i
|
||||
class="fas fa-eye fa-fw"></i></span> Ansehen</a>
|
||||
<a class="dropdown-item" href="#" data-action="edit"><span class="context-span"><i
|
||||
class="fas fa-edit fa-fw"></i></span> Bearbeiten</a>
|
||||
<a class="dropdown-item" href="#" data-action="delete"><span class="context-span"><i class="fas fa-trash fa-fw"></i></span>
|
||||
Löschen</a>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript" src="<?= self::getResourcePath() ?>assets/js/Sortable.js?<?= $git_merge_ts ?>"></script>
|
||||
<script type="text/javascript">
|
||||
@@ -640,8 +884,13 @@ if (!empty(trim($pops->vlan_ipv6)))
|
||||
let linkEditRack = "<?= self::getUrl("Poprack", "api", ['do' => 'editRack']) ?>";
|
||||
let linkAddRack = "<?= self::getUrl("Poprack", "api", ['do' => 'addRack']) ?>";
|
||||
let linkRemoveRack = "<?= self::getUrl("Poprack", "api", ['do' => 'removeRack']) ?>";
|
||||
let linkAddCable = "<?= self::getUrl("Poprackmodulecable", "api", ['do' => 'addCable']) ?>";
|
||||
let linkRemoveCable = "<?= self::getUrl("Poprackmodulecable", "api", ['do' => 'removeCable']) ?>";
|
||||
let linkUpdateCable = "<?= self::getUrl("Poprackmodulecable", "api", ['do' => 'updateCable']) ?>";
|
||||
|
||||
</script>
|
||||
<script type="text/javascript" src="<?= self::getResourcePath() ?>js/pages/pop/detail.js?<?= $git_merge_ts ?>"></script>
|
||||
<script type="text/javascript" src="<?= self::getResourcePath() ?>assets/js/datatables-std.js?<?= $git_merge_ts ?>"></script>
|
||||
<script type="text/javascript"
|
||||
src="<?= self::getResourcePath() ?>assets/js/datatables-std.js?<?= $git_merge_ts ?>"></script>
|
||||
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
|
||||
|
||||
140
Layout/default/Pop/_rack_body.php
Normal file
140
Layout/default/Pop/_rack_body.php
Normal file
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
$cellwidth = 227;
|
||||
$blocktd = 0;
|
||||
|
||||
for ($i = 1; $i <= $rack_he; $i++) : ?>
|
||||
<tr>
|
||||
<td class="border-right w-10 p-0 pl-1 pr-1 border-bottom font-13 rack-he user-select-none"
|
||||
data-toggle="modal" data-target="#rackModuleModal"
|
||||
style="cursor: pointer" data-he="<?= $i; ?>">He<?= $i; ?></td>
|
||||
<?php
|
||||
|
||||
foreach ($modules_to_render as $module) {
|
||||
|
||||
if ($module['start_he'] == $i) {
|
||||
$modulestart = 1;
|
||||
$modulelenght = $module['end_he'] - $module['start_he'] + 1;
|
||||
$position = 1;
|
||||
$slotcounter = 0;
|
||||
$calcwidth = 0;
|
||||
$extText = "";
|
||||
$extTextspan = "";
|
||||
|
||||
foreach ($module['slots'] as $slots) {
|
||||
$extText = "";
|
||||
$originalName = $slots['modulname'];
|
||||
$displayName = $originalName;
|
||||
$colorclass = "";
|
||||
if ($slots['type'] == '0' && empty(trim($displayName))) {
|
||||
$displayName = "LWL Patch Panel";
|
||||
}
|
||||
if ($slots['type'] == '0') {
|
||||
if (isset($slots['status']) && $slots['status'] == 'planned') {
|
||||
$colorclass = "rack-color-lwl-planned";
|
||||
} else {
|
||||
$colorclass = "rack-color-lwl";
|
||||
}
|
||||
$cellContent = "";
|
||||
$plugName = isset($plugs[$slots['plug']]) ? $plugs[$slots['plug']] : 'k.A.';
|
||||
$cellContent .= '<div class="module-header-info">';
|
||||
$cellContent .= ' <span class="module-name" title="' . $displayName . '">' . $displayName . '</span>';
|
||||
$cellContent .= ' <span class="port-info">(' . $slots['ports'] . 'x' . $plugName . ')</span>';
|
||||
$cellContent .= '</div>';
|
||||
$cellContent .= '<div class="cable-container" style="background-color: #fffbe9;">';
|
||||
if (!empty($slots['cables'])) {
|
||||
usort($slots['cables'], function ($a, $b) {
|
||||
return $a['port_start'] <=> $b['port_start'];
|
||||
});
|
||||
$lastPort = 0;
|
||||
foreach ($slots['cables'] as $cable) {
|
||||
$freePorts = $cable['port_start'] - $lastPort - 1;
|
||||
if ($freePorts > 0) {
|
||||
$freeWidth = ($freePorts / $slots['ports']) * 100;
|
||||
$cellContent .= '<div class="cable-free" style="width: ' . $freeWidth . '%;" title="Ports ' . ($lastPort + 1) . '-' . ($cable['port_start'] - 1) . ' frei">Ports ' . ($lastPort + 1) . '-' . ($cable['port_start'] - 1) . ' frei</div>';
|
||||
}
|
||||
$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);
|
||||
}
|
||||
$cellContent .= '<div class="cable-item" title="' . $cableTitle . '" 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>";
|
||||
if (!empty($cable['description'])) {
|
||||
$cellContent .= '<span class="cable-description" >' . 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>';
|
||||
if (!empty($cable['fiber_start'])) {
|
||||
$cellContent .= '<tool class="fiber-range">F: ' . $cable['fiber_start'] . '-' . $cable['fiber_end'] . "</tool>";
|
||||
}
|
||||
$cellContent .= '</div>';
|
||||
|
||||
$cellContent .= '</div>';
|
||||
$lastPort = $cable['port_end'];
|
||||
}
|
||||
$remainingPorts = $slots['ports'] - $lastPort;
|
||||
if ($remainingPorts > 0) {
|
||||
$remainingWidth = ($remainingPorts / $slots['ports']) * 100;
|
||||
$cellContent .= '<div class="cable-free" style="width: ' . $remainingWidth . '%;" title="Ports ' . ($lastPort + 1) . '-' . $slots['ports'] . ' frei">P: ' . ($lastPort + 1) . '-' . $slots['ports'] . ' frei</div>';
|
||||
}
|
||||
} else {
|
||||
$cellContent .= '<span style="font-size: 12px; font-style: italic; margin: auto;" class="cable-free">Ports ' . '1 -' . $slots['ports'] . ' frei</span>';
|
||||
}
|
||||
$cellContent .= '</div>';
|
||||
|
||||
$slots['modulname'] = $cellContent;
|
||||
$extTextspan = "";
|
||||
|
||||
} else if ($slots['type'] == '1') {
|
||||
$slots['modulname'] = '<a style="color: #000000;text-decoration: underline;" target="_self" href="' . self::getUrl("Device", "detail", ["id" => $slots['device_id']]) . '">' . $displayName . '</a>';
|
||||
$colorclass = "rack-color-device";
|
||||
|
||||
} else if ($slots['type'] == '2') {
|
||||
$colorclass = "rack-color-rpanel";
|
||||
} else if ($slots['type'] == '3') {
|
||||
$colorclass = "rack-color-infra";
|
||||
} else if ($slots['type'] == '4') {
|
||||
$colorclass = "rack-color-panel";
|
||||
} else if ($slots['type'] == '5') {
|
||||
$colorclass = "rack-color-blocked";
|
||||
}
|
||||
|
||||
if ($slots['width'] == "12") $width = "85%";
|
||||
else if ($slots['width'] == "6") $width = "42%";
|
||||
else if ($slots['width'] == "4") $width = "28%";
|
||||
else if ($slots['width'] == "3") $width = "21%";
|
||||
|
||||
|
||||
while ($position < $slots['position']) {
|
||||
echo '<td colspan="' . $slots['width'] . '" class="text-center border-top border-bottom border-right pl-1 pr-1" rowspan="' . $modulelenght . '">frei</td>';
|
||||
$position++;
|
||||
$calcwidth += $slots['width'];
|
||||
}
|
||||
|
||||
echo '<td title="' . strip_tags($displayName) . $extText . '" colspan="' . $slots['width'] . '" class="text-center border-top border-bottom border-right ' . $colorclass . '" data-id="' . $slots['moduleid'] . '" data-type="' . $slots['type'] . '" data-name="' . strip_tags($originalName) . '" data-status="' . ($slots['status'] ?? 'productive') . '" data-starthe="' . $module['start_he'] . '" data-ports="' . $slots['ports'] . '" data-plug="' . $slots['plug'] . '" rowspan="' . $modulelenght . '" style="width: ' . $width . '; border-color: #797979 !important;">' . $slots['modulname'] . $extTextspan . '</td>';
|
||||
|
||||
$position++;
|
||||
$calcwidth += $slots['width'];
|
||||
}
|
||||
|
||||
if ($calcwidth < 12) {
|
||||
$remaining_width = 12 - $calcwidth;
|
||||
echo '<td colspan="' . $remaining_width . '" class="text-center border-top border-bottom border-right pl-1 pr-1" rowspan="' . $modulelenght . '">frei</td>';
|
||||
}
|
||||
|
||||
$blocktd = $modulelenght + $i;
|
||||
}
|
||||
}
|
||||
if ($i >= $blocktd) {
|
||||
echo '<td colspan="12" style="background-color: #fff;" class="text-center he-free pt-1 pb-1"><span></span> frei</td>';
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<?php endfor; ?>
|
||||
Reference in New Issue
Block a user