{% extends "base.html.twig" %} {% block title %}Dashboard{% endblock %} {% block body %}
{% if(data is null) %}
Dashboard data is not available, please try it later.
{% endif %} {% if(lights is not empty) %}
{#
Device count: {{ deviceCount }}/{{ licenseSeats }}
{% set percent = (deviceCount / licenseSeats) * 100 %}
#} {#{% for light in lights %}
{{ light.name }}
{{ light.caption }}
{% endfor %}#} {% for light in lights %}
{{ light.name }}
{% if (light.name == 'Groups') %} {% elseif (light.name == 'Tunnels')%} {% endif %} {{ light.onlight }}
{{ light.caption }}
{% endfor %}
{% endif %} {% if(help is not empty) %}
Warnings:

{% for text in help %}
{{ text }}
{% endfor %}
{% endif %} {% if(groups is not empty) %}
Monitoring Groups:

{% for group in groups %}
Name: {{ group.name }}
{{ group.devices }}
{% for light in group.lights%} {#
{{ light.name }}
#}
{{ light.name }}
{% for light2 in light.lights %} {% if(loop.index == 1) and (light.state == 'G') %} {% set color = 'G' %} {% elseif(loop.index == 2 and light.state == 'W') %} {% set color = 'W' %} {% elseif(loop.index == 3 and light.state == 'B') %} {% set color = 'B' %} {% else %} {% set color = 'grey' %} {% endif %}
{{ light2.onlight }}
{% endfor %}
{% for light2 in light.lights %}
{% if(light2.subset_id <= 5) %} {{ light2.caption }} {% else %} {{ light2.caption }} {% endif %}
{% endfor %}
{% endfor%}
{% endfor %}
{% endif %} {% if( (triggeredAlerts is not empty) or (invalidAlerts is not empty) or (pastAlerts is not empty) ) %}
Alerts:

{% if(triggeredAlerts is not empty) %}
Triggered Alerts:
{% for triggeredAlert in triggeredAlerts %}

{{ loop.index }}. {{ triggeredAlert.name }} {% if(triggeredAlert.targetMonitoringGroup is not null) %} for monitoring group: {{ triggeredAlert.targetMonitoringGroup.name }} {% if(triggeredDevices[triggeredAlert.id]['device'] is not empty) %} {% set deviceNames = [] %} for devices: List All {% endif %} {% for key, triggeredDevice in triggeredDevices[triggeredAlert.id]['device']|slice(0,20) %} {% if(loop.first) %}({% endif %} {{ triggeredDevice.devid }} {% if(not loop.last) %},{% endif %} {% if(loop.last) %}{% set count = triggeredDevices[triggeredAlert.id]['device']|length %}{% if(count > 20) %} and more {{ count - 20 }} devices {% endif %}){% endif %} {% endfor %} {% else %} {% if(triggeredDevices[triggeredAlert.id]['device'] is not empty) %} for device: {{ triggeredDevices[triggeredAlert.id]['device'].devId }} {% endif %} {% endif %}

{% endfor %}
{% endif %} {% if(invalidAlerts is not empty) %}
Invalid Alerts:
{% for invalidAlert in invalidAlerts %}

{{ loop.index }}. {{ invalidAlert.name }}

{% endfor %}
{% endif %} {% if(pastAlerts is not empty) %}
Past Alerts:
{% for pastAlert in pastAlerts %}

{{ loop.index }}. {{ pastAlert.name }} {% if(pastAlert.targetMonitoringGroup is not null) %} for monitoring group: {{ pastAlert.targetMonitoringGroup.name }} {% if(pastDevices[pastAlert.id]['device'] is not empty) %} {% set deviceNames = [] %} for devices: List All {% endif %} {% for key, pastDevice in pastDevices[pastAlert.id]['device']|slice(0,20) %} {% if(loop.first) %}({% endif %} {{ pastDevice.devid }} {% if(not loop.last) %},{% endif %} {% if(loop.last) %}{% set count = pastDevices[pastAlert.id]['device']|length %}{% if(count > 20) %} and more {{ count - 20 }} devices {% endif %}){% endif %} {% endfor %} {% else %} {% if(pastDevices[pastAlert.id]['device'] is not empty) %} for device: {{ pastDevices[pastAlert.id]['device'].devId }} {% endif %} {% endif %} (Clear counter)

{% endfor %}
{% endif %}
{% endif %}
{% endblock body %}