fix get did from chir and add dpp template for details of device
This commit is contained in:
parent
74d48c173b
commit
8edfaa1bc5
|
@ -103,6 +103,8 @@
|
||||||
|
|
||||||
{% include 'tabs/evidences.html' %}
|
{% include 'tabs/evidences.html' %}
|
||||||
|
|
||||||
|
{% include 'tabs/dpps.html' %}
|
||||||
|
|
||||||
<!-- Add a note popup -->
|
<!-- Add a note popup -->
|
||||||
<div class="modal fade" id="addNoteModal" tabindex="-1" aria-labelledby="addNoteModalLabel" aria-hidden="true">
|
<div class="modal fade" id="addNoteModal" tabindex="-1" aria-labelledby="addNoteModalLabel" aria-hidden="true">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
|
|
18
device/templates/tabs/dpps.html
Normal file
18
device/templates/tabs/dpps.html
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
<div class="tab-pane fade" id="dpps">
|
||||||
|
<h5 class="card-title">{% trans 'List of dpps' %}</h5>
|
||||||
|
<div class="list-group col">
|
||||||
|
{% for d in dpps %}
|
||||||
|
<div class="list-group-item">
|
||||||
|
<div class="d-flex w-100 justify-content-between">
|
||||||
|
<small class="text-muted">{{ d.timestamp }}</small>
|
||||||
|
<span>{{ d.type }}</span>
|
||||||
|
</div>
|
||||||
|
<p class="mb-1">
|
||||||
|
<a href="{% url 'did:device_web' d.signature %}">{{ d.signature }}</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -137,15 +137,15 @@ class PublicDeviceWebView(TemplateView):
|
||||||
dev = Build(d.doc, None, check=True)
|
dev = Build(d.doc, None, check=True)
|
||||||
doc = dev.build.get_doc()
|
doc = dev.build.get_doc()
|
||||||
ev = json.dumps(doc)
|
ev = json.dumps(doc)
|
||||||
phid = dev.get_signature(doc)
|
phid = dev.sign(ev)
|
||||||
dpp = "{}:{}".format(self.pk, phid)
|
dpp = "{}:{}".format(self.pk, phid)
|
||||||
rr = {
|
rr = {
|
||||||
'dpp': dpp,
|
'dpp': dpp,
|
||||||
'document': ev,
|
'document': ev,
|
||||||
'algorithm': ALGORITHM,
|
'algorithm': ALGORITHM,
|
||||||
'manufacturer DPP': '',
|
'manufacturer DPP': '',
|
||||||
'device': dev.device,
|
'device': dev.build.device,
|
||||||
'components': dev.components
|
'components': dev.build.components
|
||||||
}
|
}
|
||||||
|
|
||||||
tmpl = dpp_tmpl.copy()
|
tmpl = dpp_tmpl.copy()
|
||||||
|
|
Loading…
Reference in a new issue