From 7ff565844ae1e00be4025a488087f687fe5091ac Mon Sep 17 00:00:00 2001 From: Maari Tamm Date: Fri, 24 Jan 2020 13:41:01 +0000 Subject: [PATCH] Update API version to 2.33 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Manila API version in the UI needs to be updated and it was advised to do that step by step. In this patch we update it to v2.33, that adds timestamp details: ’updated_at’ & ‘created_at’ to access_list API With this patch we make those two added values visible in the dashboard at: /dashboard/project/shares// /dashboard/project/shares//rules/ /dashboard/admin/shares// Partial-Bug: #1823078 Change-Id: I2502e1446070ef625538c13a30438a548498626e --- manila_ui/api/manila.py | 2 +- .../shares/templates/shares/_detail.html | 22 +++++++++++-------- manila_ui/dashboards/project/shares/tables.py | 5 +++++ .../shares/templates/shares/_detail.html | 22 +++++++++++-------- ...upgrade-api-to-v2.33-82871432659a8285.yaml | 7 ++++++ 5 files changed, 39 insertions(+), 19 deletions(-) create mode 100644 releasenotes/notes/bug-1823078-upgrade-api-to-v2.33-82871432659a8285.yaml diff --git a/manila_ui/api/manila.py b/manila_ui/api/manila.py index a40e1dde..20439d1a 100644 --- a/manila_ui/api/manila.py +++ b/manila_ui/api/manila.py @@ -32,7 +32,7 @@ LOG = logging.getLogger(__name__) MANILA_UI_USER_AGENT_REPR = "manila_ui_plugin_for_horizon" # NOTE(vponomaryov): update version to 2.34 when manilaclient is released with # its support. It will allow to show 'availability zones' for share groups. -MANILA_VERSION = "2.32" # requires manilaclient 1.13.0 or newer +MANILA_VERSION = "2.33" # requires manilaclient 1.16.0 or newer MANILA_SERVICE_TYPE = "sharev2" # API static values diff --git a/manila_ui/dashboards/admin/shares/templates/shares/_detail.html b/manila_ui/dashboards/admin/shares/templates/shares/_detail.html index a318a135..ec139378 100644 --- a/manila_ui/dashboards/admin/shares/templates/shares/_detail.html +++ b/manila_ui/dashboards/admin/shares/templates/shares/_detail.html @@ -81,15 +81,19 @@

{% trans "Access Rules" %}


- {% for rule in share.rules %} + {% for rule in share.rules %}
{{ rule.access_type }}
-

-

Access to: {{ rule.access_to }}
-
Access Level: {{ rule.access_level }}
-
Status: {{ rule.state }}
-
Access Key: {{ rule.access_key }}
-

- {% endfor %} +
+

+

Access to: {{ rule.access_to }}
+
Access Level: {{ rule.access_level }}
+
Status: {{ rule.state }}
+
Access Key: {{ rule.access_key }}
+
Created At: {{ rule.created_at|parse_date }}
+
Updated At: {{ rule.updated_at|parse_date }}
+

+
+ {% endfor %}
@@ -102,4 +106,4 @@
{{ value }}
{% endfor %} - + \ No newline at end of file diff --git a/manila_ui/dashboards/project/shares/tables.py b/manila_ui/dashboards/project/shares/tables.py index 4279f236..259306c4 100644 --- a/manila_ui/dashboards/project/shares/tables.py +++ b/manila_ui/dashboards/project/shares/tables.py @@ -21,6 +21,7 @@ from django.utils.translation import ungettext_lazy from horizon import exceptions from horizon import messages from horizon import tables +from horizon.utils import filters from manila_ui.api import manila from manila_ui.dashboards.project.share_snapshots import tables as ss_tables @@ -359,6 +360,10 @@ class RulesTable(tables.DataTable): "access_level", verbose_name=_("Access Level")) status = tables.Column("state", verbose_name=_("Status")) access_key = tables.Column("access_key", verbose_name=_("Access Key")) + created_at = tables.Column("created_at", verbose_name=_("Created At"), + filters=(filters.parse_isotime,)) + updated_at = tables.Column("updated_at", verbose_name=_("Updated At"), + filters=(filters.parse_isotime,)) def get_object_display(self, obj): return obj.id diff --git a/manila_ui/dashboards/project/shares/templates/shares/_detail.html b/manila_ui/dashboards/project/shares/templates/shares/_detail.html index a139a2a3..e71b3a63 100644 --- a/manila_ui/dashboards/project/shares/templates/shares/_detail.html +++ b/manila_ui/dashboards/project/shares/templates/shares/_detail.html @@ -83,15 +83,19 @@

{% trans "Access Rules" %}


- {% for rule in share.rules %} + {% for rule in share.rules %}
{{ rule.access_type }}
-

-

Access to: {{ rule.access_to }}
-
Access Level: {{ rule.access_level }}
-
Status: {{ rule.state }}
-
Access Key: {{ rule.access_key }}
-

- {% endfor %} +
+

+

Access to: {{ rule.access_to }}
+
Access Level: {{ rule.access_level }}
+
Status: {{ rule.state }}
+
Access Key: {{ rule.access_key }}
+
Created At: {{ rule.created_at|parse_date }}
+
Updated At: {{ rule.updated_at|parse_date }}
+

+
+ {% endfor %}
@@ -104,4 +108,4 @@
{{ value }}
{% endfor %} - + \ No newline at end of file diff --git a/releasenotes/notes/bug-1823078-upgrade-api-to-v2.33-82871432659a8285.yaml b/releasenotes/notes/bug-1823078-upgrade-api-to-v2.33-82871432659a8285.yaml new file mode 100644 index 00000000..e34e300d --- /dev/null +++ b/releasenotes/notes/bug-1823078-upgrade-api-to-v2.33-82871432659a8285.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + This change updates the Manila API version to 2.33. + This means that users can have access to timestamp details in access rules, + available since API v2.33 +