From a0a52d8248f38571494cc804622aece4c852c364 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 13 Apr 2022 18:31:39 +0200 Subject: [PATCH] view list for snapshot errors --- ereuse_devicehub/inventory/views.py | 20 +++++ .../templates/inventory/snapshot_list.html | 73 +++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 ereuse_devicehub/templates/inventory/snapshot_list.html diff --git a/ereuse_devicehub/inventory/views.py b/ereuse_devicehub/inventory/views.py index ac91ac44..5ccf6961 100644 --- a/ereuse_devicehub/inventory/views.py +++ b/ereuse_devicehub/inventory/views.py @@ -547,6 +547,25 @@ class ExportsView(View): return flask.render_template('inventory/erasure.html', **params) +class SnapshotListView(GenericMixView): + decorators = [login_required] + template_name = 'inventory/snapshot_list.html' + + def dispatch_request(self): + self.get_context() + return flask.render_template(self.template_name, **self.context) + + def get_context(self): + lots = self.get_lots() + + self.context = { + 'lots': lots, + 'version': __version__, + } + + return self.context + + devices.add_url_rule('/action/add/', view_func=NewActionView.as_view('action_add')) devices.add_url_rule('/action/trade/add/', view_func=NewTradeView.as_view('trade_add')) devices.add_url_rule( @@ -560,6 +579,7 @@ devices.add_url_rule( view_func=NewTradeDocumentView.as_view('trade_document_add'), ) devices.add_url_rule('/device/', view_func=DeviceListView.as_view('devicelist')) +devices.add_url_rule('/snapshot/', view_func=SnapshotListView.as_view('snapshotlist')) devices.add_url_rule( '/device//', view_func=DeviceDetailView.as_view('device_details') ) diff --git a/ereuse_devicehub/templates/inventory/snapshot_list.html b/ereuse_devicehub/templates/inventory/snapshot_list.html new file mode 100644 index 00000000..2eb07016 --- /dev/null +++ b/ereuse_devicehub/templates/inventory/snapshot_list.html @@ -0,0 +1,73 @@ +{% extends "ereuse_devicehub/base_site.html" %} +{% block main %} + +
+

Inventory

+ +
+ +
+
+ +
+ +
+
+ +
+
+
+ + + + + + + + + + + + {% for snap in snapshots_errors %} + + + + + + + + {% endfor %} + +
WBIDSnapshot idDeviceErrorsTime
+ {{ snap.wbid }} + + {{ snap.snapshot_uuid }} + + + {{ snap.description }} + {{ dev.created.strftime('%H:%M %d-%m-%Y') }}
+ +
+
+ +
+
+
+
+ +
+ +
+ +
+ + + +{% endblock main %}