diff --git a/dashboard/views.py b/dashboard/views.py index 36369c5..8d91732 100644 --- a/dashboard/views.py +++ b/dashboard/views.py @@ -70,10 +70,17 @@ class SearchView(InventaryMixin): return self.search_hids(query, offset, limit) devices = [] + dev_id = [] + for x in matches: - devices.append(self.get_annotations(x)) + # devices.append(self.get_annotations(x)) + dev = self.get_annotations(x) + if dev.id not in dev_id: + devices.append(dev) + dev_id.append(dev.id) count = matches.size() + # TODO fix of pagination, the count is not correct return devices, count def get_annotations(self, xp): diff --git a/device/models.py b/device/models.py index da53de8..a351a11 100644 --- a/device/models.py +++ b/device/models.py @@ -108,6 +108,22 @@ class Device: return annotation = annotations.first() self.last_evidence = Evidence(annotation.uuid) + + def is_eraseserver(self): + if not self.uuids: + self.get_uuids() + if not self.uuids: + return False + + annotation = Annotation.objects.filter( + uuid__in=self.uuids, + owner=self.owner, + type=Annotation.Type.ERASE_SERVER + ).first() + + if annotation: + return True + return False def last_uuid(self): return self.uuids[0] diff --git a/device/templates/details.html b/device/templates/details.html index ee14f75..aaee4c2 100644 --- a/device/templates/details.html +++ b/device/templates/details.html @@ -2,38 +2,126 @@ {% load i18n %} {% block content %} -
Key | +Value | +Created on | ++ | + |
---|---|---|---|---|
{{ a.key }} | +{{ a.value }} | +{{ a.created }} | ++ | + |