feat: VLAN in FDB, persist vlan, enrich port-devices with hostname, UI columns

Made-with: Cursor
This commit is contained in:
PTah
2026-04-13 12:38:05 +10:00
parent 927110167c
commit 886300b6c0
8 changed files with 91 additions and 26 deletions
+5
View File
@@ -122,8 +122,10 @@ type PortDeviceResult struct {
IP string `json:"ip"`
IfIndex int `json:"if_index"`
BridgePort int `json:"bridge_port,omitempty"`
Vlan int `json:"vlan"`
MAC string `json:"mac"`
LearnedIP string `json:"learned_ip"`
Hostname string `json:"hostname,omitempty"` // подставляется при ответе API по sysName скана, не хранится в БД
CheckedAt time.Time `json:"checked_at"`
}
@@ -419,6 +421,9 @@ func (s *MemoryStore) ListPortDeviceResults(scanID string, filterIP string, filt
if filtered[i].IfIndex != filtered[j].IfIndex {
return filtered[i].IfIndex < filtered[j].IfIndex
}
if filtered[i].Vlan != filtered[j].Vlan {
return filtered[i].Vlan < filtered[j].Vlan
}
if filtered[i].MAC != filtered[j].MAC {
return filtered[i].MAC < filtered[j].MAC
}