<!--Status Icons: Traffic light (Black Background)--> <div class="map_object map_table map_icon_large" id="<@itemid>" objectid="<@objectid>" subid="<@subid>" style="overflow:hidden;<#mapobject type="coordinates" subid="<@subid>" mode="<@editmode>">"> <#mapobject type="objectgrip" mode="<@editmode>"> <#mapobject type="htmlbefore" subid="<@subid>"> <#sensor type="colorclassofstate" id="<@objectid>" var="status"> <#objectproperty type="nodename" id="<@objectid>" var="nodename"> <#if value="@nodename" is="sensor" then="sensr" else="hasred" varexpand="value" var="containsred"> <#if value="@nodename" is="sensor" then="sensy" else="hasyellow hasnored" varexpand="value" var="containsyellow"> <#if value="@nodename" is="sensor" then="sensg" else="hasgreen hasnoyellow hasnored" varexpand="value" var="containsgreen"> <style> .trafficLight { position: absolute; display:block; background-color: #333; width:90px; height:230px; border-radius:30px; } .trafficLight span { left: 50%; width:50px; height:50px; margin-top: 20px; margin-left:20px; border-radius: 100%; display: block; } .redlightflash { background-color: red; animation: redlightflash 1.5s step-end infinite; } .yellowlightflash { background-color: yellow; animation: yellowlightflash 1.5s step-end infinite; } .greenlightflash { background-color: #00FF00; } .redlight { background-color: red; filter: brightness(45%); } .yellowlight { background-color: yellow; filter: brightness(45%); } .greenlight { background-color: #00FF00; filter: brightness(45%); } @keyframes redlightflash { 0%{ filter: brightness(110%); box-shadow: 0 0 6em red; } 50% { filter: brightness(55%); box-shadow: 0 0 0em transparent; } } @keyframes yellowlightflash { 0% { filter: brightness(110%); box-shadow: 0 0 6em yellow; } 50% { filter: brightness(45%); box-shadow: 0 0 0em transparent; } } </style> <div class="trafficLight"> <span class="<#if value="@status" contains="@containsred" then="redlightflash" else="redlight" varexpand="value,contains">"></span> <span class="<#if value="@status" contains="@containsyellow" then="yellowlightflash" else="yellowlight" varexpand="value,contains">"></span> <span class="<#if value="@status" contains="@containsgreen" then="greenlightflash" else="greenlight" varexpand="value,contains">"></span> </div> <div style="position:relative;margin-top:-20px"> <#mapobject type="htmlafter" subid="<@subid>"> </div> </div>
Note: The map object (.htm file) must be created under "C:\Program Files (x86)\PRTG Network Monitor\webroot\mapobjects" on the PRTG Server.
Add comment