mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-25 22:03:10 +00:00
Auto format MAC addresses inmachine history search
This commit is contained in:
parent
5b687ec203
commit
1f622d19f1
1 changed files with 10 additions and 2 deletions
|
@ -26,6 +26,7 @@ from django.utils.translation import ugettext_lazy as _
|
|||
from django.contrib.auth.models import Group
|
||||
from django.db.models import Q
|
||||
from django.apps import apps
|
||||
from netaddr import EUI
|
||||
|
||||
from machines.models import IpList
|
||||
from machines.models import Interface
|
||||
|
@ -149,9 +150,16 @@ class MachineHistorySearch:
|
|||
|
||||
self.events = []
|
||||
if search_type == "ip":
|
||||
return self._get_by_ip(search)[::-1]
|
||||
try:
|
||||
return self._get_by_ip(search)[::-1]
|
||||
except:
|
||||
pass
|
||||
elif search_type == "mac":
|
||||
return self._get_by_mac(search)[::-1]
|
||||
try:
|
||||
search = EUI(search)
|
||||
return self._get_by_mac(search)[::-1]
|
||||
except:
|
||||
pass
|
||||
|
||||
return None
|
||||
|
||||
|
|
Loading…
Reference in a new issue