diff options
author | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2016-12-08 22:28:22 +0200 |
---|---|---|
committer | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2016-12-08 22:28:22 +0200 |
commit | c6c4ded5a18430b2a7bbd37aa8e2d6d7f5c1aa5e (patch) | |
tree | 0ee2234e303e082614350e25a50b2c19d0751a01 /web | |
parent | 51fe106e6ac2a1588e6b59d15c79d78c153bb03a (diff) |
allow custom dashboards to link dimensions to DOM elements by name or id; fixes #1325
Diffstat (limited to 'web')
-rw-r--r-- | web/dashboard.js | 6 | ||||
-rw-r--r-- | web/demosites.html | 2 | ||||
-rw-r--r-- | web/index.html | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/web/dashboard.js b/web/dashboard.js index 080ae7dd2c..206a09d48d 100644 --- a/web/dashboard.js +++ b/web/dashboard.js @@ -2420,10 +2420,12 @@ 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); } diff --git a/web/demosites.html b/web/demosites.html index 039fc651e9..8dd1a5f64d 100644 --- a/web/demosites.html +++ b/web/demosites.html @@ -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 -- diff --git a/web/index.html b/web/index.html index f8fea7c376..f243896878 100644 --- a/web/index.html +++ b/web/index.html @@ -3170,4 +3170,4 @@ </div> </body> </html> -<script type="text/javascript" src="dashboard.js?v20161126-1"></script> +<script type="text/javascript" src="dashboard.js?v20161208-1"></script> |