wandbuchsen editieren ungetestet

This commit is contained in:
2026-02-16 10:14:41 +01:00
parent 3bc5a2ca04
commit f80ab4aaa9
3 changed files with 22 additions and 34 deletions

View File

@@ -167,7 +167,7 @@ document.addEventListener('DOMContentLoaded', () => {
if (markerType === 'outlet' && Number(entry.id) === activeId) { if (markerType === 'outlet' && Number(entry.id) === activeId) {
return; return;
} }
appendReference(entry, 'outlet-marker', 32, 32); appendReference(entry, 'outlet-marker', 10, 10);
}); });
}; };

View File

@@ -93,12 +93,17 @@ if ($type === 'patchpanel') {
} }
$defaultPanelSize = ['width' => 140, 'height' => 40]; $defaultPanelSize = ['width' => 140, 'height' => 40];
$defaultOutletSize = 32; $defaultOutletSize = 10;
$showPanelPlacementFields = $type === 'patchpanel' && $selectedFloorId > 0; $showPanelPlacementFields = $type === 'patchpanel' && $selectedFloorId > 0;
if ($type === 'patchpanel') { if ($type === 'patchpanel') {
$panel['width'] = $panel['width'] ?? $defaultPanelSize['width']; $panel['width'] = $panel['width'] ?? $defaultPanelSize['width'];
$panel['height'] = $panel['height'] ?? $defaultPanelSize['height']; $panel['height'] = $panel['height'] ?? $defaultPanelSize['height'];
$panel['pos_x'] = $panel['pos_x'] ?? 30;
$panel['pos_y'] = $panel['pos_y'] ?? 30;
} else {
$outlet['x'] = $outlet['x'] ?? 30;
$outlet['y'] = $outlet['y'] ?? 30;
} }
$markerWidth = $type === 'patchpanel' ? $panel['width'] : $defaultOutletSize; $markerWidth = $type === 'patchpanel' ? $panel['width'] : $defaultOutletSize;
@@ -177,23 +182,13 @@ $mapOutlets = $sql->get(
</div> </div>
</div> </div>
<input type="hidden" name="pos_x" value="<?php echo (int)($panel['pos_x'] ?? 30); ?>">
<input type="hidden" name="pos_y" value="<?php echo (int)($panel['pos_y'] ?? 30); ?>">
<input type="hidden" name="width" value="<?php echo (int)$panel['width']; ?>">
<input type="hidden" name="height" value="<?php echo (int)$panel['height']; ?>">
<div id="panel-placement-fields" class="form-grid" <?php echo $showPanelPlacementFields ? '' : 'hidden'; ?>> <div id="panel-placement-fields" class="form-grid" <?php echo $showPanelPlacementFields ? '' : 'hidden'; ?>>
<div class="form-group"> <p class="info">Position, Breite und Höhe werden über die Karte gesetzt.</p>
<label>X</label>
<input type="number" name="pos_x" value="<?php echo $panel['pos_x'] ?? 0; ?>">
</div>
<div class="form-group">
<label>Y</label>
<input type="number" name="pos_y" value="<?php echo $panel['pos_y'] ?? 0; ?>">
</div>
<div class="form-group">
<label>Breite</label>
<input type="number" name="width" value="<?php echo $panel['width']; ?>" readonly title="Breite wird automatisch nach Standardwerten vorgegeben.">
</div>
<div class="form-group">
<label>Höhe</label>
<input type="number" name="height" value="<?php echo $panel['height']; ?>" readonly title="Höhe wird automatisch nach Standardwerten vorgegeben.">
</div>
</div> </div>
<div id="panel-floor-plan-group" class="form-group" <?php echo $showPanelPlacementFields ? '' : 'hidden'; ?>> <div id="panel-floor-plan-group" class="form-group" <?php echo $showPanelPlacementFields ? '' : 'hidden'; ?>>
@@ -212,7 +207,7 @@ $mapOutlets = $sql->get(
<div id="floor-plan-marker" class="floor-plan-marker panel-marker" <div id="floor-plan-marker" class="floor-plan-marker panel-marker"
style="--marker-width: <?php echo $markerWidth; ?>px; --marker-height: <?php echo $markerHeight; ?>px;"></div> style="--marker-width: <?php echo $markerWidth; ?>px; --marker-height: <?php echo $markerHeight; ?>px;"></div>
</div> </div>
<p class="floor-plan-hint">Nur das aktuell bearbeitete Patchpanel ist verschiebbar. Andere Objekte werden als Referenz halbtransparent angezeigt.</p> <p class="floor-plan-hint">Nur das aktuell bearbeitete Patchpanel ist verschiebbar. Andere Objekte werden als Referenz halbtransparent angezeigt. Neue Objekte starten bei Position 30 x 30.</p>
<p class="floor-plan-position">Koordinate: <span id="floor-plan-position"></span></p> <p class="floor-plan-position">Koordinate: <span id="floor-plan-position"></span></p>
</div> </div>
</div> </div>
@@ -254,15 +249,8 @@ $mapOutlets = $sql->get(
</select> </select>
</div> </div>
<div class="form-group"> <input type="hidden" name="x" value="<?php echo (int)($outlet['x'] ?? 30); ?>">
<label>X</label> <input type="hidden" name="y" value="<?php echo (int)($outlet['y'] ?? 30); ?>">
<input type="number" name="x" value="<?php echo $outlet['x'] ?? 0; ?>">
</div>
<div class="form-group">
<label>Y</label>
<input type="number" name="y" value="<?php echo $outlet['y'] ?? 0; ?>">
</div>
<div class="form-group"> <div class="form-group">
<label>Stockwerkskarte</label> <label>Stockwerkskarte</label>
@@ -280,7 +268,7 @@ $mapOutlets = $sql->get(
<div id="floor-plan-marker" class="floor-plan-marker outlet-marker" <div id="floor-plan-marker" class="floor-plan-marker outlet-marker"
style="--marker-width: <?php echo $markerWidth; ?>px; --marker-height: <?php echo $markerHeight; ?>px;"></div> style="--marker-width: <?php echo $markerWidth; ?>px; --marker-height: <?php echo $markerHeight; ?>px;"></div>
</div> </div>
<p class="floor-plan-hint">Nur die aktuell bearbeitete Wandbuchse ist verschiebbar. Andere Objekte werden als Referenz halbtransparent angezeigt.</p> <p class="floor-plan-hint">Nur die aktuell bearbeitete Wandbuchse ist verschiebbar. Andere Objekte werden als Referenz halbtransparent angezeigt. Netzwerkdosen sind immer 10 x 10.</p>
<p class="floor-plan-position">Koordinate: <span id="floor-plan-position"></span></p> <p class="floor-plan-position">Koordinate: <span id="floor-plan-position"></span></p>
</div> </div>
</div> </div>
@@ -400,8 +388,8 @@ $mapOutlets = $sql->get(
border-radius: 6px; border-radius: 6px;
} }
.floor-plan-reference.outlet-marker { .floor-plan-reference.outlet-marker {
width: 32px; width: 10px;
height: 32px; height: 10px;
background: rgba(25, 135, 84, 0.22); background: rgba(25, 135, 84, 0.22);
border: 2px solid rgba(25, 135, 84, 0.7); border: 2px solid rgba(25, 135, 84, 0.7);
border-radius: 4px; border-radius: 4px;

View File

@@ -287,8 +287,8 @@ if ($editorFloorId > 0) {
border-radius: 6px; border-radius: 6px;
} }
.infra-marker.outlet { .infra-marker.outlet {
width: 32px; width: 10px;
height: 32px; height: 10px;
background: rgba(25, 135, 84, 0.25); background: rgba(25, 135, 84, 0.25);
border: 2px solid #198754; border: 2px solid #198754;
border-radius: 4px; border-radius: 4px;
@@ -317,7 +317,7 @@ document.addEventListener('DOMContentLoaded', () => {
return; return;
} }
const outletSize = 32; const outletSize = 10;
const patchPanels = <?php echo json_encode($editorPatchPanels, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); ?>; const patchPanels = <?php echo json_encode($editorPatchPanels, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); ?>;
const outlets = <?php echo json_encode($editorOutlets, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); ?>; const outlets = <?php echo json_encode($editorOutlets, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); ?>;