From 788fbb219a3a9bbfe4e2d89a5b503d8360f5ce3d Mon Sep 17 00:00:00 2001 From: Jacek Kolasa Date: Thu, 12 Sep 2019 15:35:44 +0200 Subject: sidebar-info update - DB engine (#6744) * remove "Netdata is using # MB of memory on HOSTNAME for # hour, # minutes, and # seconds of real-time history." * Added "memory_mode" key to the get "charts" API call * don't show db engine tip when user has it already installed * add back hostname information * add oxford comma (only for db-engine users) * update main.js hash * --> (but only in sidebar info, main.js) --- web/api/formatters/charts2json.c | 2 ++ web/gui/index.html | 2 +- web/gui/main.js | 27 ++++++++++++++++----------- 3 files changed, 19 insertions(+), 12 deletions(-) (limited to 'web') diff --git a/web/api/formatters/charts2json.c b/web/api/formatters/charts2json.c index e4e2f4dfa4..db3ef37eaf 100644 --- a/web/api/formatters/charts2json.c +++ b/web/api/formatters/charts2json.c @@ -54,6 +54,7 @@ void charts2json(RRDHOST *host, BUFFER *wb) { ",\n\t\"timezone\": \"%s\"" ",\n\t\"update_every\": %d" ",\n\t\"history\": %ld" + ",\n\t\"memory_mode\": \"%s\"" ",\n\t\"custom_info\": \"%s\"" ",\n\t\"charts\": {" , host->hostname @@ -63,6 +64,7 @@ void charts2json(RRDHOST *host, BUFFER *wb) { , host->timezone , host->rrd_update_every , host->rrd_history_entries + , rrd_memory_mode_name(host->rrd_memory_mode) , custom_dashboard_info_js_filename ); diff --git a/web/gui/index.html b/web/gui/index.html index 13478487f1..41017936cb 100644 --- a/web/gui/index.html +++ b/web/gui/index.html @@ -33,7 +33,7 @@ - + diff --git a/web/gui/main.js b/web/gui/main.js index 6aebb8ed36..71af6b59d3 100644 --- a/web/gui/main.js +++ b/web/gui/main.js @@ -1786,21 +1786,26 @@ function renderPage(menus, data) { html += mhead + shtml + '
'; } + const isMemoryModeDbEngine = data.memory_mode === "dbengine"; + sidebar += '
  • add more charts
  • '; sidebar += '
  • add more alarms
  • '; sidebar += '
  • Every ' + ((data.update_every === 1) ? 'second' : data.update_every.toString() + ' seconds') + ', ' + - 'Netdata collects ' + data.dimensions_count.toLocaleString() + ' metrics, presents them in ' + - data.charts_count.toLocaleString() + ' charts and monitors them with ' + - data.alarms_count.toLocaleString() + ' alarms. Netdata is using ' + - Math.round(data.rrd_memory_bytes / 1024 / 1024).toLocaleString() + ' MB of memory on ' + - data.hostname.toString() + ' for ' + - NETDATA.seconds4human(data.update_every * data.history, { - minute: 'minute', minutes: 'minutes', second: 'second', seconds: 'seconds', space: ' ', - }) + - ' of real-time history.
     
    ' + 'Get more history by ' + - 'configuring Netdata\'s history or using the DB engine.' + - '
     
    netdata
    ' + data.version.toString() + '
  • '; + 'Netdata collects ' + data.dimensions_count.toLocaleString() + ' metrics on ' + + data.hostname.toString() + ', presents them in ' + + data.charts_count.toLocaleString() + ' charts' + + (isMemoryModeDbEngine ? '' : ',') + // oxford comma + ' and monitors them with ' + + data.alarms_count.toLocaleString() + ' alarms.'; + + if (!isMemoryModeDbEngine) { + sidebar += '
     
    Get more history by ' + + 'configuring Netdata\'s history or using the DB engine.' + } + + sidebar += '
     
    netdata
    ' + data.version.toString() + ''; + sidebar += ''; div.innerHTML = html; document.getElementById('sidebar').innerHTML = sidebar; -- cgit v1.2.3