]> jspc29.x-matter.uni-frankfurt.de Git - mvd_epics.git/commitdiff
DASH: severity as stylesheet class
authorOle Artz <ole.artz@t-online.de>
Fri, 4 Aug 2017 12:51:40 +0000 (14:51 +0200)
committerOle Artz <ole.artz@t-online.de>
Fri, 4 Aug 2017 12:51:40 +0000 (14:51 +0200)
python_suite/dashboard/dashboard.py
python_suite/dashboard/static/css/style.css
python_suite/dashboard/views/pv_overview.jinja2

index 9f881148111a33e4bf4bf5f7eb5a3cd39fdba48f..2941d066a7f0aded2aebd95871b92e3ae89f7cc0 100755 (executable)
@@ -16,6 +16,13 @@ def index():
         for pv in group['PVs']:
             p = epics.PV(pv['name'])
             p.get_ctrlvars()
+            class_map = {
+              epics.NO_ALARM :      "",
+              epics.MINOR_ALARM :   "minor_alarm",
+              epics.MAJOR_ALARM :   "major_alarm",
+              epics.INVALID_ALARM : "invalid_alarm",
+            }
+            pv['classes'] = class_map[p.severity]
             if 'enum' in p.type:
                 pv['value'] = p.get(as_string=True)
             else:
index f02c8beb8daecc83b93acc6a45bb2960b60d3916..521017b1f8ca071a467d29ba6ff8102438b1f291 100644 (file)
@@ -21,3 +21,6 @@
 .Cooling table, th {
   text-align: left;
 }
+.invalid_alarm {
+  background-color: red;
+}
index 8bcdb402bfd37a4e8ab2fbd08aab3f871bd4d712..e91946ecba95459991073d9e6bd22a9a8f1b07ba 100644 (file)
@@ -30,7 +30,7 @@
                                                {% for PV in group.PVs %}
                                                <tr>
                                                        <td>{{ PV.name }}</td>
-                                                       <td>{{ PV.value }}</td>
+                                                       <td class="{{ PV.classes }}">{{ PV.value }}</td>
                                                        <td>{{ PV.unit }}</td>
                                                </tr>
                                                {% endfor %}