Add link with stack details in service details

Change-Id: Ic3e34c9d341309ffd005a5479b2a6ef12b3bfe05
Implements: blueprint add-stack-link
This commit is contained in:
Ekaterina Fedorova 2013-12-20 12:45:24 +04:00
parent e21ba67818
commit a873447045
2 changed files with 26 additions and 0 deletions

View File

@ -20,6 +20,7 @@ from horizon import tabs
from muranodashboard.environments.consts import LOG_LEVEL_TO_COLOR from muranodashboard.environments.consts import LOG_LEVEL_TO_COLOR
from muranodashboard.environments.consts import LOG_LEVEL_TO_TEXT from muranodashboard.environments.consts import LOG_LEVEL_TO_TEXT
from openstack_dashboard.api import nova as nova_api from openstack_dashboard.api import nova as nova_api
from openstack_dashboard.api import heat as heat_api
from muranodashboard.environments import api from muranodashboard.environments import api
from muranodashboard.environments.tables import STATUS_DISPLAY_CHOICES from muranodashboard.environments.tables import STATUS_DISPLAY_CHOICES
@ -97,6 +98,17 @@ class OverviewTab(tabs.Tab):
} }
break break
# add stack info
stack_name = 'e' + environment_id
existing_stacks = heat_api.stacks_list(request)
for stack in existing_stacks:
if stack.stack_name == stack_name:
unit_detail['stack'] = {
'id': stack.id,
'name': stack.stack_name
}
break
if len(service_data.units) > 1: if len(service_data.units) > 1:
units.append(unit_detail) units.append(unit_detail)
else: else:

View File

@ -13,6 +13,13 @@
{{ value.name }} {{ value.name }}
</a> </a>
</dd><br> </dd><br>
{% elif key == 'stack'%}
<dt>Heat stack name</dt>
<dd>
<a href=" {% url 'horizon:project:stacks:detail' value.id %}">
{{ value.name }}
</a>
</dd><br>
{% else %} {% else %}
<dt>{% blocktrans %} {{ key }} {% endblocktrans %}</dt> <dt>{% blocktrans %} {{ key }} {% endblocktrans %}</dt>
<dd>{% blocktrans %} {{ value }} {% endblocktrans %}</dd> <dd>{% blocktrans %} {{ value }} {% endblocktrans %}</dd>
@ -35,6 +42,13 @@
{{ value.name }} {{ value.name }}
</a> </a>
</dd><br> </dd><br>
{% elif key == 'stack'%}
<dt>Heat stack name</dt>
<dd>
<a href=" {% url 'horizon:project:stacks:detail' value.id %}">
{{ value.name }}
</a>
</dd><br>
{% else %} {% else %}
<dt>{% blocktrans %} {{ key }} {% endblocktrans %}</dt> <dt>{% blocktrans %} {{ key }} {% endblocktrans %}</dt>
<dd>{% blocktrans %} {{ value }} {% endblocktrans %}</dd> <dd>{% blocktrans %} {{ value }} {% endblocktrans %}</dd>