Итерация 3: инвентарь устройств

- Миграция devices (name, type, ip, mac, hostname, vendor, os, location, importance, status)
- Device model + DeviceRepository с полным CRUD
- DeviceService для бизнес-логики
- MergeSuggestionService для предложений объединения (MAC→90%, hostname→60%)
- DeviceController: список, создание, редактирование, карточка, удаление, создание из discovered_host
- Шаблоны: devices/index, devices/form, devices/show
- Dashboard с реальными счётчиками (устройства, новые находки)
- Кнопка «Создать устройство» в Discovery для новых хостов
- DeviceRepository + DeviceService + DeviceController в DI
This commit is contained in:
2026-05-26 07:50:37 +08:00
parent 177e44f015
commit 15772bc17e
13 changed files with 760 additions and 28 deletions
+5
View File
@@ -144,6 +144,11 @@
<td><?= empty($host->openPorts) ? '-' : implode(', ', $host->openPorts) ?></td>
<td><?= $host->confidence ?>%</td>
<td>
<form method="POST" action="/devices/from-host" class="d-inline">
<input type="hidden" name="host_id" value="<?= $host->id ?>">
<input type="hidden" name="name" value="<?= htmlspecialchars($host->hostname ?: $host->ipAddress) ?>">
<button type="submit" class="btn btn-sm btn-outline-primary">Создать устройство</button>
</form>
<form method="POST" action="/discovery/hosts/ignore" class="d-inline">
<input type="hidden" name="host_id" value="<?= $host->id ?>">
<button type="submit" class="btn btn-sm btn-outline-secondary">Игнорировать</button>