@cryptotaxi247 / netdata-1 / commits / a70455232

no need to escape object members in js; updated toolbox help

Costa Tsaousis (ktsaou) committed Nov 23, 2017 at 02:35 UTC a704552327e29998752d63eca537d1880ab93661
1 file changed +6 -17
web/dashboard.js
+6 -17
@@ -1154,14 +1154,7 @@ var NETDATA = window.NETDATA || {};
1154 this.charts = {};
1155 },
1156
1157 - fixid: function(id) {
1158 - return id.replace(/:/g, "_").replace(/\//g, "_");
1159 - },
1160 -
1157 add: function(host, id, data) {
1162 - host = this.fixid(host);
1163 - id = this.fixid(id);
1164 -
1158 if(typeof this.charts[host] === 'undefined')
1159 this.charts[host] = {};
1160
@@ -1170,9 +1163,6 @@ var NETDATA = window.NETDATA || {};
1163 },
1164
1165 get: function(host, id) {
1173 - host = this.fixid(host);
1174 - id = this.fixid(id);
1175 -
1166 if(typeof this.charts[host] === 'undefined')
1167 return null;
1168
@@ -1188,23 +1178,22 @@ var NETDATA = window.NETDATA || {};
1178
1179 var self = this;
1180
1191 - function fix_data(data, callback) {
1181 + function got_data(h, data, callback) {
1182 if(data !== null) {
1193 - var h = NETDATA.chartRegistry.fixid(host);
1183 self.charts[h] = data.charts;
1184
1185 // update the server timezone in our options
1186 if(typeof data.timezone === 'string')
1187 NETDATA.options.server_timezone = data.timezone;
1188 }
1200 - else NETDATA.error(406, host + '/api/v1/charts');
1189 + else NETDATA.error(406, h + '/api/v1/charts');
1190
1191 if(typeof callback === 'function')
1192 callback(data);
1193 }
1194
1195 if(netdataSnapshotData !== null) {
1207 - fix_data(netdataSnapshotData.charts, callback);
1196 + got_data(host, netdataSnapshotData.charts, callback);
1197 }
1198 else {
1199 $.ajax({
@@ -1214,7 +1203,7 @@ var NETDATA = window.NETDATA || {};
1203 xhrFields: {withCredentials: true} // required for the cookie
1204 })
1205 .done(function (data) {
1217 - fix_data(data, callback);
1206 + got_data(host, data, callback);
1207 })
1208 .fail(function () {
1209 NETDATA.error(405, host + '/api/v1/charts');
@@ -3839,7 +3828,7 @@ var NETDATA = window.NETDATA || {};
3828 placement: 'bottom',
3829 delay: { show: NETDATA.options.current.show_help_delay_show_ms, hide: NETDATA.options.current.show_help_delay_hide_ms },
3830 title: 'Chart Zoom In',
3842 - content: 'Zoom in the chart. You can also press SHIFT and select an area of the chart to zoom in. On Chrome and Opera, you can press the SHIFT or the ALT keys and then use the mouse wheel to zoom in or out.<br/><small>Help, can be disabled from the settings.</small>'
3831 + content: 'Zoom in the chart. You can also press SHIFT and select an area of the chart, or press SHIFT or ALT and use the mouse wheel or 2-finger touchpad scroll to zoom in or out.<br/><small>Help, can be disabled from the settings.</small>'
3832 });
3833
3834 this.element_legend_childs.toolbox_zoomout.className += ' netdata-legend-toolbox-button';
@@ -3862,7 +3851,7 @@ var NETDATA = window.NETDATA || {};
3851 placement: 'bottom',
3852 delay: { show: NETDATA.options.current.show_help_delay_show_ms, hide: NETDATA.options.current.show_help_delay_hide_ms },
3853 title: 'Chart Zoom Out',
3865 - content: 'Zoom out the chart. On Chrome and Opera, you can also press the SHIFT or the ALT keys and then use the mouse wheel to zoom in or out.<br/><small>Help, can be disabled from the settings.</small>'
3854 + content: 'Zoom out the chart. You can also press SHIFT or ALT and use the mouse wheel, or 2-finger touchpad scroll to zoom in or out.<br/><small>Help, can be disabled from the settings.</small>'
3855 });
3856
3857 //this.element_legend_childs.toolbox_volume.className += ' netdata-legend-toolbox-button';