feat: VLAN in FDB, persist vlan, enrich port-devices with hostname, UI columns
Made-with: Cursor
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user