Separate internal MURANO_REPO_URL and DISPLAY_MURANO_REPO_URL

The repo url in dashboard is not found, since it used the same url with
internal repo_url. This patch separates internal repo_url and display
repo_url.

Change-Id: I600f32a02814eacf2a920763ee9f70ce37b57ab8
Closes-Bug: #1542776
This commit is contained in:
lvdongbing 2016-08-15 02:33:32 -04:00 committed by Kirill Zaitsev
parent da828b0615
commit 0eceafb448
7 changed files with 16 additions and 5 deletions

View File

@ -584,7 +584,7 @@ class IndexView(generic_views.PageTitleMixin, list_view.ListView):
context['tenant_id'] = self.request.session['token'].tenant['id']
context.update(get_environments_context(self.request))
context['repo_url'] = pkg_consts.MURANO_REPO_URL
context['display_repo_url'] = pkg_consts.DISPLAY_MURANO_REPO_URL
context['pkg_def_url'] = reverse('horizon:murano:packages:index')
context['no_apps'] = True
if self.get_current_category() != ALL_CATEGORY_NAME or search:

View File

@ -542,7 +542,7 @@ class ServicesTable(tables.DataTable):
return actions
def get_repo_url(self):
return pkg_consts.MURANO_REPO_URL
return pkg_consts.DISPLAY_MURANO_REPO_URL
def get_pkg_def_url(self):
return reverse('horizon:murano:packages:index')

View File

@ -9,6 +9,8 @@ MURANO_USE_GLARE = False
MURANO_REPO_URL = 'http://apps.openstack.org/api/v1/murano_repo/liberty/'
DISPLAY_MURANO_REPO_URL = 'http://apps.openstack.org/#tab=murano-apps'
# Overrides the default dashboard name (Murano) that is displayed
# in the main accordion navigation
# MURANO_DASHBOARD_NAME = "Murano"

View File

@ -22,6 +22,10 @@ MURANO_REPO_URL = getattr(
settings, 'MURANO_REPO_URL',
"http://apps.openstack.org/api/v1/murano_repo/liberty/")
DISPLAY_MURANO_REPO_URL = getattr(
settings, 'DISPLAY_MURANO_REPO_URL',
"http://apps.openstack.org/#tab=murano-apps")
try:
MAX_FILE_SIZE_MB = int(getattr(settings, 'MAX_FILE_SIZE_MB', 5))
except ValueError:

View File

@ -112,7 +112,7 @@
<p class="col-xs-12 alert alert-info">
{% if no_apps %}
{% blocktrans trimmed %}There are no applications in the catalog. You can import apps from
<a href="{{ repo_url }}" target="_blank"> {{ repo_url }}</a>.{% endblocktrans %}
<a href="{{ display_repo_url }}" target="_blank"> {{ display_repo_url }}</a>.{% endblocktrans %}
<br><br>
{% blocktrans trimmed %}Go to
<b>

View File

@ -56,9 +56,9 @@
</div>
{% else %}
<p id="no_apps_in_catalog_message" class="col-xs-12 alert alert-info ">
{% with repo_url=table.get_repo_url pkg_def_url=table.get_pkg_def_url %}
{% with display_repo_url=table.get_repo_url pkg_def_url=table.get_pkg_def_url %}
{% trans "There are no applications in the catalog. You can import apps from" %}
<a href="{{ repo_url }}" target="_blank"> {{ repo_url }}</a>.
<a href="{{ display_repo_url }}" target="_blank"> {{ display_repo_url }}</a>.
<br><br>
{% blocktrans trimmed %}Go to
<b>

View File

@ -0,0 +1,5 @@
---
features:
- Added DISPLAY_MURANO_REPO_URL, that will be used as a
user-visible link to apps.openstack.org or any other murano
apps repository,