BCDBrian

UIM Dashboard Tool - Embedding HTML within a SQL Datasource

Discussion created by BCDBrian on Mar 17, 2015

Hey folks.  I've been creating dashboards using the new Dashboard tool for various customers. I had a request to put an alarm console for an application, and they wanted the background color of the severity column to change with the severity.  There's no option for background colors, only foreground (at least in Dashboard version I am using).

 

So to get around the inability to set the background color I embedded the HTML within the SQL query (shown below).  When using this datasource in a table element, it will do all the coloring for you.  This may open up other ideas for altering how the Dashboard tool can display things, so I thought I'd share.

 

SELECT CASE WHEN severity = 'critical' THEN '<div style="background-color: #ff0000;">Critical</div>'

                       WHEN severity = 'major' THEN '<div style="background-color: #ff8000;">Major</div>'

                       WHEN severity = 'minor' THEN '<div style="background-color: #ffff00;">Minor</div>'

                       WHEN severity = 'warning' THEN '<div style="background-color: #3366cc;">Warning</div>'

                       WHEN severity = 'information' THEN '<div style="background-color: #46b1f9;">Info</div>'

                       END AS severity,

              hostname,

              message,

              CONVERT(VARCHAR, time_arrival, 100) AS time_arrival,

              suppcount,

              CONVERT(VARCHAR, time_supp, 100) AS time_supp

FROM nas_alarms

WHERE robot IN ('someappserver1', 'someappserver2')

ORDER BY time_arrival DESC

Outcomes