This commit is contained in:
2026-02-12 09:55:27 +01:00
parent 88c8a3fd58
commit 985fc05aa1
3 changed files with 133 additions and 1 deletions

View File

@@ -111,11 +111,20 @@ $devices = $sql->get("SELECT id, name FROM devices ORDER BY name", "", []);
<th>Nach (Gerät → Port)</th>
<th>VLANs</th>
<th>Beschreibung</th>
<th>Status</th>
<th>Aktionen</th>
</tr>
</thead>
<tbody>
<?php foreach ($connections as $conn): ?>
<?php
$comment = trim($conn['comment'] ?? '');
$hasMissingInfo = empty($conn['device_a_name']) || empty($conn['device_b_name'])
|| empty($conn['port_a_name']) || empty($conn['port_b_name']);
$commentLower = mb_strtolower($comment, 'UTF-8');
$warningFromComment = preg_match('/warn|achtung|critical/', $commentLower);
$hasWarning = $hasMissingInfo || $warningFromComment;
?>
<tr>
<td>
<strong><?php echo htmlspecialchars($conn['device_a_name'] ?? 'N/A'); ?></strong><br>
@@ -143,6 +152,17 @@ $devices = $sql->get("SELECT id, name FROM devices ORDER BY name", "", []);
<td>
<small><?php echo htmlspecialchars($conn['comment'] ?? ''); ?></small>
</td>
<td class="status-cell">
<?php if ($hasWarning): ?>
<span class="status-badge status-badge-warning" title="Unvollständige oder kritische Verbindung">
⚠️ Warnung
</span>
<?php else: ?>
<span class="status-badge status-badge-ok" title="Verbindung vollständig">
✔️ OK
</span>
<?php endif; ?>
</td>
<td class="actions">
<a href="?module=connections&action=edit&id=<?php echo $conn['id']; ?>" class="button button-small">Bearbeiten</a>