Compare commits

..

2 Commits

3 changed files with 13 additions and 13 deletions

View File

@ -15,7 +15,7 @@
<a href="#details" class="nav-link active" data-bs-toggle="tab" data-bs-target="#details">{% trans 'General details' %}</a>
</li>
<li class="nav-item">
<a href="#annotations" class="nav-link" data-bs-toggle="tab" data-bs-target="#annotations">{% trans 'User properties' %}</a>
<a href="#user_properties" class="nav-link" data-bs-toggle="tab" data-bs-target="#user_properties">{% trans 'User properties' %}</a>
</li>
<li class="nav-item">
<a href="#documents" class="nav-link" data-bs-toggle="tab" data-bs-target="#documents">{% trans 'Documents' %}</a>
@ -100,7 +100,7 @@
{% endfor %}
</div>
<div class="tab-pane fade" id="annotations">
<div class="tab-pane fade" id="user_properties">
<div class="btn-group mt-1 mb-3">
<a href="{% url 'device:add_user_property' object.pk %}" class="btn btn-primary">
<i class="bi bi-plus"></i>

View File

@ -8,7 +8,7 @@ from utils.device import create_property, create_doc, create_index
from utils.forms import MultipleFileField
from device.models import Device
from evidence.parse import Build
from evidence.models import SystemProperty
from evidence.models import SystemProperty, Property
from utils.save_snapshots import move_json, save_in_disk
@ -68,9 +68,9 @@ class UserTagForm(forms.Form):
self.pk = None
self.uuid = kwargs.pop('uuid', None)
self.user = kwargs.pop('user')
instance = Annotation.objects.filter(
instance = SystemProperty.objects.filter(
uuid=self.uuid,
type=Annotation.Type.SYSTEM,
type=Property.Type.SYSTEM,
key='CUSTOM_ID',
owner=self.user.institution
).first()
@ -88,7 +88,7 @@ class UserTagForm(forms.Form):
self.tag = data
self.instance = SystemProperty.objects.filter(
uuid=self.uuid,
type=Annotation.Type.SYSTEM,
type=Property.Type.SYSTEM,
key='CUSTOM_ID',
owner=self.user.institution
).first()
@ -186,9 +186,9 @@ class EraseServerForm(forms.Form):
self.pk = None
self.uuid = kwargs.pop('uuid', None)
self.user = kwargs.pop('user')
instance = Annotation.objects.filter(
instance = SystemProperty.objects.filter(
uuid=self.uuid,
type=Annotation.Type.ERASE_SERVER,
type=SystemProperty.Type.ERASE_SERVER,
key='ERASE_SERVER',
owner=self.user.institution
).first()
@ -201,9 +201,9 @@ class EraseServerForm(forms.Form):
def clean(self):
self.erase_server = self.cleaned_data.get('erase_server', False)
self.instance = Annotation.objects.filter(
self.instance = SystemProperty.objects.filter(
uuid=self.uuid,
type=Annotation.Type.ERASE_SERVER,
type=Property.Type.ERASE_SERVER,
key='ERASE_SERVER',
owner=self.user.institution
).first()
@ -224,7 +224,7 @@ class EraseServerForm(forms.Form):
SystemProperty.objects.create(
uuid=self.uuid,
type=Annotation.Type.ERASE_SERVER,
type=Property.Type.ERASE_SERVER,
key='ERASE_SERVER',
value=self.erase_server,
owner=self.user.institution,

View File

@ -45,7 +45,7 @@
</th>
</tr>
</thead>
{% for snap in object.annotations %}
{% for snap in object.properties %}
<tbody>
{% if snap.type == 0 %}
<tr>
@ -94,7 +94,7 @@
</div>
{% if form.tag.value %}
<div class="col-1">
<a class="btn btn-yellow" href="{% url 'evidence:delete_annotation' form.pk %}">{% translate "Delete" %}</a>
<a class="btn btn-yellow" href="{% url 'evidence:delete_user_property' form.pk %}">{% translate "Delete" %}</a>
</div>
{% endif %}
</div>