Change Patches Tab to Releases Tab

This is part of the changes required to implement USM in GUI (Horizon).

In order to improve the user experience, some labels have been modified
as part of the USM integration.

Change-Id: If412e1954474a4350e1cbd6b73f6a8e82cfbf070
This commit is contained in:
Italo Lemos 2024-03-26 16:15:51 -03:00 committed by Italo Lemos
parent f04638e8f8
commit e31bebd926
3 changed files with 33 additions and 33 deletions

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2013-2018 Wind River Systems, Inc.
# Copyright (c) 2013-2024 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@ -18,14 +18,14 @@ from starlingx_dashboard.dashboards.admin.software_management import \
LOG = logging.getLogger(__name__)
class PatchesTab(tabs.TableTab):
class ReleasesTab(tabs.TableTab):
table_classes = (toplevel_tables.PatchesTable,)
name = _("Patches")
slug = "patches"
template_name = ("admin/software_management/_patches.html")
name = _("Releases")
slug = "releases"
template_name = "admin/software_management/_releases.html"
def get_context_data(self, request):
context = super(PatchesTab, self).get_context_data(request)
context = super(ReleasesTab, self).get_context_data(request)
phosts = []
try:
@ -39,16 +39,16 @@ class PatchesTab(tabs.TableTab):
return context
def get_patches_data(self):
def get_releases_data(self):
request = self.request
patches = []
releases = []
try:
patches = stx_api.patch.get_patches(request)
releases = stx_api.patch.get_patches(request)
except Exception:
exceptions.handle(self.request,
_('Unable to retrieve patch list.'))
_('Unable to retrieve release list.'))
return patches
return releases
class PatchOrchestrationTab(tabs.TableTab):
@ -137,5 +137,5 @@ class UpgradeOrchestrationTab(tabs.TableTab):
class SoftwareManagementTabs(tabs.TabGroup):
slug = "software_management_tabs"
tabs = (PatchesTab, PatchOrchestrationTab, UpgradeOrchestrationTab)
tabs = (ReleasesTab, PatchOrchestrationTab, UpgradeOrchestrationTab)
sticky = True

View File

@ -1,20 +1,20 @@
{% load i18n sizeformat %}
{% block main %}
<div id="patches">
<div id="patching-status" class="info details">
<span>
{% if patch_current %}
<span class="badge badge-success">{% trans "System is Patch Current" %}</span>
{% else %}
<span class="badge badge-warning">{% trans "System is Not Patch Current" %}</span>
{% endif %}
</span>
</div>
{{ patches_table.render }}
</div>
{% endblock %}
{% load i18n sizeformat %}
{% block main %}
<div id="patches">
<div id="patching-status" class="info details">
<span>
{% if patch_current %}
<span class="badge badge-success">{% trans "System is Patch Current" %}</span>
{% else %}
<span class="badge badge-warning">{% trans "System is Not Patch Current" %}</span>
{% endif %}
</span>
</div>
{{ patches_table.render }}
</div>
{% endblock %}

View File

@ -21,7 +21,7 @@ class PatchesTab(tabs.TableTab):
table_classes = (tables.PatchesTable,)
name = _("Patches")
slug = "patches"
template_name = ("dc_admin/dc_software_management/_patches.html")
template_name = ("dc_admin/dc_software_management/_releases.html")
preload = False
def get_dc_patches_data(self):