]> arthur.barton.de Git - netdata.git/commitdiff
Merge pull request #1336 from ktsaou/master
authorCosta Tsaousis <costa@tsaousis.gr>
Thu, 8 Dec 2016 20:33:04 +0000 (22:33 +0200)
committerGitHub <noreply@github.com>
Thu, 8 Dec 2016 20:33:04 +0000 (22:33 +0200)
allow custom dashboards to link dimensions to DOM elements by name or id

web/dashboard.js
web/demosites.html
web/index.html

index 080ae7dd2cf114009dc633f7d36f56252f2b82b6..206a09d48d107d220742cba5d164c32f75191c43 100644 (file)
                 var color = state._chartDimensionColor(name);
 
                 var user_element = null;
-                var user_id = self.data('show-value-of-' + dim + '-at') || null;
+                var user_id = self.data('show-value-of-' + name.toLowerCase() + '-at') || null;
+                if(user_id === null)
+                    user_id = self.data('show-value-of-' + dim.toLowerCase() + '-at') || null;
                 if(user_id !== null) {
                     user_element = document.getElementById(user_id) || null;
-                    if(user_element === null)
+                    if (user_element === null)
                         state.log('Cannot find element with id: ' + user_id);
                 }
 
index 039fc651e9473d2e09589ad9b43b5d3832a3b781..8dd1a5f64d172be0c968c4a693ec9d8f5f377e91 100644 (file)
@@ -505,7 +505,7 @@ p {
     and that you have chown it to be owned by netdata:netdata
 -->
 <!-- <script type="text/javascript" src="http://my.server:19999/dashboard.js"></script> -->
-<script type="text/javascript" src="dashboard.js?v20161112-1"></script>
+<script type="text/javascript" src="dashboard.js?v20161208-1"></script>
 
 <script>
     // --- OPTIONS FOR THE CHARTS --
index f8fea7c3766a6de0a81ffbdca658f994dc77dfba..f24389687878d32df7ca6057cf5abfb1c36b1a6d 100644 (file)
     </div>
 </body>
 </html>
-<script type="text/javascript" src="dashboard.js?v20161126-1"></script>
+<script type="text/javascript" src="dashboard.js?v20161208-1"></script>