+
{% trans "Performance & Metrics" %}
{% url 'horizon:infrastructure:roles:performance' role.uuid as node_perf_url %}
{% include "infrastructure/_performance_chart_box.html" with meter_conf=meter_conf node_perf_url=node_perf_url col_size=4 %}
diff --git a/tuskar_ui/infrastructure/static/infrastructure/scss/_individual_pages.scss b/tuskar_ui/infrastructure/static/infrastructure/scss/_individual_pages.scss
index da7ba9a68..1a1262d26 100644
--- a/tuskar_ui/infrastructure/static/infrastructure/scss/_individual_pages.scss
+++ b/tuskar_ui/infrastructure/static/infrastructure/scss/_individual_pages.scss
@@ -115,10 +115,6 @@ $link-color: #428bca;
.fa.powerstate {
display: inline-block;
vertical-align: middle;
- font-size: 18px;
- background: $gray-lighter;
- border: 1px solid $gray-light;
- padding: .2em;
&.fa-play {
color: $brand-success;
}
diff --git a/tuskar_ui/infrastructure/templatetags/icon_helpers.py b/tuskar_ui/infrastructure/templatetags/icon_helpers.py
new file mode 100644
index 000000000..c4e9fb516
--- /dev/null
+++ b/tuskar_ui/infrastructure/templatetags/icon_helpers.py
@@ -0,0 +1,58 @@
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+from django import template
+from django.utils.translation import ugettext_lazy as _
+
+
+register = template.Library()
+
+IRONIC_NODE_STATE_STRING_DICT = {
+ 'active': _('powered on'),
+ 'wait call-back': _('waiting'),
+ 'deploying': _('deploying'),
+ 'deploy failed': _('deployment failed'),
+ 'deploy complete': _('deployment complete'),
+ 'deleting': _('deleting'),
+ 'deleted': _('deleted'),
+ 'error': _('error'),
+ 'rebuild': _('rebuilding'),
+ 'power on': _('powered on'),
+ 'power off': _('powered off'),
+ 'rebooting': _('rebooting'),
+}
+
+IRONIC_NODE_STATE_ICON_DICT = {
+ 'active': 'fa-play',
+ 'wait call-back': 'fa-spinner',
+ 'deploying': 'fa-spinner',
+ 'deploy failed': 'fa-warning',
+ 'deploy complete': 'fa-ok',
+ 'deleting': 'fa-spinner',
+ 'deleted': 'fa-cancel',
+ 'error': 'fa-warning',
+ 'rebuild': 'fa-spinner',
+ 'power on': 'fa-play',
+ 'power off': 'fa-stop',
+ 'rebooting': 'fa-spinner',
+}
+
+
+@register.filter(is_safe=True)
+def iconized_ironic_node_state(node_power_state):
+ state = IRONIC_NODE_STATE_STRING_DICT.get(node_power_state, "—")
+ icon = IRONIC_NODE_STATE_ICON_DICT.get(node_power_state, None)
+ html_string = """
+ %s """ % (icon, state)
+
+ return html_string