@cryptotaxi247 / netdata-1 / commits / c6c4ded5a

allow custom dashboards to link dimensions to DOM elements by name or id; fixes #1325

Costa Tsaousis (ktsaou) committed Dec 8, 2016 at 22:28 UTC c6c4ded5a18430b2a7bbd37aa8e2d6d7f5c1aa5e
3 files changed +6 -4
web/dashboard.js
+4 -2
@@ -2420,10 +2420,12 @@
2420 var color = state._chartDimensionColor(name);
2421
2422 var user_element = null;
2423 - var user_id = self.data('show-value-of-' + dim + '-at') || null;
2423 + var user_id = self.data('show-value-of-' + name.toLowerCase() + '-at') || null;
2424 + if(user_id === null)
2425 + user_id = self.data('show-value-of-' + dim.toLowerCase() + '-at') || null;
2426 if(user_id !== null) {
2427 user_element = document.getElementById(user_id) || null;
2426 - if(user_element === null)
2428 + if (user_element === null)
2429 state.log('Cannot find element with id: ' + user_id);
2430 }
2431
web/demosites.html
+1 -1
@@ -505,7 +505,7 @@ p {
505 and that you have chown it to be owned by netdata:netdata
506 -->
507 <!-- <script type="text/javascript" src="http://my.server:19999/dashboard.js"></script> -->
508 -<script type="text/javascript" src="dashboard.js?v20161112-1"></script>
508 +<script type="text/javascript" src="dashboard.js?v20161208-1"></script>
509
510 <script>
511 // --- OPTIONS FOR THE CHARTS --
web/index.html
+1 -1
@@ -3170,4 +3170,4 @@
3170 </div>
3171 </body>
3172 </html>
3173 -<script type="text/javascript" src="dashboard.js?v20161126-1"></script>
3173 +<script type="text/javascript" src="dashboard.js?v20161208-1"></script>