diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-05-19 12:33:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-05-19 12:33:27 +0000 |
commit | 841395dd16f470e3c051a0a4fff5b91efc983c30 (patch) | |
tree | 4115f6eedcddda75067130b80acaff9e51612f49 /web/gui/dashboard/dashboard.js | |
parent | Adding upstream version 1.30.1. (diff) | |
download | netdata-841395dd16f470e3c051a0a4fff5b91efc983c30.tar.xz netdata-841395dd16f470e3c051a0a4fff5b91efc983c30.zip |
Adding upstream version 1.31.0.upstream/1.31.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | web/gui/dashboard/dashboard.js (renamed from web/gui/dashboard.js) | 87 |
1 files changed, 25 insertions, 62 deletions
diff --git a/web/gui/dashboard.js b/web/gui/dashboard/dashboard.js index 53e9090b1..f9c2aac5f 100644 --- a/web/gui/dashboard.js +++ b/web/gui/dashboard/dashboard.js @@ -827,6 +827,13 @@ NETDATA.unitsConversion = { 'GiB/s': 1024 * 1024, 'TiB/s': 1024 * 1024 * 1024 }, + 'bytes': { + 'bytes': 1, + 'kilobytes': 1024, + 'megabytes': 1024 * 1024, + 'gigabytes': 1024 * 1024 * 1024, + 'terabytes': 1024 * 1024 * 1024 * 1024 + }, 'B': { 'B': 1, 'KiB': 1024, @@ -889,7 +896,17 @@ NETDATA.unitsConversion = { 'num (M)': 1000000, 'num (G)': 1000000000, 'num (T)': 1000000000000 - } + }, + 'Hz': { + 'Hz': 1, + 'kHz': 10 ** 3, + 'MHz': 10 ** 6, + 'GHz': 10 ** 9, + 'THz': 10 ** 12, + 'PHz': 10 ** 15, + 'EHz': 10 ** 18, + 'ZHz': 10 ** 21, + }, /* 'milliseconds': { 'seconds': 1000 @@ -2199,9 +2216,6 @@ NETDATA.dygraphChartCreate = function (state, data) { visibility: state.dimensions_visibility.selected2BooleanArray(state.data.dimension_names), logscale: NETDATA.chartLibraries.dygraph.isLogScale(state) ? 'y' : undefined, - // Expects a string in the format "<series name>: <style>" where each series is separated by a | - perSeriesStyle: NETDATA.dataAttribute(state.element, 'dygraph-per-series-style', ''), - axes: { x: { pixelsPerLabel: NETDATA.dataAttribute(state.element, 'dygraph-xpixelsperlabel', 50), @@ -2858,23 +2872,18 @@ NETDATA.dygraphChartCreate = function (state, data) { //state.tmp.dygraph_options.isZoomedIgnoreProgrammaticZoom = true; } - let seriesStyles = NETDATA.dygraphGetSeriesStyle(state.tmp.dygraph_options); - state.tmp.dygraph_options.series = seriesStyles; + state.tmp.dygraph_instance = new Dygraph(state.element_chart, + data.result.data, state.tmp.dygraph_options); - state.tmp.dygraph_instance = new Dygraph( - state.element_chart, - data.result.data, - state.tmp.dygraph_options - ); state.tmp.dygraph_history_tip_element = document.createElement('div'); state.tmp.dygraph_history_tip_element.innerHTML = ` <span class="dygraph__history-tip-content"> Want to extend your history of real-time metrics? <br /> - <a href="https://docs.netdata.cloud/docs/configuration-guide/#increase-the-metrics-retention-period" target=_blank> + <a href="https://learn.netdata.cloud/guides/longer-metrics-storage/" target=_blank> Configure Netdata's <b>history</b></a> - or use the <a href="https://docs.netdata.cloud/database/engine/" target=_blank>DB engine</a>. + or use the <a href="https://learn.netdata.cloud/docs/agent/database/engine/" target=_blank>DB engine</a>. </span> `; state.tmp.dygraph_history_tip_element.className = 'dygraph__history-tip'; @@ -2903,51 +2912,6 @@ NETDATA.dygraphChartCreate = function (state, data) { return true; }; - -NETDATA.dygraphGetSeriesStyle = function(dygraphOptions) { - const seriesStyleStr = dygraphOptions.perSeriesStyle; - let formattedStyles = {}; - - if (seriesStyleStr === '') { - return formattedStyles; - } - - // Parse the config string into a JSON object - let styles = seriesStyleStr.replace(' ', '').split('|'); - - styles.forEach(style => { - const keys = style.split(':'); - formattedStyles[keys[0]] = keys[1]; - }); - - for (let key in formattedStyles) { - if (formattedStyles.hasOwnProperty(key)) { - let settings; - - switch (formattedStyles[key]) { - case 'line': - settings = { fillGraph: false }; - break; - case 'area': - settings = { fillGraph: true }; - break; - case 'dot': - settings = { - fillGraph: false, - drawPoints: true, - pointSize: dygraphOptions.pointSize - }; - break; - default: - settings = undefined; - } - - formattedStyles[key] = settings; - } - } - - return formattedStyles; -}; // ---------------------------------------------------------------------------------------------------------------- // sparkline @@ -3512,7 +3476,7 @@ NETDATA.gaugeChartCreate = function (state, data) { colorStart: startColor, // Colors colorStop: stopColor, // just experiment with them strokeColor: strokeColor, // to see which ones work best for you - generateGradient: (generateGradient === true), // gmosx: + generateGradient: (generateGradient === true), // gmosx: gradientType: 0, highDpiSupport: true // High resolution support }; @@ -8395,7 +8359,6 @@ let chartState = function (element) { if (this.dimensions) { this.data_url += "&dimensions=" + this.dimensions; } - if (NETDATA.options.debug.chart_data_url || this.debug) { this.log('chartURL(): ' + this.data_url + ' WxH:' + this.chartWidth() + 'x' + this.chartHeight() + ' points: ' + data_points.toString() + ' library: ' + this.library_name); } @@ -10020,7 +9983,7 @@ NETDATA.registry = { } NETDATA.registry.access(2, function (person_urls) { NETDATA.registry.parsePersonUrls(person_urls); - }); + }); } }); }, @@ -10071,7 +10034,7 @@ NETDATA.registry = { // data. name = NETDATA.registry.hostname; url = NETDATA.serverDefault; - } + } console.log("ACCESS", name, url); |