From 5e74255145de0d9f80a0331831342b3fac81f2ab Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 11 May 2022 16:59:36 +0200 Subject: [PATCH] basic list snapshots --- ereuse_devicehub/inventory/views.py | 13 ++++ .../templates/inventory/snapshots_list.html | 63 +++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 ereuse_devicehub/templates/inventory/snapshots_list.html diff --git a/ereuse_devicehub/inventory/views.py b/ereuse_devicehub/inventory/views.py index a09f4f5b..f089dc63 100644 --- a/ereuse_devicehub/inventory/views.py +++ b/ereuse_devicehub/inventory/views.py @@ -505,6 +505,18 @@ class ExportsView(View): return flask.render_template('inventory/erasure.html', **params) +class SnapshotListView(GenericMixView): + methods = ['GET'] + decorators = [login_required] + template_name = 'inventory/snapshots_list.html' + + def dispatch_request(self, id): + self.get_context() + self.context['page_title'] = "Snapshots" + self.context['snapshots'] = [] + return flask.render_template(self.template_name, **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( @@ -551,3 +563,4 @@ devices.add_url_rule( devices.add_url_rule( '/export//', view_func=ExportsView.as_view('export') ) +devices.add_url_rule('/snapshots/', view_func=SnapshotListView.as_view('snapshotslist')) diff --git a/ereuse_devicehub/templates/inventory/snapshots_list.html b/ereuse_devicehub/templates/inventory/snapshots_list.html new file mode 100644 index 00000000..e6004f63 --- /dev/null +++ b/ereuse_devicehub/templates/inventory/snapshots_list.html @@ -0,0 +1,63 @@ +{% extends "ereuse_devicehub/base_site.html" %} +{% block main %} + +
+

Inventory

+ +
+ +
+
+ +
+ +
+
+ + +
+ +
+ +
Snapshot
+ + + + + + + + + + + + {% for snap in snapshots %} + + + + + + + + {% endfor %} + +
SidWorkbench VersionErrorsDHIDUploaded
{{ snap.sid }}{{ snap.version }}{{ snap.status }}{{ snap.device.devicehub_id }}{{ snap.created }}
+ +
+ +
+
+ +
+
+
+ + + +{% endblock main %}