diff --git a/tuskar_ui/infrastructure/overview/templates/overview/_deployment_status.html b/tuskar_ui/infrastructure/overview/templates/overview/_deployment_status.html deleted file mode 100644 index 90ee5759a..000000000 --- a/tuskar_ui/infrastructure/overview/templates/overview/_deployment_status.html +++ /dev/null @@ -1,106 +0,0 @@ -{% load i18n %} -{% load url from future%} - -{% if stack %} - {% if stack.is_deleting or stack.is_delete_failed or stack.is_deploying or stack.is_failed %} -
-
-
-
-
- - {% if stack.is_deleting %} - Undeploying... - {% elif stack.is_delete_failed %} - Undeploying failed - {% elif stack.is_deploying %} - Deploying... - {% elif stack.is_failed %} - Deployment failed - {% endif %} - -
-
-
-
-
- {% if last_failed_events %} - {% trans "Last failed events:" %} - {% for event in last_failed_events %} -
-
-
{% trans "Timestamp" %}
-
-
{% trans "Resource Name" %}
-
{{ event.resource_name }}
-
{% trans "Status" %}
-
{{ event.resource_status }}
-
{% trans "Reason" %}
-
{{ event.resource_status_reason }}
-
-
- {% endfor %} - {% endif %} - See full log -
-
-
-
-
- {% endif %} - - {% if stack.is_deployed and not stack.is_initialized %} -
-
-
-
-
- - - -
-
-

{% trans "Your OpenStack cloud is deployed but it needs to get initialized in order to get live." %}

- - {% trans "Initialize" %} - -
-
-
-
-
- {% else %} - Deployment is live -
-

{% trans "Access Information" %}

- {% for dashboard_url in dashboard_urls %} -

- - {% trans "Horizon URL" %} ({{ dashboard_url }}) - -

- {% endfor %} -
- {% endif %} -
- - - - - {% trans "Undeploy" %} - -{% else %} -
- -
-
-

{% trans "Ready to get deployed" %}

- - - {% trans "Deploy" %} - -
-{% endif %} diff --git a/tuskar_ui/infrastructure/overview/templates/overview/deployment_base.html b/tuskar_ui/infrastructure/overview/templates/overview/deployment_base.html new file mode 100644 index 000000000..51f579b31 --- /dev/null +++ b/tuskar_ui/infrastructure/overview/templates/overview/deployment_base.html @@ -0,0 +1,22 @@ +{% load i18n %} +{% load url from future%} + +
+ {% block deployment-icon %} + + {% endblock %} +
+
+

{% block deployment-title %}{% endblock %}

+ {% block deployment-info %}{% endblock %} +
+ {% block deployment-buttons %} + + + {% trans "Undeploy" %} + + {% endblock %} +
+
diff --git a/tuskar_ui/infrastructure/overview/templates/overview/deployment_failed.html b/tuskar_ui/infrastructure/overview/templates/overview/deployment_failed.html new file mode 100644 index 000000000..74ce6d469 --- /dev/null +++ b/tuskar_ui/infrastructure/overview/templates/overview/deployment_failed.html @@ -0,0 +1,43 @@ +{% extends "infrastructure/overview/deployment_base.html" %} + +{% load i18n %} +{% load url from future%} + +{% block deployment-icon %} + +{% endblock %} + +{% block deployment-title %} + {% if stack.is_delete_failed %} + {% trans "Undeploying failed" %} + {% elif stack.is_failed %} + {% trans "Deployment failed" %} + {% else %} + {% trans "Failure" %} + {% endif %} +{% endblock %} + +{% block deployment-info %} +{% if last_failed_events %} +{% trans "Last failed events:" %} +{% for event in last_failed_events %} +
+
+
{% trans "Timestamp" %}
+
+
{% trans "Resource Name" %}
+
{{ event.resource_name }}
+
{% trans "Status" %}
+
{{ event.resource_status }}
+
{% trans "Reason" %}
+
{{ event.resource_status_reason }}
+
+
+{% endfor %} +{% endif %} +

See full log

+{% endblock %} + +{% block deployment-buttons %} +{% endblock %} + diff --git a/tuskar_ui/infrastructure/overview/templates/overview/deployment_initialize.html b/tuskar_ui/infrastructure/overview/templates/overview/deployment_initialize.html new file mode 100644 index 000000000..c44495133 --- /dev/null +++ b/tuskar_ui/infrastructure/overview/templates/overview/deployment_initialize.html @@ -0,0 +1,23 @@ +{% extends "infrastructure/overview/deployment_base.html" %} + +{% load i18n %} +{% load url from future%} + +{% block deployment-icon %} + +{% endblock %} + +{% block deployment-title %}{% trans "Initialization" %}{% endblock %} + +{% block deployment-info %} +

{% trans "Your OpenStack cloud is deployed but it needs to get initialized in order to get live." %}

+{% endblock %} + +{% block deployment-buttons %} + {{ block.super }} + + + {% trans "Initialize" %} + +{% endblock %} diff --git a/tuskar_ui/infrastructure/overview/templates/overview/deployment_live.html b/tuskar_ui/infrastructure/overview/templates/overview/deployment_live.html new file mode 100644 index 000000000..5b36b8a7e --- /dev/null +++ b/tuskar_ui/infrastructure/overview/templates/overview/deployment_live.html @@ -0,0 +1,22 @@ +{% extends "infrastructure/overview/deployment_base.html" %} + +{% load i18n %} +{% load url from future%} + +{% block deployment-icon %} + +{% endblock %} +{% block deployment-title %}{% trans "Deployment is live" %}{% endblock %} +{% block deployment-info %} +{% trans "Access information" %} +
+ {% for dashboard_url in dashboard_urls %} +
{% trans "Horizon URL" %}
+
{{ dashboard_url }}
+ {% endfor %} +
{% trans "User name" %}
+
TO BE ADDED
+
{% trans "Password" %}
+
TO BE ADDED
+
+{% endblock %} diff --git a/tuskar_ui/infrastructure/overview/templates/overview/deployment_plan.html b/tuskar_ui/infrastructure/overview/templates/overview/deployment_plan.html new file mode 100644 index 000000000..904b63c4b --- /dev/null +++ b/tuskar_ui/infrastructure/overview/templates/overview/deployment_plan.html @@ -0,0 +1,20 @@ +{% extends "infrastructure/overview/deployment_base.html" %} + +{% load i18n %} +{% load url from future%} + +{% block deployment-icon %} + +{% endblock %} + +{% block deployment-title %} + {% trans "Ready to get deployed" %} +{% endblock %} + +{% block deployment-buttons %} + + + {% trans "Deploy" %} + +{% endblock %} diff --git a/tuskar_ui/infrastructure/overview/templates/overview/deployment_progress.html b/tuskar_ui/infrastructure/overview/templates/overview/deployment_progress.html new file mode 100644 index 000000000..71fbb25ff --- /dev/null +++ b/tuskar_ui/infrastructure/overview/templates/overview/deployment_progress.html @@ -0,0 +1,61 @@ +{% extends "infrastructure/overview/deployment_base.html" %} + +{% load i18n %} +{% load url from future%} + +{% block deployment-icon %} + +{% endblock %} + +{% block deployment-title %} + {% if stack.is_deleting %} + {% trans "Undeploying..." %} + {% elif stack.is_deploying %} + {% trans "Deploying..." %} + {% endif %} +{% endblock %} + +{% block deployment-info %} +{% if progress %} +
+
{{ progress }}% {% trans "Complete" %}
+
+{% endif %} +{% if last_failed_events %} + {% trans "Last failed events:" %} +{% for event in last_failed_events %} +
+
+
{% trans "Timestamp" %}
+
+
{% trans "Resource Name" %}
+
{{ event.resource_name }}
+
{% trans "Status" %}
+
{{ event.resource_status }}
+
{% trans "Reason" %}
+
{{ event.resource_status_reason }}
+
+
+{% endfor %} +{% endif %} +

See full log

+{% endblock %} + +{% block deployment-buttons %} + {% if stack.is_deploying %} + + + {% trans "Stop" %} + + {% endif %} +{% endblock %} + diff --git a/tuskar_ui/infrastructure/overview/templates/overview/index.html b/tuskar_ui/infrastructure/overview/templates/overview/index.html index 835efa426..60ac0d49c 100644 --- a/tuskar_ui/infrastructure/overview/templates/overview/index.html +++ b/tuskar_ui/infrastructure/overview/templates/overview/index.html @@ -18,10 +18,26 @@ {% block main %}
- {% include "infrastructure/overview/_deployment_status.html" %} + {% if stack %} + {% if stack.is_deleting or stack.is_deploying %} + {% include "infrastructure/overview/deployment_progress.html" %} + {% elif stack.is_delete_failed or stack.is_failed %} + {% include "infrastructure/overview/deployment_failed.html" %} + {% elif stack.is_deployed and not stack.is_initialized %} + {% include "infrastructure/overview/deployment_initialize.html" %} + {% else %} + {% include "infrastructure/overview/deployment_live.html" %} + {% endif %} + {% else %} + {% include "infrastructure/overview/deployment_plan.html" %} + {% endif %}
- {% include "infrastructure/overview/_role_nodes.html" %} + {% if stack %} + {% include "infrastructure/overview/role_nodes_status.html" %} + {% else %} + {% include "infrastructure/overview/role_nodes_edit.html" %} + {% endif %}
{% endblock %} diff --git a/tuskar_ui/infrastructure/overview/templates/overview/_role_nodes.html b/tuskar_ui/infrastructure/overview/templates/overview/role_nodes_edit.html similarity index 87% rename from tuskar_ui/infrastructure/overview/templates/overview/_role_nodes.html rename to tuskar_ui/infrastructure/overview/templates/overview/role_nodes_edit.html index 193d532f9..d1f438839 100644 --- a/tuskar_ui/infrastructure/overview/templates/overview/_role_nodes.html +++ b/tuskar_ui/infrastructure/overview/templates/overview/role_nodes_edit.html @@ -25,5 +25,8 @@ {% endfor %}
- + diff --git a/tuskar_ui/infrastructure/overview/templates/overview/role_nodes_status.html b/tuskar_ui/infrastructure/overview/templates/overview/role_nodes_status.html new file mode 100644 index 000000000..688835ab6 --- /dev/null +++ b/tuskar_ui/infrastructure/overview/templates/overview/role_nodes_status.html @@ -0,0 +1,28 @@ +{% load i18n %} +{% load url from future %} + +

{% trans "Deployment Roles" %}

+{% for role in roles %} +
+
+ {% if role.deployed_node_count < role.planned_node_count %} + {{ role.deployed_node_count }}/{{ role.planned_node_count }} + {% else %} + {{ role.planned_node_count }} + {% endif %} +
+
+ {{ role.name }} +
+
+{% endfor %} diff --git a/tuskar_ui/infrastructure/overview/tests.py b/tuskar_ui/infrastructure/overview/tests.py index f9f14356f..09937c25d 100644 --- a/tuskar_ui/infrastructure/overview/tests.py +++ b/tuskar_ui/infrastructure/overview/tests.py @@ -90,7 +90,7 @@ class OverviewTests(test.BaseAdminViewTests): self.assertTemplateUsed( res, 'infrastructure/overview/index.html') self.assertTemplateUsed( - res, 'infrastructure/overview/_role_nodes.html') + res, 'infrastructure/overview/role_nodes_edit.html') def test_index_stack_not_created_post(self): with contextlib.nested( @@ -140,7 +140,7 @@ class OverviewTests(test.BaseAdminViewTests): self.assertTemplateUsed( res, 'infrastructure/overview/index.html') self.assertTemplateUsed( - res, 'infrastructure/overview/_deployment_status.html') + res, 'infrastructure/overview/deployment_live.html') def test_index_stack_undeploy_in_progress(self): stack = api.heat.Stack(TEST_DATA.heatclient_stacks.first()) @@ -163,7 +163,7 @@ class OverviewTests(test.BaseAdminViewTests): self.assertTemplateUsed( res, 'infrastructure/overview/index.html') self.assertTemplateUsed( - res, 'infrastructure/overview/_deployment_status.html') + res, 'infrastructure/overview/deployment_progress.html') def test_deploy_get(self): with _mock_plan(): diff --git a/tuskar_ui/infrastructure/overview/views.py b/tuskar_ui/infrastructure/overview/views.py index c2905506e..9e2cd60c2 100644 --- a/tuskar_ui/infrastructure/overview/views.py +++ b/tuskar_ui/infrastructure/overview/views.py @@ -140,8 +140,10 @@ class IndexView(horizon.forms.ModalFormView, StackMixin): else: # stack is active total = sum(d['total_node_count'] for d in roles) - context['progress'] = 100 * sum(d.get('deployed_node_count', 0) - for d in roles) // (total or 1) + context['progress'] = max( + 5, 100 * sum(d.get('deployed_node_count', 0) + for d in roles) // (total or 1) + ) context['dashboard_urls'] = stack.dashboard_urls return context diff --git a/tuskar_ui/infrastructure/static/infrastructure/scss/_individual_pages.scss b/tuskar_ui/infrastructure/static/infrastructure/scss/_individual_pages.scss index 97b7481ac..65a602aab 100644 --- a/tuskar_ui/infrastructure/static/infrastructure/scss/_individual_pages.scss +++ b/tuskar_ui/infrastructure/static/infrastructure/scss/_individual_pages.scss @@ -158,7 +158,13 @@ $link-color: #428bca; .deployment-box { border-left: 4px solid #eee; - margin-left: 12px; + margin-left: 16px; + margin-bottom: 12px; + padding-left: 20px; +} + +.deployment-buttons { + margin-top: 12px; } .deployment-roles-label {