]> arthur.barton.de Git - netdata.git/blobdiff - web/index.html
Merge pull request #337 from ktsaou/master
[netdata.git] / web / index.html
old mode 100755 (executable)
new mode 100644 (file)
index 4db417f..17b4fca
@@ -12,7 +12,7 @@
        <meta name="author" content="costa@tsaousis.gr">
 
        <link rel="shortcut icon" href="images/seo-performance-multi-size.ico">
-       
+
        <link rel="apple-touch-icon" href="images/seo-performance-72.png">
        <link rel="apple-touch-icon" sizes="72x72" href="images/seo-performance-72.png">
        <link rel="apple-touch-icon" sizes="114x114" href="images/seo-performance-114.png">
@@ -28,7 +28,7 @@
 
        <style>
 
-       /* prevent body from hidding under the navbar */
+       /* prevent body from hiding under the navbar */
        body {
                padding-top: 50px;
        }
                position: relative;
                z-index: -2;
        }
-       h1:before, h2:before { 
-               display: block; 
-               content: " "; 
+       h1:before, h2:before {
+               display: block;
+               content: " ";
                margin-top: -70px;
                height: 70px;
-               visibility: hidden; 
+               visibility: hidden;
        }
 
        .p {
@@ -74,7 +74,7 @@
        }
 
        .chart-message {
-               display: block; 
+               display: block;
                margin-top: 10px;
        }
 
        <!-- you can also give a different server per chart, with the attribute: data-host="http://netdata.server:19999" -->
        <!-- <script> netdataServer = "http://box:19999"; </script> -->
 
+       <!-- check which theme to use -->
+       <script>
+               function loadLocalStorage(name) {
+                       var ret = null;
+
+                       try {
+                               if(typeof Storage !== "undefined" && typeof localStorage === 'object')
+                                       ret = localStorage.getItem(name);
+                       }
+                       catch(error) {
+                               ;
+                       }
+
+                       if(typeof ret === 'undefined' || ret === null)
+                               return null;
+
+                       return ret;
+               }
+
+               function saveLocalStorage(name, value) {
+                       try {
+                               if(typeof Storage !== "undefined" && typeof localStorage === 'object') {
+                                       localStorage.setItem(name, value.toString());
+                                       return true;
+                               }
+                       }
+                       catch(error) {
+                               ;
+                       }
+
+                       return false;
+               }
+
+               function getTheme(def) {
+                       var ret = loadLocalStorage('netdataTheme');
+                       if(typeof ret === 'undefined' || ret === null || ret === 'undefined')
+                               return def;
+                       else
+                               return ret;
+               }
+               var netdataTheme = getTheme('slate');
+
+               function setTheme(theme) {
+                       if(theme === netdataTheme) return false;
+
+                       return saveLocalStorage('netdataTheme', theme);
+               }
+       </script>
+
        <!-- load the dashboard manager - it will do the rest -->
-       <script type="text/javascript" src="dashboard.js?v23"></script>
+       <script type="text/javascript" src="dashboard.js?v34"></script>
 </head>
 
 <body data-spy="scroll" data-target="#sidebar">
                                </button>
                                <a href="/" class="navbar-brand" id="hostname">netdata</a>
                        </div>
+                       <nav id="demosites_nav" class="collapse navbar-collapse navbar-left" role="navigation">
+                               <ul class="nav navbar-nav">
+                                       <li class="dropdown">
+                                               <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="current_view">demo sites <strong class="caret"></strong></a>
+                                               <ul class="dropdown-menu scrollable-menu inpagemenu" role="menu">
+                                                       <li id="demo_eu"><a href="//netdata1.firehol.org?nowelcome">EU - London (DigitalOcean.com)</a></li>
+                                                       <li id="demo_us"><a href="//netdata2.firehol.org?nowelcome">US - Atlanta (CDN77.com)</a></li>
+                                                       <li id="demo_gr"><a href="//netdata3.firehol.org?nowelcome">EU - Greece</a></li>
+                                                       <li role="separator" class="divider"></li>
+                                                       <li id="demo_tv"><a href="tv.html">TV Dashboard for 2 servers</a></li>
+                                                       <li id="demosites"><a href="demosites.html">Dashboard for monitoring netdata demo sites</a></li>
+                                               </ul>
+                                       </li>
+                               </ul>
+                       </nav>
                        <nav class="collapse navbar-collapse navbar-right" role="navigation">
                                <ul class="nav navbar-nav">
                                        <li><a href="#" class="btn" data-toggle="modal" data-target="#optionsModal"><i class="fa fa-cog"></i> settings</a></li>
                                        <li><a href="https://github.com/firehol/netdata/wiki" class="btn" target="_blank"><i class="fa fa-github"></i> community</a></li>
+                                       <li id="updateButton"><a href="#" class="btn" data-toggle="modal" data-target="#updateModal"><i class="fa fa-cloud-download"></i> update</a></li>
 <!--                                   <li><a href="old/" class="btn" target="_blank"><i class="fa fa-step-backward"></i> old dashboard</a></li> -->
                                        <li><a href="#" class="btn" data-toggle="modal" data-target="#helpModal"><i class="fa fa-question-circle"></i> help</a></li>
 <!--                                   <li><a href="#sec">Visualize</a></li>
                                                <i class="fa fa-circle"></i> <a href="http://D3js.org/" target="_blank">D3</a>,
                                                <i class="fa fa-copyright"></i> Copyright 2015, Mike Bostock, <a href="http://opensource.org/licenses/BSD-3-Clause" target="_blank">BSD License</a>
 
+                                               <i class="fa fa-circle"></i> <a href="https://github.com/broofa/node-int64" target="_blank">node-int64</a>,
+                                               <i class="fa fa-copyright"></i> Copyright 2014, Robert Kieffer, <a href="https://github.com/broofa/node-int64/blob/master/LICENSE" target="_blank">MIT License</a>
+
                                        </small>
                                </div>
                        </div>
                                </div>
                                <div class="modal-body">
                                                <div class="p">
-                                               <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></b> is the fastest way to visualize key metrics. It is a resource efficient, highly optimized system for collecting and visualizing any type of realtime timeseries data, from CPU usage, disk activity, SQL queries, API calls, web site visitors, etc.
+                                               <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></b> is the fastest way to visualize metrics. It is a resource efficient, highly optimized system for collecting and visualizing any type of real-time time series data, from CPU usage, disk activity, SQL queries, API calls, web site visitors, etc.
                                                </div>
                                                <div class="p">
                                                <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></b> tries to visualize the truth of <b>now</b>, in its <b>greatest detail</b>, so that you can get insights of what is happening now and what just happened, on your systems and applications.
                                                </div>
                                                <div class="p">
-                                               To make a chart in <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></b>, you just need a <b>number</b>. Just a number you can read somehow. <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></b> will turn this number to a real time, interactive, web chart. For collecting these numbers, it supports <a href="https://github.com/firehol/netdata/tree/master/plugins.d" target="_blank">external plugins</a>, even <a href="https://github.com/firehol/netdata/tree/master/charts.d" target="_blank">bash shell plugins</a>. Any computer program, in any language, that can print a few lines of text on its standard output, can be a netdata data collector.
+                                               To make a chart in <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></b>, you just need a <b>number</b>. Just a number you can read somehow. <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></b> will turn this number to a real time, interactive, web chart. For collecting these numbers, it supports <a href="https://github.com/firehol/netdata/wiki/External-Plugins" target="_blank">external plugins</a>, even <a href="https://github.com/firehol/netdata/wiki/General-Info---charts.d" target="_blank">shell</a> or <a href="https://github.com/firehol/netdata/wiki/General-Info---charts.d" target="_blank">node.js</a> plugins. Any computer program, in any language, that can print a few lines of text on its standard output, can be a netdata data collector.
                                                </div>
                                                <div class="p">
                                                <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></b> can embed charts everywhere, like this one <div data-netdata="system.cpu" data-dimensions="system" data-after="-120" data-width="25%" data-height="15px" data-chart-library="dygraph" data-dygraph-theme="sparkline" data-show-value-of-system-at="system.cpu.system.modal.1"></div> (my CPU system usage which is <span id="system.cpu.system.modal.1" style="display: inline-block; width: 40px; text-align: right;"></span>%),
                                                or this one <div data-netdata="ipv4.tcppackets" data-dimensions="received" data-after="-120" data-width="25%" data-height="15px" data-chart-library="dygraph" data-dygraph-theme="sparkline" data-show-value-of-received-at="ipv4.tcppackets.received.modal.1"></div> (my IPv4 received TCP packets, which are <span id="ipv4.tcppackets.received.modal.1" style="display: inline-block; width: 60px; text-align: right;"></span>/second).
                                                </div>
                                                <div class="p">
-                                               You can have <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></b> charts on your site too. Just give it a <code>div</code> and a real time chart, zoomable and draggable will appear (try it even on these tiny ones - <b>drag</b> them to pan horizontally, <b>shift + drag</b> to zoom in, on <b>chrome shift + mouse wheel</b> to zoom in/out, <b>double click</b> on them to reset them - don't be afraid of <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></b> performance - <a href="https://github.com/firehol/netdata/issues/36" target="_blank">a raspberry pi 2 can sustain 300 charts updates per second</a>!).
+                                               You can have <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></b> charts on your site too. Just give it a <code>div</code> and a real time chart, zoomable and draggable will appear (try it even on these tiny ones - <b>drag</b> them to pan horizontally, <b>shift + drag</b> to zoom in, on <b>chrome shift + mouse wheel</b> to zoom in/out, <b>double click</b> on them to reset them - don't be afraid of <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></b> performance - <a href="https://github.com/firehol/netdata/wiki/Performance" target="_blank">a raspberry pi 2 can sustain 300 charts updates per second</a>!).
                                                </div>
                                                <div class="p">
                                                For more information please refer to the <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata wiki</a></b>.
                                                        </div>
                                                        <hr/>
                                                        <div class="p">
-                                                               <h4>Trag Chart Contents</h4>
-                                                               Trag the contents of a chart to pan it horizontally.
+                                                               <h4>Drag Chart Contents</h4>
+                                                               Drag the contents of a chart to pan it horizontally.
                                                                <br/>
                                                                All the charts will follow soon after you let the chart alone (this little delay is by design: it speeds up your browser and lets you focus on what you are exploring).
                                                                <br/>
                                                        </div>
                                                        <hr/>
                                                        <div class="p">
-                                                               <h4>SHIFT + Trag</h4>
-                                                               While pressing the shift key, select with the mouse and area of a chart, to zoom in. The other charts will follow too. Zooming is performed in two phases:
+                                                               <h4>SHIFT + Drag</h4>
+                                                               While pressing the shift key, click on the contents of a chart and move the mouse to select an area, to zoom in. The other charts will follow too. Zooming is performed in two phases:
                                                                <ul>
                                                                        <li>The already loaded chart contents are zoomed (low resolution)</li>
-                                                                       <li>New data are transfered from the netdata server, to refresh the chart with possibly more detail.</li>
+                                                                       <li>New data are transferred from the netdata server, to refresh the chart with possibly more detail.</li>
                                                                </ul>
                                                                Once a chart is zoomed, auto refreshing stops for all charts. To enable it again, <b>double click</b> a zoomed chart.
                                                        </div>
                                                        <hr/>
                                                        <div class="p">
                                                                <h4>Legend Operations</h4>
-                                                               Click on the label or value of a dimension, will select / unselect this dimension.
+                                                               Click on the label or value of a dimension, will select / un-select this dimension.
                                                                <br/>
-                                                               You can press any of the shift or control keys and the click on legend labels or values, to select / unselect multiple dimensions.
+                                                               You can press any of the SHIFT or CONTROL keys and then click on legend labels or values, to select / un-select multiple dimensions.
                                                        </div>
                                                </div>
                                                <div role="tabpanel" class="tab-pane" id="help_touch">
                                                        </div>
                                                        <hr/>
                                                        <div class="p">
-                                                               <h4>Trag Chart Contents</h4>
-                                                               Touch and Trag the contents of a chart to pan it horizontally.
+                                                               <h4>Drag Chart Contents</h4>
+                                                               Touch and Drag the contents of a chart to pan it horizontally.
                                                                <br/>
                                                                All the charts will follow soon after you let the chart alone (this little delay is by design: it speeds up your browser and lets you focus on what you are exploring).
                                                                <br/>
                                                        <hr/>
                                                        <div class="p">
                                                                <h4>Legend Operations</h4>
-                                                               Tap on the label or value of a dimension, will select / unselect this dimension.
+                                                               Tap on the label or value of a dimension, will select / un-select this dimension.
                                                        </div>
                                                </div>
                                        </div>
                                </div>
                                <div class="modal-body">
                                        <center>
-                                               <small style="color: #BBBBBB;">Settings take effect immediately and are saved permanently to browser local storage (except the refresh on focus / always option).
+                                               <small style="color: #BBBBBB;">These are browser settings. Each viewer has its own. They do not affect the operation of your netdata server.
                                                <br/>
-                                               To reset all options (including charts sizes) to their defaults, click <a href="#" onclick="NETDATA.resetOptions(); return false;">here</a>.</small>
+                                               Settings take effect immediately and are saved permanently to browser local storage (except the refresh on focus / always option).
+                                               <br/>
+                                               To reset all options (including charts sizes) to their defaults, click <a href="#" onclick="resetDashboardOptions(); return false;">here</a>.</small>
                                        </center>
                                        <div style="padding: 10px;"></div>
 
                                        <!-- Tab panes -->
                                        <div class="tab-content">
                                                <div role="tabpanel" class="tab-pane active" id="settings_performance">
-                                                       <form id="optionsForm" method="get" class="form-horizontal">
+                                                       <form id="optionsForm1" method="get" class="form-horizontal">
                                                                <div class="form-group">
                                                                        <table>
                                                                        <tr class="option-row">
                                                                                <input id="eliminate_zero_dimensions" type="checkbox" checked data-toggle="toggle" data-on="Non Zero" data-off="All" data-width="110px">
                                                                                </td>
                                                                                <td class="option-info"><strong>Which dimensions to show?</strong><br/>
-                                                                                       <small>When set to <b>Non Zero</b>, dimensions that have all their values (within the current view) set to zero will not be transfered from the netdata server (except if all dimensions of the chart are zero, in which case this setting does nothing - all dimensions are transfered and shown). When set to <b>All</b>, all dimensions will always be shown. Set it to <b>Non Zero</b> to lower the data transfered between netdata and your browser, lower the CPU requirements of your browser (fewer lines to draw) and increase the focus on the legends (fewer entries at the legends).</small>
+                                                                                       <small>When set to <b>Non Zero</b>, dimensions that have all their values (within the current view) set to zero will not be transferred from the netdata server (except if all dimensions of the chart are zero, in which case this setting does nothing - all dimensions are transferred and shown). When set to <b>All</b>, all dimensions will always be shown. Set it to <b>Non Zero</b> to lower the data transferred between netdata and your browser, lower the CPU requirements of your browser (fewer lines to draw) and increase the focus on the legends (fewer entries at the legends).</small>
                                                                                </td>
                                                                                </tr>
                                                                        <tr class="option-row">
                                                        </form>
                                                </div>
                                                <div role="tabpanel" class="tab-pane" id="settings_sync">
-                                                       <form id="optionsForm" method="get" class="form-horizontal">
+                                                       <form id="optionsForm2" method="get" class="form-horizontal">
                                                                <div class="form-group">
                                                                        <table>
                                                                        <tr class="option-row">
-                                                                               <td class="option-control"><input id="parallel_refresher" type="checkbox" checked data-toggle="toggle" data-on="Parallel" data-off="Sequencial" data-width="110px"></td>
+                                                                               <td class="option-control"><input id="parallel_refresher" type="checkbox" checked data-toggle="toggle" data-on="Parallel" data-off="Sequential" data-width="110px"></td>
                                                                                <td class="option-info"><strong>Which chart refresh policy to use?</strong><br/>
-                                                                                       <small>When set to <b>parallel</b>, visible charts are refreshed in parallel (all queries are sent to netdata server in parallel) and are rendered asynchronously. When set to <b>sequencial</b> charts are refreshed one after another. Set it to parallel if your browser can cope with it (most modern browsers do), set it to sequencial if you work on an older/slower computer.</small>
+                                                                                       <small>When set to <b>parallel</b>, visible charts are refreshed in parallel (all queries are sent to netdata server in parallel) and are rendered asynchronously. When set to <b>sequential</b> charts are refreshed one after another. Set it to parallel if your browser can cope with it (most modern browsers do), set it to sequential if you work on an older/slower computer.</small>
                                                                                </td>
                                                                                </tr>
                                                                        <tr class="option-row" id="concurrent_refreshes_row">
                                                        </form>
                                                </div>
                                                <div role="tabpanel" class="tab-pane" id="settings_visual">
-                                                       <form id="optionsForm" method="get" class="form-horizontal">
+                                                       <form id="optionsForm3" method="get" class="form-horizontal">
                                                                <div class="form-group">
                                                                        <table>
+                                                                       <tr class="option-row">
+                                                                               <td class="option-control"><input id="netdata_theme_control" type="checkbox" checked data-toggle="toggle" data-offstyle="danger" data-onstyle="success" data-on="Dark" data-off="White" data-width="110px"></td>
+                                                                               <td class="option-info"><strong>Which theme to use?</strong><br/>
+                                                                                       <small>Netdata comes with two themes: <b>Dark</b> (the default) and <b>White</b>.
+                                                                                       <br/>
+                                                                                       <b>Switching this will reload the dashboard</b>.
+                                                                                       </small>
+                                                                               </td>
+                                                                               </tr>
+                                                                       <tr class="option-row">
+                                                                               <td class="option-control"><input id="show_help" type="checkbox" checked data-toggle="toggle" data-on="Help Me" data-off="No Help" data-width="110px"></td>
+                                                                               <td class="option-info"><strong>Do you need help?</strong><br/>
+                                                                                       <small>Netdata can show some help in some areas to help you use the dashboard. If all these balloons bother you, disable them using this switch.
+                                                                                       <br/>
+                                                                                       <b>Switching this will reload the dashboard</b>.
+                                                                                       </small>
+                                                                               </td>
+                                                                               </tr>
                                                                        <tr class="option-row">
                                                                                <td class="option-control"><input id="pan_and_zoom_data_padding" type="checkbox" checked data-toggle="toggle"  data-on="Pad" data-off="Don't Pad" data-width="110px"></td>
                                                                                <td class="option-info"><strong>Enable data padding when panning and zooming?</strong><br/>
                                                                        <tr class="option-row">
                                                                                <td class="option-control"><input id="smooth_plot" type="checkbox" checked data-toggle="toggle"  data-on="Smooth" data-off="Rough" data-width="110px"></td>
                                                                                <td class="option-info"><strong>Enable Bézier lines on charts?</strong><br/>
-                                                                                       <small>When set to <b>Smooth</b> the charts libraries that support it, will plot smooth curves instead of simple straight lines to connect the points.</small>
+                                                                                       <small>When set to <b>Smooth</b> the charts libraries that support it, will plot smooth curves instead of simple straight lines to connect the points.
+                                                                                       <br/>
+                                                                                       Keep in mind <a href="http://dygraphs.com" target="_blank">dygraphs</a>, the main charting library in netdata dashboards, can only smooth line charts. It cannot smooth area or stacked charts. When set to <b>Rough</b>, this setting can lower the CPU resources consumed by your browser.</small>
                                                                                </td>
                                                                                </tr>
                                                                        </table>
                </div>
        </div>
 
-</body>
-</html>
+
+       <div class="modal fade" id="updateModal" tabindex="-1" role="dialog" aria-labelledby="updateModalLabel">
+               <div class="modal-dialog" role="document">
+                       <div class="modal-content">
+                               <div class="modal-header">
+                                       <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+                                       <h4 class="modal-title" id="updateModalLabel">Update Check</h4>
+                               </div>
+                               <div class="modal-body">
+                                       Your netdata version: <b><code><span id="netdataVersion">Unknown</span></code></b>
+                                       <br/>
+                                       <div style="padding: 10px;"></div>
+                                       <div id="versionCheckLog">Not checked yet. Please press the Check Now button.</div>
+                               </div>
+                               <div class="modal-footer">
+                                       <a href="#" onclick="notifyForUpdate(true);" type="button" class="btn btn-default">Check Now</a>
+                                       <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
+                               </div>
+                       </div>
+               </div>
+       </div>
+
 <script>
 
-var demo_hostname = 'netdata.firehol.org';
-// var demo_hostname = 'box';
+var this_is_demo = null;
+function isdemo() {
+       if(this_is_demo !== null) return this_is_demo;
+       this_is_demo = false;
+
+       try {
+               if(typeof document.location.hostname === 'string') {
+                       if(document.location.hostname === 'netdata.firehol.org' || document.location.hostname === 'netdata1.firehol.org') {
+                               document.getElementById("demo_eu").className = "active";
+                               this_is_demo = true;
+                       }
+                       else if(document.location.hostname === 'netdata2.firehol.org') {
+                               document.getElementById("demo_us").className = "active";
+                               this_is_demo = true;
+                       }
+                       else if(document.location.hostname === 'netdata3.firehol.org') {
+                               document.getElementById("demo_gr").className = "active";
+                               this_is_demo = true;
+                       }
+               }
 
-if(document.location.hostname === demo_hostname) {
+               if(!this_is_demo)
+                       document.getElementById("demosites_nav").style.visibility = "hidden";
+       }
+       catch(error) {
+               ;
+       }
+
+       return this_is_demo;
+}
+
+if(isdemo()) {
        document.getElementById('masthead').style.display = 'block';
 }
 
 var options = {
        sparklines_registry: {},
-       interfaces_registry: {},
+       submenu_names: {},
        data: null,
        hostname: 'netdata_server', // will be overwritten by the netdata server
        categories: new Array(),
@@ -725,40 +863,6 @@ function sparkline(chart, dimension, units) {
        return h;
 }
 
-// documentation for each category and chart
-var messages = {
-
-       // categories / sections
-       'system': 'Overview of the key system metrices.',
-       'tc': 'Netdata collects and visualizes tc class utilization using its <a href="https://github.com/firehol/netdata/blob/master/plugins.d/tc-qos-helper.sh" target="_blank">tc-helper plugin</a>. If you also use <a href="http://firehol.org/#fireqos" target="_blank">FireQOS</a> for setting up QoS, netdata automatically collects interface and class names. If your QoS configuration includes overheads calculation, the values shown here will include these overheads (the total bandwidth for the same interface as reported in the Network Interfaces section, will be lower than the total bandwidth reported here). Also, data collection may have a slight time difference compared to the interface (QoS data collection is implemented with a BASH script, so a shift in data collection of a few milliseconds should be justified).',
-       'net': 'Per network interface statistics collected from <code>/proc/net/dev</code>.',
-       'apps': 'Per application statistics are collected using netdata\'s <code>apps.plugin</code>. This plugin walks through the entire <code>/proc</code> filesystem and aggregates statistics for applications of interest, defined in <code>/etc/netdata/apps_groups.conf</code> (the default is <a href="https://github.com/firehol/netdata/blob/master/conf.d/apps_groups.conf" target="_blank">here</a>). The plugin internaly builds a process tree (much like <code>ps fax</code> does), and groups processes together (evaluating both child and parent processes) so that the result is always a chart with a predefined set of dimensions (of course, only application groups found running are reported).<br/><b>IMPORTANT</b>: The values shown here are not 100% accurate. They only include values for the processes running. If an application is spawning childs continiously, which are terminated in just a few milliseconds (like shell scripts do), the values reported will be inaccurate. Linux does report the values for the exited childs of a process. However, these values are reported to the parent process <b>only when the child exits</b>. If these values, of the exited child processes, were also aggregated in the charts below, the charts would have been full of spikes, presenting unrealisting utilization for each process group. So, we decided to ignore these values and present only the utilization of <b>the currently running processes</b>.',
-
-       // charts
-       'system.cpu': 'Total CPU utilization (all cores). 100% here means there is no CPU idle time at all. You can get per core usage at the <a href="#cpu">CPUs</a> section and per application usage at the <a href="#apps">Applications Monitoring</a> section.<br/>Keep an eye on <b>iowait</b> ' + sparkline('system.cpu', 'iowait', '%') + '. If it is constantly high, your disks are a bottleneck and they slow your system down.<br/>Another important metric worth monitoring, is <b>softirq</b> ' + sparkline('system.cpu', 'softirq', '%') + '. A constantly high percentage of softirq may indicate network drivers issues.',
-       'system.io': 'Total Disk I/O, for all disks, read from <code>/proc/vmstat</code>. You can get detailed information about each disk at the <a href="#disk">Disks</a> section and per application Disk usage at the <a href="#apps">Applications Monitoring</a> section.',
-       'system.swapio': 'Total Swap I/O, read from <code>/proc/vmstat</code>. (netdata measures both <code>in</code> and <code>out</code>. If either of them is not shown in the chart, it is because it is zero - you can change the page settings to always render all the available dimensions on all charts).',
-       'system.pgfaults': 'Total page faults, read from <code>/proc/vmstat</code>. <b>Major page faults</b> indicates that the system is using its swap. You can find which applications use the swap at the <a href="#apps">Applications Monitoring</a> section.',
-       'system.entropy': '<a href="https://en.wikipedia.org/wiki/Entropy_(computing)" target="_blank">Entropy</a>, read from <code>/proc/sys/kernel/random/entropy_avail</code>, is like a pool of random numbers that are mainly used in cryptography. It is advised that the pool remains always <a href="https://blog.cloudflare.com/ensuring-randomness-with-linuxs-random-number-generator/" target="_blank">above 200</a>. If the pool of entropy gets empty, you risk your security to be predictable and you should install a user-space random numbers generating daemon, like <a href="http://www.issihosts.com/haveged/" target="_blank">haveged</a>, to keep the pool in healthy levels.',
-       'system.forks': 'The number of new processes created per second, read from <code>/proc/stat</code>.',
-       'system.intr': 'Total number of CPU interrupts, read from <code>/proc/stat</code>. Check <code>system.interrupts</code> that gives more detail about each interrupt and also the <a href="#cpu">CPUs</a> section where interrupts are analyzed per CPU core.',
-       'system.interrupts': 'CPU interrupts in detail, read from <code>/proc/interrupts</code>. At the <a href="#cpu">CPUs</a> section, interrupts are analyzed per CPU core.',
-       'system.softirqs': 'CPU softirqs in detail, read from <code>/proc/softirqs</code>. At the <a href="#cpu">CPUs</a> section, softirqs are analyzed per CPU core.',
-       'system.processes': 'System processes, read from <code>/proc/stat</code>. <b>Blocked</b> are processes that are willing to execute but they cannot, e.g. because they wait for disk activity.',
-       'system.ctxt': '<a href="https://en.wikipedia.org/wiki/Context_switch" target="_blank">Context Switches</a>, read from <code>/proc/stat</code>, is the switching of the CPU from one process, task or thread to another. If there are many processes or threads willing to execute and very few CPU cores available to handle them, the system is making more context switching to balance the CPU resources among them. The whole process is computationally intensive. The more the context switches, the slower the system gets.',
-       'system.idlejitter': 'Idle jitter is calculated by netdata. A thread is spawned that requests to sleep for a few microseconds. When the system wakes it up, it measures how many microseconds have passed. The different between the requested and the actual duration of the sleep, is the <b>idle jitter</b>. This number is useful in realtime environments, where CPU jitter can affect the quality of the service (like VoIP media gateways).',
-       'system.ipv4': 'Total IPv4 Traffic, read from <code>/proc/net/netstat</code>. This includes <code>lo</code> device traffic.',
-       'system.ram': 'System memory, read from <code>/proc/meminfo</code>.',
-       'system.swap': 'System swap memory, read from <code>/proc/meminfo</code>.',
-
-       // just a line to allow ending all entries above with comma
-       'end': 'end'
-};
-
-function screenWidth() {
-       return (($(window).width() * 0.95) - 50);
-}
-
 function chartsPerRow(total) {
        if(options.chartsPerRow === 0) {
                width = Math.floor(total / options.chartsMinWidth);
@@ -768,249 +872,723 @@ function chartsPerRow(total) {
        else return options.chartsPerRow;
 }
 
-function chartsPrioritySort(a, b) {
-       if(a.priority === b.priority) {
-               if(a.name < b.name) return -1;
-       }
-       else if(a.priority < b.priority) return -1;
+function prioritySort(a, b) {
+       if(a.priority < b.priority) return -1;
+       if(a.priority > b.priority) return 1;
+       if(a.name < b.name) return -1;
        return 1;
 }
 
-function uniq(array, find_key, get_result) {
-       if(typeof get_result === 'undefined' || get_result === null)
-               get_result = find_key;
-
+function sortObjectByPriority(object) {
        var idx = {};
-       var result = new Array();
+       var sorted = new Array();
 
-       $.each(array, function(i, c) {
-               key = find_key(c);
-               if(typeof idx[key] === 'undefined') {
-                       idx[key] = true;
-                       result.push(get_result(c));
+       for(var i in object) {
+               if(typeof idx[i] === 'undefined') {
+                       idx[i] = object[i];
+                       sorted.push(i);
                }
-       });
-       return result;
-}
-
-function uniq_with_list(array, find_key_function) {
-       var idx = {};
-       var result = new Array();
+       }
 
-       $.each(array, function(i, c) {
-               key = find_key_function(c);
-               if(typeof idx[key] === 'undefined') {
-                       idx[key] = new Array();
-                       result.push( { name: key, values: idx[key] } );
-               }
-               idx[key].push(c);
-       });
-       result.sort(function(a, b) {
-               if(a.name < b.name) return -1;
+       sorted.sort(function(a, b) {
+               if(idx[a].priority < idx[b].priority) return -1;
+               if(idx[a].priority > idx[b].priority) return 1;
+               if(a < b) return -1;
                return 1;
        });
-       return result;
+
+       return sorted;
 }
 
-function prepareScreen(data) {
-       // console.log('NETDATA is paused - ready to prepare the screen');
-       // console.log(data);
+// ----------------------------------------------------------------------------
 
-       options.data = data;
-       options.hostname = data.hostname;
-       document.getElementById('hostname').innerHTML = options.hostname;
-       document.getElementById('hostname').href = NETDATA.serverDefault;
-       document.title = options.hostname + ' dashboard';
-       var charts = data.charts;
+function gaugeChart(title, width, dimensions, colors) {
+       if(typeof colors === 'undefined')
+               colors = '';
 
-       function name2id(s) {
-               return s
-                       .replace(' ', '_')
-                       .replace('(', '_')
-                       .replace(')', '_')
-                       .replace('/', '_');
+       if(typeof dimensions === 'undefined')
+               dimensions = '';
+
+       return '<div data-netdata="CHART_UNIQUE_ID"'
+                                                       + ' data-dimensions="' + dimensions + '"'
+                                                       + ' data-chart-library="gauge"'
+                                                       + ' data-gauge-adjust="width"'
+                                                       + ' data-title="' + title + '"'
+                                                       + ' data-width="' + width + '"'
+                                                       + ' data-before="0"'
+                                                       + ' data-after="-CHART_DURATION"'
+                                                       + ' data-points="CHART_DURATION"'
+                                                       + ' data-colors="' + colors + '"'
+                                                       + ' role="application"></div>';
+}
+
+// ----------------------------------------------------------------------------
+
+var menuData = {
+       'system': {
+               title: 'System Overview',
+               info: 'Overview of the key system metrics.'
+       },
+
+       'ap': {
+               title: 'Access Points',
+               info: undefined
+       },
+
+       'tc': {
+               title: 'Quality of Service',
+               info: 'Netdata collects and visualizes tc class utilization using its <a href="https://github.com/firehol/netdata/blob/master/plugins.d/tc-qos-helper.sh" target="_blank">tc-helper plugin</a>. If you also use <a href="http://firehol.org/#fireqos" target="_blank">FireQOS</a> for setting up QoS, netdata automatically collects interface and class names. If your QoS configuration includes overheads calculation, the values shown here will include these overheads (the total bandwidth for the same interface as reported in the Network Interfaces section, will be lower than the total bandwidth reported here). Also, data collection may have a slight time difference compared to the interface (QoS data collection is implemented with a BASH script, so a shift in data collection of a few milliseconds should be justified).'
+       },
+
+       'net': {
+               title: 'Network Interfaces',
+               info: 'Per network interface statistics collected from <code>/proc/net/dev</code>.'
+       },
+
+       'ipv4': {
+               title: 'IPv4 Networking',
+               info: undefined
+       },
+
+       'ipv6': {
+               title: 'IPv6 Networking',
+               info: undefined
+       },
+
+       'ipvs': {
+               title: 'IP Virtual Server',
+               info: undefined
+       },
+
+       'netfilter': {
+               title: 'Firewall (netfilter)',
+               info: undefined
+       },
+
+       'cpu': {
+               title: 'CPUs',
+               info: undefined
+       },
+
+       'mem': {
+               title: 'Memory',
+               info: undefined
+       },
+
+       'disk': {
+               title: 'Disks',
+               info: undefined
+       },
+
+       'sensors': {
+               title: 'Sensors',
+               info: undefined
+       },
+
+       'nfsd': {
+               title: 'File Server (nfsd)',
+               info: undefined
+       },
+
+       'apps': {
+               title: 'Applications',
+               info: 'Per application statistics are collected using netdata\'s <code>apps.plugin</code>. This plugin walks through the entire <code>/proc</code> filesystem and aggregates statistics for applications of interest, defined in <code>/etc/netdata/apps_groups.conf</code> (the default is <a href="https://github.com/firehol/netdata/blob/master/conf.d/apps_groups.conf" target="_blank">here</a>). The plugin internally builds a process tree (much like <code>ps fax</code> does), and groups processes together (evaluating both child and parent processes) so that the result is always a chart with a predefined set of dimensions (of course, only application groups found running are reported).<br/><b>IMPORTANT</b>: The values shown here are not 100% accurate. They only include values for the processes running. If an application is spawning children continuously, which are terminated in just a few milliseconds (like shell scripts do), the values reported will be inaccurate. Linux does report the values for the exited children of a process. However, these values are reported to the parent process <b>only when the child exits</b>. If these values, of the exited child processes, were also aggregated in the charts below, the charts would have been full of spikes, presenting unrealistic utilization for each process group. So, we decided to ignore these values and present only the utilization of <b>the currently running processes</b>.',
+               height: 1.5
+       },
+
+       'users': {
+               title: 'Users',
+               info: 'Per user statistics are collected using netdata\'s <code>apps.plugin</code>. This plugin walks through the entire <code>/proc</code> filesystem and aggregates statistics per user.<br/><b>IMPORTANT</b>: The values shown here are not 100% accurate. They only include values for the processes running. If an application is spawning children continuously, which are terminated in just a few milliseconds (like shell scripts do), the values reported will be inaccurate. Linux does report the values for the exited children of a process. However, these values are reported to the parent process <b>only when the child exits</b>. If these values, of the exited child processes, were also aggregated in the charts below, the charts would have been full of spikes, presenting unrealistic utilization for each process group. So, we decided to ignore these values and present only the utilization of <b>the currently running processes</b>.',
+               height: 1.5
+       },
+
+       'groups': {
+               title: 'User Groups',
+               info: 'Per user group statistics are collected using netdata\'s <code>apps.plugin</code>. This plugin walks through the entire <code>/proc</code> filesystem and aggregates statistics per user group.<br/><b>IMPORTANT</b>: The values shown here are not 100% accurate. They only include values for the processes running. If an application is spawning children continuously, which are terminated in just a few milliseconds (like shell scripts do), the values reported will be inaccurate. Linux does report the values for the exited children of a process. However, these values are reported to the parent process <b>only when the child exits</b>. If these values, of the exited child processes, were also aggregated in the charts below, the charts would have been full of spikes, presenting unrealistic utilization for each process group. So, we decided to ignore these values and present only the utilization of <b>the currently running processes</b>.',
+               height: 1.5
+       },
+
+       'netdata': {
+               title: 'Netdata Monitoring',
+               info: undefined
+       },
+
+       'example': {
+               title: 'Example Charts',
+               info: undefined
+       },
+
+       'cgroup': {
+               title: 'Container',
+               info: undefined
+       },
+
+       'mysql': {
+               title: 'MySQL',
+               info: undefined
+       },
+
+       'named': {
+               title: 'named',
+               info: undefined
+       },
+};
+
+var submenuData = {
+       'mem.ksm': {
+               title: 'Memory Deduper',
+               info: 'Kernel Same-page Merging (KSM) performance monitoring, read from several files in <code>/sys/kernel/mm/ksm/</code>. KSM is a memory-saving de-duplication feature in the Linux kernel (since version 2.6.32). The KSM daemon ksmd periodically scans those areas of user memory which have been registered with it, looking for pages of identical content which can be replaced by a single write-protected page (which is automatically copied if a process later wants to update its content). KSM was originally developed for use with KVM (where it was known as Kernel Shared Memory), to fit more virtual machines into physical memory, by sharing the data common between them.  But it can be useful to any application which generates many instances of the same data.'
+       },
+
+       'netfilter.conntrack': {
+               title: 'Connection Tracker',
+               info: 'Netfilter Connection Tracker performance monitoring, read from <code>/proc/net/stat/nf_conntrack</code>. The connection tracker keeps track of all connections of the machine, inbound and outbound. It works by keeping a database with all open connections, tracking network and address translation and connection expectations.'
+       },
+
+       'netfilter.nfacct': {
+               title: 'Bandwidth Accounting',
+               info: 'The following information is read using the <code>nfacct.plugin</code>.'
+       },
+
+       'netfilter.synproxy': {
+               title: 'DDoS Protection',
+               info: 'DDoS Protection performance monitoring read from <code>/proc/net/stat/synproxy</code>. <a href="https://github.com/firehol/firehol/wiki/Working-with-SYNPROXY" target="_blank">SYNPROXY</a> is a TCP SYN packets proxy. It is used to protect any TCP server (like a web server) from SYN floods and similar DDoS attacks. It is a netfilter module, in the Linux kernel (since version 3.12). It is optimized to handle millions of packets per second utilizing all CPUs available without any concurrency locking between the connections. It can be used for any kind of TCP traffic (even encrypted), since it does not interfere with the content itself.'
        }
+};
 
-       $.each(charts, function(i, c) {
-               if(c.enabled === true) {
-
-                       // find the category of the chart
-                       c.category = c.type.split('.')[0];
-
-                       var tmp = c.category.split('_')[0];
-                       if(tmp === 'net' || tmp === 'disk' || tmp === 'ap')
-                               c.category = tmp;
-
-                       switch(c.category) {
-                               case 'system':
-                                       c.category_priority = 10;
-                                       c.category_title = 'System Summary';
-                                       c.glyphicon = "glyphicon-dashboard";
-                                       break;
-
-                               case 'tc':
-                                       c.category_priority = 20;
-                                       c.category_title = 'Quality Of Service';
-                                       c.glyphicon = "glyphicon-random";
-                                       
-                                       // find the name of the interface from the tc family
-                                       if(typeof options.interfaces_registry[c.family] === 'undefined' || options.interfaces_registry[c.family] === c.family)
-                                                options.interfaces_registry[c.family] = c.name.split('.')[1].split('_')[0];
-
-                                       break;
-
-                               case 'net':
-                                       c.category_priority = 30;
-                                       c.category_title = 'Network Interfaces';
-                                       c.glyphicon = "glyphicon-transfer";
-                                       break;
-
-                               case 'ap':
-                                       c.category_priority = 35;
-                                       c.category_title = 'Access Points';
-                                       c.glyphicon = "glyphicon-transfer";
-                                       break;
-
-                               case 'apps':
-                                       c.category_priority = 40;
-                                       c.category_title = 'Applications Monitoring';
-                                       c.glyphicon = "glyphicon-tasks";
-                                       break;
-
-                               case 'ipvs':
-                                       c.category_priority = 50;
-                                       c.category_title = 'IP Virtual Server';
-                                       c.glyphicon = "glyphicon-transfer";
-                                       break;
-
-                               case 'netfilter':
-                                       c.category_priority = 60;
-                                       c.category_title = 'Netfilter / IPTables';
-                                       c.glyphicon = "glyphicon-cloud";
-                                       break;
-
-                               case 'ipv4':
-                                       c.category_priority = 70;
-                                       c.category_title = 'IPv4 Summary';
-                                       c.glyphicon = "glyphicon-globe";
-                                       break;
-
-                               case 'mem':
-                                       c.category_priority = 80;
-                                       c.category_title = 'Memory';
-                                       c.glyphicon = "glyphicon-dashboard";
-                                       break;
-
-                               case 'cpu':
-                                       c.category_priority = 90;
-                                       c.category_title = 'CPU Cores';
-                                       c.glyphicon = "glyphicon-dashboard";
-
-                                       if(c.id.match(/^cpu\.cpu[0-9]+$/)) {
-                                               c.family = 'Utilization';
-                                       }
-                                       else if(c.id.match(/^cpu\.cpu[0-9]+_interrupts$/)) {
-                                               c.family = 'Interrupts';
-                                       }
-                                       else if(c.id.match(/^cpu\.cpu[0-9]+_softirqs$/)) {
-                                               c.family = 'SoftIRQs';
-                                       }
-
-                                       break;
-
-                               case 'disk':
-                                       c.category_priority = 100;
-                                       c.category_title = 'Disks';
-                                       c.glyphicon = "glyphicon-hdd";
-                                       break;
-
-                               case 'nfsd':
-                                       c.category_priority = 110;
-                                       c.category_title = 'NFS Server';
-                                       c.glyphicon = "glyphicon-hdd";
-                                       break;
-
-                               case 'squid':
-                                       c.category_priority = 140;
-                                       c.category_title = 'Proxy Server';
-                                       c.glyphicon = "glyphicon-link";
-                                       break;
-
-                               case 'netdata':
-                                       c.category_priority = 150;
-                                       c.category_title = 'Netdata Monitoring';
-                                       c.glyphicon = "glyphicon-thumbs-up";
-                                       break;
-
-                               case 'sensors':
-                                       c.category_priority = 160;
-                                       c.category_title = 'Hardware Sensors';
-                                       c.glyphicon = "glyphicon-thumbs-up";
-                                       break;
-
-                               case 'postfix':
-                                       c.category_priority = 170;
-                                       c.category_title = 'Mail Server';
-                                       c.glyphicon = "glyphicon-thumbs-up";
-                                       break;
-
-                               case 'example':
-                                       c.category_priority = 100000;
-                                       c.category_title = 'Example Plugins';
-                                       c.glyphicon = "glyphicon-search";
-                                       break;
-
-                               default:
-                                       c.category_priority = 150;
-                                       c.category_title = c.type;
-                                       c.glyphicon = "glyphicon-dashboard";
-                                       break;
+var chartData = {
+       'system.cpu': {
+               info: 'Total CPU utilization (all cores). 100% here means there is no CPU idle time at all. You can get per core usage at the <a href="#cpu">CPUs</a> section and per application usage at the <a href="#apps">Applications Monitoring</a> section.<br/>Keep an eye on <b>iowait</b> ' + sparkline('system.cpu', 'iowait', '%') + '. If it is constantly high, your disks are a bottleneck and they slow your system down.<br/>Another important metric worth monitoring, is <b>softirq</b> ' + sparkline('system.cpu', 'softirq', '%') + '. A constantly high percentage of softirq may indicate network drivers issues.'
+       },
+
+       'system.load': {
+               info: 'Current system load read from <code>/proc/loadavg</code>.',
+               height: 0.7
+       },
+
+       'system.io': {
+               info: 'Total Disk I/O, for all disks, read from <code>/proc/vmstat</code>. You can get detailed information about each disk at the <a href="#disk">Disks</a> section and per application Disk usage at the <a href="#apps">Applications Monitoring</a> section.'
+       },
+
+       'system.swapio': {
+               info: 'Total Swap I/O, read from <code>/proc/vmstat</code>. (netdata measures both <code>in</code> and <code>out</code>. If either of them is not shown in the chart, it is because it is zero - you can change the page settings to always render all the available dimensions on all charts).'
+       },
+
+       'system.pgfaults': {
+               info: 'Total page faults, read from <code>/proc/vmstat</code>. <b>Major page faults</b> indicates that the system is using its swap. You can find which applications use the swap at the <a href="#apps">Applications Monitoring</a> section.'
+       },
+
+       'system.entropy': {
+               colors: '#CC22AA',
+               info: '<a href="https://en.wikipedia.org/wiki/Entropy_(computing)" target="_blank">Entropy</a>, read from <code>/proc/sys/kernel/random/entropy_avail</code>, is like a pool of random numbers that are mainly used in cryptography. It is advised that the pool remains always <a href="https://blog.cloudflare.com/ensuring-randomness-with-linuxs-random-number-generator/" target="_blank">above 200</a>. If the pool of entropy gets empty, you risk your security to be predictable and you should install a user-space random numbers generating daemon, like <a href="http://www.issihosts.com/haveged/" target="_blank">haveged</a>, to keep the pool in healthy levels.'
+       },
+
+       'system.forks': {
+               colors: '#5555DD',
+               info: 'The number of new processes created per second, read from <code>/proc/stat</code>.'
+       },
+
+       'system.intr': {
+               colors: '#DD5555',
+               info: 'Total number of CPU interrupts, read from <code>/proc/stat</code>. Check <code>system.interrupts</code> that gives more detail about each interrupt and also the <a href="#cpu">CPUs</a> section where interrupts are analyzed per CPU core.'
+       },
+
+       'system.interrupts': {
+               info: 'CPU interrupts in detail, read from <code>/proc/interrupts</code>. At the <a href="#cpu">CPUs</a> section, interrupts are analyzed per CPU core.'
+       },
+
+       'system.softirqs': {
+               info: 'CPU softirqs in detail, read from <code>/proc/softirqs</code>. At the <a href="#cpu">CPUs</a> section, softirqs are analyzed per CPU core.'
+       },
+
+       'system.processes': {
+               info: 'System processes, read from <code>/proc/stat</code>. <b>Blocked</b> are processes that are willing to execute but they cannot, e.g. because they wait for disk activity.'
+       },
+
+       'system.active_processes': {
+               info: 'All system active processes, read from <code>/proc/loadavg</code>.'
+       },
+
+       'system.ctxt': {
+               info: '<a href="https://en.wikipedia.org/wiki/Context_switch" target="_blank">Context Switches</a>, read from <code>/proc/stat</code>, is the switching of the CPU from one process, task or thread to another. If there are many processes or threads willing to execute and very few CPU cores available to handle them, the system is making more context switching to balance the CPU resources among them. The whole process is computationally intensive. The more the context switches, the slower the system gets.'
+       },
+
+       'system.idlejitter': {
+               colors: '#5555AA',
+               info: 'Idle jitter is calculated by netdata. A thread is spawned that requests to sleep for a few microseconds. When the system wakes it up, it measures how many microseconds have passed. The difference between the requested and the actual duration of the sleep, is the <b>idle jitter</b>. This number is useful in real-time environments, where CPU jitter can affect the quality of the service (like VoIP media gateways).'
+       },
+
+       'system.ipv4': {
+               info: 'Total IPv4 Traffic, read from <code>/proc/net/netstat</code>.'
+       },
+
+       'system.ipv6': {
+               info: 'Total IPv6 Traffic, read from <code>/proc/net/snmp6</code>.'
+       },
+
+       'system.ram': {
+               info: 'System memory, read from <code>/proc/meminfo</code>.'
+       },
+
+       'system.swap': {
+               info: 'System swap memory, read from <code>/proc/meminfo</code>.'
+       },
+
+       'mem.ksm_savings': {
+               heads: [
+                       gaugeChart('Saved', '12%', 'savings', '#0099CC')
+               ]
+       },
+
+       'mem.ksm_ratios': {
+               heads: [
+                       function(id) {
+                               return  '<div data-netdata="' + id + '"'
+                                       + ' data-gauge-max-value="100"'
+                                       + ' data-chart-library="gauge"'
+                                       + ' data-title="Savings"'
+                                       + ' data-units="percentage %"'
+                                       + ' data-gauge-adjust="width"'
+                                       + ' data-width="12%"'
+                                       + ' data-before="0"'
+                                       + ' data-after="-CHART_DURATION"'
+                                       + ' data-points="CHART_DURATION"'
+                                       + ' role="application"></div>';
                        }
-
-                       // find the unique categories
-                       if(typeof options.categories_idx[c.category] === 'undefined') {
-                               options.categories_idx[c.category] = {
-                                       charts: new Array()
-                               }
-                               options.categories.push({
-                                       name: c.category,
-                                       title: c.category_title,
-                                       priority: c.category_priority,
-                                       glyphicon: c.glyphicon,
-                                       charts: options.categories_idx[c.category].charts
-                               });
+               ]
+       },
+
+       'mem.committed': {
+               colors: NETDATA.colors[3]
+       },
+
+       'apps.cpu': {
+               height: 2.0
+       },
+
+       'apps.preads': {
+               height: 2.0
+       },
+
+       'apps.pwrites': {
+               height: 2.0
+       },
+
+       'users.cpu': {
+               height: 2.0
+       },
+
+       'users.preads': {
+               height: 2.0
+       },
+
+       'users.pwrites': {
+               height: 2.0
+       },
+
+       'groups.cpu': {
+               height: 2.0
+       },
+
+       'groups.preads': {
+               height: 2.0
+       },
+
+       'groups.pwrites': {
+               height: 2.0
+       },
+
+       'tc.qos': {
+               heads: [
+                       function(id) {
+                               if(id.match(/.*-ifb$/))
+                                       return gaugeChart('Inbound', '12%', '', '#5555AA');
+                               else
+                                       return gaugeChart('Outbound', '12%', '', '#AA9900');
                        }
-                       options.categories_idx[c.category].charts.push(c);
-
-                       // find the unique families
-                       if(typeof options.families_idx[c.family] === 'undefined') {
-                               options.families_idx[c.family] = {
-                                       charts: new Array()
-                               };
-                               options.families.push({
-                                       name: c.family,
-                                       title: c.family,
-                                       priority: c.category_priority,
-                                       glyphicon: c.glyphicon,
-                                       charts: options.categories_idx[c.category].charts
-                               });
+               ]
+       },
+
+       'net.net': {
+               heads: [
+                       gaugeChart('Received', '12%', 'received'),
+                       gaugeChart('Sent', '12%', 'sent')
+               ]
+       },
+
+       'disk.util': {
+               colors: '#FF5588',
+               heads: [
+                       gaugeChart('Utilization', '12%', '', '#FF5588')
+               ]
+       },
+
+       'disk.backlog': {
+               colors: '#0099CC'
+       },
+
+       'disk.io': {
+               heads: [
+                       gaugeChart('Read', '12%', 'reads'),
+                       gaugeChart('Write', '12%', 'writes')
+               ]
+       },
+
+       'netfilter.sockets': {
+               colors: '#88AA00',
+               heads: [
+                       gaugeChart('Active Connections', '12%', '', '#88AA00')
+               ]
+       },
+
+       'netfilter.new': {
+               heads: [
+                       gaugeChart('New Connections', '12%', 'new', '#5555AA')
+               ]
+       },
+
+       'disk.iotime': {
+               height: 0.5
+       },
+       'disk.mops': {
+               height: 0.5
+       },
+       'disk.svctm': {
+               height: 0.5
+       },
+       'disk.avgsz': {
+               height: 0.5
+       },
+       'disk.await': {
+               height: 0.5
+       },
+
+       'apache.connections': {
+               colors: NETDATA.colors[4],
+               mainheads: [
+                       gaugeChart('Connections', '12%', '', NETDATA.colors[4])
+               ]
+       },
+
+       'apache.requests': {
+               colors: NETDATA.colors[0],
+               mainheads: [
+                       gaugeChart('Connections', '12%', '', NETDATA.colors[0])
+               ]
+       },
+
+       'apache.net': {
+               colors: NETDATA.colors[3],
+               mainheads: [
+                       gaugeChart('Bandwidth', '12%', '', NETDATA.colors[3])
+               ]
+       },
+
+       'apache.workers': {
+               mainheads: [
+                       function(id) {
+                               return  '<div data-netdata="' + id + '"'
+                                       + ' data-dimensions="busy"'
+                                       + ' data-append-options="percentage"'
+                                       + ' data-gauge-max-value="100"'
+                                       + ' data-chart-library="gauge"'
+                                       + ' data-title="Workers Utilization"'
+                                       + ' data-units="percentage %"'
+                                       + ' data-gauge-adjust="width"'
+                                       + ' data-width="12%"'
+                                       + ' data-before="0"'
+                                       + ' data-after="-CHART_DURATION"'
+                                       + ' data-points="CHART_DURATION"'
+                                       + ' role="application"></div>';
                        }
-                       options.families_idx[c.family].charts.push(c);
-               }
-       });
+               ]
+       },
+
+       'apache.bytesperreq': {
+               colors: NETDATA.colors[3],
+               height: 0.5
+       },
+
+       'apache.reqpersec': {
+               colors: NETDATA.colors[4],
+               height: 0.5
+       },
+
+       'apache.bytespersec': {
+               colors: NETDATA.colors[6],
+               height: 0.5
+       },
+
+       'nginx.connections': {
+               colors: NETDATA.colors[4],
+               mainheads: [
+                       gaugeChart('Connections', '12%', '', NETDATA.colors[4])
+               ]
+       },
+
+       'nginx.requests': {
+               colors: NETDATA.colors[0],
+               mainheads: [
+                       gaugeChart('Requests', '12%', '', NETDATA.colors[0])
+               ]
+       }
+};
 
-       function prioritySort(a, b) {
-               if(a.priority < b.priority) return -1;
-               if(a.priority > b.priority) return 1;
-               if(a.name < b.name) return -1;
-               return 1;
+function anyAttribute(obj, attr, key, def) {
+       if(typeof obj[key] !== 'undefined') {
+               if(typeof obj[key][attr] !== 'undefined')
+                       return obj[key][attr];
+       }
+       return def;
+}
+
+function menuTitle(chart) {
+       if(typeof chart.menu_pattern !== 'undefined') {
+               return anyAttribute(menuData, 'title', chart.menu_pattern, chart.menu_pattern).toString()
+                               + ': ' + chart.type.slice(-(chart.type.length - chart.menu_pattern.length - 1)).toString();
+       }
+
+       return anyAttribute(menuData, 'title', chart.menu, chart.menu);
+}
+
+function menuInfo(menu) {
+       return anyAttribute(menuData, 'info', menu, null);
+}
+
+function menuHeight(menu, relative) {
+       return anyAttribute(menuData, 'height', menu, 1.0) * relative;
+}
+
+function submenuTitle(menu, submenu) {
+       var key = menu + '.' + submenu;
+       return anyAttribute(submenuData, 'title', key, submenu);
+}
+
+function submenuInfo(menu, submenu) {
+       var key = menu + '.' + submenu;
+       return anyAttribute(submenuData, 'info', key, null);
+}
+
+function submenuHeight(menu, submenu, relative) {
+       var key = menu + '.' + submenu;
+       return anyAttribute(submenuData, 'height', key, 1.0) * relative;
+}
+
+
+function chartInfo(id) {
+       if(typeof chartData[id] !== 'undefined' && typeof chartData[id].info !== 'undefined')
+               return '<div class="chart-message netdata-chart-alignment" role="document">' + chartData[id].info + '</div>';
+       else
+               return '';
+}
+
+function chartHeight(id, def) {
+       if(typeof chartData[id] !== 'undefined' && typeof chartData[id].height !== 'undefined')
+               return def * chartData[id].height;
+       else
+               return def;
+}
+
+
+// ----------------------------------------------------------------------------
+
+// enrich the data structure returned by netdata
+// to reflect our menu system and content
+function enrichChartData(chart) {
+       var tmp = chart.type.split('_')[0];
+
+       switch(tmp) {
+               case 'ap':
+               case 'net':
+               case 'disk':
+                       chart.menu = tmp;
+                       break;
+
+               case 'mysql':
+               case 'named':
+               case 'cgroup':
+                       chart.menu = chart.type;
+                       chart.menu_pattern = tmp;
+                       break;
+
+               case 'tc':
+                       chart.menu = tmp;
+
+                       // find a name for this device from fireqos info
+                       // we strip '_(in|out)' or '(in|out)_'
+                       if(typeof options.submenu_names[chart.family] === 'undefined' || options.submenu_names[chart.family] === chart.family) {
+                               var n = chart.name.split('.')[1];
+                               if(n.endsWith('_in'))
+                                       options.submenu_names[chart.family] = n.slice(0, n.lastIndexOf('_in'));
+                               else if(n.endsWith('_out'))
+                                       options.submenu_names[chart.family] = n.slice(0, n.lastIndexOf('_out'));
+                               else if(n.startsWith('in_'))
+                                       options.submenu_names[chart.family] = n.slice(3, n.length);
+                               else if(n.startsWith('out_'))
+                                       options.submenu_names[chart.family] = n.slice(4, n.length);
+                       }
+
+                       // increase the priority of IFB devices
+                       // to have inbound appear before outbound
+                       if(chart.id.match(/.*-ifb$/))
+                               chart.priority--;
+
+                       break;
+
+               default:
+                       chart.menu = chart.type;
+                       break;
+       }
+
+       chart.submenu = chart.family;
+}
+
+// ----------------------------------------------------------------------------
+
+function name2id(s) {
+       return s
+               .replace(/ /g, '_')
+               .replace(/\(/g, '_')
+               .replace(/\)/g, '_')
+               .replace(/\./g, '_')
+               .replace(/\//g, '_');
+}
+
+function headMain(charts, duration) {
+       var head = '';
+
+       if(typeof charts['system.swap'] !== 'undefined')
+               head += '<div style="margin-right: 10px;" data-netdata="system.swap"'
+               + ' data-dimensions="free"'
+               + ' data-append-options="percentage"'
+               + ' data-chart-library="easypiechart"'
+               + ' data-title="Free Swap"'
+               + ' data-units="%"'
+               + ' data-easypiechart-max-value="100"'
+               + ' data-width="8%"'
+               + ' data-before="0"'
+               + ' data-after="-' + duration.toString() + '"'
+               + ' data-points="' + duration.toString() + '"'
+               + ' data-colors="#DD4400"'
+               + ' role="application"></div>';
+
+       if(typeof charts['system.io'] !== 'undefined') {
+               head += '<div style="margin-right: 10px;" data-netdata="system.io"'
+               + ' data-dimensions="in"'
+               + ' data-chart-library="easypiechart"'
+               + ' data-title="Disk Read"'
+               + ' data-units="KB / s"'
+               + ' data-width="10%"'
+               + ' data-before="0"'
+               + ' data-after="-' + duration.toString() + '"'
+               + ' data-points="' + duration.toString() + '"'
+               + ' role="application"></div>';
+
+               head += '<div style="margin-right: 10px;" data-netdata="system.io"'
+               + ' data-dimensions="out"'
+               + ' data-chart-library="easypiechart"'
+               + ' data-title="Disk Write"'
+               + ' data-units="KB / s"'
+               + ' data-width="10%"'
+               + ' data-before="0"'
+               + ' data-after="-' + duration.toString() + '"'
+               + ' data-points="' + duration.toString() + '"'
+               + ' role="application"></div>';
        }
 
-       // sort all of them
-       options.categories.sort(prioritySort);
-       options.families.sort(prioritySort);
-       $.each(options.families,   function(i, c) { c.charts.sort(prioritySort); });
+       if(typeof charts['system.cpu'] !== 'undefined')
+               head += '<div data-netdata="system.cpu"'
+               + ' data-chart-library="gauge"'
+               + ' data-title="CPU"'
+               + ' data-units="%"'
+               + ' data-gauge-max-value="100"'
+               + ' data-width="18%"'
+               + ' data-after="-' + duration.toString() + '"'
+               + ' data-points="' + duration.toString() + '"'
+               + ' data-colors="' + NETDATA.colors[12] + '"'
+               + ' role="application"></div>';
+
+       if(typeof charts['system.ipv4'] !== 'undefined') {
+               head += '<div style="margin-right: 10px;" data-netdata="system.ipv4"'
+               + ' data-dimensions="received"'
+               + ' data-chart-library="easypiechart"'
+               + ' data-title="IPv4 Inbound"'
+               + ' data-units="kbps"'
+               + ' data-width="10%"'
+               + ' data-before="0"'
+               + ' data-after="-' + duration.toString() + '"'
+               + ' data-points="' + duration.toString() + '"'
+               + ' role="application"></div>';
+
+               head += '<div style="margin-right: 10px;" data-netdata="system.ipv4"'
+               + ' data-dimensions="sent"'
+               + ' data-chart-library="easypiechart"'
+               + ' data-title="IPv4 Outbound"'
+               + ' data-units="kbps"'
+               + ' data-width="10%"'
+               + ' data-before="0"'
+               + ' data-after="-' + duration.toString() + '"'
+               + ' data-points="' + duration.toString() + '"'
+               + ' role="application"></div>';
+       }
+       else if(typeof charts['system.ipv6'] !== 'undefined') {
+               head += '<div style="margin-right: 10px;" data-netdata="system.ipv6"'
+               + ' data-dimensions="received"'
+               + ' data-chart-library="easypiechart"'
+               + ' data-title="IPv6 Inbound"'
+               + ' data-units="kbps"'
+               + ' data-width="10%"'
+               + ' data-before="0"'
+               + ' data-after="-' + duration.toString() + '"'
+               + ' data-points="' + duration.toString() + '"'
+               + ' role="application"></div>';
+
+               head += '<div style="margin-right: 10px;" data-netdata="system.ipv6"'
+               + ' data-dimensions="sent"'
+               + ' data-chart-library="easypiechart"'
+               + ' data-title="IPv6 Outbound"'
+               + ' data-units="kbps"'
+               + ' data-width="10%"'
+               + ' data-before="0"'
+               + ' data-after="-' + duration.toString() + '"'
+               + ' data-points="' + duration.toString() + '"'
+               + ' role="application"></div>';
+       }
 
+       if(typeof charts['system.ram'] !== 'undefined')
+               head += '<div style="margin-right: 10px;" data-netdata="system.ram"'
+               + ' data-dimensions="cached|free"'
+               + ' data-append-options="percentage"'
+               + ' data-chart-library="easypiechart"'
+               + ' data-title="Available RAM"'
+               + ' data-units="%"'
+               + ' data-easypiechart-max-value="100"'
+               + ' data-width="8%"'
+               + ' data-after="-' + duration.toString() + '"'
+               + ' data-points="' + duration.toString() + '"'
+               + ' data-colors="' + NETDATA.colors[7] + '"'
+               + ' role="application"></div>';
+
+       return head;
+}
+
+function generateHeadCharts(type, chart, duration) {
+       var head = '';
+       var hcharts = anyAttribute(chartData, type, chart.context, []);
+       if(hcharts.length > 0) {
+               var hi = 0, hlen = hcharts.length;
+               while(hi < hlen) {
+                       if(typeof hcharts[hi] === 'function')
+                               head += hcharts[hi](chart.id).replace('CHART_DURATION', duration.toString()).replace('CHART_UNIQUE_ID', chart.id);
+                       else
+                               head += hcharts[hi].replace('CHART_DURATION', duration.toString()).replace('CHART_UNIQUE_ID', chart.id);
+                       hi++;
+               }
+       }
+       return head;
+}
+
+function renderPage(menus, data) {
        var div = document.getElementById('charts_div');
        var pcent_width = Math.floor(100 / chartsPerRow($(div).width()));
 
@@ -1018,667 +1596,320 @@ function prepareScreen(data) {
        var duration = Math.round(($(div).width() * pcent_width / 100 * data.update_every / 3) / 60) * 60;
        var html = '';
        var sidebar = '<ul class="nav dashboard-sidenav" data-spy="affix" id="sidebar_ul">';
+       var mainhead = headMain(data.charts, duration);
 
-       function getMessage(id) {
-               if(typeof messages[id] !== 'undefined')
-                       return '<div class="chart-message" role="document">' + messages[id] + '</div>';
-               else
-                       return '';
-       }
+       // sort the menus
+       var main = sortObjectByPriority(menus);
+       var i = 0, len = main.length;
+       while(i < len) {
+               var menu = main[i++];
 
-       // render the charts
-       $.each(options.categories, function(i, t) {
-               t.charts.sort(prioritySort);
-
-               sidebar += '<li class="' + ((i === 0)?'active':'').toString() + '"><a href="#' + name2id(t.name) + '">' + t.title + '</a>';
-               html += '<div role="section"><div role="sectionhead"><h1 id="' + name2id(t.name) + '" role="heading">' + t.title + '</h1>' + getMessage(t.name) + '</div><div id="' + name2id(t.name) + '" role="document">';
-
-               if(t.name === 'cpu') {
-                       var families = uniq_with_list(t.charts, function(c) { return c.family; });
-
-                       sidebar += '<ul class="nav">';
-                       $.each(families, function(j, c) {
-                               sidebar += '<li class><a href="#' + name2id(t.name) + '_' + name2id(c.name) + '">' + c.name + '</a></li>';
-                               html += '<div class="netdata-group-container" id="family_' + name2id(t.name) + '_' + name2id(c.name) + '" style="display: inline-block; width: ' + pcent_width.toString() + '%"><h2 id="' + name2id(t.name) + '_' + name2id(c.name) + '" class="netdata-chart-alignment" role="heading">' + c.name + '</h2>';
-                               $.each(c.values, function(x, f) {
-                                       var c = null;
-                                       var h = options.chartsHeight;
-
-                                       html += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
-                                               + ' data-width="100%"'
-                                               + ' data-height="' + h.toString() + 'px"'
-                                               + ' data-before="0"'
-                                               + ' data-after="-' + duration.toString() + '"'
-                                               + ' data-colors="' + c + '"'
-                                               + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
-                                               + ' role="application"></div>';
-                               });
-                               html += '</div>'; // netdata-group-container
-                       });
-                       sidebar += '</ul>';
-               }
-               else if(t.name === 'net' || t.name === 'tc' || t.name === 'ap') {
-                       var interfaces = uniq_with_list(t.charts, function(c) { return c.family; });
-
-                       sidebar += '<ul class="nav">';
-                       $.each(interfaces, function(j, c) {
-                               var menuitem = c.name;
-                               var name = options.interfaces_registry[menuitem];
-                               if(typeof name !== 'undefined' && name !== menuitem)
-                                       menuitem = menuitem + ' (' + name + ')';
-
-                               sidebar += '<li class><a href="#' + name2id(t.name) + '_' + name2id(c.name) + '">' + menuitem + '</a></li>';
-                               html += '<div class="netdata-group-container" id="interface_' + name2id(t.name) + '_' + name2id(c.name) + '" style="display: inline-block; width: ' + pcent_width.toString() + '%"><h2 id="' + name2id(t.name) + '_' + name2id(c.name) + '" class="netdata-chart-alignment" role="heading">' + menuitem + '</h2>';
-
-                               var head = '<div style="width: 100%; text-align: center;">';
-                               var all = '';
-
-                               $.each(c.values, function(x, f) {
-                                       var c = null;
-                                       var h = options.chartsHeight / 2;
-                                       switch(f.type) {
-                                               case 'net':
-                                                       h = options.chartsHeight;
-
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-dimensions="received"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-title="Receive"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' role="application"></div>';
+               // generate an entry at the main menu
 
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-dimensions="sent"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-title="Sent"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' role="application"></div>';
-                                                       break;
-
-                                               case 'tc':
-                                                       h = options.chartsHeight;
-                                                       if(f.id.match(/.*-ifb$/) !== null)
-                                                               head += '<div data-netdata="' + f.id + '"'
-                                                               + ' data-chart-library="gauge"'
-                                                               + ' data-gauge-adjust="width"'
-                                                               + ' data-title="Receive"'
-                                                               + ' data-width="12%"'
-                                                               + ' data-before="0"'
-                                                               + ' data-after="-' + duration.toString() + '"'
-                                                               + ' data-points="' + duration.toString() + '"'
-                                                               + ' data-colors="' + NETDATA.colors[2] + '"'
-                                                               + ' role="application"></div>';
-
-                                                       else
-                                                               head += '<div data-netdata="' + f.id + '"'
-                                                               + ' data-chart-library="gauge"'
-                                                               + ' data-gauge-adjust="width"'
-                                                               + ' data-title="Sent"'
-                                                               + ' data-width="12%"'
-                                                               + ' data-before="0"'
-                                                               + ' data-after="-' + duration.toString() + '"'
-                                                               + ' data-points="' + duration.toString() + '"'
-                                                               + ' data-colors="' + NETDATA.colors[3] + '"'
-                                                               + ' role="application"></div>';
-                                                       break;
-                                               case 'ap_bandwidth': h = options.chartsHeight; break;
-                                               case 'ap_bitrate'  : h = options.chartsHeight; break;
-                                       }
-
-                                       all += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
-                                               + ' data-width="100%"'
-                                               + ' data-height="' + h.toString() + 'px"'
-                                               + ' data-before="0"'
-                                               + ' data-after="-' + duration.toString() + '"'
-                                               + ' data-colors="' + c + '"'
-                                               + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
-                                               + ' role="application"></div>';
-                               });
-
-                               head += '</div>';
-                               html += head + all + '</div>'; // netdata-group-container
-                       });
-                       sidebar += '</ul>';
-               }
-               else if(t.name === 'disk') {
-                       var disks = uniq_with_list(t.charts, function(c) { return c.family; });
-
-                       sidebar += '<ul class="nav">';
-                       $.each(disks, function(j, c) {
-                               sidebar += '<li class><a href="#' + name2id(c.name) + '">' + c.name + '</a></li>';
-                               html += '<div class="netdata-group-container" id="disk_' + name2id(c.name) + '" style="display: inline-block; width: ' + pcent_width.toString() + '%"><h2 id="' + name2id(c.name) + '" class="netdata-chart-alignment" role="heading">' + c.name + '</h2>';
-                               var head = '<div style="width: 100%; text-align: center;">';
-                               var all = '';
-                               $.each(c.values, function(x, f) {
-                                       var c = null;
-                                       var h = options.chartsHeight / 2;
-                                       switch(f.type) {
-                                               case 'disk'        : h = options.chartsHeight;
-                                                               head += '<div data-netdata="' + f.id + '"'
-                                                               + ' data-dimensions="reads"'
-                                                               + ' data-chart-library="gauge"'
-                                                               + ' data-gauge-adjust="width"'
-                                                               + ' data-title="Read"'
-                                                               + ' data-width="12%"'
-                                                               + ' data-before="0"'
-                                                               + ' data-after="-' + duration.toString() + '"'
-                                                               + ' data-points="' + duration.toString() + '"'
-                                                               + ' role="application"></div>';
-
-                                                               head += '<div data-netdata="' + f.id + '"'
-                                                               + ' data-dimensions="writes"'
-                                                               + ' data-chart-library="gauge"'
-                                                               + ' data-gauge-adjust="width"'
-                                                               + ' data-title="Write"'
-                                                               + ' data-width="12%"'
-                                                               + ' data-before="0"'
-                                                               + ' data-after="-' + duration.toString() + '"'
-                                                               + ' data-points="' + duration.toString() + '"'
-                                                               + ' role="application"></div>';
-                                                               break;
-                                               case 'disk_backlog': c = '#DD4477'; break;
-                                               case 'disk_util'   : c = '#109618';
-                                                               head += '<div data-netdata="' + f.id + '"'
-                                                               + ' data-chart-library="gauge"'
-                                                               + ' data-title="Utilization"'
-                                                               + ' data-gauge-max-value="100"'
-                                                               + ' data-gauge-adjust="width"'
-                                                               + ' data-width="12%"'
-                                                               + ' data-before="0"'
-                                                               + ' data-after="-' + duration.toString() + '"'
-                                                               + ' data-points="' + duration.toString() + '"'
-                                                               + ' data-colors="' + c + '"'
-                                                               + ' role="application"></div>';
-                                                               break;
-                                               case 'disk_qops'   : c = '#E67300'; break;
-                                       }
-
-                                       all += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
-                                               + ' data-width="100%"'
-                                               + ' data-height="' + h.toString() + 'px"'
-                                               + ' data-before="0"'
-                                               + ' data-after="-' + duration.toString() + '"'
-                                               + ' data-colors="' + c + '"'
-                                               + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
-                                               + ' role="application"></div>';
-                               });
-                               head += '</div>';
-                               html += head + all + '</div>'; // netdata-group-container
-                       });
-                       sidebar += '</ul>';
-               }
-               else if(t.name === 'apps') {
-                       $.each(t.charts, function(x, f) {
-                               var c = null;
-                               var h = options.chartsHeight / 2;
-                               switch(f.id) {
-                                       case 'apps.cpu'         : h = options.chartsHeight; break;
-                                       case 'apps.preads'      : h = options.chartsHeight; break;
-                                       case 'apps.pwrites'     : h = options.chartsHeight; break;
-                                       case 'apps.mem'         : h = options.chartsHeight; break;
-                                       case 'apps.major_faults': h = options.chartsHeight; break;
-                               }
+               sidebar += '<li class=""><a href="#' + name2id(menu) + '">' + menus[menu].title + '</a><ul class="nav">';
+               html += '<div role="section"><div role="sectionhead"><h1 id="' + menu + '" role="heading">' + menus[menu].title + '</h1></div><div id="' + menu + '" role="document">';
 
-                               html += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
-                                       + ' data-width="100%"'
-                                       + ' data-height="' + h.toString() + 'px"'
-                                       + ' data-before="0"'
-                                       + ' data-after="-' + duration.toString() + '"'
-                                       + ' data-colors="' + c + '"'
-                                       + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
-                                       + ' role="application"></div>';
-                       });
-               }
-               else if(t.name === 'system') {
-                       var head = '<div style="text-align: center; vertical-align: bottom; width: 100%;">';
-
-                       if(typeof charts['system.swap'] !== 'undefined')
-                               head += '<div style="margin-right: 10px;" data-netdata="system.swap"'
-                               + ' data-dimensions="free"'
-                               + ' data-append-options="percentage"'
-                               + ' data-chart-library="easypiechart"'
-                               + ' data-title="Free Swap"'
-                               + ' data-units="%"'
-                               + ' data-easypiechart-max-value="100"'
-                               + ' data-width="8%"'
-                               + ' data-before="0"'
-                               + ' data-after="-' + duration.toString() + '"'
-                               + ' data-points="' + duration.toString() + '"'
-                               + ' data-colors="' + NETDATA.colors[1] + '"'
-                               + ' role="application"></div>';
-
-                       if(typeof charts['system.io'] !== 'undefined') {
-                               head += '<div style="margin-right: 10px;" data-netdata="system.io"'
-                               + ' data-dimensions="in"'
-                               + ' data-chart-library="easypiechart"'
-                               + ' data-title="Disk Read"'
-                               + ' data-units="KB / s"'
-                               + ' data-width="10%"'
-                               + ' data-before="0"'
-                               + ' data-after="-' + duration.toString() + '"'
-                               + ' data-points="' + duration.toString() + '"'
-                               + ' role="application"></div>';
-
-                               head += '<div style="margin-right: 10px;" data-netdata="system.io"'
-                               + ' data-dimensions="out"'
-                               + ' data-chart-library="easypiechart"'
-                               + ' data-title="Disk Write"'
-                               + ' data-units="KB / s"'
-                               + ' data-width="10%"'
-                               + ' data-before="0"'
-                               + ' data-after="-' + duration.toString() + '"'
-                               + ' data-points="' + duration.toString() + '"'
-                               + ' role="application"></div>';
-                       }
+               if(menus[menu].info !== null)
+                       html += menus[menu].info;
 
-                       if(typeof charts['system.cpu'] !== 'undefined')
-                               head += '<div data-netdata="system.cpu"'
-                               + ' data-chart-library="gauge"'
-                               + ' data-title="CPU"'
-                               + ' data-units="%"'
-                               + ' data-gauge-max-value="100"'
-                               + ' data-width="18%"'
-                               + ' data-after="-' + duration.toString() + '"'
-                               + ' data-points="' + duration.toString() + '"'
-                               + ' data-colors="' + NETDATA.colors[12] + '"'
-                               + ' role="application"></div>';
-
-                       if(typeof charts['system.ipv4'] !== 'undefined') {
-                               head += '<div style="margin-right: 10px;" data-netdata="system.ipv4"'
-                               + ' data-dimensions="received"'
-                               + ' data-chart-library="easypiechart"'
-                               + ' data-title="IPv4 Inbound"'
-                               + ' data-units="kbps"'
-                               + ' data-width="10%"'
-                               + ' data-before="0"'
-                               + ' data-after="-' + duration.toString() + '"'
-                               + ' data-points="' + duration.toString() + '"'
-                               + ' role="application"></div>';
-
-                               head += '<div style="margin-right: 10px;" data-netdata="system.ipv4"'
-                               + ' data-dimensions="sent"'
-                               + ' data-chart-library="easypiechart"'
-                               + ' data-title="IPv4 Outbound"'
-                               + ' data-units="kbps"'
-                               + ' data-width="10%"'
-                               + ' data-before="0"'
-                               + ' data-after="-' + duration.toString() + '"'
-                               + ' data-points="' + duration.toString() + '"'
-                               + ' role="application"></div>';
-                       }
+               // console.log(' >> ' + menu + ' (' + menus[menu].priority + '): ' + menus[menu].title);
 
-                       if(typeof charts['system.ram'] !== 'undefined')
-                               head += '<div style="margin-right: 10px;" data-netdata="system.ram"'
-                               + ' data-dimensions="cached|free"'
-                               + ' data-append-options="percentage"'
-                               + ' data-chart-library="easypiechart"'
-                               + ' data-title="Available RAM"'
-                               + ' data-units="%"'
-                               + ' data-easypiechart-max-value="100"'
-                               + ' data-width="8%"'
-                               + ' data-after="-' + duration.toString() + '"'
-                               + ' data-points="' + duration.toString() + '"'
-                               + ' data-colors="' + NETDATA.colors[7] + '"'
-                               + ' role="application"></div>';
-
-/*                     if(typeof charts['system.swapio'] !== 'undefined') {
-                               head += "<div style=\"display: inline-block\">";
-
-                               head += '<div style="margin-right: 10px;" data-netdata="system.swapio"'
-                               + ' data-dimensions="in"'
-                               + ' data-chart-library="easypiechart"'
-                               + ' data-title="Swap Read"'
-                               + ' data-width="100px"'
-                               + ' data-before="0"'
-                               + ' data-after="-' + duration.toString() + '"'
-                               + ' data-points="' + duration.toString() + '"'
-                               + ' data-colors="' + NETDATA.colors[2] + '"'
-                               + ' role="application"></div>';
-
-                               head += '<div style="margin-right: 10px;" data-netdata="system.swapio"'
-                               + ' data-dimensions="out"'
-                               + ' data-chart-library="easypiechart"'
-                               + ' data-title="Swap Write"'
-                               + ' data-width="100px"'
-                               + ' data-before="0"'
-                               + ' data-after="-' + duration.toString() + '"'
-                               + ' data-points="' + duration.toString() + '"'
-                               + ' data-colors="' + NETDATA.colors[1] + '"'
-                               + ' role="application"></div>';
-
-                               head += "</div>";
-                       }
+               var shtml = '';
+               var mhead = '<div style="width: 100%; text-align: center;">' + mainhead;
+               mainhead = '';
 
-                       if(typeof charts['system.ctxt'] !== 'undefined')
-                               head += '<div style="margin-right: 10px;" data-netdata="system.ctxt"'
-                               + ' data-chart-library="easypiechart"'
-                               + ' data-title="Switches"'
-                               + ' data-width="100px"'
-                               + ' data-before="0"'
-                               + ' data-after="-' + duration.toString() + '"'
-                               + ' data-points="' + duration.toString() + '"'
-                               + ' data-colors="' + NETDATA.colors[3] + '"'
-                               + ' role="application"></div>';
-
-                       if(typeof charts['system.intr'] !== 'undefined')
-                               head += '<div style="margin-right: 10px;" data-netdata="system.intr"'
-                               + ' data-chart-library="easypiechart"'
-                               + ' data-title="Interrupts"'
-                               + ' data-width="100px"'
-                               + ' data-before="0"'
-                               + ' data-after="-' + duration.toString() + '"'
-                               + ' data-points="' + duration.toString() + '"'
-                               + ' data-colors="' + NETDATA.colors[7] + '"'
-                               + ' role="application"></div>';
-*/
-                       head += "</div>";
-                       var all = '';
-                       $.each(t.charts, function(x, f) {
-                               all += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
-                                       + ' data-width="' + pcent_width.toString() + '%"'
-                                       + ' data-height="' + options.chartsHeight.toString() + 'px"'
-                                       + ' data-before="0"'
-                                       + ' data-after="-' + duration.toString() + '"'
-                                       + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
-                                       + ' role="application"></div>';
-                       });
-                       html += head + all;
-               }
-               else if(t.name === 'netdata') {
-                       var head = '<div style="width: 100%; text-align: center;">';
-                       var all = '';
+               // sort the submenus of this menu
+               var sub = sortObjectByPriority(menus[menu].submenus);
+               var si = 0, slen = sub.length;
+               while(si < slen) {
+                       var submenu = sub[si++];
 
-                       $.each(t.charts, function(x, f) {
-                               switch(f.id) {
-                                       case 'netdata.net'   :
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-dimensions="in"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-title="Received"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' data-colors="' + NETDATA.colors[0] + '"'
-                                                       + ' role="application"></div>';
+                       // generate an entry at the submenu
+                       sidebar += '<li class><a href="#' + name2id(menu + '_' + submenu) + '">' + menus[menu].submenus[submenu].title + '</a></li>';
+                       shtml += '<div class="netdata-group-container" id="submenu_' + name2id(menu + '_' + submenu) + '" style="display: inline-block; width: ' + pcent_width.toString() + '%"><h2 id="' + name2id(menu + '_' + submenu) + '" class="netdata-chart-alignment" role="heading">' + menus[menu].submenus[submenu].title + '</h2>';
 
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-dimensions="out"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-title="Sent"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' data-colors="' + NETDATA.colors[1] + '"'
-                                                       + ' role="application"></div>';
-                                                       break;
+                       if(menus[menu].submenus[submenu].info !== null)
+                               shtml += '<div class="chart-message netdata-chart-alignment" role="document">' + menus[menu].submenus[submenu].info + '</div>';
 
-                                       case 'netdata.requests'   : c = NETDATA.colors[2];
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-title="Requests / second"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' data-colors="' + c + '"'
-                                                       + ' role="application"></div>';
-                                                       break;
+                       var head = '<div style="width: 100%; text-align: center;">';
+                       var chtml = '';
 
-                                       case 'netdata.clients'   : c = NETDATA.colors[3];
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-title="Connections"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' data-colors="' + c + '"'
-                                                       + ' role="application"></div>';
-                                                       break;
-                               }
+                       // console.log('    \------- ' + submenu + ' (' + menus[menu].submenus[submenu].priority + '): ' + menus[menu].submenus[submenu].title);
+
+                       // sort the charts in this submenu of this menu
+                       menus[menu].submenus[submenu].charts.sort(prioritySort);
+                       var ci = 0, clen = menus[menu].submenus[submenu].charts.length;
+                       while(ci < clen) {
+                               var chart = menus[menu].submenus[submenu].charts[ci++];
 
-                               all += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
+                               // generate the submenu heading charts
+                               mhead += generateHeadCharts('mainheads', chart, duration);
+                               head += generateHeadCharts('heads', chart, duration);
+
+                               // generate the chart
+                               chtml += chartInfo(chart.context) + '<div data-netdata="' + chart.id + '"'
                                        + ' data-width="' + pcent_width.toString() + '%"'
-                                       + ' data-height="' + options.chartsHeight.toString() + 'px"'
+                                       + ' data-height="' + chartHeight(chart.context, options.chartsHeight).toString() + 'px"'
                                        + ' data-before="0"'
                                        + ' data-after="-' + duration.toString() + '"'
-                                       + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
+                                       + ' data-id="' + name2id(options.hostname + '/' + chart.id) + '"'
+                                       + ' data-colors="' + anyAttribute(chartData, 'colors', chart.context, '') + '"'
                                        + ' role="application"></div>';
-                       });
+
+                               // console.log('         \------- ' + chart.id + ' (' + chart.priority + '): ' + chart.context  + ' height: ' + menus[menu].submenus[submenu].height);
+                       }
+
                        head += '</div>';
-                       html += head + all;
+                       shtml += head + chtml + '</div>';
                }
-               else if(t.name === 'netfilter') {
-                       var head = '<div style="width: 100%; text-align: center;">';
-                       var all = '';
 
-                       $.each(t.charts, function(x, f) {
-                               switch(f.id) {
-                                       case 'netfilter.sockets'   :
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-title="Active Connections"'
-                                                       + ' data-units="connections"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' data-colors="' + NETDATA.colors[0] + '"'
-                                                       + ' role="application"></div>';
-                                                       break;
+               mhead += '</div>';
+               sidebar += '</ul></li>';
+               html += mhead + shtml + '</div></div><hr role="separator"/>';
+       }
 
-                                       case 'netfilter.new':
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-dimensions="new"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-title="New Connections"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' data-colors="' + NETDATA.colors[2] + '"'
-                                                       + ' role="application"></div>';
-                                                       break;
-                               }
+       sidebar += '</ul>';
+       div.innerHTML = html;
+       document.getElementById('sidebar').innerHTML = sidebar;
+       finalizePage();
+}
 
-                               all += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
-                                       + ' data-width="' + pcent_width.toString() + '%"'
-                                       + ' data-height="' + options.chartsHeight.toString() + 'px"'
-                                       + ' data-before="0"'
-                                       + ' data-after="-' + duration.toString() + '"'
-                                       + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
-                                       + ' role="application"></div>';
-                       });
-                       head += '</div>';
-                       html += head + all;
+function renderChartsAndMenu(data) {
+       var menus = {};
+       var charts = data.charts;
+
+       for(var c in charts) {
+               enrichChartData(charts[c]);
+
+               // create the menu
+               if(typeof menus[charts[c].menu] === 'undefined') {
+                       menus[charts[c].menu] = {
+                               priority: charts[c].priority,
+                               submenus: {},
+                               title: menuTitle(charts[c]),
+                               info: menuInfo(charts[c].menu),
+                               height: menuHeight(charts[c].menu, options.chartsHeight)
+                       };
                }
-               else if(t.name === 'apache') {
-                       var head = '<div style="width: 100%; text-align: center;">';
-                       var all = '';
-
-                       $.each(t.charts, function(x, f) {
-                               var c = 'null';
-                               var h = options.chartsHeight;
-                               switch(f.id) {
-                                       case 'apache.connections':
-                                                       c = NETDATA.colors[4];
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-title="Connections"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' data-colors="' + c + '"'
-                                                       + ' role="application"></div>';
-                                                       break;
 
-                                       case 'apache.requests':
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-title="Requests"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' data-colors="' + NETDATA.colors[0] + '"'
-                                                       + ' role="application"></div>';
-                                                       break;
+               if(charts[c].priority < menus[charts[c].menu].priority)
+                       menus[charts[c].menu].priority = charts[c].priority;
+
+               // create the submenu
+               if(typeof menus[charts[c].menu].submenus[charts[c].submenu] === 'undefined') {
+                       menus[charts[c].menu].submenus[charts[c].submenu] = {
+                               priority: charts[c].priority,
+                               charts: new Array(),
+                               title: null,
+                               info: submenuInfo(charts[c].menu, charts[c].submenu),
+                               height: submenuHeight(charts[c].menu, charts[c].submenu, menus[charts[c].menu].height)
+                       };
+               }
 
-                                       case 'apache.net':
-                                                       c = NETDATA.colors[1];
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-title="Bandwidth"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' data-colors="' + c + '"'
-                                                       + ' role="application"></div>';
-                                                       break;
+               if(charts[c].priority < menus[charts[c].menu].submenus[charts[c].submenu].priority)
+                       menus[charts[c].menu].submenus[charts[c].submenu].priority = charts[c].priority;
 
-                                       case 'apache.workers':
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-dimensions="busy"'
-                                                       + ' data-append-options="percentage"'
-                                                       + ' data-gauge-max-value="100"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-title="Workers Utilization"'
-                                                       + ' data-units="percentage %"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' data-colors="' + NETDATA.colors[2] + '"'
-                                                       + ' role="application"></div>';
-                                                       break;
+               // index the chart in the menu/submenu
+               menus[charts[c].menu].submenus[charts[c].submenu].charts.push(charts[c]);
+       }
 
-                                       case 'apache.bytesperreq':
-                                                       c = NETDATA.colors[3];
-                                                       h = Math.round(h / 2);
-                                                       break;
+       // propagate the descriptive subname given to QoS
+       // to all the other submenus with the same name
+       for(var m in menus) {
+               for(var s in menus[m].submenus) {
+                       // set the family using a name
+                       if(typeof options.submenu_names[s] !== 'undefined') {
+                               menus[m].submenus[s].title = s + ' (' + options.submenu_names[s] + ')';
+                       }
+                       else {
+                               menus[m].submenus[s].title = submenuTitle(m, s);
+                       }
+               }
+       }
 
-                                       default:
-                                                       h = Math.round(h / 2);
-                                                       break;
-                               }
+       renderPage(menus, data);
+}
 
-                               all += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
-                                       + ' data-width="' + pcent_width.toString() + '%"'
-                                       + ' data-height="' + h.toString() + 'px"'
-                                       + ' data-before="0"'
-                                       + ' data-after="-' + duration.toString() + '"'
-                                       + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
-                                       + ' data-colors="' + c + '"'
-                                       + ' role="application"></div>';
-                       });
-                       head += '</div>';
-                       html += head + all;
-               }
-               else if(t.name === 'nginx') {
-                       var head = '<div style="width: 100%; text-align: center;">';
-                       var all = '';
-                       $.each(t.charts, function(x, f) {
-                               var c = 'null';
-                               var h = options.chartsHeight;
-
-                               switch(f.id) {
-                                       case 'nginx.connections':
-                                                       c = NETDATA.colors[4];
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-title="Connections"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' data-colors="' + c + '"'
-                                                       + ' role="application"></div>';
-                                                       break;
+function downloadAllCharts(netdata_url) {
+       if(typeof netdata_url === 'undefined' || netdata_url === null)
+               netdata_url = NETDATA.serverDefault;
 
-                                       case 'nginx.requests':
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-title="Requests"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' data-colors="' + NETDATA.colors[0] + '"'
-                                                       + ' role="application"></div>';
-                                                       break;
-                               }
+       NETDATA.pause(function() {
 
-                               all += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
-                                       + ' data-width="' + pcent_width.toString() + '%"'
-                                       + ' data-height="' + h.toString() + 'px"'
-                                       + ' data-before="0"'
-                                       + ' data-after="-' + duration.toString() + '"'
-                                       + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
-                                       + ' data-colors="' + c + '"'
-                                       + ' role="application"></div>';
-                       });
-                       head += '</div>';
-                       html += head + all;
+               // download all the charts the server knows
+               NETDATA.chartRegistry.downloadAll(netdata_url, function(data) {
+
+                       options.data = data;
+                       options.hostname = data.hostname;
+                       document.getElementById('hostname').innerHTML = options.hostname;
+                       document.getElementById('hostname').href = NETDATA.serverDefault;
+                       document.title = options.hostname + ' dashboard';
+
+                       renderChartsAndMenu(data);
+
+                       // prepare our DOM
+//                     prepareScreen(data);
+
+                       // due to affix issues, prepareScreen() will unpause
+                       // netdata as needed
+               });
+       });
+}
+
+// ----------------------------------------------------------------------------
+
+function versionLog(msg) {
+       document.getElementById('versionCheckLog').innerHTML = msg;
+}
+
+function getNetdataVersion(callback) {
+       versionLog('Downloading installed version info from netdata...');
+
+       $.ajax({
+               url: 'version.txt',
+               async: true,
+               cache: false
+       })
+       .done(function(data) {
+               data = data.replace(/(\r\n|\n|\r| |\t)/gm,"");
+               if(data.length !== 40) {
+                       versionLog('Received version string is invalid.');
+                       callback(null);
                }
                else {
-                       $.each(t.charts, function(x, f) {
-                               html += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
-                                       + ' data-width="' + pcent_width.toString() + '%"'
-                                       + ' data-height="' + options.chartsHeight.toString() + 'px"'
-                                       + ' data-before="0"'
-                                       + ' data-after="-' + duration.toString() + '"'
-                                       + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
-                                       + ' role="application"></div>';
-                       });
+                       versionLog('Installed version of netdata is ' + data);
+                       document.getElementById('netdataVersion').innerHTML = data;
+                       callback(data);
                }
+       })
+       .fail(function() {
+               versionLog('Failed to download installed version info from netdata!');
+               callback(null);
+       });
+}
 
-               sidebar += '</li>';
-               html += '</div>'; // document
-               html += '</div>'; // section
-               html += '<hr role="separator"/>';
+function getGithubLatestCommit(callback) {
+       versionLog('Downloading latest version info from github...');
+
+       $.ajax({
+               url: 'https://api.github.com/repos/firehol/netdata/commits',
+               async: true,
+               cache: false
+       })
+       .done(function(data) {
+               versionLog('Latest version info from github is ' + data[0].sha);
+               callback(data[0].sha);
+       })
+       .fail(function() {
+               versionLog('Failed to download installed version info from github!');
+               callback(null);
        });
-       sidebar += '</ul>';
-/*
-       // show the colors
-       html += '<br/><div class="row">'
-       $.each(NETDATA.colors, function(i, c){
-               html += '<div style="display: inline-block;"><div style="display: inline-block; width: 100px; height: 100px; background: ' + c + ';"></div><br/>' + c + '</div>';
+}
+
+function checkForUpdate(callback) {
+       getNetdataVersion(function(sha1) {
+               if(sha1 === null) callback(null, null);
+
+               getGithubLatestCommit(function(sha2) {
+                       callback(sha1, sha2);
+               });
        });
-       html += '</div>'
-*/
-       div.innerHTML = html;
-       document.getElementById('sidebar').innerHTML = sidebar;
-       
+
+       return null;
+}
+
+var updateBlinkCounter = 0;
+function notifyForUpdate(force) {
+       versionLog('<p>checking for updates...</p>');
+
+       var now = new Date().getTime();
+
+       if(typeof force === 'undefined' || force !== true) {
+               var last = loadLocalStorage('last_update_check');
+
+               if(typeof last === 'string')
+                       last = parseInt(last);
+               else
+                       last = 0;
+
+               if(now - last < 3600000 * 8) {
+                       // no need to check it - too soon
+                       return;
+               }
+       }
+
+       checkForUpdate(function(sha1, sha2) {
+               var save = false;
+
+               if(sha1 === null) {
+                       save = false;
+                       versionLog('<p><big>Failed to get your netdata version!</big></p><p>You can always get the latest version of netdata from <a href="https://github.com/firehol/netdata" target="_blank">its github page</a>.</p>');
+               }
+               else if(sha2 === null) {
+                       save = false;
+                       versionLog('<p><big>Failed to get the latest version from github.</big></p><p>You can always get the latest version of netdata from <a href="https://github.com/firehol/netdata" target="_blank">its github page</a>.</p>');
+               }
+               else if(sha1 === sha2) {
+                       save = true;
+                       versionLog('<p><big>You already have the latest version of netdata!</big></p><p>No update yet?<br/>Probably, we need some motivation to keep going on!</p><p>If you haven\'t already, <a href="https://github.com/firehol/netdata" target="_blank">give netdata a <b>Star</b> at its github page</a>.</p>');
+               }
+               else {
+                       save = true;
+                       var compare = 'https://github.com/firehol/netdata/compare/' + sha1.toString() + '...' + sha2.toString();
+
+                       versionLog('<p><big><strong>New version of netdata available!</strong></big></p><p>Latest version: ' + sha2.toString() + '</p><p><a href="' + compare + '" target="_blank">Click here for the changes log</a> since your installed version, and<br/><a href="https://github.com/firehol/netdata/wiki/Updating-Netdata" target="_blank">click here for directions on updating</a> your netdata installation.</p><p>We suggest to review the changes log for new features you may be interested, or important bug fixes you may need.<br/>Keeping your netdata updated, is generally a good idea.</p>');
+
+                       function updateButtonBlink() {
+                               updateBlinkCounter--;
+                               if(updateBlinkCounter > 0)
+                                       $('#updateButton').fadeOut(500).fadeIn(500, updateButtonBlink);
+                       }
+
+                       if(updateBlinkCounter === 0) {
+                               updateBlinkCounter = 300;
+                               updateButtonBlink();
+                       }
+               }
+
+               if(save)
+                       saveLocalStorage('last_update_check', now.toString());
+       });
+}
+
+// ----------------------------------------------------------------------------
+
+function getUrlParameter(sParam) {
+    var sPageURL = decodeURIComponent(window.location.search.substring(1)),
+        sURLVariables = sPageURL.split('&'),
+        sParameterName,
+        i;
+
+    for (i = 0; i < sURLVariables.length; i++) {
+        sParameterName = sURLVariables[i].split('=');
+
+        if (sParameterName[0] === sParam) {
+            return sParameterName[1] === undefined ? true : sParameterName[1];
+        }
+    }
+}
+
+function finalizePage() {
        // resize all charts - without starting the background thread
        // this has to be done while NETDATA is paused
        // if we ommit this, the affix menu will be wrong, since all
        // the Dom elements are initially zero-sized
        NETDATA.parseDom();
 
+       var before = 0, after = 0, nowelcome = 0;
+       after = getUrlParameter('force_after_ms');
+       before = getUrlParameter('force_before_ms');
+       nowelcome = (getUrlParameter('nowelcome') === true)?true:false;
+
+       if(before > 0 && after > 0) {
+               nowelcome = true;
+               NETDATA.globalPanAndZoom.setMaster(NETDATA.options.targets[0], after, before);
+       }
+
        // let it run (update the charts)
        NETDATA.unpause();
 
@@ -1695,7 +1926,7 @@ function prepareScreen(data) {
        /* activate bootstrap sidebar (affix) */
        $('#sidebar').affix({
                offset: {
-                       top: (document.location.hostname === demo_hostname)?150:0,
+                       top: (isdemo())?150:0,
                        bottom: 0
                }
        });
@@ -1706,7 +1937,7 @@ function prepareScreen(data) {
        $('#sidebar').on('affixed.bs.affix', function() {
                $(this).removeAttr('style');
        });
-       
+
        /* activate bootstrap scrollspy (needed for sidebar) */
        $(document.body).scrollspy({
                target: '#sidebar',
@@ -1728,6 +1959,12 @@ function prepareScreen(data) {
                        }
                }
 
+               var theme_sync_option = function(option) {
+                       var self = $('#' + option);
+
+                       self.bootstrapToggle(netdataTheme === 'slate'?'on':'off');
+               }
+
                sync_option('eliminate_zero_dimensions');
                sync_option('destroy_on_hide');
                sync_option('parallel_refresher');
@@ -1737,6 +1974,8 @@ function prepareScreen(data) {
                sync_option('stop_updates_when_focus_is_lost');
                sync_option('smooth_plot');
                sync_option('pan_and_zoom_data_padding');
+               sync_option('show_help');
+               theme_sync_option('netdata_theme_control');
 
                if(NETDATA.getOption('parallel_refresher') === false) {
                        $('#concurrent_refreshes_row').hide();
@@ -1757,32 +1996,42 @@ function prepareScreen(data) {
        $('#stop_updates_when_focus_is_lost').change(function() { NETDATA.setOption('stop_updates_when_focus_is_lost', $(this).prop('checked')); });
        $('#smooth_plot').change(function()                     { NETDATA.setOption('smooth_plot', $(this).prop('checked')); });
        $('#pan_and_zoom_data_padding').change(function()       { NETDATA.setOption('pan_and_zoom_data_padding', $(this).prop('checked')); });
-       
-       if(document.location.hostname === demo_hostname)
+       $('#show_help').change(function()                       { NETDATA.setOption('show_help', $(this).prop('checked')); location.reload(); });
+
+       // this has to be the last
+       // it reloads the page
+       $('#netdata_theme_control').change(function() {
+               if(setTheme($(this).prop('checked')?'slate':'white'))
+                       location.reload();
+       });
+
+       if(!nowelcome && isdemo()) {
                setTimeout(function() {
                        $('#welcomeModal').modal();
                }, 1000);
-}
+       }
+       else
+               notifyForUpdate();
 
-NETDATA.pause(function() {
+       $('#updateModal').on('shown.bs.modal', function() {
+               notifyForUpdate(true);
+       });
+}
 
-//     $('#welcomeModal').on('hidden.bs.modal', function (e) {
-//             NETDATA.updatedDom();
-//     });
-//     $('#welcomeModal').on('shown.bs.modal', function (e) {
-//             NETDATA.updatedDom();
-//     });
+function resetDashboardOptions() {
+       var help = NETDATA.options.current.show_help;
 
-       // download all the charts the server knows
-       NETDATA.chartRegistry.downloadAll(NETDATA.serverDefault, function(data) {
+       NETDATA.resetOptions();
+       if(setTheme('slate'))
+               location.reload();
 
-               // prepare our DOM
-               // this will be called when NETDATA is paused
-               prepareScreen(data);
+       if(help !== NETDATA.options.current.show_help)
+               location.reload();
+}
 
-               // due to affix issues, prepareScreen() will unpause
-               // netdata as needed
-       });
-});
+downloadAllCharts();
 
 </script>
+
+</body>
+</html>