]> arthur.barton.de Git - netdata.git/commitdiff
dashboard strings are now in dashboard_info.js; dashboard now downloads requires...
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sat, 24 Sep 2016 21:50:58 +0000 (00:50 +0300)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sat, 24 Sep 2016 21:50:58 +0000 (00:50 +0300)
web/Makefile.am
web/dashboard.js
web/dashboard_info.js [new file with mode: 0755]
web/index.html

index fc14269f8f4c1ead407f60d6e5d5267c23632c77..0631a78156b554be20af6fbf3906b679f8c5374a 100644 (file)
@@ -9,6 +9,7 @@ dist_web_DATA = \
        demosites.html \
        dashboard.html \
        dashboard.js \
+       dashboard_info.js \
        dashboard.css \
        dashboard.slate.css \
        favicon.ico \
index d567daa345a587f684ca490fe0001b190765c143..8f759a07293b7347f8bbf07416fe633b4e9fa537 100644 (file)
 //
 // var netdataRegistryAfterMs = 1500    // the time to consult to registry on startup
 //
+// var netdataCallback = null;          // a function to call when netdata is ready
+//                                      // netdata will be running while this is called (call NETDATA.pause to stop it)
+// var netdataPrepCallback = null;      // a callback to be called before netdata does anything else
+//
 // You can also set the default netdata server, using the following.
 // When this variable is not set, we assume the page is hosted on your
 // netdata server already.
 
         // Registry initialization
         setTimeout(NETDATA.registry.init, netdataRegistryAfterMs);
+
+        if(typeof netdataCallback === 'function')
+            netdataCallback();
     };
 
     // ----------------------------------------------------------------------------------------------------------------
         }
     ];
 
+    NETDATA.loadedRequiredJs = 0;
     NETDATA.loadRequiredJs = function(index, callback) {
-        if(index >= NETDATA.requiredJs.length)  {
-            if(typeof callback === 'function')
-                callback();
-            return;
-        }
+        if(index >= NETDATA.requiredJs.length) return;
 
         if(NETDATA.requiredJs[index].isAlreadyLoaded()) {
+            NETDATA.loadedRequiredJs++;
             NETDATA.loadRequiredJs(++index, callback);
             return;
         }
         $.ajax({
             url: NETDATA.requiredJs[index].url,
             cache: true,
+            async: true,
             dataType: "script",
             xhrFields: { withCredentials: true } // required for the cookie
         })
         .done(function() {
             if(NETDATA.options.debug.main_loop === true)
                 console.log('loaded ' + NETDATA.requiredJs[index].url);
-
-            NETDATA.loadRequiredJs(++index, callback);
         })
         .fail(function() {
             alert('Cannot load required JS library: ' + NETDATA.requiredJs[index].url);
         })
+        .always(function() {
+            NETDATA.loadedRequiredJs++;
+            if(typeof callback === 'function' && NETDATA.loadedRequiredJs >= NETDATA.requiredJs.length)
+                callback();
+        })
+
+        NETDATA.loadRequiredJs(++index, callback);
     };
 
     NETDATA.loadRequiredCSS = function(index) {
     // ----------------------------------------------------------------------------------------------------------------
     // Boot it!
 
+    if(typeof netdataPrepCallback === 'function')
+        netdataPrepCallback();
+
     NETDATA.errorReset();
     NETDATA.loadRequiredCSS(0);
 
diff --git a/web/dashboard_info.js b/web/dashboard_info.js
new file mode 100755 (executable)
index 0000000..31ddf82
--- /dev/null
@@ -0,0 +1,706 @@
+\r
+var netdataDashboard = window.netdataDashboard || {};\r
+\r
+// menu\r
+// information about the main menus\r
+\r
+netdataDashboard.menu = {\r
+    'system': {\r
+        title: 'System Overview',\r
+        icon: '<i class="fa fa-bookmark" aria-hidden="true"></i>',\r
+        info: 'Overview of the key system metrics.'\r
+    },\r
+\r
+    'ap': {\r
+        title: 'Access Points',\r
+        icon: '<i class="fa fa-wifi" aria-hidden="true"></i>',\r
+        info: undefined\r
+    },\r
+\r
+    'tc': {\r
+        title: 'Quality of Service',\r
+        icon: '<i class="fa fa-globe" aria-hidden="true"></i>',\r
+        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).'\r
+    },\r
+\r
+    'net': {\r
+        title: 'Network Interfaces',\r
+        icon: '<i class="fa fa-share-alt" aria-hidden="true"></i>',\r
+        info: 'Per network interface statistics collected from <code>/proc/net/dev</code>.'\r
+    },\r
+\r
+    'ipv4': {\r
+        title: 'IPv4 Networking',\r
+        icon: '<i class="fa fa-cloud" aria-hidden="true"></i>',\r
+        info: undefined\r
+    },\r
+\r
+    'ipv6': {\r
+        title: 'IPv6 Networking',\r
+        icon: '<i class="fa fa-cloud" aria-hidden="true"></i>',\r
+        info: undefined\r
+    },\r
+\r
+    'ipvs': {\r
+        title: 'IP Virtual Server',\r
+        icon: '<i class="fa fa-eye" aria-hidden="true"></i>',\r
+        info: undefined\r
+    },\r
+\r
+    'netfilter': {\r
+        title: 'Firewall (netfilter)',\r
+        icon: '<i class="fa fa-shield" aria-hidden="true"></i>',\r
+        info: undefined\r
+    },\r
+\r
+    'cpu': {\r
+        title: 'CPUs',\r
+        icon: '<i class="fa fa-bolt" aria-hidden="true"></i>',\r
+        info: undefined\r
+    },\r
+\r
+    'mem': {\r
+        title: 'Memory',\r
+        icon: '<i class="fa fa-bolt" aria-hidden="true"></i>',\r
+        info: undefined\r
+    },\r
+\r
+    'disk': {\r
+        title: 'Disks',\r
+        icon: '<i class="fa fa-folder" aria-hidden="true"></i>',\r
+        info: 'Charts with performance information for all the system disks. Special care has been given to present disk performance metrics in a way compatible with <code>iostat -x</code>. netdata by default prevents rendering performance charts for individual partitions and unmounted virtual disks. Disabled charts can still be enabled by altering the relative settings in the netdata configuration file.'\r
+    },\r
+\r
+    'sensors': {\r
+        title: 'Sensors',\r
+        icon: '<i class="fa fa-leaf" aria-hidden="true"></i>',\r
+        info: undefined\r
+    },\r
+\r
+    'nfsd': {\r
+        title: 'NFS Server',\r
+        icon: '<i class="fa fa-folder-open" aria-hidden="true"></i>',\r
+        info: undefined\r
+    },\r
+\r
+    'nfs': {\r
+        title: 'NFS Client',\r
+        icon: '<i class="fa fa-folder-open" aria-hidden="true"></i>',\r
+        info: undefined\r
+    },\r
+\r
+    'apps': {\r
+        title: 'Applications',\r
+        icon: '<i class="fa fa-heartbeat" aria-hidden="true"></i>',\r
+        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). The reported values are compatible with <code>top</code>, although the netdata plugin counts also the resources of exited children (unlike <code>top</code> which shows only the resources of the currently running processes). So for processes like shell scripts, the reported values include the resources used by the commands these scripts run within each timeframe.',\r
+        height: 1.5\r
+    },\r
+\r
+    'users': {\r
+        title: 'Users',\r
+        icon: '<i class="fa fa-user" aria-hidden="true"></i>',\r
+        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. The reported values are compatible with <code>top</code>, although the netdata plugin counts also the resources of exited children (unlike <code>top</code> which shows only the resources of the currently running processes). So for processes like shell scripts, the reported values include the resources used by the commands these scripts run within each timeframe.',\r
+        height: 1.5\r
+    },\r
+\r
+    'groups': {\r
+        title: 'User Groups',\r
+        icon: '<i class="fa fa-users" aria-hidden="true"></i>',\r
+        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. The reported values are compatible with <code>top</code>, although the netdata plugin counts also the resources of exited children (unlike <code>top</code> which shows only the resources of the currently running processes). So for processes like shell scripts, the reported values include the resources used by the commands these scripts run within each timeframe.',\r
+        height: 1.5\r
+    },\r
+\r
+    'netdata': {\r
+        title: 'Netdata Monitoring',\r
+        icon: '<i class="fa fa-bar-chart" aria-hidden="true"></i>',\r
+        info: undefined\r
+    },\r
+\r
+    'example': {\r
+        title: 'Example Charts',\r
+        info: undefined\r
+    },\r
+\r
+    'cgroup': {\r
+        title: '',\r
+        icon: '<i class="fa fa-th" aria-hidden="true"></i>',\r
+        info: undefined\r
+    },\r
+\r
+    'cgqemu': {\r
+        title: '',\r
+        icon: '<i class="fa fa-th-large" aria-hidden="true"></i>',\r
+        info: undefined\r
+    },\r
+\r
+    'memcached': {\r
+        title: 'memcached',\r
+        icon: '<i class="fa fa-database" aria-hidden="true"></i>',\r
+        info: undefined\r
+    },\r
+\r
+    'mysql': {\r
+        title: 'MySQL',\r
+        icon: '<i class="fa fa-database" aria-hidden="true"></i>',\r
+        info: undefined\r
+    },\r
+\r
+    'redis': {\r
+        title: 'Redis',\r
+        icon: '<i class="fa fa-database" aria-hidden="true"></i>',\r
+        info: undefined\r
+    },\r
+\r
+    'retroshare': {\r
+        title: 'RetroShare',\r
+        icon: '<i class="fa fa-share-alt" aria-hidden="true"></i>',\r
+        info: undefined\r
+    },\r
+\r
+    'ipfs': {\r
+        title: 'IPFS',\r
+        icon: '<i class="fa fa-folder-open" aria-hidden="true"></i>',\r
+        info: undefined\r
+    },\r
+\r
+    'phpfpm': {\r
+        title: 'PHP-FPM',\r
+        icon: '<i class="fa fa-eye" aria-hidden="true"></i>',\r
+        info: undefined,\r
+    },\r
+\r
+    'postfix': {\r
+        title: 'postfix',\r
+        icon: '<i class="fa fa-envelope" aria-hidden="true"></i>',\r
+        info: undefined,\r
+    },\r
+\r
+    'nginx': {\r
+        title: 'nginx',\r
+        icon: '<i class="fa fa-eye" aria-hidden="true"></i>',\r
+        info: undefined,\r
+    },\r
+\r
+    'apache': {\r
+        title: 'Apache',\r
+        icon: '<i class="fa fa-eye" aria-hidden="true"></i>',\r
+        info: undefined,\r
+    },\r
+\r
+    'named': {\r
+        title: 'named',\r
+        icon: '<i class="fa fa-tag" aria-hidden="true"></i>',\r
+        info: undefined\r
+    },\r
+\r
+    'squid': {\r
+        title: 'squid',\r
+        icon: '<i class="fa fa-exchange" aria-hidden="true"></i>',\r
+        info: undefined\r
+    },\r
+\r
+    'nut': {\r
+        title: 'UPS',\r
+        icon: '<i class="fa fa-battery-half" aria-hidden="true"></i>',\r
+        info: undefined\r
+    },\r
+\r
+    'apcupsd': {\r
+        title: 'UPS',\r
+        icon: '<i class="fa fa-battery-half" aria-hidden="true"></i>',\r
+        info: undefined\r
+    },\r
+\r
+    'smawebbox': {\r
+        title: 'Solar Power',\r
+        icon: '<i class="fa fa-sun-o" aria-hidden="true"></i>',\r
+        info: undefined\r
+    },\r
+\r
+    'snmp': {\r
+        title: 'SNMP',\r
+        icon: '<i class="fa fa-random" aria-hidden="true"></i>',\r
+        info: undefined\r
+    }\r
+};\r
+\r
+// submenu\r
+// information about the submenus\r
+netdataDashboard.submenu = {\r
+    'mem.ksm': {\r
+        title: 'Memory Deduper',\r
+        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.'\r
+    },\r
+\r
+    'ipv4.ecn': {\r
+        info: '<a href="https://en.wikipedia.org/wiki/Explicit_Congestion_Notification" target="_blank">Explicit Congestion Notification (ECN)</a> is a TCP extension that allows end-to-end notification of network congestion without dropping packets. ECN is an optional feature that may be used between two ECN-enabled endpoints when the underlying network infrastructure also supports it.'\r
+    },\r
+\r
+    'netfilter.conntrack': {\r
+        title: 'Connection Tracker',\r
+        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.'\r
+    },\r
+\r
+    'netfilter.nfacct': {\r
+        title: 'Bandwidth Accounting',\r
+        info: 'The following information is read using the <code>nfacct.plugin</code>.'\r
+    },\r
+\r
+    'netfilter.synproxy': {\r
+        title: 'DDoS Protection',\r
+        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.'\r
+    },\r
+\r
+    'system.softnet_stat': {\r
+        title: 'softnet',\r
+        info: 'Statistics for CPUs SoftIRQs related to network receive work, read from <code>/proc/net/softnet_stat</code>. Break down per CPU core can be found at <a href="#cpu_softnet_stat">CPU / softnet statistics</a>. <b>processed</b> states the number of packets processed, <b>dropped</b> is the number packets dropped because the network device backlog was full (to fix them use <code>sysctl</code> to increase <code>net.core.netdev_max_backlog</code>), <b>squeezed</b> is the number of packets dropped because the network device budget ran out (to fix them use <code>sysctl</code> to increase <code>net.core.netdev_budget</code>). More information about identifying and troubleshooting network driver related issues can be found at <a href="https://access.redhat.com/sites/default/files/attachments/20150325_network_performance_tuning.pdf" target="_blank">Red Hat Enterprise Linux Network Performance Tuning Guide</a>.'\r
+    },\r
+\r
+    'cpu.softnet_stat': {\r
+        title: 'softnet',\r
+        info: 'Statistics for per CPUs core SoftIRQs related to network receive work, read from <code>/proc/net/softnet_stat</code>. Total for all CPU cores can be found at <a href="#system_softnet_stat">System / softnet statistics</a>. <b>processed</b> states the number of packets processed, <b>dropped</b> is the number packets dropped because the network device backlog was full (to fix them use <code>sysctl</code> to increase <code>net.core.netdev_max_backlog</code>), <b>squeezed</b> is the number of packets dropped because the network device budget ran out (to fix them use <code>sysctl</code> to increase <code>net.core.netdev_budget</code>). More information about identifying and troubleshooting network driver related issues can be found at <a href="https://access.redhat.com/sites/default/files/attachments/20150325_network_performance_tuning.pdf" target="_blank">Red Hat Enterprise Linux Network Performance Tuning Guide</a>.'\r
+    }\r
+};\r
+\r
+// chart\r
+// information works on the context of a chart\r
+// Its purpose is to set:\r
+//\r
+// info: the text above the charts\r
+// heads: the representation of the chart at the top the subsection (second level menu)\r
+// mainheads: the representation of the chart at the top of the section (first level menu)\r
+// colors: the dimension colors of the chart (the default colors are appended)\r
+// height: the ratio of the chart height relative to the default\r
+//\r
+netdataDashboard.context = {\r
+    'system.cpu': {\r
+        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.'\r
+    },\r
+\r
+    'system.load': {\r
+        info: 'Current system load, i.e. the number of processes using CPU or waiting for system resources (usually CPU and disk). The 3 metrics refer to 1, 5 and 15 minute averages. Linux calculates this once every 5 seconds. Netdata reads them from <code>/proc/loadavg</code>. For more information check <a href="https://en.wikipedia.org/wiki/Load_(computing)" target="_blank">this wikipedia article</a>',\r
+        height: 0.7\r
+    },\r
+\r
+    'system.io': {\r
+        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.'\r
+    },\r
+\r
+    'system.swapio': {\r
+        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).'\r
+    },\r
+\r
+    'system.pgfaults': {\r
+        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.'\r
+    },\r
+\r
+    'system.entropy': {\r
+        colors: '#CC22AA',\r
+        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 (<a href="https://en.wikipedia.org/wiki//dev/random" target="_blank">/dev/random</a>) 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> or <code>rng-tools</code> (i.e. <b>rngd</b>), to keep the pool in healthy levels.'\r
+    },\r
+\r
+    'system.forks': {\r
+        colors: '#5555DD',\r
+        info: 'The number of new processes created per second, read from <code>/proc/stat</code>.'\r
+    },\r
+\r
+    'system.intr': {\r
+        colors: '#DD5555',\r
+        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.'\r
+    },\r
+\r
+    'system.interrupts': {\r
+        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.'\r
+    },\r
+\r
+    'system.softirqs': {\r
+        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.'\r
+    },\r
+\r
+    'system.processes': {\r
+        info: 'System processes, read from <code>/proc/stat</code>. <b>Running</b> are the processes in the CPU. <b>Blocked</b> are processes that are willing to enter the CPU, but they cannot, e.g. because they wait for disk activity.'\r
+    },\r
+\r
+    'system.active_processes': {\r
+        info: 'All system processes, read from <code>/proc/loadavg</code>.'\r
+    },\r
+\r
+    'system.ctxt': {\r
+        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.'\r
+    },\r
+\r
+    'system.idlejitter': {\r
+        colors: '#5555AA',\r
+        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).'\r
+    },\r
+\r
+    'system.ipv4': {\r
+        info: 'Total IPv4 Traffic, read from <code>/proc/net/netstat</code>.'\r
+    },\r
+\r
+    'system.ipv6': {\r
+        info: 'Total IPv6 Traffic, read from <code>/proc/net/snmp6</code>.'\r
+    },\r
+\r
+    'system.ram': {\r
+        info: 'System memory, read from <code>/proc/meminfo</code>.'\r
+    },\r
+\r
+    'system.swap': {\r
+        info: 'System swap memory, read from <code>/proc/meminfo</code>.'\r
+    },\r
+\r
+    // ------------------------------------------------------------------------\r
+    // MEMORY\r
+\r
+    'mem.ksm_savings': {\r
+        heads: [\r
+            netdataDashboard.gaugeChart('Saved', '12%', 'savings', '#0099CC')\r
+        ]\r
+    },\r
+\r
+    'mem.ksm_ratios': {\r
+        heads: [\r
+            function(id) {\r
+                return  '<div data-netdata="' + id + '"'\r
+                    + ' data-gauge-max-value="100"'\r
+                    + ' data-chart-library="gauge"'\r
+                    + ' data-title="Savings"'\r
+                    + ' data-units="percentage %"'\r
+                    + ' data-gauge-adjust="width"'\r
+                    + ' data-width="12%"'\r
+                    + ' data-before="0"'\r
+                    + ' data-after="-CHART_DURATION"'\r
+                    + ' data-points="CHART_DURATION"'\r
+                    + ' role="application"></div>';\r
+            }\r
+        ]\r
+    },\r
+\r
+    'mem.committed': {\r
+        colors: NETDATA.colors[3]\r
+    },\r
+\r
+    // ------------------------------------------------------------------------\r
+    // network interfaces\r
+\r
+    'net.drops': {\r
+        info: 'Packets that have been dropped at the network interface level. These are the same counters reported by <code>ifconfig</code> as <code>RX dropped</code> (inbound) and <code>TX dropped</code> (outbound). <b>inbound</b> packets can be dropped at the network interface level due to <a href="#system_softnet_stat">softnet backlog</a> overflow, bad / unintented VLAN tags, unknown or unregistered protocols, IPv6 frames when the server is not configured for IPv6. Check <a href="https://www.novell.com/support/kb/doc.php?id=7007165" target="_blank">this document</a> for more information.'\r
+    },\r
+\r
+    // ------------------------------------------------------------------------\r
+    // IPv4\r
+\r
+    'ipv4.tcpmemorypressures': {\r
+        info: 'Number of times a socket was put in <b>memory pressure</b> due to a non fatal memory allocation failure (the kernel attempts to work around this situation by reducing the send buffers, etc).'\r
+    },\r
+\r
+    'ipv4.tcpconnaborts': {\r
+        info: 'TCP connection aborts. <b>baddata</b> (<code>TCPAbortOnData</code>) happens while the connection is on <code>FIN_WAIT1</code> and the kernel receives a packet with a sequence number beyond the last one for this connection - the kernel responds with <code>RST</code> (closes the connection). <b>userclosed</b> (<code>TCPAbortOnClose</code>) happens when the kernel receives data on an already closed connection and responds with <code>RST</code>. <b>nomemory</b> (<code>TCPAbortOnMemory</code> happens when there are too many orphaned sockets (not attached to an fd) and the kernel has to drop a connection - sometimes it will send an <code>RST</code>, sometimes it won\'t. <b>timeout</b> (<code>TCPAbortOnTimeout</code>) happens when a connection times out. <b>linger</b> (<code>TCPAbortOnLinger</code>) happens when the kernel killed a socket that was already closed by the application and lingered around for long enough. <b>failed</b> (<code>TCPAbortFailed</code>) happens when the kernel attempted to send an <code>RST</code> but failed because there was no memory available.'\r
+    },\r
+\r
+    // ------------------------------------------------------------------------\r
+    // APPS\r
+\r
+    'apps.cpu': {\r
+        height: 2.0\r
+    },\r
+\r
+    'apps.preads': {\r
+        height: 2.0\r
+    },\r
+\r
+    'apps.pwrites': {\r
+        height: 2.0\r
+    },\r
+\r
+    // ------------------------------------------------------------------------\r
+    // USERS\r
+\r
+    'users.cpu': {\r
+        height: 2.0\r
+    },\r
+\r
+    'users.preads': {\r
+        height: 2.0\r
+    },\r
+\r
+    'users.pwrites': {\r
+        height: 2.0\r
+    },\r
+\r
+    // ------------------------------------------------------------------------\r
+    // GROUPS\r
+\r
+    'groups.cpu': {\r
+        height: 2.0\r
+    },\r
+\r
+    'groups.preads': {\r
+        height: 2.0\r
+    },\r
+\r
+    'groups.pwrites': {\r
+        height: 2.0\r
+    },\r
+\r
+    // ------------------------------------------------------------------------\r
+    // NETWORK QoS\r
+\r
+    'tc.qos': {\r
+        heads: [\r
+            function(id) {\r
+                if(id.match(/.*-ifb$/))\r
+                    return netdataDashboard.gaugeChart('Inbound', '12%', '', '#5555AA');\r
+                else\r
+                    return netdataDashboard.gaugeChart('Outbound', '12%', '', '#AA9900');\r
+            }\r
+        ]\r
+    },\r
+\r
+    // ------------------------------------------------------------------------\r
+    // NETWORK INTERFACES\r
+\r
+    'net.net': {\r
+        heads: [\r
+            netdataDashboard.gaugeChart('Received', '12%', 'received'),\r
+            netdataDashboard.gaugeChart('Sent', '12%', 'sent')\r
+        ]\r
+    },\r
+\r
+    // ------------------------------------------------------------------------\r
+    // NETFILTER\r
+\r
+    'netfilter.sockets': {\r
+        colors: '#88AA00',\r
+        heads: [\r
+            netdataDashboard.gaugeChart('Active Connections', '12%', '', '#88AA00')\r
+        ]\r
+    },\r
+\r
+    'netfilter.new': {\r
+        heads: [\r
+            netdataDashboard.gaugeChart('New Connections', '12%', 'new', '#5555AA')\r
+        ]\r
+    },\r
+\r
+    // ------------------------------------------------------------------------\r
+    // DISKS\r
+\r
+    'disk.util': {\r
+        colors: '#FF5588',\r
+        heads: [\r
+            netdataDashboard.gaugeChart('Utilization', '12%', '', '#FF5588')\r
+        ],\r
+        info: 'Disk Utilization measures the amount of time the disk was busy with something. This is not related to its performance. 100% means that the Linux kernel always had an outstanding operation on the disk. Keep in mind that depending on the underlying technology of the disk, 100% here may or may not be an indication of congestion.'\r
+    },\r
+\r
+    'disk.backlog': {\r
+        colors: '#0099CC',\r
+        info: 'Backlog is an indication of the duration of pending disk operations. On every I/O event the Linux kernel is multiplying the time spent doing I/O since the last update of this field with the number of pending operations. While not accurate, this metric can provide an indication of the expected completion time of the operations in progress.'\r
+    },\r
+\r
+    'disk.io': {\r
+        heads: [\r
+            netdataDashboard.gaugeChart('Read', '12%', 'reads'),\r
+            netdataDashboard.gaugeChart('Write', '12%', 'writes')\r
+        ],\r
+        info: 'Amount of data transferred to and from disk.'\r
+    },\r
+\r
+    'disk.ops': {\r
+        info: 'Completed disk I/O operations. Keep in mind the number of operations requested might be higher, since the Linux kernel is able to merge adjacent to each other (see merged operations chart).'\r
+    },\r
+\r
+    'disk.qops': {\r
+        info: 'I/O operations currently in progress. This metric is a snapshot - it is not an average over the last interval.'\r
+    },\r
+\r
+    'disk.iotime': {\r
+        height: 0.5,\r
+        info: 'The sum of the duration of all completed I/O operations. This number can exceed the interval if the disk is able to execute I/O operations in parallel.'\r
+    },\r
+    'disk.mops': {\r
+        height: 0.5,\r
+        info: 'The number of merged disk operations. The Linux kernel is able to merge adjacent I/O operations, for example two 4KB reads can become one 8KB read before given to disk.'\r
+    },\r
+    'disk.svctm': {\r
+        height: 0.5,\r
+        info: 'The average service time for completed I/O operations. This metric is calculated using the total busy time of the disk and the number of completed operations. If the disk is able to execute multiple parallel operations the reporting average service time will be misleading.'\r
+    },\r
+    'disk.avgsz': {\r
+        height: 0.5,\r
+        info: 'The average I/O operation size.'\r
+    },\r
+    'disk.await': {\r
+        height: 0.5,\r
+        info: 'The average time for I/O requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.'\r
+    },\r
+\r
+    'disk.space': {\r
+        info: 'Disk space utilization. reserved for root is automatically reserved by the system to prevent the root user from getting out of space.'\r
+    },\r
+    'disk.inodes': {\r
+        info: 'inodes (or index nodes) are filesystem objects (e.g. files and directories). On many types of file system implementations, the maximum number of inodes is fixed at filesystem creation, limiting the maximum number of files the filesystem can hold. It is possible for a device to run out of inodes. When this happens, new files cannot be created on the device, even though there may be free space available.'\r
+    },\r
+\r
+    'mysql.net': {\r
+        info: 'The amount of data sent to mysql clients (<strong>out</strong>) and received from mysql clients (<strong>in</strong>).'\r
+    },\r
+\r
+    // ------------------------------------------------------------------------\r
+    // MYSQL\r
+\r
+    'mysql.queries': {\r
+        info: 'The number of statements executed by the server.<ul>' +\r
+        '<li><strong>queries</strong> counts the statements executed within stored SQL programs.</li>' +\r
+        '<li><strong>questions</strong> counts the statements sent to the mysql server by mysql clients.</li>' +\r
+        '<li><strong>slow queries</strong> counts the number of statements that took more than <a href="http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_long_query_time" target="_blank">long_query_time</a> seconds to be executed.' +\r
+        ' For more information about slow queries check the mysql <a href="http://dev.mysql.com/doc/refman/5.7/en/slow-query-log.html" target="_blank">slow query log</a>.</li>' +\r
+        '</ul>'\r
+    },\r
+\r
+    'mysql.handlers': {\r
+        info: 'Usage of the internal handlers of mysql. This chart provides very good insights of what the mysql server is actually doing.' +\r
+        ' (if the chart is not showing all these dimensions it is because they are zero - set <strong>Which dimensions to show?</strong> to <strong>All</strong> from the dashboard settings, to render even the zero values)<ul>' +\r
+        '<li><strong>commit</strong>, the number of internal <a href="http://dev.mysql.com/doc/refman/5.7/en/commit.html" target="_blank">COMMIT</a> statements.</li>' +\r
+        '<li><strong>delete</strong>, the number of times that rows have been deleted from tables.</li>' +\r
+        '<li><strong>prepare</strong>, a counter for the prepare phase of two-phase commit operations.</li>' +\r
+        '<li><strong>read first</strong>, the number of times the first entry in an index was read. A high value suggests that the server is doing a lot of full index scans; e.g. <strong>SELECT col1 FROM foo</strong>, with col1 indexed.</li>' +\r
+        '<li><strong>read key</strong>, the number of requests to read a row based on a key. If this value is high, it is a good indication that your tables are properly indexed for your queries.</li>' +\r
+        '<li><strong>read next</strong>, the number of requests to read the next row in key order. This value is incremented if you are querying an index column with a range constraint or if you are doing an index scan.</li>' +\r
+        '<li><strong>read prev</strong>, the number of requests to read the previous row in key order. This read method is mainly used to optimize <strong>ORDER BY ... DESC</strong>.</li>' +\r
+        '<li><strong>read rnd</strong>, the number of requests to read a row based on a fixed position. A high value indicates you are doing a lot of queries that require sorting of the result. You probably have a lot of queries that require MySQL to scan entire tables or you have joins that do not use keys properly.</li>' +\r
+        '<li><strong>read rnd next</strong>, the number of requests to read the next row in the data file. This value is high if you are doing a lot of table scans. Generally this suggests that your tables are not properly indexed or that your queries are not written to take advantage of the indexes you have.</li>' +\r
+        '<li><strong>rollback</strong>, the number of requests for a storage engine to perform a rollback operation.</li>' +\r
+        '<li><strong>savepoint</strong>, the number of requests for a storage engine to place a savepoint.</li>' +\r
+        '<li><strong>savepoint rollback</strong>, the number of requests for a storage engine to roll back to a savepoint.</li>' +\r
+        '<li><strong>update</strong>, the number of requests to update a row in a table.</li>' +\r
+        '<li><strong>write</strong>, the number of requests to insert a row in a table.</li>' +\r
+        '</ul>'\r
+    },\r
+\r
+    'mysql.table_locks': {\r
+        info: 'MySQL table locks counters: <ul>' +\r
+        '<li><strong>immediate</strong>, the number of times that a request for a table lock could be granted immediately.</li>' +\r
+        '<li><strong>waited</strong>, the number of times that a request for a table lock could not be granted immediately and a wait was needed. If this is high and you have performance problems, you should first optimize your queries, and then either split your table or tables or use replication.</li>' +\r
+        '</ul>'\r
+    },\r
+\r
+    // ------------------------------------------------------------------------\r
+    // APACHE\r
+\r
+    'apache.connections': {\r
+        colors: NETDATA.colors[4],\r
+        mainheads: [\r
+            netdataDashboard.gaugeChart('Connections', '12%', '', NETDATA.colors[4])\r
+        ]\r
+    },\r
+\r
+    'apache.requests': {\r
+        colors: NETDATA.colors[0],\r
+        mainheads: [\r
+            netdataDashboard.gaugeChart('Requests', '12%', '', NETDATA.colors[0])\r
+        ]\r
+    },\r
+\r
+    'apache.net': {\r
+        colors: NETDATA.colors[3],\r
+        mainheads: [\r
+            netdataDashboard.gaugeChart('Bandwidth', '12%', '', NETDATA.colors[3])\r
+        ]\r
+    },\r
+\r
+    'apache.workers': {\r
+        mainheads: [\r
+            function(id) {\r
+                return  '<div data-netdata="' + id + '"'\r
+                    + ' data-dimensions="busy"'\r
+                    + ' data-append-options="percentage"'\r
+                    + ' data-gauge-max-value="100"'\r
+                    + ' data-chart-library="gauge"'\r
+                    + ' data-title="Workers Utilization"'\r
+                    + ' data-units="percentage %"'\r
+                    + ' data-gauge-adjust="width"'\r
+                    + ' data-width="12%"'\r
+                    + ' data-before="0"'\r
+                    + ' data-after="-CHART_DURATION"'\r
+                    + ' data-points="CHART_DURATION"'\r
+                    + ' role="application"></div>';\r
+            }\r
+        ]\r
+    },\r
+\r
+    'apache.bytesperreq': {\r
+        colors: NETDATA.colors[3],\r
+        height: 0.5\r
+    },\r
+\r
+    'apache.reqpersec': {\r
+        colors: NETDATA.colors[4],\r
+        height: 0.5\r
+    },\r
+\r
+    'apache.bytespersec': {\r
+        colors: NETDATA.colors[6],\r
+        height: 0.5\r
+    },\r
+\r
+\r
+    // ------------------------------------------------------------------------\r
+    // NGINX\r
+\r
+    'nginx.connections': {\r
+        colors: NETDATA.colors[4],\r
+        mainheads: [\r
+            netdataDashboard.gaugeChart('Connections', '12%', '', NETDATA.colors[4])\r
+        ]\r
+    },\r
+\r
+    'nginx.requests': {\r
+        colors: NETDATA.colors[0],\r
+        mainheads: [\r
+            netdataDashboard.gaugeChart('Requests', '12%', '', NETDATA.colors[0])\r
+        ]\r
+    },\r
+\r
+    // ------------------------------------------------------------------------\r
+    // NETDATA\r
+\r
+    'netdata.response_time': {\r
+        info: 'The netdata API response time measures the time netdata needed to serve requests. This time includes everything, from the reception of the first byte of a request, to the dispatch of the last byte of its reply, therefore it includes all network latencies involved (i.e. a client over a slow network will influence these metrics).'\r
+    },\r
+\r
+    // ------------------------------------------------------------------------\r
+    // RETROSHARE\r
+    'retroshare.bandwidth': {\r
+        info: 'Shows inbound and outbound traffic.',\r
+        mainheads: [\r
+            netdataDashboard.gaugeChart('Received', '12%', 'bandwidth_down_kb'),\r
+            netdataDashboard.gaugeChart('Sent', '12%', 'bandwidth_up_kb')\r
+        ]\r
+    },\r
+\r
+    'retroshare.peers': {\r
+        info: 'Shows the number of (connected) friends.',\r
+        mainheads: [\r
+            function(id) {\r
+                return  '<div data-netdata="' + id + '"'\r
+                    + ' data-dimensions="peers_connected"'\r
+                    + ' data-append-options="friends"'\r
+                    + ' data-chart-library="easypiechart"'\r
+                    + ' data-title="connected friends"'\r
+                    + ' data-units=""'\r
+                    + ' data-width="8%"'\r
+                    + ' data-before="0"'\r
+                    + ' data-after="-CHART_DURATION"'\r
+                    + ' data-points="CHART_DURATION"'\r
+                    + ' role="application"></div>';\r
+            }\r
+        ]\r
+    },\r
+\r
+    'retroshare.dht': {\r
+        info: 'Shows statistics about RetroShare\'s DHT. These values are estimated!'\r
+    }\r
+};\r
index fe76674f0d307c6a49ae5169756aaf38b342a90f..e2a40f11be606edc284cc84f1df1d5438c29b4fd 100644 (file)
             a1 += '<li><a href="#" onClick="return false;">&nbsp;</a></li>';
 
             el += '<li role="separator" class="divider"></li>' +
-                    '<li><a href="//london.netdata.rocks/default.html">EU - London (DigitalOcean.com)</a></li>' +
+                    '<li><a href="//london.netdata.rocks/default.html">UK - London (DigitalOcean.com)</a></li>' +
+                    '<li><a href="//newyork.netdata.rocks/default.html">US - New York (DigitalOcean.com)</a></li>' +
+                    '<li><a href="//sanfrancisco.netdata.rocks/default.html">US - San Francisco (DigitalOcean.com)</a></li>' +
                     '<li><a href="//atlanta.netdata.rocks/default.html">US - Atlanta (CDN77.com)</a></li>' +
-                    '<li><a href="//athens.netdata.rocks/default.html">EU - Athens</a></li>';
+                    '<li><a href="//frankfurt.netdata.rocks/default.html">Germany - Frankfurt (DigitalOcean.com)</a></li>' +
+                    '<li><a href="//toronto.netdata.rocks/default.html">Canada - Toronto (DigitalOcean.com)</a></li>' +
+                    '<li><a href="//singapore.netdata.rocks/default.html">Japan - Singapore (DigitalOcean.com)</a></li>' +
+                    '<li><a href="//bangalore.netdata.rocks/default.html">India - Bangalore (DigitalOcean.com)</a></li>';
             a1 += '<li role="separator" class="divider"></li>' +
                     '<li><a href="#">&nbsp;</a></li>' +
                     '<li><a href="#">&nbsp;</a></li>'+
+                    '<li><a href="#">&nbsp;</a></li>'+
+                    '<li><a href="#">&nbsp;</a></li>'+
+                    '<li><a href="#">&nbsp;</a></li>'+
+                    '<li><a href="#">&nbsp;</a></li>'+
+                    '<li><a href="#">&nbsp;</a></li>'+
                     '<li><a href="#">&nbsp;</a></li>';
         }
 
         gotoServerInit();
     };
 
-</script>
+    var this_is_demo = null;
+    function isdemo() {
+        if(this_is_demo !== null) return this_is_demo;
+        this_is_demo = false;
 
-<body data-spy="scroll" data-target="#sidebar">
-    <div id="loadOverlay" class="loadOverlay" style="background-color: #888; color: #888;">
-        netdata<br/><div style="font-size: 3vh;">Real-time performance monitoring, done right!</div>
-    </div>
-    <script type="text/javascript">
-        // change the loadOverlay colors ASAP to match the theme
-        document.getElementById('loadOverlay').style = (urlOptions.theme === 'slate')?"background-color:#272b30; color: #373b40;":"background-color:#fff; color: #ddd;";
-    </script>
-    <nav class="navbar navbar-default navbar-fixed-top" role="banner">
-        <div class="container">
-            <nav id="mynetdata_nav" class="collapse navbar-collapse navbar-left hidden-sm hidden-xs" role="navigation" style="padding-right: 20px;">
-                <ul class="nav navbar-nav">
-                    <li class="dropdown">
-                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="current_view">my-netdata <strong class="caret"></strong></a>
-                        <ul class="dropdown-menu scrollable-menu inpagemenu multi-column columns-2" role="menu">
-                            <div class="row">
-                                <div class="col-sm-6" style="width: 85%; padding-right: 0;">
-                                    <ul id="mynetdata_servers" class="multi-column-dropdown">
-                                        <li><a href="#" onclick="return false;" style="color: #999;">loading...</a></li>
-                                    </ul>
-                                </div>
-                                <div class="col-sm-3 hidden-xs" style="width: 15%; padding-left: 0;">
-                                    <ul id="mynetdata_actions1" class="multi-column-dropdown">
-                                    <li style="color: #999;">&nbsp;</li>
-                                    </ul>
-                                </div>
-                            </div>
-                        </ul>
-                    </li>
-                </ul>
-            </nav>
-            <div class="navbar-header">
-                <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".navbar-collapse">
-                    <span class="sr-only">Toggle navigation</span>
-                    <span class="icon-bar"></span>
-                    <span class="icon-bar"></span>
-                    <span class="icon-bar"></span>
-                </button>
-                <a href="/" class="navbar-brand" id="hostname" title="reload the dashboard">netdata</a>
-            </div>
-            <nav class="collapse navbar-collapse navbar-right" role="navigation">
-                <ul class="nav navbar-nav">
-                    <li><a href="#" class="btn" data-toggle="modal" data-target="#alarmsModal" title="alarms"><i class="fa fa-bell"></i></span>&nbsp;<span class="hidden-sm">Alarms&nbsp;</span><span id="alarms_count_badge" class="badge"></a></li>
-                    <li><a href="#" class="btn" data-toggle="modal" data-target="#optionsModal" title="dashboard settings"><i class="fa fa-sliders"></i>&nbsp;<span class="hidden-sm">Settings</span></a></li>
-                    <li><a href="https://github.com/firehol/netdata/wiki" class="btn" target="_blank" title="netdata community"><i class="fa fa-github"></i>&nbsp;<span class="hidden-sm hidden-md">Community</span></a></li>
-                    <li class="hidden-sm" id="updateButton"><a href="#" class="btn" data-toggle="modal" data-target="#updateModal" title="check for update"><i class="fa fa-cloud-download"></i><span id="update_badge" class="badge"></span>&nbsp;<span class="hidden-sm hidden-md">Update</span></a></li>
-                    <li class="hidden-sm"><a href="#" class="btn" data-toggle="modal" data-target="#helpModal" title="dashboard help"><i class="fa fa-question-circle"></i>&nbsp;<span class="hidden-sm hidden-md">Help</span></a></li>
-                    <!--
-                    <li class="dropdown hidden-md hidden-lg hidden-xs">
-                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="current_view">Menu <strong class="caret"></strong></a>
-                        <ul class="dropdown-menu scrollable-menu inpagemenu" role="menu">
-                            <li><a href="#" class="btn" data-toggle="modal" data-target="#alarmsModal"><i class="fa fa-bell"></i> alarms</a></li>
-                            <li><a href="#" class="btn" data-toggle="modal" data-target="#optionsModal"><i class="fa fa-sliders"></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><a href="#" class="btn" data-toggle="modal" data-target="#helpModal"><i class="fa fa-question-circle"></i> help</a></li>
-                        </ul>
-                    </li>
-                    -->
-                    <li class="dropdown hidden-sm hidden-md hidden-lg">
-                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="current_view">my-netdata <strong class="caret"></strong></a>
-                        <ul id="mynetdata_servers2" class="dropdown-menu scrollable-menu inpagemenu" role="menu">
-                            <li><a href="#" onclick="return false;" style="color: #999;">loading...</a></li>
-                        </ul>
-                    </li>
-                </ul>
-            </nav>
-    </nav>
-        </div>
-    </nav>
+        try {
+            if(typeof document.location.hostname === 'string') {
+                if(document.location.hostname.endsWith('.my-netdata.io') ||
+                        document.location.hostname.endsWith('.mynetdata.io') ||
+                        document.location.hostname.endsWith('.netdata.rocks') ||
+                        document.location.hostname.endsWith('.firehol.org') ||
+                        document.location.hostname.endsWith('.netdata.online'))
+                        this_is_demo = true;
+            }
+        }
+        catch(error) {
+            ;
+        }
 
-    <div id="masthead" style="display: none;">
-        <div class="container">
-            <div class="row">
-                <div class="col-md-7">
-                    <h1>Netdata
-                        <p class="lead">Real-time performance monitoring, in the greatest possible detail</p>
-                    </h1>
-                </div>
-                <div class="col-md-5">
-                    <div class="well well-lg">
-                        <div class="row">
-                        <div class="col-md-6">
-                            <b>Drag</b> charts to pan.
-                            <b>Shift + wheel</b> on them, to zoom in and out.
-                            <b>Double-click</b> on them, to reset.
-                            <b>Hover</b> on them too!
-                            </div>
-                        <div class="col-md-6">
-                            <div data-netdata="system.intr" data-chart-library="dygraph" data-dygraph-theme="sparkline" data-dygraph-type="line" data-dygraph-strokewidth="3" data-dygraph-smooth="true" data-dygraph-highlightcirclesize="6" data-after="-90" data-height="60px" data-colors="#C66"></div>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
+        return this_is_demo;
+    }
 
-    <div class="container">
-        <div class="row">
-            <div class="charts-body" role="main">
-                <div id="charts_div"></div>
-            </div>
-            <div class="sidebar-body hidden-xs hidden-sm" role="complementary">
-                <nav class="dashboard-sidebar hidden-print hidden-xs hidden-sm" id="sidebar" role="menu"></nav>
-            </div>
-        </div>
-    </div>
+    if(isdemo()) {
+        document.getElementById('masthead').style.display = 'block';
+    }
 
-    <div id="footer" class="container" style="display: none;">
-        <div class="row">
-            <div class="col-md-10" role="main">
-                <div class="p">
-                    <big><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></big><br/>
-                    <i class="fa fa-copyright"></i> Copyright 2016, Costa Tsaousis.<br/>
-                    Released under <a href="http://www.gnu.org/licenses/gpl-3.0.en.html" target="_blank">GPL v3 or later</a>.<br/>
-                </div>
-                <div class="p">
-                    <small>
-                        <a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a> re-distributes these software tools:
+    function netdataURL(url) {
+        if(typeof url === 'undefined')
+            url = document.location.toString();
 
-                        <i class="fa fa-circle"></i> The excellent <a href="http://dygraphs.com/" target="_blank">Dygraphs.com</a> web chart library,
-                        <i class="fa fa-copyright"></i> Copyright 2009, Dan Vanderkam, <a href="http://dygraphs.com/legal.html" target="_blank">MIT License</a>
+        if(url.indexOf('#') !== -1)
+            url = url.substring(0, url.indexOf('#'));
 
-                        <i class="fa fa-circle"></i> <a href="http://omnipotent.net/jquery.sparkline/" target="_blank">jQuery Sparklines</a> web chart library,
-                        <i class="fa fa-copyright"></i> Copyright 2009-2012, Splunk Inc., <a href="http://opensource.org/licenses/BSD-3-Clause" target="_blank">New BSD License</a>
+        var hash = netdataHash();
 
-                        <i class="fa fa-circle"></i> <a href="http://benpickles.github.io/peity/" target="_blank">Peity</a> web chart library,
-                        <i class="fa fa-copyright"></i> Copyright 2009-2015, Ben Pickles, <a href="https://github.com/benpickles/peity/blob/master/MIT-LICENCE" target="_blank">MIT License</a>
+        // console.log('netdataURL: ' + url + hash);
 
-                        <i class="fa fa-circle"></i> <a href="https://rendro.github.io/easy-pie-chart/" target="_blank">Easy Pie Chart</a> web chart library,
-                        <i class="fa fa-copyright"></i> Copyright 2013, Robert Fleischmann, <a href="https://github.com/rendro/easy-pie-chart/blob/master/LICENSE" target="_blank">MIT License</a>
+        return url + hash;
+    }
 
-                        <i class="fa fa-circle"></i> <a href="http://bernii.github.io/gauge.js/" target="_blank">Gauge.js</a> web chart library,
-                        <i class="fa fa-copyright"></i> Copyright, Bernard Kobos, <a href="http://bernii.github.io/gauge.js/" target="_blank">MIT License</a>
+    function netdataReload(url) {
+        var t = netdataURL(url);
+        // console.log('netdataReload: ' + t);
+        document.location = t;
 
-                        <i class="fa fa-circle"></i> <a href="https://jquery.org/" target="_blank">jQuery</a>,
-                        <i class="fa fa-copyright"></i> Copyright 2015, jQuery Foundation, <a href="https://jquery.org/license/" target="_blank">MIT License</a>
+        // since we play with hash
+        // this is needed to reload the page
+        location.reload();
+    }
 
-                        <i class="fa fa-circle"></i> <a href="http://getbootstrap.com/getting-started/" target="_blank">Bootstrap</a>,
-                        <i class="fa fa-copyright"></i> Copyright 2015, Twitter, <a href="http://getbootstrap.com/getting-started/#license-faqs" target="_blank">MIT License</a>
+    var gotoServerValidateRemaining = 0;
+    var gotoServerMiddleClick = false;
+    var gotoServerStop = false;
+    function gotoServerValidateUrl(id, guid, url) {
+        var penaldy = 0;
+        var error = 'failed';
 
-                        <i class="fa fa-circle"></i> <a href="http://www.bootstraptoggle.com/" target="_blank">Bootstrap Toggle</a>,
-                        <i class="fa fa-copyright"></i> Copyright (c) 2011-2014 Min Hur, The New York Times Company, <a href="https://github.com/minhur/bootstrap-toggle/blob/master/LICENSE" target="_blank">MIT License</a>
+        if(document.location.toString().startsWith('http://') && url.toString().startsWith('https://'))
+                // we penalize https only if the current url is http
+                // to allow the user walk through all its servers.
+                penaldy = 500;
 
-                        <i class="fa fa-circle"></i> <a href="https://jamesflorentino.github.io/nanoScrollerJS/" target="_blank">NanoScroller</a>,
-                        <i class="fa fa-copyright"></i> Copyright 2012, James Florentino, <a href="https://github.com/jamesflorentino/nanoScrollerJS/blob/master/LICENSE" target="_blank">MIT License</a>
+        else if(document.location.toString().startsWith('https://') && url.toString().startsWith('http://'))
+            error = 'can\'t check';
+        
+        var finalURL = netdataURL(url);
 
-                        <i class="fa fa-circle"></i> <a href="https://github.com/marcj/css-element-queries" target="_blank">CSS Element Queries</a>,
-                        <i class="fa fa-copyright"></i> Copyright Marc J. Schmidt, <a href="https://github.com/marcj/css-element-queries/blob/master/LICENSE" target="_blank">MIT License</a>
+        setTimeout(function() {
+            document.getElementById('gotoServerList').innerHTML += '<tr><td style="padding-left: 20px;"><a href="' + finalURL + '" target="_blank">' + url + '</a></td><td style="padding-left: 30px;"><code id="' + guid + '-' + id + '-status">checking...</code></td></tr>';
 
-                        <i class="fa fa-circle"></i> <a href="https://fortawesome.github.io/Font-Awesome/" target="_blank">FontAwesome</a>,
-                        <i class="fa fa-copyright"></i> Created by Dave Gandy, Font: <a href="http://scripts.sil.org/OFL" target="_blank">SIL OFL 1.1 License</a>, CSS: <a href="http://opensource.org/licenses/mit-license.html" target="_blank">MIT License</a>
+            NETDATA.registry.hello(url, function(data) {
+                if (data) {
+                    // console.log('OK ' + id + ' URL: ' + url);
+                    document.getElementById(guid + '-' + id + '-status').innerHTML = "OK";
 
-                        <i class="fa fa-circle"></i> <a href="http://www.iconsdb.com/soylent-red-icons/seo-performance-icon.html" target="_blank">IconsDB.com Icons</a>, Icons provided as CC0 1.0 Universal (CC0 1.0) Public Domain Dedication.
+                    if(!gotoServerStop) {
+                        gotoServerStop = true;
 
-                        <i class="fa fa-circle"></i> <a href="http://morrisjs.github.io/morris.js/" target="_blank">morris.js</a>,
-                        <i class="fa fa-copyright"></i> Copyright 2013, Olly Smith, <a href="http://morrisjs.github.io/morris.js/" target="_blank">Simplified BSD License</a>
+                        if(gotoServerMiddleClick) {
+                            window.open(finalURL, '_blank');
+                            gotoServerMiddleClick = false;
+                            document.getElementById('gotoServerResponse').innerHTML = '<b>Opening new window to ' + NETDATA.registry.machines[guid].name + '<br/><a href="' + finalURL + '">' + url + '</a></b><br/>(check your pop-up blocker if it fails)';
+                        }
+                        else
+                            document.location = finalURL;
+                    }
+                }
+                else {
+                    document.getElementById(guid + '-' + id + '-status').innerHTML = error;
+                    gotoServerValidateRemaining--;
+                    if(gotoServerValidateRemaining <= 0) {
+                        gotoServerMiddleClick = false;
+                        document.getElementById('gotoServerResponse').innerHTML = '<b>Sorry! I cannot find any operational URL for this server</b>';
+                    }
+                }
+            });
+        }, (id * 50) + penaldy);
+    }
 
-                        <i class="fa fa-circle"></i> <a href="http://raphaeljs.com/" target="_blank">Raphaël</a>,
-                        <i class="fa fa-copyright"></i> Copyright 2008, Dmitry Baranovskiy, <a href="http://raphaeljs.com/license.html" target="_blank">MIT License</a>
+    function gotoServerModalHandler(guid) {
+        // console.log('goto server: ' + guid);
 
-                        <i class="fa fa-circle"></i> <a href="http://C3js.org/" target="_blank">C3</a>,
-                        <i class="fa fa-copyright"></i> Copyright 2013, Masayuki Tanaka, <a href="https://github.com/masayuki0812/c3/blob/master/LICENSE" target="_blank">MIT License</a>
+        gotoServerStop = false;
+        var len = NETDATA.registry.machines[guid].alternate_urls.length;
 
-                        <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>
+        document.getElementById('gotoServerResponse').innerHTML = '';
+        document.getElementById('gotoServerList').innerHTML = '';
+        document.getElementById('gotoServerName').innerHTML = NETDATA.registry.machines[guid].name;
+        $('#gotoServerModal').modal('show');
 
-                    </small>
-                </div>
-            </div>
-        </div>
-    </div>
+        gotoServerValidateRemaining = len;
+        while(len--)
+            gotoServerValidateUrl(len, guid, NETDATA.registry.machines[guid].alternate_urls[len]);
 
-    <div class="modal fade" id="welcomeModal" tabindex="-1" role="dialog" aria-labelledby="welcomeModalLabel">
-        <div class="modal-dialog modal-lg" 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="welcomeModalLabel">Welcome!</h4>
-                </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 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/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/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>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
-                </div>
-            </div>
-        </div>
-    </div>
+        return false;
+    }
 
-    <div class="modal fade" id="helpModal" tabindex="-1" role="dialog" aria-labelledby="helpModalLabel">
-        <div class="modal-dialog modal-lg" 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="helpModalLabel">Dashboard Help</h4>
-                </div>
-                <div class="modal-body">
+    function gotoServerInit() {
+        $(".registry_link").on('click', function(e) {
+            if(e.which === 2) {
+                e.preventDefault();
+                gotoServerMiddleClick = true;
+            }
+            else {
+                gotoServerMiddleClick = false;
+            }
 
-                    <h4>Dygraphs (line, area and stacked area charts)</h4>
+            return true;
+        });
+    }
 
-                    <!-- Nav tabs -->
-                    <ul class="nav nav-tabs" role="tablist">
-                        <li role="presentation" class="active"><a href="#help_mouse" aria-controls="help_mouse" role="tab" data-toggle="tab">Mouse Interface</a></li>
-                        <li role="presentation"><a href="#help_touch" aria-controls="help_touch" role="tab" data-toggle="tab">Touch Interface</a></li>
-                    </ul>
+    function switchRegistryModalHandler() {
+        document.getElementById('switchRegistryPersonGUID').value = NETDATA.registry.person_guid;
+        document.getElementById('switchRegistryURL').innerHTML = NETDATA.registry.server;
+        document.getElementById('switchRegistryResponse').innerHTML = '';
+        $('#switchRegistryModal').modal('show');
+    }
 
-                    <!-- Tab panes -->
-                    <div class="tab-content">
-                        <div role="tabpanel" class="tab-pane active" id="help_mouse">
-                            <div class="p">
-                                <h4>Mouse Over / Hover</h4>
-                                Mouse over on a chart to show, at its legend, the values for the timestamp under the mouse (the chart will also highlight the point at the chart).
-                                <br/>
-                                All the other visible charts will also show and highlight their values for the same timestamp.
-                            </div>
-                            <hr/>
-                            <div class="p">
-                                <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/>
-                                Once a chart is panned, auto refreshing stops for all charts. To enable it again, <b>double click</b> a panned chart.
-                            </div>
-                            <hr/>
-                            <div class="p">
-                                <h4>Double Click</h4>
-                                Double Click a chart to reset all the charts to their default auto-refreshing state.
-                            </div>
-                            <hr/>
-                            <div class="p">
-                                <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 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>SHIFT + Mouse Wheel <small>(does not work on firefox and IE/Edge)</small></h4>
-                                While pressing the shift key and the mouse pointer is over the contents of a chart, scroll the mouse wheel to zoom in or out. This kind of zooming is aligned to center below the mouse pointer. The other charts will follow too.
-                                <br/>
-                                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 / un-select this dimension.
-                                <br/>
-                                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 class="p">
-                                <h4>Single Tap</h4>
-                                Single Tap on the contents of a chart to show, at its legend, the values for the timestamp tapped (the chart will also highlight the point at the chart).
-                                <br/>
-                                All the other visible charts will also show and highlight their values for the same timestamp.
-                            </div>
-                            <hr/>
-                            <div class="p">
-                                <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/>
-                                Once a chart is panned, auto refreshing stops for all charts. To enable it again, <b>double tap</b> a panned chart.
-                            </div>
-                            <hr/>
-                            <div class="p">
-                                <h4>Double Tap</h4>
-                                Double tap a chart to reset all the charts to their default auto-refreshing state.
-                            </div>
-                            <hr/>
-                            <div class="p">
-                                <h4>Zoom <small>(does not work on firefox and IE/Edge)</small></h4>
-                                With two fingers, zoom in or out.
-                                <br/>
-                                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>
-                                Tap on the label or value of a dimension, will select / un-select this dimension.
-                            </div>
-                        </div>
-                    </div>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
-                </div>
-            </div>
-        </div>
-    </div>
+    function notifyForSwitchRegistry() {
+        var n = document.getElementById('switchRegistryPersonGUID').value;
 
-    <div class="modal fade" id="alarmsModal" tabindex="-1" role="dialog" aria-labelledby="alarmsModalLabel">
-        <div class="modal-dialog modal-lg" 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="alarmsModalLabel">netdata alarms</h4>
-                </div>
-                <div class="modal-body">
-                    <!-- Nav tabs -->
-                    <ul class="nav nav-tabs" role="tablist">
-                        <li role="presentation" class="active"><a href="#alarms_active" aria-controls="alarms_active" role="tab" data-toggle="tab">Active</a></li>
-                        <li role="presentation"><a href="#alarms_all" aria-controls="alarms_all" role="tab" data-toggle="tab">All</a></li>
-                        <li role="presentation"><a href="#alarms_log" aria-controls="alarms_log" role="tab" data-toggle="tab">Log</a></li>
-                    </ul>
+        if(n !== '' && n.length === 36) {
+            NETDATA.registry.switch(n, function(result) {
+                if(result !== null) {
+                    $('#switchRegistryModal').modal('hide');
+                    NETDATA.registry.init();
+                }
+                else {
+                    document.getElementById('switchRegistryResponse').innerHTML = "<b>Sorry! The registry rejected your request.</b>";
+                }
+            });
+        }
+        else
+            document.getElementById('switchRegistryResponse').innerHTML = "<b>The ID you have entered is not a GUID.</b>";
+    }
+
+    var deleteRegistryUrl = null;
+    function deleteRegistryModalHandler(guid, name, url) {
+        deleteRegistryUrl = url;
+        document.getElementById('deleteRegistryServerName').innerHTML = name;
+        document.getElementById('deleteRegistryServerName2').innerHTML = name;
+        document.getElementById('deleteRegistryServerURL').innerHTML = url;
+        document.getElementById('deleteRegistryResponse').innerHTML = '';
+        $('#deleteRegistryModal').modal('show');
+    }
+
+    function notifyForDeleteRegistry() {
+        if(deleteRegistryUrl) {
+            NETDATA.registry.delete(deleteRegistryUrl, function(result) {
+                if(result !== null) {
+                    deleteRegistryUrl = null;
+                    $('#deleteRegistryModal').modal('hide');
+                    NETDATA.registry.init();
+                }
+                else {
+                    document.getElementById('deleteRegistryResponse').innerHTML = "<b>Sorry! this command was rejected by the registry server.</b>";
+                }
+            });
+        }
+    }
 
-                    <!-- Tab panes -->
-                    <div class="tab-content">
-                        <div role="tabpanel" class="tab-pane active" id="alarms_active">
-                            loading...
-                        </div>
-                        <div role="tabpanel" class="tab-pane" id="alarms_all">
-                            loading...
-                        </div>
-                        <div role="tabpanel" class="tab-pane" id="alarms_log">
-                            loading...
-                        </div>
-                    </div>
-                </div>
-                <div class="modal-footer">
-                    <!-- <a href="#" onclick="alarmsUpdateModal(); return false;" type="button" class="btn btn-default">Update</a> -->
-                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
-                </div>
-            </div>
-        </div>
-    </div>
+    var options = {
+        sparklines_registry: {},
+        menus: {},
+        submenu_names: {},
+        data: null,
+        hostname: 'netdata_server', // will be overwritten by the netdata server
+        categories: new Array(),
+        categories_idx: {},
+        families: new Array(),
+        families_idx: {},
+
+        chartsPerRow: 0,
+        chartsMinWidth: 1450,
+        chartsHeight: 180,
+        sparklinesHeight: 60,
+    };
 
-    <div class="modal fade" id="optionsModal" tabindex="-1" role="dialog" aria-labelledby="optionsModalLabel">
-        <div class="modal-dialog modal-lg" 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="optionsModalLabel">netdata dashboard options</h4>
-                </div>
-                <div class="modal-body">
-                    <center>
-                        <small style="color: #BBBBBB;">These are browser settings. Each viewer has its own. They do not affect the operation of your netdata server.
-                        <br/>
-                        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>
+    // generate a sparkline
+    // used in the documentation
+    function sparkline(chart, dimension, units) {
+        var key = chart + '.' + dimension;
 
-                    <!-- Nav tabs -->
-                    <ul class="nav nav-tabs" role="tablist">
-                        <li role="presentation" class="active"><a href="#settings_performance" aria-controls="settings_performance" role="tab" data-toggle="tab">Performance</a></li>
-                        <li role="presentation"><a href="#settings_sync" aria-controls="settings_sync" role="tab" data-toggle="tab">Synchronization</a></li>
-                        <li role="presentation"><a href="#settings_visual" aria-controls="settings_visual" role="tab" data-toggle="tab">Visual</a></li>
-                    </ul>
+        if(typeof units === 'undefined')
+            units = '';
 
-                    <!-- Tab panes -->
-                    <div class="tab-content">
-                        <div role="tabpanel" class="tab-pane active" id="settings_performance">
-                            <form id="optionsForm1" method="get" class="form-horizontal">
-                                <div class="form-group">
-                                    <table>
-                                    <tr class="option-row">
-                                        <td class="option-control"><input id="stop_updates_when_focus_is_lost" type="checkbox" checked data-toggle="toggle" data-offstyle="danger" data-onstyle="success" data-on="On Focus" data-off="Always" data-width="110px"></td>
-                                        <td class="option-info"><strong>When to refresh the charts?</strong><br/>
-                                            <small>When set to <b>On Focus</b>, the charts will stop being updated if the page / tab does not have the focus of the user. When set to <b>Always</b>, the charts will always be refreshed. Set it to <b>On Focus</b> it to lower the CPU requirements of the browser (and extend the battery of laptops and tablets) when this page does not have your focus. Set to <b>Always</b> to work on another window (i.e. change the settings of something) and have the charts auto-refresh in this window.</small>
-                                        </td>
-                                        </tr>
-                                    <tr class="option-row">
-                                        <td class="option-control">
-                                        <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 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">
-                                        <td class="option-control"><input id="destroy_on_hide" type="checkbox" data-toggle="toggle" data-on="Destroy" data-off="Hide" data-width="110px"></td>
-                                        <td class="option-info"><strong>How to handle hidden charts?</strong><br/>
-                                            <small>When set to <b>Destroy</b>, charts that are not in the current viewport of the browser (are above, or below the visible area of the page), will be destroyed and re-created if and when they become visible again. When set to <b>Hide</b>, the not-visible charts will be just hidden, to simplify the DOM and speed up your browser. Set it to <b>Destroy</b>, to lower the memory requirements of your browser. Set it to <b>Hide</b> for smoother page scrolling.</small>
-                                        </td>
-                                        </tr>
-                                    </table>
-                                </div>
-                            </form>
-                        </div>
-                        <div role="tabpanel" class="tab-pane" id="settings_sync">
-                            <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="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>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">
-                                        <td class="option-control"></td>
-                                        <td class="option-info">
-                                            <table>
-                                            <tr class="option-row">
-                                            <td class="option-control">
-                                            <input id="concurrent_refreshes" type="checkbox" checked data-toggle="toggle" data-on="Resync" data-off="Best Effort" data-width="110px">
-                                            </td>
-                                            <td class="option-info">
-                                            <strong>Shall we re-sync chart refreshes?</strong><br/>
-                                            <small>When set to <b>Resync</b>, the dashboard will attempt to re-synchronize all the charts so that they are refreshed concurrently. When set to <b>Best Effort</b>, each chart may be refreshed with a little time difference to the others. Normally, the dashboard starts refreshing them in parallel, but depending on the speed of your computer and the network latencies, charts start having a slight time difference. Setting this to <b>Resync</b> will attempt to re-synchronize the charts on every update. Setting it to <b>Best Effort</b> may lower the pressure on your browser and the network.</small>
-                                            </td>
-                                            </tr>
-                                            </table>
-                                        </td>
-                                        </tr>
-                                    <tr class="option-row">
-                                        <td class="option-control"><input id="sync_selection" type="checkbox" checked data-toggle="toggle" data-on="Sync" data-off="Don't Sync" data-onstyle="success" data-offstyle="danger" data-width="110px"></td>
-                                        <td class="option-info"><strong>Sync hover selection on all charts?</strong><br/>
-                                            <small>When enabled, a selection on one chart will automatically select the same time on all other visible charts and the legends of all visible charts will be updated to show the selected values. When disabled, only the chart getting the user's attention will be selected. Enable it to get better insights of the data. Disable it if you are on a very slow computer that cannot actually do it.</small>
-                                        </td>
-                                        </tr>
-                                    <tr class="option-row">
-                                        <td class="option-control"><input id="sync_pan_and_zoom" type="checkbox" checked data-toggle="toggle"  data-on="Sync" data-off="Don't Sync" data-onstyle="success" data-offstyle="danger" data-width="110px"></td>
-                                        <td class="option-info"><strong>Sync pan and zoom on all charts?</strong><br/>
-                                            <small>When enabled, pan and zoom operations on a chart will be replicated to all charts (even the ones that are not currently visible - of course only when they will become visible). When disabled, pan and zoom operations will not be propagated to other charts.</small>
-                                        </td>
-                                        </tr>
-                                    </table>
-                                </div>
-                            </form>
-                        </div>
-                        <div role="tabpanel" class="tab-pane" id="settings_visual">
-                            <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/>
-                                            <small>When set to <b>Pad</b> the charts will be padded with more data, both before and after the visible area, thus giving the impression the whole database is loaded. This padding will happen only after the first pan or zoom operation on the chart (initially all charts have only the visible data). When set to <b>Don't Pad</b> only the visible data will be transfered from the netdata server, even after the first pan and zoom operation.</small>
-                                        </td>
-                                        </tr>
-                                    <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.
-                                            <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>
-                            </form>
-                        </div>
-                    </div>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
-                </div>
-            </div>
-        </div>
-    </div>
-
-
-    <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); return false;" 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>
+        if(typeof options.sparklines_registry[key] === 'undefined')
+            options.sparklines_registry[key] = { count: 1 };
+        else
+            options.sparklines_registry[key].count++;
 
-    <div class="modal fade" id="deleteRegistryModal" tabindex="-1" role="dialog" aria-labelledby="deleteRegistryModalLabel">
-        <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="deleteRegistryModalLabel">Delete <span id="deleteRegistryServerName"></span>?</h4>
-                </div>
-                <div class="modal-body">
-                    You are about to delete, from your personal list of netdata servers, the following server:
-                    <p style="text-align: center; padding-top: 10px; padding-bottom: 10px; line-height: 2;">
-                    <b><span id="deleteRegistryServerName2"></span></b>
-                    <br/>
-                    <b><span id="deleteRegistryServerURL"></span></b>
-                    </p>
-                    Are you sure you want to do this?
-                    <br/>
-                    <div style="padding: 10px;"></div>
-                    <small>Keep in mind, this server will be added back if and when you visit it again.</small>
-                    <br/>
-                    <div id="deleteRegistryResponse" style="display: block; width: 100%; text-align: center; padding-top: 20px;"></div>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-success" data-dismiss="modal">keep it</button>
-                    <a href="#" onclick="notifyForDeleteRegistry(true); return false;" type="button" class="btn btn-danger">delete it</a>
-                </div>
-            </div>
-        </div>
-    </div>
+        key = key + '.' + options.sparklines_registry[key].count;
 
-    <div class="modal fade" id="switchRegistryModal" tabindex="-1" role="dialog" aria-labelledby="switchRegistryModalLabel">
-        <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="switchRegistryModalLabel">Switch Netdata Registry Identity</h4>
-                </div>
-                <div class="modal-body">
-                    You can copy and paste the following ID to all your browsers (e.g. work and home).
-                    <br/>
-                    All the browsers with the same ID will identify <b>you</b>, so please don't share this with others.
-                    <p style="text-align: center; padding-top: 10px; padding-bottom: 10px; line-height: 2;">
-                    <form action="#">
-                    <input type="text" class="form-control" id="switchRegistryPersonGUID" placeholder="your personal ID" maxlength="36" autocomplete="off" style="text-align: center; font-size: 1.4em;">
-                    </form>
-                    </p>
-                    Either copy this ID and paste it to another browser, or paste here the ID you have taken from another browser.
-                    <p style="padding-top: 10px;"><small>
-                        Keep in mind that:
-                        <ul>
-                            <li>when you switch ID, your previous ID will be lost forever - this is irreversible.</li>
-                            <li>both IDs (your old and the new) must list this netdata at their personal lists.</li>
-                            <li>both IDs have to be known by the registry: <b><span id="switchRegistryURL"></span></b>.</li>
-                            <li>to get a new ID, just clear your browser cookies.</li>
-                        </ul>
-                    </small></p>
-                    <div id="switchRegistryResponse" style="display: block; width: 100%; text-align: center; padding-top: 20px;"></div>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-success" data-dismiss="modal">cancel</button>
-                    <a href="#" onclick="notifyForSwitchRegistry(true); return false;" type="button" class="btn btn-danger">impersonate</a>
-                </div>
-            </div>
-        </div>
-    </div>
+        var h = '<div data-netdata="' + chart + '" data-after="-120" data-width="25%" data-height="15px" data-chart-library="dygraph" data-dygraph-theme="sparkline" data-dimensions="' + dimension + '" data-show-value-of-' + dimension + '-at="' + key + '"></div> (<span id="' + key + '" style="display: inline-block; min-width: 50px; text-align: right;">X</span>' + units + ')';
 
-    <div class="modal fade" id="gotoServerModal" tabindex="-1" role="dialog" aria-labelledby="gotoServerModalLabel">
-        <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="gotoServerModalLabel"><span id="gotoServerName"></span></h4>
-                </div>
-                <div class="modal-body">
-                    Checking known URLs for this server...
-                    <div  style="padding-top: 20px;">
-                        <table id="gotoServerList">
-                        </table>
-                    </div>
-                    <p style="padding-top: 10px;"><small>
-                        Checks may fail if you are viewing an HTTPS page and the server to be checked is HTTP only.
-                    </small></p>
-                    <div id="gotoServerResponse" style="display: block; width: 100%; text-align: center; padding-top: 20px;"></div>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
-                </div>
-            </div>
-        </div>
-    </div>
+        return h;
+    }
 
-<!-- load the dashboard manager - it will do the rest -->
-<script type="text/javascript" src="dashboard.js?v51"></script>
-<script type="text/javascript">
-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.endsWith('.my-netdata.io') ||
-                    document.location.hostname.endsWith('.mynetdata.io') ||
-                    document.location.hostname.endsWith('.netdata.rocks') ||
-                    document.location.hostname.endsWith('.firehol.org') ||
-                    document.location.hostname.endsWith('.netdata.online'))
-                    this_is_demo = true;
+    function chartsPerRow(total) {
+        if(options.chartsPerRow === 0) {
+            width = Math.floor(total / options.chartsMinWidth);
+            if(width === 0) width = 1;
+            return width;
         }
+        else return options.chartsPerRow;
     }
-    catch(error) {
-        ;
+
+    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;
     }
 
-    return this_is_demo;
-}
+    function sortObjectByPriority(object) {
+        var idx = {};
+        var sorted = new Array();
 
-if(isdemo()) {
-    document.getElementById('masthead').style.display = 'block';
-}
+        for(var i in object) {
+            if(typeof idx[i] === 'undefined') {
+                idx[i] = object[i];
+                sorted.push(i);
+            }
+        }
 
-function netdataURL(url) {
-    if(typeof url === 'undefined')
-        url = document.location.toString();
+        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;
+        });
 
-    if(url.indexOf('#') !== -1)
-        url = url.substring(0, url.indexOf('#'));
+        return sorted;
+    }
 
-    var hash = netdataHash();
 
-    // console.log('netdataURL: ' + url + hash);
+    // ----------------------------------------------------------------------------
+    // scroll to a section, without changing the browser history
 
-    return url + hash;
-}
+    function scrollToId(hash) {
+        if(hash && hash != '') {
+            var offset = $('#' + hash).offset();
+            if(typeof offset !== 'undefined')
+                $('html, body').animate({ scrollTop: offset.top }, 0);
+        }
 
-function netdataReload(url) {
-    var t = netdataURL(url);
-    // console.log('netdataReload: ' + t);
-    document.location = t;
+        // we must return false to prevent the default action
+        return false;
+    }
 
-    // since we play with hash
-    // this is needed to reload the page
-    location.reload();
-}
+    // ----------------------------------------------------------------------------
+
+    var netdataDashboard = {
+        menu: {},
+        submenu: {},
+        context: {},
+
+        gaugeChart: function(title, width, dimensions, colors) {
+            if(typeof colors === 'undefined')
+                colors = '';
+
+            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>';
+        },
+
+        anyAttribute: function(obj, attr, key, def) {
+            if(typeof obj[key] !== 'undefined') {
+                if(typeof obj[key][attr] !== 'undefined')
+                    return obj[key][attr];
+            }
+            return def;
+        },
 
-var gotoServerValidateRemaining = 0;
-var gotoServerMiddleClick = false;
-var gotoServerStop = false;
-function gotoServerValidateUrl(id, guid, url) {
-    var penaldy = 0;
-    var error = 'failed';
+        menuTitle: function(chart) {
+            if(typeof chart.menu_pattern !== 'undefined') {
+                return (netdataDashboard.anyAttribute(netdataDashboard.menu, 'title', chart.menu_pattern, chart.menu_pattern).toString()
+                        + '&nbsp;' + chart.type.slice(-(chart.type.length - chart.menu_pattern.length - 1)).toString()).replace(/_/g, ' ');
+            }
 
-    if(document.location.toString().startsWith('http://') && url.toString().startsWith('https://'))
-            // we penalize https only if the current url is http
-            // to allow the user walk through all its servers.
-            penaldy = 500;
+            return (netdataDashboard.anyAttribute(netdataDashboard.menu, 'title', chart.menu, chart.menu)).toString().replace(/_/g, ' ');
+        },
 
-    else if(document.location.toString().startsWith('https://') && url.toString().startsWith('http://'))
-        error = 'can\'t check';
-    
-    var finalURL = netdataURL(url);
+        menuIcon: function(chart) {
+            if(typeof chart.menu_pattern !== 'undefined')
+                return netdataDashboard.anyAttribute(netdataDashboard.menu, 'icon', chart.menu_pattern, '<i class="fa fa-puzzle-piece" aria-hidden="true"></i>').toString();
 
-    setTimeout(function() {
-        document.getElementById('gotoServerList').innerHTML += '<tr><td style="padding-left: 20px;"><a href="' + finalURL + '" target="_blank">' + url + '</a></td><td style="padding-left: 30px;"><code id="' + guid + '-' + id + '-status">checking...</code></td></tr>';
+            return netdataDashboard.anyAttribute(netdataDashboard.menu, 'icon', chart.menu, '<i class="fa fa-puzzle-piece" aria-hidden="true"></i>');
+        },
 
-        NETDATA.registry.hello(url, function(data) {
-            if (data) {
-                // console.log('OK ' + id + ' URL: ' + url);
-                document.getElementById(guid + '-' + id + '-status').innerHTML = "OK";
+        menuInfo: function(menu) {
+            return netdataDashboard.anyAttribute(netdataDashboard.menu, 'info', menu, null);
+        },
 
-                if(!gotoServerStop) {
-                    gotoServerStop = true;
+        menuHeight: function(menu, relative) {
+            return netdataDashboard.anyAttribute(netdataDashboard.menu, 'height', menu, 1.0) * relative;
+        },
 
-                    if(gotoServerMiddleClick) {
-                        window.open(finalURL, '_blank');
-                        gotoServerMiddleClick = false;
-                        document.getElementById('gotoServerResponse').innerHTML = '<b>Opening new window to ' + NETDATA.registry.machines[guid].name + '<br/><a href="' + finalURL + '">' + url + '</a></b><br/>(check your pop-up blocker if it fails)';
-                    }
-                    else
-                        document.location = finalURL;
-                }
-            }
-            else {
-                document.getElementById(guid + '-' + id + '-status').innerHTML = error;
-                gotoServerValidateRemaining--;
-                if(gotoServerValidateRemaining <= 0) {
-                    gotoServerMiddleClick = false;
-                    document.getElementById('gotoServerResponse').innerHTML = '<b>Sorry! I cannot find any operational URL for this server</b>';
-                }
+        submenuTitle: function(menu, submenu) {
+            var key = menu + '.' + submenu;
+            var title = netdataDashboard.anyAttribute(netdataDashboard.submenu, 'title', key, submenu).toString().replace(/_/g, ' ');;
+            if(title.length > 28) {
+                var a = title.substring(0, 13);
+                var b = title.substring(title.length - 12, title.length);
+                return a + '...' + b;
             }
-        });
-    }, (id * 50) + penaldy);
-}
-
-function gotoServerModalHandler(guid) {
-    // console.log('goto server: ' + guid);
-
-    gotoServerStop = false;
-    var len = NETDATA.registry.machines[guid].alternate_urls.length;
-
-    document.getElementById('gotoServerResponse').innerHTML = '';
-    document.getElementById('gotoServerList').innerHTML = '';
-    document.getElementById('gotoServerName').innerHTML = NETDATA.registry.machines[guid].name;
-    $('#gotoServerModal').modal('show');
-
-    gotoServerValidateRemaining = len;
-    while(len--)
-        gotoServerValidateUrl(len, guid, NETDATA.registry.machines[guid].alternate_urls[len]);
-
-    return false;
-}
+            return title;
+        },
+
+        submenuInfo: function(menu, submenu) {
+            var key = menu + '.' + submenu;
+            return netdataDashboard.anyAttribute(netdataDashboard.submenu, 'info', key, null);
+        },
+
+        submenuHeight: function(menu, submenu, relative) {
+            var key = menu + '.' + submenu;
+            return netdataDashboard.anyAttribute(netdataDashboard.submenu, 'height', key, 1.0) * relative;
+        },
+
+        contextInfo: function(id) {
+            if(typeof netdataDashboard.context[id] !== 'undefined' && typeof netdataDashboard.context[id].info !== 'undefined')
+                return '<div class="chart-message netdata-chart-alignment" role="document">' + netdataDashboard.context[id].info + '</div>';
+            else
+                return '';
+        },
 
-function gotoServerInit() {
-    $(".registry_link").on('click', function(e) {
-        if(e.which === 2) {
-            e.preventDefault();
-            gotoServerMiddleClick = true;
-        }
-        else {
-            gotoServerMiddleClick = false;
+        contextHeight: function(id, def) {
+            if(typeof netdataDashboard.context[id] !== 'undefined' && typeof netdataDashboard.context[id].height !== 'undefined')
+                return def * netdataDashboard.context[id].height;
+            else
+                return def;
         }
+    };
 
-        return true;
-    });
-}
-
-function switchRegistryModalHandler() {
-    document.getElementById('switchRegistryPersonGUID').value = NETDATA.registry.person_guid;
-    document.getElementById('switchRegistryURL').innerHTML = NETDATA.registry.server;
-    document.getElementById('switchRegistryResponse').innerHTML = '';
-    $('#switchRegistryModal').modal('show');
-}
-
-function notifyForSwitchRegistry() {
-    var n = document.getElementById('switchRegistryPersonGUID').value;
-
-    if(n !== '' && n.length === 36) {
-        NETDATA.registry.switch(n, function(result) {
-            if(result !== null) {
-                $('#switchRegistryModal').modal('hide');
-                NETDATA.registry.init();
-            }
-            else {
-                document.getElementById('switchRegistryResponse').innerHTML = "<b>Sorry! The registry rejected your request.</b>";
-            }
-        });
-    }
-    else
-        document.getElementById('switchRegistryResponse').innerHTML = "<b>The ID you have entered is not a GUID.</b>";
-}
-
-var deleteRegistryUrl = null;
-function deleteRegistryModalHandler(guid, name, url) {
-    deleteRegistryUrl = url;
-    document.getElementById('deleteRegistryServerName').innerHTML = name;
-    document.getElementById('deleteRegistryServerName2').innerHTML = name;
-    document.getElementById('deleteRegistryServerURL').innerHTML = url;
-    document.getElementById('deleteRegistryResponse').innerHTML = '';
-    $('#deleteRegistryModal').modal('show');
-}
-
-function notifyForDeleteRegistry() {
-    if(deleteRegistryUrl) {
-        NETDATA.registry.delete(deleteRegistryUrl, function(result) {
-            if(result !== null) {
-                deleteRegistryUrl = null;
-                $('#deleteRegistryModal').modal('hide');
-                NETDATA.registry.init();
-            }
-            else {
-                document.getElementById('deleteRegistryResponse').innerHTML = "<b>Sorry! this command was rejected by the registry server.</b>";
-            }
-        });
-    }
-}
-
-var options = {
-    sparklines_registry: {},
-    menus: {},
-    submenu_names: {},
-    data: null,
-    hostname: 'netdata_server', // will be overwritten by the netdata server
-    categories: new Array(),
-    categories_idx: {},
-    families: new Array(),
-    families_idx: {},
-
-    chartsPerRow: 0,
-    chartsMinWidth: 1450,
-    chartsHeight: 180,
-    sparklinesHeight: 60,
-};
-
-// generate a sparkline
-// used in the documentation
-function sparkline(chart, dimension, units) {
-    var key = chart + '.' + dimension;
-
-    if(typeof units === 'undefined')
-        units = '';
-
-    if(typeof options.sparklines_registry[key] === 'undefined')
-        options.sparklines_registry[key] = { count: 1 };
-    else
-        options.sparklines_registry[key].count++;
-
-    key = key + '.' + options.sparklines_registry[key].count;
+    // ----------------------------------------------------------------------------
 
-    var h = '<div data-netdata="' + chart + '" data-after="-120" data-width="25%" data-height="15px" data-chart-library="dygraph" data-dygraph-theme="sparkline" data-dimensions="' + dimension + '" data-show-value-of-' + dimension + '-at="' + key + '"></div> (<span id="' + key + '" style="display: inline-block; min-width: 50px; text-align: right;">X</span>' + units + ')';
+    // enrich the data structure returned by netdata
+    // to reflect our menu system and content
+    function enrichChartData(chart) {
+        var tmp = chart.type.split('_')[0];
 
-    return h;
-}
+        switch(tmp) {
+            case 'ap':
+            case 'net':
+            case 'disk':
+                chart.menu = tmp;
+                break;
 
-function chartsPerRow(total) {
-    if(options.chartsPerRow === 0) {
-        width = Math.floor(total / options.chartsMinWidth);
-        if(width === 0) width = 1;
-        return width;
-    }
-    else return options.chartsPerRow;
-}
+            case 'cgroup':
+                chart.menu = chart.type;
+                if(chart.id.match(/.*[\._\/-:]qemu[\._\/-:]*/) || chart.id.match(/.*[\._\/-:]kvm[\._\/-:]*/))
+                    chart.menu_pattern = 'cgqemu';
+                else
+                    chart.menu_pattern = 'cgroup';
+                break;
+
+            case 'apache':
+            case 'exim':
+            case 'memcached':
+            case 'mysql':
+            case 'named':
+            case 'nginx':
+            case 'nut':
+            case 'phpfpm':
+            case 'postfix':
+            case 'redis':
+            case 'retroshare':
+            case 'ipfs':
+            case 'smawebbox':
+            case 'squid':
+            case 'snmp':
+            case 'tomcat':
+                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);
+                }
 
-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;
-}
+                // increase the priority of IFB devices
+                // to have inbound appear before outbound
+                if(chart.id.match(/.*-ifb$/))
+                    chart.priority--;
 
-function sortObjectByPriority(object) {
-    var idx = {};
-    var sorted = new Array();
+                break;
 
-    for(var i in object) {
-        if(typeof idx[i] === 'undefined') {
-            idx[i] = object[i];
-            sorted.push(i);
+            default:
+                chart.menu = chart.type;
+                break;
         }
-    }
 
-    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 sorted;
-}
-
-
-// ----------------------------------------------------------------------------
-// scroll to a section, without changing the browser history
-
-function scrollToId(hash) {
-    if(hash && hash != '') {
-        var offset = $('#' + hash).offset();
-        if(typeof offset !== 'undefined')
-            $('html, body').animate({ scrollTop: offset.top }, 0);
-    }
-
-    // we must return false to prevent the default action
-    return false;
-}
-
-// ----------------------------------------------------------------------------
-
-function gaugeChart(title, width, dimensions, colors) {
-    if(typeof colors === 'undefined')
-        colors = '';
-
-    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',
-        icon: '<i class="fa fa-bookmark" aria-hidden="true"></i>',
-        info: 'Overview of the key system metrics.'
-    },
-
-    'ap': {
-        title: 'Access Points',
-        icon: '<i class="fa fa-wifi" aria-hidden="true"></i>',
-        info: undefined
-    },
-
-    'tc': {
-        title: 'Quality of Service',
-        icon: '<i class="fa fa-globe" aria-hidden="true"></i>',
-        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',
-        icon: '<i class="fa fa-share-alt" aria-hidden="true"></i>',
-        info: 'Per network interface statistics collected from <code>/proc/net/dev</code>.'
-    },
-
-    'ipv4': {
-        title: 'IPv4 Networking',
-        icon: '<i class="fa fa-cloud" aria-hidden="true"></i>',
-        info: undefined
-    },
-
-    'ipv6': {
-        title: 'IPv6 Networking',
-        icon: '<i class="fa fa-cloud" aria-hidden="true"></i>',
-        info: undefined
-    },
-
-    'ipvs': {
-        title: 'IP Virtual Server',
-        icon: '<i class="fa fa-eye" aria-hidden="true"></i>',
-        info: undefined
-    },
-
-    'netfilter': {
-        title: 'Firewall (netfilter)',
-        icon: '<i class="fa fa-shield" aria-hidden="true"></i>',
-        info: undefined
-    },
-
-    'cpu': {
-        title: 'CPUs',
-        icon: '<i class="fa fa-bolt" aria-hidden="true"></i>',
-        info: undefined
-    },
-
-    'mem': {
-        title: 'Memory',
-        icon: '<i class="fa fa-bolt" aria-hidden="true"></i>',
-        info: undefined
-    },
-
-    'disk': {
-        title: 'Disks',
-        icon: '<i class="fa fa-folder" aria-hidden="true"></i>',
-        info: 'Charts with performance information for all the system disks. Special care has been given to present disk performance metrics in a way compatible with <code>iostat -x</code>. netdata by default prevents rendering performance charts for individual partitions and unmounted virtual disks. Disabled charts can still be enabled by altering the relative settings in the netdata configuration file.'
-    },
-
-    'sensors': {
-        title: 'Sensors',
-        icon: '<i class="fa fa-leaf" aria-hidden="true"></i>',
-        info: undefined
-    },
-
-    'nfsd': {
-        title: 'NFS Server',
-        icon: '<i class="fa fa-folder-open" aria-hidden="true"></i>',
-        info: undefined
-    },
-
-    'nfs': {
-        title: 'NFS Client',
-        icon: '<i class="fa fa-folder-open" aria-hidden="true"></i>',
-        info: undefined
-    },
-
-    'apps': {
-        title: 'Applications',
-        icon: '<i class="fa fa-heartbeat" aria-hidden="true"></i>',
-        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). The reported values are compatible with <code>top</code>, although the netdata plugin counts also the resources of exited children (unlike <code>top</code> which shows only the resources of the currently running processes). So for processes like shell scripts, the reported values include the resources used by the commands these scripts run within each timeframe.',
-        height: 1.5
-    },
-
-    'users': {
-        title: 'Users',
-        icon: '<i class="fa fa-user" aria-hidden="true"></i>',
-        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. The reported values are compatible with <code>top</code>, although the netdata plugin counts also the resources of exited children (unlike <code>top</code> which shows only the resources of the currently running processes). So for processes like shell scripts, the reported values include the resources used by the commands these scripts run within each timeframe.',
-        height: 1.5
-    },
-
-    'groups': {
-        title: 'User Groups',
-        icon: '<i class="fa fa-users" aria-hidden="true"></i>',
-        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. The reported values are compatible with <code>top</code>, although the netdata plugin counts also the resources of exited children (unlike <code>top</code> which shows only the resources of the currently running processes). So for processes like shell scripts, the reported values include the resources used by the commands these scripts run within each timeframe.',
-        height: 1.5
-    },
-
-    'netdata': {
-        title: 'Netdata Monitoring',
-        icon: '<i class="fa fa-bar-chart" aria-hidden="true"></i>',
-        info: undefined
-    },
-
-    'example': {
-        title: 'Example Charts',
-        info: undefined
-    },
-
-    'cgroup': {
-        title: '',
-        icon: '<i class="fa fa-th" aria-hidden="true"></i>',
-        info: undefined
-    },
-
-    'cgqemu': {
-        title: '',
-        icon: '<i class="fa fa-th-large" aria-hidden="true"></i>',
-        info: undefined
-    },
-
-    'memcached': {
-        title: 'memcached',
-        icon: '<i class="fa fa-database" aria-hidden="true"></i>',
-        info: undefined
-    },
-
-    'mysql': {
-        title: 'MySQL',
-        icon: '<i class="fa fa-database" aria-hidden="true"></i>',
-        info: undefined
-    },
-
-    'redis': {
-        title: 'Redis',
-        icon: '<i class="fa fa-database" aria-hidden="true"></i>',
-        info: undefined
-    },
-
-    'retroshare': {
-        title: 'RetroShare',
-        icon: '<i class="fa fa-share-alt" aria-hidden="true"></i>',
-        info: undefined
-    },
-
-    'ipfs': {
-        title: 'IPFS',
-        icon: '<i class="fa fa-folder-open" aria-hidden="true"></i>',
-        info: undefined
-    },
-
-    'phpfpm': {
-        title: 'PHP-FPM',
-        icon: '<i class="fa fa-eye" aria-hidden="true"></i>',
-        info: undefined,
-    },
-
-    'postfix': {
-        title: 'postfix',
-        icon: '<i class="fa fa-envelope" aria-hidden="true"></i>',
-        info: undefined,
-    },
-
-    'nginx': {
-        title: 'nginx',
-        icon: '<i class="fa fa-eye" aria-hidden="true"></i>',
-        info: undefined,
-    },
-
-    'apache': {
-        title: 'Apache',
-        icon: '<i class="fa fa-eye" aria-hidden="true"></i>',
-        info: undefined,
-    },
-
-    'named': {
-        title: 'named',
-        icon: '<i class="fa fa-tag" aria-hidden="true"></i>',
-        info: undefined
-    },
-
-    'squid': {
-        title: 'squid',
-        icon: '<i class="fa fa-exchange" aria-hidden="true"></i>',
-        info: undefined
-    },
-
-    'nut': {
-        title: 'UPS',
-        icon: '<i class="fa fa-battery-half" aria-hidden="true"></i>',
-        info: undefined
-    },
-
-    'apcupsd': {
-        title: 'UPS',
-        icon: '<i class="fa fa-battery-half" aria-hidden="true"></i>',
-        info: undefined
-    },
-
-    'smawebbox': {
-        title: 'Solar Power',
-        icon: '<i class="fa fa-sun-o" aria-hidden="true"></i>',
-        info: undefined
-    },
-
-    'snmp': {
-        title: 'SNMP',
-        icon: '<i class="fa fa-random" aria-hidden="true"></i>',
-        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.'
-    },
-
-    'ipv4.ecn': {
-        info: '<a href="https://en.wikipedia.org/wiki/Explicit_Congestion_Notification" target="_blank">Explicit Congestion Notification (ECN)</a> is a TCP extension that allows end-to-end notification of network congestion without dropping packets. ECN is an optional feature that may be used between two ECN-enabled endpoints when the underlying network infrastructure also supports it.'
-    },
-
-    '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.'
-    },
-
-    'system.softnet_stat': {
-        title: 'softnet',
-        info: 'Statistics for CPUs SoftIRQs related to network receive work, read from <code>/proc/net/softnet_stat</code>. Break down per CPU core can be found at <a href="#cpu_softnet_stat">CPU / softnet statistics</a>. <b>processed</b> states the number of packets processed, <b>dropped</b> is the number packets dropped because the network device backlog was full (to fix them use <code>sysctl</code> to increase <code>net.core.netdev_max_backlog</code>), <b>squeezed</b> is the number of packets dropped because the network device budget ran out (to fix them use <code>sysctl</code> to increase <code>net.core.netdev_budget</code>). More information about identifying and troubleshooting network driver related issues can be found at <a href="https://access.redhat.com/sites/default/files/attachments/20150325_network_performance_tuning.pdf" target="_blank">Red Hat Enterprise Linux Network Performance Tuning Guide</a>.'
-    },
-
-    'cpu.softnet_stat': {
-        title: 'softnet',
-        info: 'Statistics for per CPUs core SoftIRQs related to network receive work, read from <code>/proc/net/softnet_stat</code>. Total for all CPU cores can be found at <a href="#system_softnet_stat">System / softnet statistics</a>. <b>processed</b> states the number of packets processed, <b>dropped</b> is the number packets dropped because the network device backlog was full (to fix them use <code>sysctl</code> to increase <code>net.core.netdev_max_backlog</code>), <b>squeezed</b> is the number of packets dropped because the network device budget ran out (to fix them use <code>sysctl</code> to increase <code>net.core.netdev_budget</code>). More information about identifying and troubleshooting network driver related issues can be found at <a href="https://access.redhat.com/sites/default/files/attachments/20150325_network_performance_tuning.pdf" target="_blank">Red Hat Enterprise Linux Network Performance Tuning Guide</a>.'
-    }
-};
-
-//
-// chartData works on the context of a chart
-// Its purpose is to set:
-//
-// info: the text above the charts
-// heads: the representation of the chart at the top the subsection (second level menu)
-// mainheads: the representation of the chart at the top of the section (first level menu)
-// colors: the dimension colors of the chart (the default colors are appended)
-// height: the ratio of the chart height relative to the default
-//
-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, i.e. the number of processes using CPU or waiting for system resources (usually CPU and disk). The 3 metrics refer to 1, 5 and 15 minute averages. Linux calculates this once every 5 seconds. Netdata reads them from <code>/proc/loadavg</code>. For more information check <a href="https://en.wikipedia.org/wiki/Load_(computing)" target="_blank">this wikipedia article</a>',
-        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 (<a href="https://en.wikipedia.org/wiki//dev/random" target="_blank">/dev/random</a>) 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> or <code>rng-tools</code> (i.e. <b>rngd</b>), 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>Running</b> are the processes in the CPU. <b>Blocked</b> are processes that are willing to enter the CPU, but they cannot, e.g. because they wait for disk activity.'
-    },
-
-    'system.active_processes': {
-        info: 'All system 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>.'
-    },
-
-    // ------------------------------------------------------------------------
-    // MEMORY
-
-    '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>';
-            }
-        ]
-    },
+        chart.submenu = chart.family;
+    }
+
+    // ----------------------------------------------------------------------------
+
+    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-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-width="10%"'
+            + ' data-before="0"'
+            + ' data-after="-' + duration.toString() + '"'
+            + ' data-points="' + duration.toString() + '"'
+            + ' role="application"></div>';
+        }
 
-    'mem.committed': {
-        colors: NETDATA.colors[3]
-    },
+        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-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-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>';
+        }
 
-    // ------------------------------------------------------------------------
-    // network interfaces
+        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 = netdataDashboard.anyAttribute(netdataDashboard.context, 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;
+    }
 
-    'net.drops': {
-        info: 'Packets that have been dropped at the network interface level. These are the same counters reported by <code>ifconfig</code> as <code>RX dropped</code> (inbound) and <code>TX dropped</code> (outbound). <b>inbound</b> packets can be dropped at the network interface level due to <a href="#system_softnet_stat">softnet backlog</a> overflow, bad / unintented VLAN tags, unknown or unregistered protocols, IPv6 frames when the server is not configured for IPv6. Check <a href="https://www.novell.com/support/kb/doc.php?id=7007165" target="_blank">this document</a> for more information.'
-    },
+    function renderPage(menus, data) {
+        var div = document.getElementById('charts_div');
+        var pcent_width = Math.floor(100 / chartsPerRow($(div).width()));
 
-    // ------------------------------------------------------------------------
-    // IPv4
+        // find the proper duration for per-second updates
+        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);
 
-    'ipv4.tcpmemorypressures': {
-        info: 'Number of times a socket was put in <b>memory pressure</b> due to a non fatal memory allocation failure (the kernel attempts to work around this situation by reducing the send buffers, etc).'
-    },
+        // sort the menus
+        var main = sortObjectByPriority(menus);
+        var i = 0, len = main.length;
+        while(i < len) {
+            var menu = main[i++];
 
-    'ipv4.tcpconnaborts': {
-        info: 'TCP connection aborts. <b>baddata</b> (<code>TCPAbortOnData</code>) happens while the connection is on <code>FIN_WAIT1</code> and the kernel receives a packet with a sequence number beyond the last one for this connection - the kernel responds with <code>RST</code> (closes the connection). <b>userclosed</b> (<code>TCPAbortOnClose</code>) happens when the kernel receives data on an already closed connection and responds with <code>RST</code>. <b>nomemory</b> (<code>TCPAbortOnMemory</code> happens when there are too many orphaned sockets (not attached to an fd) and the kernel has to drop a connection - sometimes it will send an <code>RST</code>, sometimes it won\'t. <b>timeout</b> (<code>TCPAbortOnTimeout</code>) happens when a connection times out. <b>linger</b> (<code>TCPAbortOnLinger</code>) happens when the kernel killed a socket that was already closed by the application and lingered around for long enough. <b>failed</b> (<code>TCPAbortFailed</code>) happens when the kernel attempted to send an <code>RST</code> but failed because there was no memory available.'
-    },
+            // generate an entry at the main menu
 
-    // ------------------------------------------------------------------------
-    // APPS
+            var menuid = NETDATA.name2id('menu_' + menu);
+            sidebar += '<li class=""><a href="#' + menuid + '" onClick="return scrollToId(\'' + menuid + '\');">' + menus[menu].icon + ' ' + menus[menu].title + '</a><ul class="nav">';
+            html += '<div role="section"><div role="sectionhead"><h1 id="' + menuid + '" role="heading">' + menus[menu].title + '</h1></div><div role="document">';
 
-    'apps.cpu': {
-        height: 2.0
-    },
+            if(menus[menu].info !== null)
+                html += menus[menu].info;
 
-    'apps.preads': {
-        height: 2.0
-    },
+            // console.log(' >> ' + menu + ' (' + menus[menu].priority + '): ' + menus[menu].title);
 
-    'apps.pwrites': {
-        height: 2.0
-    },
+            var shtml = '';
+            var mhead = '<div class="netdata-chart-row">' + mainhead;
+            mainhead = '';
 
-    // ------------------------------------------------------------------------
-    // USERS
+            // 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++];
 
-    'users.cpu': {
-        height: 2.0
-    },
+                // generate an entry at the submenu
+                var submenuid = NETDATA.name2id('menu_' + menu + '_submenu_' + submenu);
+                sidebar += '<li class><a href="#' + submenuid + '" onClick="return scrollToId(\'' + submenuid + '\');">' + menus[menu].submenus[submenu].title + '</a></li>';
+                shtml += '<div class="netdata-group-container" id="' + submenuid + '" style="display: inline-block; width: ' + pcent_width.toString() + '%"><h2 id="' + submenuid + '" class="netdata-chart-alignment" role="heading">' + menus[menu].submenus[submenu].title + '</h2>';
 
-    'users.preads': {
-        height: 2.0
-    },
+                if(menus[menu].submenus[submenu].info !== null)
+                    shtml += '<div class="chart-message netdata-chart-alignment" role="document">' + menus[menu].submenus[submenu].info + '</div>';
 
-    'users.pwrites': {
-        height: 2.0
-    },
+                var head = '<div class="netdata-chart-row">';
+                var chtml = '';
 
-    // ------------------------------------------------------------------------
-    // GROUPS
+                // console.log('    \------- ' + submenu + ' (' + menus[menu].submenus[submenu].priority + '): ' + menus[menu].submenus[submenu].title);
 
-    'groups.cpu': {
-        height: 2.0
-    },
+                // 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++];
 
-    'groups.preads': {
-        height: 2.0
-    },
+                    // generate the submenu heading charts
+                    mhead += generateHeadCharts('mainheads', chart, duration);
+                    head += generateHeadCharts('heads', chart, duration);
 
-    'groups.pwrites': {
-        height: 2.0
-    },
+                    // generate the chart
+                    chtml += netdataDashboard.contextInfo(chart.context) + '<div id="chart_' + NETDATA.name2id(chart.id) + '" data-netdata="' + chart.id + '"'
+                        + ' data-width="' + pcent_width.toString() + '%"'
+                        + ' data-height="' + netdataDashboard.contextHeight(chart.context, options.chartsHeight).toString() + 'px"'
+                        + ' data-before="0"'
+                        + ' data-after="-' + duration.toString() + '"'
+                        + ' data-id="' + NETDATA.name2id(options.hostname + '/' + chart.id) + '"'
+                        + ' data-colors="' + netdataDashboard.anyAttribute(netdataDashboard.context, 'colors', chart.context, '') + '"'
+                        + ' role="application"></div>';
 
-    // ------------------------------------------------------------------------
-    // NETWORK QoS
+                    // console.log('         \------- ' + chart.id + ' (' + chart.priority + '): ' + chart.context  + ' height: ' + menus[menu].submenus[submenu].height);
+                }
 
-    'tc.qos': {
-        heads: [
-            function(id) {
-                if(id.match(/.*-ifb$/))
-                    return gaugeChart('Inbound', '12%', '', '#5555AA');
-                else
-                    return gaugeChart('Outbound', '12%', '', '#AA9900');
-            }
-        ]
-    },
-
-    // ------------------------------------------------------------------------
-    // NETWORK INTERFACES
-
-    'net.net': {
-        heads: [
-            gaugeChart('Received', '12%', 'received'),
-            gaugeChart('Sent', '12%', 'sent')
-        ]
-    },
-
-    // ------------------------------------------------------------------------
-    // NETFILTER
-
-    'netfilter.sockets': {
-        colors: '#88AA00',
-        heads: [
-            gaugeChart('Active Connections', '12%', '', '#88AA00')
-        ]
-    },
-
-    'netfilter.new': {
-        heads: [
-            gaugeChart('New Connections', '12%', 'new', '#5555AA')
-        ]
-    },
-
-    // ------------------------------------------------------------------------
-    // DISKS
-
-    'disk.util': {
-        colors: '#FF5588',
-        heads: [
-            gaugeChart('Utilization', '12%', '', '#FF5588')
-        ],
-        info: 'Disk Utilization measures the amount of time the disk was busy with something. This is not related to its performance. 100% means that the Linux kernel always had an outstanding operation on the disk. Keep in mind that depending on the underlying technology of the disk, 100% here may or may not be an indication of congestion.'
-    },
-
-    'disk.backlog': {
-        colors: '#0099CC',
-        info: 'Backlog is an indication of the duration of pending disk operations. On every I/O event the Linux kernel is multiplying the time spent doing I/O since the last update of this field with the number of pending operations. While not accurate, this metric can provide an indication of the expected completion time of the operations in progress.'
-    },
-
-    'disk.io': {
-        heads: [
-            gaugeChart('Read', '12%', 'reads'),
-            gaugeChart('Write', '12%', 'writes')
-        ],
-        info: 'Amount of data transferred to and from disk.'
-    },
-
-    'disk.ops': {
-        info: 'Completed disk I/O operations. Keep in mind the number of operations requested might be higher, since the Linux kernel is able to merge adjacent to each other (see merged operations chart).'
-    },
-
-    'disk.qops': {
-        info: 'I/O operations currently in progress. This metric is a snapshot - it is not an average over the last interval.'
-    },
-
-    'disk.iotime': {
-        height: 0.5,
-        info: 'The sum of the duration of all completed I/O operations. This number can exceed the interval if the disk is able to execute I/O operations in parallel.'
-    },
-    'disk.mops': {
-        height: 0.5,
-        info: 'The number of merged disk operations. The Linux kernel is able to merge adjacent I/O operations, for example two 4KB reads can become one 8KB read before given to disk.'
-    },
-    'disk.svctm': {
-        height: 0.5,
-        info: 'The average service time for completed I/O operations. This metric is calculated using the total busy time of the disk and the number of completed operations. If the disk is able to execute multiple parallel operations the reporting average service time will be misleading.'
-    },
-    'disk.avgsz': {
-        height: 0.5,
-        info: 'The average I/O operation size.'
-    },
-    'disk.await': {
-        height: 0.5,
-        info: 'The average time for I/O requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.'
-    },
-
-    'disk.space': {
-        info: 'Disk space utilization. reserved for root is automatically reserved by the system to prevent the root user from getting out of space.'
-    },
-    'disk.inodes': {
-        info: 'inodes (or index nodes) are filesystem objects (e.g. files and directories). On many types of file system implementations, the maximum number of inodes is fixed at filesystem creation, limiting the maximum number of files the filesystem can hold. It is possible for a device to run out of inodes. When this happens, new files cannot be created on the device, even though there may be free space available.'
-    },
-
-    'mysql.net': {
-        info: 'The amount of data sent to mysql clients (<strong>out</strong>) and received from mysql clients (<strong>in</strong>).'
-    },
-
-    // ------------------------------------------------------------------------
-    // MYSQL
-
-    'mysql.queries': {
-        info: 'The number of statements executed by the server.<ul>' +
-        '<li><strong>queries</strong> counts the statements executed within stored SQL programs.</li>' +
-        '<li><strong>questions</strong> counts the statements sent to the mysql server by mysql clients.</li>' +
-        '<li><strong>slow queries</strong> counts the number of statements that took more than <a href="http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_long_query_time" target="_blank">long_query_time</a> seconds to be executed.' +
-        ' For more information about slow queries check the mysql <a href="http://dev.mysql.com/doc/refman/5.7/en/slow-query-log.html" target="_blank">slow query log</a>.</li>' +
-        '</ul>'
-    },
-
-    'mysql.handlers': {
-        info: 'Usage of the internal handlers of mysql. This chart provides very good insights of what the mysql server is actually doing.' +
-        ' (if the chart is not showing all these dimensions it is because they are zero - set <strong>Which dimensions to show?</strong> to <strong>All</strong> from the dashboard settings, to render even the zero values)<ul>' +
-        '<li><strong>commit</strong>, the number of internal <a href="http://dev.mysql.com/doc/refman/5.7/en/commit.html" target="_blank">COMMIT</a> statements.</li>' +
-        '<li><strong>delete</strong>, the number of times that rows have been deleted from tables.</li>' +
-        '<li><strong>prepare</strong>, a counter for the prepare phase of two-phase commit operations.</li>' +
-        '<li><strong>read first</strong>, the number of times the first entry in an index was read. A high value suggests that the server is doing a lot of full index scans; e.g. <strong>SELECT col1 FROM foo</strong>, with col1 indexed.</li>' +
-        '<li><strong>read key</strong>, the number of requests to read a row based on a key. If this value is high, it is a good indication that your tables are properly indexed for your queries.</li>' +
-        '<li><strong>read next</strong>, the number of requests to read the next row in key order. This value is incremented if you are querying an index column with a range constraint or if you are doing an index scan.</li>' +
-        '<li><strong>read prev</strong>, the number of requests to read the previous row in key order. This read method is mainly used to optimize <strong>ORDER BY ... DESC</strong>.</li>' +
-        '<li><strong>read rnd</strong>, the number of requests to read a row based on a fixed position. A high value indicates you are doing a lot of queries that require sorting of the result. You probably have a lot of queries that require MySQL to scan entire tables or you have joins that do not use keys properly.</li>' +
-        '<li><strong>read rnd next</strong>, the number of requests to read the next row in the data file. This value is high if you are doing a lot of table scans. Generally this suggests that your tables are not properly indexed or that your queries are not written to take advantage of the indexes you have.</li>' +
-        '<li><strong>rollback</strong>, the number of requests for a storage engine to perform a rollback operation.</li>' +
-        '<li><strong>savepoint</strong>, the number of requests for a storage engine to place a savepoint.</li>' +
-        '<li><strong>savepoint rollback</strong>, the number of requests for a storage engine to roll back to a savepoint.</li>' +
-        '<li><strong>update</strong>, the number of requests to update a row in a table.</li>' +
-        '<li><strong>write</strong>, the number of requests to insert a row in a table.</li>' +
-        '</ul>'
-    },
-
-    'mysql.table_locks': {
-        info: 'MySQL table locks counters: <ul>' +
-        '<li><strong>immediate</strong>, the number of times that a request for a table lock could be granted immediately.</li>' +
-        '<li><strong>waited</strong>, the number of times that a request for a table lock could not be granted immediately and a wait was needed. If this is high and you have performance problems, you should first optimize your queries, and then either split your table or tables or use replication.</li>' +
-        '</ul>'
-    },
-
-    // ------------------------------------------------------------------------
-    // APACHE
-
-    'apache.connections': {
-        colors: NETDATA.colors[4],
-        mainheads: [
-            gaugeChart('Connections', '12%', '', NETDATA.colors[4])
-        ]
-    },
-
-    'apache.requests': {
-        colors: NETDATA.colors[0],
-        mainheads: [
-            gaugeChart('Requests', '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>';
+                head += '</div>';
+                shtml += head + chtml + '</div>';
             }
-        ]
-    },
-
-    '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
-
-    '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])
-        ]
-    },
-
-    // ------------------------------------------------------------------------
-    // NETDATA
-
-    'netdata.response_time': {
-        info: 'The netdata API response time measures the time netdata needed to serve requests. This time includes everything, from the reception of the first byte of a request, to the dispatch of the last byte of its reply, therefore it includes all network latencies involved (i.e. a client over a slow network will influence these metrics).'
-    },
-
-    // ------------------------------------------------------------------------
-    // RETROSHARE
-    'retroshare.bandwidth': {
-        info: 'Shows inbound and outbound traffic.',
-        mainheads: [
-            gaugeChart('Received', '12%', 'bandwidth_down_kb'),
-            gaugeChart('Sent', '12%', 'bandwidth_up_kb')
-        ]
-    },
-
-    'retroshare.peers': {
-        info: 'Shows the number of (connected) friends.',
-        mainheads: [
-            function(id) {
-                return  '<div data-netdata="' + id + '"'
-                    + ' data-dimensions="peers_connected"'
-                    + ' data-append-options="friends"'
-                    + ' data-chart-library="easypiechart"'
-                    + ' data-title="connected friends"'
-                    + ' data-units=""'
-                    + ' data-width="8%"'
-                    + ' data-before="0"'
-                    + ' data-after="-CHART_DURATION"'
-                    + ' data-points="CHART_DURATION"'
-                    + ' role="application"></div>';
-            }
-        ]
-    },
-
-    'retroshare.dht': {
-        info: 'Shows statistics about RetroShare\'s DHT. These values are estimated!'
-    }
-};
 
-function anyAttribute(obj, attr, key, def) {
-    if(typeof obj[key] !== 'undefined') {
-        if(typeof obj[key][attr] !== 'undefined')
-            return obj[key][attr];
-    }
-    return def;
-}
+            mhead += '</div>';
+            sidebar += '</ul></li>';
+            html += mhead + shtml + '</div></div><hr role="separator"/>';
+        }
 
-function menuTitle(chart) {
-    if(typeof chart.menu_pattern !== 'undefined') {
-        return (anyAttribute(menuData, 'title', chart.menu_pattern, chart.menu_pattern).toString()
-                + '&nbsp;' + chart.type.slice(-(chart.type.length - chart.menu_pattern.length - 1)).toString()).replace(/_/g, ' ');
+        sidebar += '</ul>';
+        div.innerHTML = html;
+        document.getElementById('sidebar').innerHTML = sidebar;
+        finalizePage();
     }
 
-    return (anyAttribute(menuData, 'title', chart.menu, chart.menu)).toString().replace(/_/g, ' ');
-}
-
-function menuIcon(chart) {
-    if(typeof chart.menu_pattern !== 'undefined')
-        return anyAttribute(menuData, 'icon', chart.menu_pattern, '<i class="fa fa-puzzle-piece" aria-hidden="true"></i>').toString();
+    function renderChartsAndMenu(data) {
+        var menus = options.menus;
+        var charts = data.charts;
 
-    return anyAttribute(menuData, 'icon', chart.menu, '<i class="fa fa-puzzle-piece" aria-hidden="true"></i>');
-}
+        for(var c in charts) {
+            enrichChartData(charts[c]);
 
-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;
-    var title = anyAttribute(submenuData, 'title', key, submenu).toString().replace(/_/g, ' ');;
-    if(title.length > 28) {
-        var a = title.substring(0, 13);
-        var b = title.substring(title.length - 12, title.length);
-        return a + '...' + b;
-    }
-    return title;
-}
+            // create the menu
+            if(typeof menus[charts[c].menu] === 'undefined') {
+                menus[charts[c].menu] = {
+                    priority: charts[c].priority,
+                    submenus: {},
+                    title: netdataDashboard.menuTitle(charts[c]),
+                    icon: netdataDashboard.menuIcon(charts[c]),
+                    info: netdataDashboard.menuInfo(charts[c].menu),
+                    height: netdataDashboard.menuHeight(charts[c].menu, options.chartsHeight)
+                };
+            }
 
-function submenuInfo(menu, submenu) {
-    var key = menu + '.' + submenu;
-    return anyAttribute(submenuData, 'info', key, null);
-}
+            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: netdataDashboard.submenuInfo(charts[c].menu, charts[c].submenu),
+                    height: netdataDashboard.submenuHeight(charts[c].menu, charts[c].submenu, menus[charts[c].menu].height)
+                };
+            }
 
-function submenuHeight(menu, submenu, relative) {
-    var key = menu + '.' + submenu;
-    return anyAttribute(submenuData, 'height', key, 1.0) * relative;
-}
+            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;
 
+            // index the chart in the menu/submenu
+            menus[charts[c].menu].submenus[charts[c].submenu].charts.push(charts[c]);
+        }
 
-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 '';
-}
+        // 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 = netdataDashboard.submenuTitle(m, s);
+                }
+            }
+        }
 
-function chartHeight(id, def) {
-    if(typeof chartData[id] !== 'undefined' && typeof chartData[id].height !== 'undefined')
-        return def * chartData[id].height;
-    else
-        return def;
-}
+        renderPage(menus, data);
+    }
 
+    // ----------------------------------------------------------------------------
 
-// ----------------------------------------------------------------------------
+    function alarmsUpdateModal() {
+        var active = '<h3>Raised Alarms</h3><table class="table">';
+        var all = '<h3>All Running Alarms</h3><div class="panel-group" id="alarms_all_accordion" role="tablist" aria-multiselectable="true">';
+        var log = '<h3>Alarm Log</h3><table class="table"><tr><th>When</th><th>Chart</th><th>Alarm</th><th>Status</th>';
+        var footer = '<hr/><a href="https://github.com/firehol/netdata/wiki/Generating-Badges" target="_blank">netdata badges</a> refresh automatically. Their color indicates the state of the alarm: <span style="color: #e05d44"><b>&nbsp;red&nbsp;</b></span> is critical, <span style="color:#fe7d37"><b>&nbsp;orange&nbsp;</b></span> is warning, <span style="color: #4c1"><b>&nbsp;bright green&nbsp;</b></span> is ok, <span style="color: #9f9f9f"><b>&nbsp;light grey&nbsp;</b></span> is undefined (i.e. no data or no status), <span style="color: #000"><b>&nbsp;black&nbsp;</b></span> is not initialized. You can copy and paste their URLs to embed them in any web page.<br/>netdata can send notifications for these alarms. Check <a href="https://github.com/firehol/netdata/blob/master/conf.d/health_alarm_notify.conf">this configuration file</a> for more information.';
 
-// enrich the data structure returned by netdata
-// to reflect our menu system and content
-function enrichChartData(chart) {
-    var tmp = chart.type.split('_')[0];
+        NETDATA.alarms.get('all', function(data) {
+            options.alarm_families = new Array();
 
-    switch(tmp) {
-        case 'ap':
-        case 'net':
-        case 'disk':
-            chart.menu = tmp;
-            break;
+            alarmsCallback(data);
 
-        case 'cgroup':
-            chart.menu = chart.type;
-            if(chart.id.match(/.*[\._\/-:]qemu[\._\/-:]*/) || chart.id.match(/.*[\._\/-:]kvm[\._\/-:]*/))
-                chart.menu_pattern = 'cgqemu';
-            else
-                chart.menu_pattern = 'cgroup';
-            break;
-
-        case 'apache':
-        case 'exim':
-        case 'memcached':
-        case 'mysql':
-        case 'named':
-        case 'nginx':
-        case 'nut':
-        case 'phpfpm':
-        case 'postfix':
-        case 'redis':
-        case 'retroshare':
-        case 'ipfs':
-        case 'smawebbox':
-        case 'squid':
-        case 'snmp':
-        case 'tomcat':
-            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);
+            if(data === null) {
+                document.getElementById('alarms_active').innerHTML =
+                        document.getElementById('alarms_all').innerHTML =
+                                document.getElementById('alarms_log').innerHTML =
+                                        'failed to load alarm data!';
+                return;
             }
 
-            // 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 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-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-width="10%"'
-        + ' data-before="0"'
-        + ' data-after="-' + duration.toString() + '"'
-        + ' data-points="' + duration.toString() + '"'
-        + ' role="application"></div>';
-    }
-
-    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-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-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()));
-
-    // find the proper duration for per-second updates
-    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);
-
-    // sort the menus
-    var main = sortObjectByPriority(menus);
-    var i = 0, len = main.length;
-    while(i < len) {
-        var menu = main[i++];
-
-        // generate an entry at the main menu
+            function frequency_text(seconds, sfx) {
+                if(seconds === 0)
+                    return 'now';
 
-        var menuid = NETDATA.name2id('menu_' + menu);
-        sidebar += '<li class=""><a href="#' + menuid + '" onClick="return scrollToId(\'' + menuid + '\');">' + menus[menu].icon + ' ' + menus[menu].title + '</a><ul class="nav">';
-        html += '<div role="section"><div role="sectionhead"><h1 id="' + menuid + '" role="heading">' + menus[menu].title + '</h1></div><div role="document">';
+                var suffix = '';
+                if(seconds < 0) {
+                    seconds = -seconds;
+                    if(sfx) suffix = '&nbsp;ago';
+                }
 
-        if(menus[menu].info !== null)
-            html += menus[menu].info;
+                var hours = Math.floor(seconds / 3600);
+                seconds -= (hours * 3600);
 
-        // console.log(' >> ' + menu + ' (' + menus[menu].priority + '): ' + menus[menu].title);
+                var minutes = Math.floor(seconds / 60);
+                seconds -= (minutes * 60);
 
-        var shtml = '';
-        var mhead = '<div class="netdata-chart-row">' + mainhead;
-        mainhead = '';
+                var txt = '';
+                
+                if(hours > 1) txt += hours.toString() + '&nbsp;hours';
+                else if(hours === 1) txt += hours.toString() + '&nbsp;hour';
 
-        // 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++];
+                if(hours > 0 && minutes > 0 && seconds == 0)
+                    txt += '&nbsp;and&nbsp;';
+                else if(hours > 0 && minutes > 0 && seconds > 0)
+                    txt += ',&nbsp;';
 
-            // generate an entry at the submenu
-            var submenuid = NETDATA.name2id('menu_' + menu + '_submenu_' + submenu);
-            sidebar += '<li class><a href="#' + submenuid + '" onClick="return scrollToId(\'' + submenuid + '\');">' + menus[menu].submenus[submenu].title + '</a></li>';
-            shtml += '<div class="netdata-group-container" id="' + submenuid + '" style="display: inline-block; width: ' + pcent_width.toString() + '%"><h2 id="' + submenuid + '" class="netdata-chart-alignment" role="heading">' + menus[menu].submenus[submenu].title + '</h2>';
+                if(minutes > 1) txt += minutes.toString() + '&nbsp;minutes';
+                else if(minutes === 1) txt += minutes.toString() + '&nbsp;minute';
 
-            if(menus[menu].submenus[submenu].info !== null)
-                shtml += '<div class="chart-message netdata-chart-alignment" role="document">' + menus[menu].submenus[submenu].info + '</div>';
+                if((minutes > 0 || minutes > 0) && seconds > 0)
+                    txt += '&nbsp;and&nbsp;';
 
-            var head = '<div class="netdata-chart-row">';
-            var chtml = '';
+                if(seconds > 1) txt += seconds.toString() + '&nbsp;seconds';
+                else if(seconds === 1) txt += seconds.toString() + '&nbsp;second';
 
-            // console.log('    \------- ' + submenu + ' (' + menus[menu].submenus[submenu].priority + '): ' + menus[menu].submenus[submenu].title);
+                return txt + suffix;
+            }
 
-            // 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++];
+            function alarm_lookup_explain(alarm, chart) {
+                var dimensions = ' of all values ';
 
-                // generate the submenu heading charts
-                mhead += generateHeadCharts('mainheads', chart, duration);
-                head += generateHeadCharts('heads', chart, duration);
+                if(chart.dimensions.length > 1)
+                    dimensions = ' of the sum of all dimensions ';
 
-                // generate the chart
-                chtml += chartInfo(chart.context) + '<div id="chart_' + NETDATA.name2id(chart.id) + '" data-netdata="' + chart.id + '"'
-                    + ' data-width="' + pcent_width.toString() + '%"'
-                    + ' data-height="' + chartHeight(chart.context, options.chartsHeight).toString() + 'px"'
-                    + ' data-before="0"'
-                    + ' data-after="-' + duration.toString() + '"'
-                    + ' data-id="' + NETDATA.name2id(options.hostname + '/' + chart.id) + '"'
-                    + ' data-colors="' + anyAttribute(chartData, 'colors', chart.context, '') + '"'
-                    + ' role="application"></div>';
+                if(typeof alarm.lookup_dimensions !== 'undefined') {
+                    var d = alarm.lookup_dimensions.replace('|', ',');
+                    var x = d.split(',');
+                    if(x.length > 1)
+                        dimensions = 'of the sum of dimensions <code>' + alarm.lookup_dimensions + '</code> ';
+                    else
+                        dimensions = 'of all values of dimension <code>' + alarm.lookup_dimensions + '</code> ';
+                }
 
-                // console.log('         \------- ' + chart.id + ' (' + chart.priority + '): ' + chart.context  + ' height: ' + menus[menu].submenus[submenu].height);
+                return '<code>' + alarm.lookup_method + '</code> '
+                    + dimensions + ', of chart <code>' + alarm.chart + '</code>'
+                    + ', starting <code>' + frequency_text(alarm.lookup_after + alarm.lookup_before, true) + '</code> and up to <code>' + frequency_text(alarm.lookup_before, true) + '</code>'
+                    + ((alarm.lookup_options)?(', with options <code>' + alarm.lookup_options.replace(' ', ',&nbsp;') + '</code>'):'')
+                    + '.';
             }
 
-            head += '</div>';
-            shtml += head + chtml + '</div>';
-        }
+            function alarm_to_html(alarm, full) {
+                var chart = options.data.charts[alarm.chart];
 
-        mhead += '</div>';
-        sidebar += '</ul></li>';
-        html += mhead + shtml + '</div></div><hr role="separator"/>';
-    }
-
-    sidebar += '</ul>';
-    div.innerHTML = html;
-    document.getElementById('sidebar').innerHTML = sidebar;
-    finalizePage();
-}
-
-function renderChartsAndMenu(data) {
-    var menus = options.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]),
-                icon: menuIcon(charts[c]),
-                info: menuInfo(charts[c].menu),
-                height: menuHeight(charts[c].menu, options.chartsHeight)
-            };
-        }
+                var html = '<tr><td class="text-center" style="vertical-align:middle" width="40%"><b>' + alarm.chart + '</b><br/>&nbsp;<br/><embed src="' + NETDATA.alarms.server + '/api/v1/badge.svg?chart=' + alarm.chart + '&alarm=' + alarm.name + '&refresh=auto" type="image/svg+xml" height="20"/><br/>&nbsp;<br/><span style="font-size: 18px">' + alarm.info + '</span><br/>&nbsp;<br/>role: <b>' + alarm.recipient + '</b><br/>&nbsp;<br/><b><i class="fa fa-line-chart" aria-hidden="true"></i></b><small>&nbsp;&nbsp;<a href="#" onClick="NETDATA.alarms.scrollToChart(\'' + alarm.chart + '\'); $(\'#alarmsModal\').modal(\'hide\'); return false;">jump to chart</a></small></td>'
+                    + '<td><table class="table">'
+                    + ((typeof alarm.warn !== 'undefined')?('<tr><td width="10%" style="text-align:right">warning&nbsp;when</td><td><span style="font-family: monospace; color:#fe7d37; font-weight: bold;">' + alarm.warn + '</span></td></tr>'):'')
+                    + ((typeof alarm.crit !== 'undefined')?('<tr><td width="10%" style="text-align:right">critical&nbsp;when</td><td><span style="font-family: monospace; color: #e05d44; font-weight: bold;">' + alarm.crit + '</span></td></tr>'):'');
 
-        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)
-            };
-        }
+                if(full === true) {
+                        html += ((typeof alarm.lookup_after !== 'undefined')?('<tr><td width="10%" style="text-align:right">db&nbsp;lookup</td><td>' + alarm_lookup_explain(alarm, chart) + '</td></tr>'):'')
+                        + ((typeof alarm.calc !== 'undefined')?('<tr><td width="10%" style="text-align:right">calculation</td><td><span style="font-family: monospace;">' + alarm.calc + '</span></td></tr>'):'')
+                        + ((chart.green !== null)?('<tr><td width="10%" style="text-align:right">green&nbsp;threshold</td><td><code>' + chart.green + ' ' + chart.units + '</code></td></tr>'):'')
+                        + ((chart.red !== null)?('<tr><td width="10%" style="text-align:right">red&nbsp;threshold</td><td><code>' + chart.red + ' ' + chart.units + '</code></td></tr>'):'');
+                }
 
-        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;
+                var delay = '';
+                if((alarm.delay_up_duration > 0 || alarm.delay_down_duration > 0) && alarm.delay_multiplier != 0 && alarm.delay_max_duration > 0) {
+                    if(alarm.delay_up_duration == alarm.delay_down_duration) {
+                        delay += '<small><br/>hysteresis ' + frequency_text(alarm.delay_up_duration);
+                    }
+                    else {
+                        delay = '<small><br/>hysteresis ';
+                        if(alarm.delay_up_duration > 0) {
+                            delay += 'on&nbsp;escalation&nbsp;<code>' + frequency_text(alarm.delay_up_duration) + '</code>, ';
+                        }
+                        if(alarm.delay_down_duration > 0) {
+                            delay += 'on&nbsp;recovery&nbsp;<code>' + frequency_text(alarm.delay_down_duration) + '</code>, ';
+                        }
+                    }
+                    if(alarm.delay_multiplier != 1.0) {
+                        delay += 'multiplied&nbsp;by&nbsp;<code>' + alarm.delay_multiplier.toString() + '</code>';
+                        delay += ',&nbsp;up&nbsp;to&nbsp;<code>' + frequency_text(alarm.delay_max_duration) + '</code>';
+                    }
+                    delay += '</small>';
+                }
 
-        // index the chart in the menu/submenu
-        menus[charts[c].menu].submenus[charts[c].submenu].charts.push(charts[c]);
-    }
+                html += '<tr><td width="10%" style="text-align:right">check&nbsp;every</td><td>' + frequency_text(alarm.update_every) + '</td></tr>'
+                    + '<tr><td width="10%" style="text-align:right">execute</td><td><span style="font-family: monospace;">' + alarm.exec + '</span>' + delay + '</td></tr>'
+                    + '<tr><td width="10%" style="text-align:right">source</td><td><span style="font-family: monospace;">' + alarm.source + '</span></td></tr>'
+                    + '</table></td></tr>';
 
-    // 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] + ')';
+                return html;
             }
-            else {
-                menus[m].submenus[s].title = submenuTitle(m, s);
+
+            function alarm_family_show(id) {
+                var html = '<table class="table">';
+                var family = options.alarm_families[id];
+                var len = family.arr.length;
+                while(len--) {
+                    var alarm = family.arr[len];
+                    html += alarm_to_html(alarm, true);
+                }
+                html += '</table>';
+
+                $('#alarm_all_' + id.toString()).html(html);
             }
-        }
-    }
 
-    renderPage(menus, data);
-}
+            // find the proper family of each alarm
+            var now = new Date().getTime();
+            var x;
+            var count_active = 0;
+            var count_all = 0;
+            var families = {};
+            var families_sort = new Array();
+            for(x in data.alarms) {
+                var alarm = data.alarms[x];
+                var family = alarm.family;
+
+                // find the chart
+                var chart = options.data.charts[alarm.chart];
+                if(typeof chart === 'undefined')
+                    chart = options.data.charts_by_name[alarm.chart];
+
+                // not found - this should never happen!
+                if(typeof chart === 'undefined') {
+                    console.log('WARNING: alarm ' + x + ' is linked to chart ' + alarm.chart + ', which is not found in the list of chart got from the server.');
+                    chart = { priority: 9999999 };
+                }
+                else if(typeof chart.menu !== 'undefined' && typeof chart.submenu !== 'undefined')
+                    // the family based on the chart
+                    family = chart.menu + ' - ' + chart.submenu;
+
+                if(typeof families[family] === 'undefined') {
+                    families[family] = {
+                        name: family,
+                        arr: new Array(),
+                        priority: chart.priority
+                    };
+
+                    families_sort.push(families[family]);
+                }
+
+                if(chart.priority < families[family].priority)
+                    families[family].priority = chart.priority;
 
-// ----------------------------------------------------------------------------
+                families[family].arr.unshift(alarm);
+            }
 
-function alarmsUpdateModal() {
-    var active = '<h3>Raised Alarms</h3><table class="table">';
-    var all = '<h3>All Running Alarms</h3><div class="panel-group" id="alarms_all_accordion" role="tablist" aria-multiselectable="true">';
-    var log = '<h3>Alarm Log</h3><table class="table"><tr><th>When</th><th>Chart</th><th>Alarm</th><th>Status</th>';
-    var footer = '<hr/><a href="https://github.com/firehol/netdata/wiki/Generating-Badges" target="_blank">netdata badges</a> refresh automatically. Their color indicates the state of the alarm: <span style="color: #e05d44"><b>&nbsp;red&nbsp;</b></span> is critical, <span style="color:#fe7d37"><b>&nbsp;orange&nbsp;</b></span> is warning, <span style="color: #4c1"><b>&nbsp;bright green&nbsp;</b></span> is ok, <span style="color: #9f9f9f"><b>&nbsp;light grey&nbsp;</b></span> is undefined (i.e. no data or no status), <span style="color: #000"><b>&nbsp;black&nbsp;</b></span> is not initialized. You can copy and paste their URLs to embed them in any web page.<br/>netdata can send notifications for these alarms. Check <a href="https://github.com/firehol/netdata/blob/master/conf.d/health_alarm_notify.conf">this configuration file</a> for more information.';
+            // sort the families, like the dashboard menu does
+            var families_sorted = families_sort.sort(function (a, b) {
+                if (a.priority > b.priority) return -1;
+                if (a.priority < b.priority) return 1;
+                return 0;
+            });
 
-    NETDATA.alarms.get('all', function(data) {
-        options.alarm_families = new Array();
+            var fc = 0;
+            var len = families_sorted.length;
+            while(len--) {
+                var family = families_sorted[len].name;
+                var active_family_added = false;
+                var expanded = 'true';
+                var collapsed = '';
+                var cin = 'in';
+
+                if(fc !== 0) {
+                    all += "</table></div></div></div>";
+                    expanded = 'false';
+                    collapsed = 'class="collapsed"'
+                    cin = '';
+                }
 
-        alarmsCallback(data);
+                all += '<div class="panel panel-default"><div class="panel-heading" role="tab" id="alarm_all_heading_' + fc.toString() + '"><h4 class="panel-title"><a ' + collapsed + ' role="button" data-toggle="collapse" data-parent="#alarms_all_accordion" href="#alarm_all_' + fc.toString() + '" aria-expanded="' + expanded + '" aria-controls="alarm_all_' + fc.toString() + '">' + family.toString() + '</a></h4></div><div id="alarm_all_' + fc.toString() + '" class="panel-collapse collapse ' + cin + '" role="tabpanel" aria-labelledby="alarm_all_heading_' + fc.toString() + '" data-alarm-id="' + fc.toString() + '"><div class="panel-body" id="alarm_all_body_' + fc.toString() + '">';
 
-        if(data === null) {
-            document.getElementById('alarms_active').innerHTML =
-                    document.getElementById('alarms_all').innerHTML =
-                            document.getElementById('alarms_log').innerHTML =
-                                    'failed to load alarm data!';
-            return;
-        }
+                options.alarm_families[fc] = families[family];
 
-        function frequency_text(seconds, sfx) {
-            if(seconds === 0)
-                return 'now';
+                fc++;
 
-            var suffix = '';
-            if(seconds < 0) {
-                seconds = -seconds;
-                if(sfx) suffix = '&nbsp;ago';
+                var arr = families[family].arr;
+                var c = arr.length;
+                while(c--) {
+                    var alarm = arr[c];
+                    if(alarm.status === 'WARNING' || alarm.status === 'CRITICAL') {
+                        if(!active_family_added) {
+                            active_family_added = true;
+                            active += '<tr><th class="text-center" colspan="2"><h4>' + family + '</h4></th></tr>';
+                        }
+                        count_active++;
+                        active += alarm_to_html(alarm, true);
+                    }
+
+                    count_all++;
+                }
             }
+            active += "</table>";
+            if(families_sorted.length > 0) all += "</div></div></div>";
+            all += "</div>";
 
-            var hours = Math.floor(seconds / 3600);
-            seconds -= (hours * 3600);
+            if(!count_active)
+                active += "<h4>Everything is normal. No raised alarms.</h4>";
+            else
+                active += footer;
 
-            var minutes = Math.floor(seconds / 60);
-            seconds -= (minutes * 60);
+            if(!count_all)
+                all += "<h4>No alarms are running in this system.</h4>";
+            else
+                all += footer;
 
-            var txt = '';
-            
-            if(hours > 1) txt += hours.toString() + '&nbsp;hours';
-            else if(hours === 1) txt += hours.toString() + '&nbsp;hour';
+            document.getElementById('alarms_active').innerHTML = active;
+            document.getElementById('alarms_all').innerHTML = all;
 
-            if(hours > 0 && minutes > 0 && seconds == 0)
-                txt += '&nbsp;and&nbsp;';
-            else if(hours > 0 && minutes > 0 && seconds > 0)
-                txt += ',&nbsp;';
+            if(families_sorted.length > 0) alarm_family_show(0);
 
-            if(minutes > 1) txt += minutes.toString() + '&nbsp;minutes';
-            else if(minutes === 1) txt += minutes.toString() + '&nbsp;minute';
+            // register bootstrap events
+            $('#alarms_all_accordion').on('show.bs.collapse', function (d) {
+                var target = $(d.target);
+                var id = $(target).data('alarm-id');
+                alarm_family_show(id);
+            });
+            $('#alarms_all_accordion').on('hidden.bs.collapse', function (d) {
+                var target = $(d.target);
+                var id = $(target).data('alarm-id');
+                $('#alarm_all_' + id.toString()).html('');
+            });
 
-            if((minutes > 0 || minutes > 0) && seconds > 0)
-                txt += '&nbsp;and&nbsp;';
+            NETDATA.alarms.get_log(0, function(data) {
+                if(data === null) {
+                    document.getElementById('alarms_log').innerHTML =
+                            'failed to load alarm data!';
+                    return;
+                }
 
-            if(seconds > 1) txt += seconds.toString() + '&nbsp;seconds';
-            else if(seconds === 1) txt += seconds.toString() + '&nbsp;second';
+                var i = 0;
+                var len = data.length;
+                if(len > 50) len = 50;
+                while(i < len) {
+                    var time = new Date(data[i].when * 1000);
+                    log += '<tr><td>'
+                            + time.toLocaleDateString() + ' '
+                            + time.toLocaleTimeString() + '</td><td>'
+                            + data[i].chart.toString() + '</td><td>'
+                            + data[i].name.toString() + ' = ' + ((data[i].value !== null)?Math.floor(data[i].value):'NaN').toString() + ' ' + data[i].units.toString() + '</td><td>'
+                            + data[i].status.toString() + '</td></tr>';
+                    i++;
+                }
+                log += "</table>";
 
-            return txt + suffix;
-        }
+                if(i == 0)
+                    log += "<h4>No alarms have been logged in this system.</h4>";
 
-        function alarm_lookup_explain(alarm, chart) {
-            var dimensions = ' of all values ';
+                document.getElementById('alarms_log').innerHTML = log;
+            })
+        });
+    }
 
-            if(chart.dimensions.length > 1)
-                dimensions = ' of the sum of all dimensions ';
+    function alarmsCallback(data) {
+        var count = 0;
+        for(x in data.alarms) {
+            var alarm = data.alarms[x];
+            if(alarm.status === 'WARNING' || alarm.status === 'CRITICAL')
+                count++;
+        }
 
-            if(typeof alarm.lookup_dimensions !== 'undefined') {
-                var d = alarm.lookup_dimensions.replace('|', ',');
-                var x = d.split(',');
-                if(x.length > 1)
-                    dimensions = 'of the sum of dimensions <code>' + alarm.lookup_dimensions + '</code> ';
-                else
-                    dimensions = 'of all values of dimension <code>' + alarm.lookup_dimensions + '</code> ';
-            }
+        if(count > 0)
+            document.getElementById('alarms_count_badge').innerHTML = count.toString();
+        else
+            document.getElementById('alarms_count_badge').innerHTML = '';
+    }
 
-            return '<code>' + alarm.lookup_method + '</code> '
-                + dimensions + ', of chart <code>' + alarm.chart + '</code>'
-                + ', starting <code>' + frequency_text(alarm.lookup_after + alarm.lookup_before, true) + '</code> and up to <code>' + frequency_text(alarm.lookup_before, true) + '</code>'
-                + ((alarm.lookup_options)?(', with options <code>' + alarm.lookup_options.replace(' ', ',&nbsp;') + '</code>'):'')
-                + '.';
-        }
+    function initializeDynamicDashboard(netdata_url) {
+        if(typeof netdata_url === 'undefined' || netdata_url === null)
+            netdata_url = NETDATA.serverDefault;
 
-        function alarm_to_html(alarm, full) {
-            var chart = options.data.charts[alarm.chart];
+        // initialize clickable alarms
+        NETDATA.alarms.chart_div_offset = 100;
+        NETDATA.alarms.chart_div_id_prefix = 'chart_';
+        NETDATA.alarms.chart_div_animation_duration = 0;
 
-            var html = '<tr><td class="text-center" style="vertical-align:middle" width="40%"><b>' + alarm.chart + '</b><br/>&nbsp;<br/><embed src="' + NETDATA.alarms.server + '/api/v1/badge.svg?chart=' + alarm.chart + '&alarm=' + alarm.name + '&refresh=auto" type="image/svg+xml" height="20"/><br/>&nbsp;<br/><span style="font-size: 18px">' + alarm.info + '</span><br/>&nbsp;<br/>role: <b>' + alarm.recipient + '</b><br/>&nbsp;<br/><b><i class="fa fa-line-chart" aria-hidden="true"></i></b><small>&nbsp;&nbsp;<a href="#" onClick="NETDATA.alarms.scrollToChart(\'' + alarm.chart + '\'); $(\'#alarmsModal\').modal(\'hide\'); return false;">jump to chart</a></small></td>'
-                + '<td><table class="table">'
-                + ((typeof alarm.warn !== 'undefined')?('<tr><td width="10%" style="text-align:right">warning&nbsp;when</td><td><span style="font-family: monospace; color:#fe7d37; font-weight: bold;">' + alarm.warn + '</span></td></tr>'):'')
-                + ((typeof alarm.crit !== 'undefined')?('<tr><td width="10%" style="text-align:right">critical&nbsp;when</td><td><span style="font-family: monospace; color: #e05d44; font-weight: bold;">' + alarm.crit + '</span></td></tr>'):'');
+        NETDATA.pause(function() {
+            NETDATA.alarms.callback = alarmsCallback;
 
-            if(full === true) {
-                    html += ((typeof alarm.lookup_after !== 'undefined')?('<tr><td width="10%" style="text-align:right">db&nbsp;lookup</td><td>' + alarm_lookup_explain(alarm, chart) + '</td></tr>'):'')
-                    + ((typeof alarm.calc !== 'undefined')?('<tr><td width="10%" style="text-align:right">calculation</td><td><span style="font-family: monospace;">' + alarm.calc + '</span></td></tr>'):'')
-                    + ((chart.green !== null)?('<tr><td width="10%" style="text-align:right">green&nbsp;threshold</td><td><code>' + chart.green + ' ' + chart.units + '</code></td></tr>'):'')
-                    + ((chart.red !== null)?('<tr><td width="10%" style="text-align:right">red&nbsp;threshold</td><td><code>' + chart.red + ' ' + chart.units + '</code></td></tr>'):'');
-            }
+            // download all the charts the server knows
+            NETDATA.chartRegistry.downloadAll(netdata_url, function(data) {
+                if(data !== null) {
+                    options.hostname = data.hostname;
+                    options.data = data;
 
-            var delay = '';
-            if((alarm.delay_up_duration > 0 || alarm.delay_down_duration > 0) && alarm.delay_multiplier != 0 && alarm.delay_max_duration > 0) {
-                if(alarm.delay_up_duration == alarm.delay_down_duration) {
-                    delay += '<small><br/>hysteresis ' + frequency_text(alarm.delay_up_duration);
-                }
-                else {
-                    delay = '<small><br/>hysteresis ';
-                    if(alarm.delay_up_duration > 0) {
-                        delay += 'on&nbsp;escalation&nbsp;<code>' + frequency_text(alarm.delay_up_duration) + '</code>, ';
-                    }
-                    if(alarm.delay_down_duration > 0) {
-                        delay += 'on&nbsp;recovery&nbsp;<code>' + frequency_text(alarm.delay_down_duration) + '</code>, ';
-                    }
-                }
-                if(alarm.delay_multiplier != 1.0) {
-                    delay += 'multiplied&nbsp;by&nbsp;<code>' + alarm.delay_multiplier.toString() + '</code>';
-                    delay += ',&nbsp;up&nbsp;to&nbsp;<code>' + frequency_text(alarm.delay_max_duration) + '</code>';
-                }
-                delay += '</small>';
-            }
+                    // update the dashboard hostname
+                    document.getElementById('hostname').innerHTML = options.hostname;
+                    document.getElementById('hostname').href = NETDATA.serverDefault;
 
-            html += '<tr><td width="10%" style="text-align:right">check&nbsp;every</td><td>' + frequency_text(alarm.update_every) + '</td></tr>'
-                + '<tr><td width="10%" style="text-align:right">execute</td><td><span style="font-family: monospace;">' + alarm.exec + '</span>' + delay + '</td></tr>'
-                + '<tr><td width="10%" style="text-align:right">source</td><td><span style="font-family: monospace;">' + alarm.source + '</span></td></tr>'
-                + '</table></td></tr>';
+                    // update the dashboard title
+                    document.title = options.hostname + ' netdata dashboard';
 
-            return html;
-        }
+                    // close the splash screen
+                    $("#loadOverlay").css("display","none");
 
-        function alarm_family_show(id) {
-            var html = '<table class="table">';
-            var family = options.alarm_families[id];
-            var len = family.arr.length;
-            while(len--) {
-                var alarm = family.arr[len];
-                html += alarm_to_html(alarm, true);
-            }
-            html += '</table>';
+                    // create a chart_by_name index
+                    data.charts_by_name = {};
+                    var charts = data.charts;
+                    var x;
+                    for(x in charts) {
+                        var chart = charts[x];
+                        data.charts_by_name[chart.name] = chart;
+                    }
 
-            $('#alarm_all_' + id.toString()).html(html);
-        }
+                    // render all charts
+                    renderChartsAndMenu(data);
+                }
+            });
+        });
+    }
 
-        // find the proper family of each alarm
-        var now = new Date().getTime();
-        var x;
-        var count_active = 0;
-        var count_all = 0;
-        var families = {};
-        var families_sort = new Array();
-        for(x in data.alarms) {
-            var alarm = data.alarms[x];
-            var family = alarm.family;
+    // ----------------------------------------------------------------------------
 
-            // find the chart
-            var chart = options.data.charts[alarm.chart];
-            if(typeof chart === 'undefined')
-                chart = options.data.charts_by_name[alarm.chart];
+    function versionLog(msg) {
+        document.getElementById('versionCheckLog').innerHTML = msg;
+    }
 
-            // not found - this should never happen!
-            if(typeof chart === 'undefined') {
-                console.log('WARNING: alarm ' + x + ' is linked to chart ' + alarm.chart + ', which is not found in the list of chart got from the server.');
-                chart = { priority: 9999999 };
-            }
-            else if(typeof chart.menu !== 'undefined' && typeof chart.submenu !== 'undefined')
-                // the family based on the chart
-                family = chart.menu + ' - ' + chart.submenu;
-
-            if(typeof families[family] === 'undefined') {
-                families[family] = {
-                    name: family,
-                    arr: new Array(),
-                    priority: chart.priority
-                };
+    function getNetdataVersion(callback) {
+        versionLog('Downloading installed version info from netdata...');
 
-                families_sort.push(families[family]);
+        $.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 {
+                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);
+        });
+    }
 
-            if(chart.priority < families[family].priority)
-                families[family].priority = chart.priority;
+    function getGithubLatestCommit(callback) {
+        versionLog('Downloading latest version info from github...');
 
-            families[family].arr.unshift(alarm);
-        }
+        $.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);
+        });
+    }
+
+    function checkForUpdate(callback) {
+        getNetdataVersion(function(sha1) {
+            if(sha1 === null) callback(null, null);
 
-        // sort the families, like the dashboard menu does
-        var families_sorted = families_sort.sort(function (a, b) {
-            if (a.priority > b.priority) return -1;
-            if (a.priority < b.priority) return 1;
-            return 0;
+            getGithubLatestCommit(function(sha2) {
+                callback(sha1, sha2);
+            });
         });
 
-        var fc = 0;
-        var len = families_sorted.length;
-        while(len--) {
-            var family = families_sorted[len].name;
-            var active_family_added = false;
-            var expanded = 'true';
-            var collapsed = '';
-            var cin = 'in';
-
-            if(fc !== 0) {
-                all += "</table></div></div></div>";
-                expanded = 'false';
-                collapsed = 'class="collapsed"'
-                cin = '';
-            }
+        return null;
+    }
 
-            all += '<div class="panel panel-default"><div class="panel-heading" role="tab" id="alarm_all_heading_' + fc.toString() + '"><h4 class="panel-title"><a ' + collapsed + ' role="button" data-toggle="collapse" data-parent="#alarms_all_accordion" href="#alarm_all_' + fc.toString() + '" aria-expanded="' + expanded + '" aria-controls="alarm_all_' + fc.toString() + '">' + family.toString() + '</a></h4></div><div id="alarm_all_' + fc.toString() + '" class="panel-collapse collapse ' + cin + '" role="tabpanel" aria-labelledby="alarm_all_heading_' + fc.toString() + '" data-alarm-id="' + fc.toString() + '"><div class="panel-body" id="alarm_all_body_' + fc.toString() + '">';
+    function notifyForUpdate(force) {
+        versionLog('<p>checking for updates...</p>');
 
-            options.alarm_families[fc] = families[family];
+        var now = new Date().getTime();
 
-            fc++;
+        if(typeof force === 'undefined' || force !== true) {
+            var last = loadLocalStorage('last_update_check');
 
-            var arr = families[family].arr;
-            var c = arr.length;
-            while(c--) {
-                var alarm = arr[c];
-                if(alarm.status === 'WARNING' || alarm.status === 'CRITICAL') {
-                    if(!active_family_added) {
-                        active_family_added = true;
-                        active += '<tr><th class="text-center" colspan="2"><h4>' + family + '</h4></th></tr>';
-                    }
-                    count_active++;
-                    active += alarm_to_html(alarm, true);
-                }
+            if(typeof last === 'string')
+                last = parseInt(last);
+            else
+                last = 0;
 
-                count_all++;
+            if(now - last < 3600000 * 8) {
+                // no need to check it - too soon
+                return;
             }
         }
-        active += "</table>";
-        if(families_sorted.length > 0) all += "</div></div></div>";
-        all += "</div>";
 
-        if(!count_active)
-            active += "<h4>Everything is normal. No raised alarms.</h4>";
-        else
-            active += footer;
+        checkForUpdate(function(sha1, sha2) {
+            var save = false;
 
-        if(!count_all)
-            all += "<h4>No alarms are running in this system.</h4>";
-        else
-            all += footer;
+            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();
 
-        document.getElementById('alarms_active').innerHTML = active;
-        document.getElementById('alarms_all').innerHTML = all;
+                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>');
 
-        if(families_sorted.length > 0) alarm_family_show(0);
+                document.getElementById('update_badge').innerHTML = '!';
+            }
 
-        // register bootstrap events
-        $('#alarms_all_accordion').on('show.bs.collapse', function (d) {
-            var target = $(d.target);
-            var id = $(target).data('alarm-id');
-            alarm_family_show(id);
-        });
-        $('#alarms_all_accordion').on('hidden.bs.collapse', function (d) {
-            var target = $(d.target);
-            var id = $(target).data('alarm-id');
-            $('#alarm_all_' + id.toString()).html('');
+            if(save)
+                saveLocalStorage('last_update_check', now.toString());
         });
+    }
 
-        NETDATA.alarms.get_log(0, function(data) {
-            if(data === null) {
-                document.getElementById('alarms_log').innerHTML =
-                        'failed to load alarm data!';
-                return;
+    // ----------------------------------------------------------------------------
+
+    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();
+
+        if(urlOptions.pan_and_zoom === true)
+            NETDATA.globalPanAndZoom.setMaster(NETDATA.options.targets[0], urlOptions.after, urlOptions.before);
+
+        // ------------------------------------------------------------------------
+        // https://github.com/viralpatel/jquery.shorten/blob/master/src/jquery.shorten.js
+        $.fn.shorten = function(settings) {
+            "use strict";
+
+            var config = {
+                showChars: 750,
+                minHideChars: 10,
+                ellipsesText: "...",
+                moreText: '<i class="fa fa-expand" aria-hidden="true"></i> show more information',
+                lessText: '<i class="fa fa-compress" aria-hidden="true"></i> show less information',
+                onLess: function() { NETDATA.onscroll(); },
+                onMore: function() { NETDATA.onscroll(); },
+                errMsg: null,
+                force: false
+            };
+
+            if (settings) {
+                $.extend(config, settings);
             }
 
-            var i = 0;
-            var len = data.length;
-            if(len > 50) len = 50;
-            while(i < len) {
-                var time = new Date(data[i].when * 1000);
-                log += '<tr><td>'
-                        + time.toLocaleDateString() + ' '
-                        + time.toLocaleTimeString() + '</td><td>'
-                        + data[i].chart.toString() + '</td><td>'
-                        + data[i].name.toString() + ' = ' + ((data[i].value !== null)?Math.floor(data[i].value):'NaN').toString() + ' ' + data[i].units.toString() + '</td><td>'
-                        + data[i].status.toString() + '</td></tr>';
-                i++;
+            if ($(this).data('jquery.shorten') && !config.force) {
+                return false;
             }
-            log += "</table>";
+            $(this).data('jquery.shorten', true);
+
+            $(document).off("click", '.morelink');
+
+            $(document).on({
+                click: function() {
+
+                    var $this = $(this);
+                    if ($this.hasClass('less')) {
+                        $this.removeClass('less');
+                        $this.html(config.moreText);
+                        $this.parent().prev().animate({'height':'0'+'%'}, 0, function () { $this.parent().prev().prev().show(); }).hide(0, function() {
+                            config.onLess();
+                        });
+
+                    } else {
+                        $this.addClass('less');
+                        $this.html(config.lessText);
+                        $this.parent().prev().animate({'height':'100'+'%'}, 0, function () { $this.parent().prev().prev().hide(); }).show(0, function() {
+                            config.onMore();
+                        });
+                    }
+                    return false;
+                }
+            }, '.morelink');
 
-            if(i == 0)
-                log += "<h4>No alarms have been logged in this system.</h4>";
+            return this.each(function() {
+                var $this = $(this);
 
-            document.getElementById('alarms_log').innerHTML = log;
-        })
-    });
-}
+                var content = $this.html();
+                var contentlen = $this.text().length;
+                if (contentlen > config.showChars + config.minHideChars) {
+                    var c = content.substr(0, config.showChars);
+                    if (c.indexOf('<') >= 0) // If there's HTML don't want to cut it
+                    {
+                        var inTag = false; // I'm in a tag?
+                        var bag = ''; // Put the characters to be shown here
+                        var countChars = 0; // Current bag size
+                        var openTags = []; // Stack for opened tags, so I can close them later
+                        var tagName = null;
+
+                        for (var i = 0, r = 0; r <= config.showChars; i++) {
+                            if (content[i] == '<' && !inTag) {
+                                inTag = true;
+
+                                // This could be "tag" or "/tag"
+                                tagName = content.substring(i + 1, content.indexOf('>', i));
+
+                                // If its a closing tag
+                                if (tagName[0] == '/') {
+
+
+                                    if (tagName != '/' + openTags[0]) {
+                                        config.errMsg = 'ERROR en HTML: the top of the stack should be the tag that closes';
+                                    } else {
+                                        openTags.shift(); // Pops the last tag from the open tag stack (the tag is closed in the retult HTML!)
+                                    }
 
-function alarmsCallback(data) {
-    var count = 0;
-    for(x in data.alarms) {
-        var alarm = data.alarms[x];
-        if(alarm.status === 'WARNING' || alarm.status === 'CRITICAL')
-            count++;
-    }
+                                } else {
+                                    // There are some nasty tags that don't have a close tag like <br/>
+                                    if (tagName.toLowerCase() != 'br') {
+                                        openTags.unshift(tagName); // Add to start the name of the tag that opens
+                                    }
+                                }
+                            }
+                            if (inTag && content[i] == '>') {
+                                inTag = false;
+                            }
 
-    if(count > 0)
-        document.getElementById('alarms_count_badge').innerHTML = count.toString();
-    else
-        document.getElementById('alarms_count_badge').innerHTML = '';
-}
+                            if (inTag) { bag += content.charAt(i); } // Add tag name chars to the result
+                            else {
+                                r++;
+                                if (countChars <= config.showChars) {
+                                    bag += content.charAt(i); // Fix to ie 7 not allowing you to reference string characters using the []
+                                    countChars++;
+                                } else // Now I have the characters needed
+                                {
+                                    if (openTags.length > 0) // I have unclosed tags
+                                    {
+                                        //console.log('They were open tags');
+                                        //console.log(openTags);
+                                        for (j = 0; j < openTags.length; j++) {
+                                            //console.log('Cierro tag ' + openTags[j]);
+                                            bag += '</' + openTags[j] + '>'; // Close all tags that were opened
+
+                                            // You could shift the tag from the stack to check if you end with an empty stack, that means you have closed all open tags
+                                        }
+                                        break;
+                                    }
+                                }
+                            }
+                        }
+                        c = $('<div/>').html(bag + '<span class="ellip">' + config.ellipsesText + '</span>').html();
+                    }else{
+                        c+=config.ellipsesText;
+                    }
 
-function initializeDynamicDashboard(netdata_url) {
-    if(typeof netdata_url === 'undefined' || netdata_url === null)
-        netdata_url = NETDATA.serverDefault;
+                    var html = '<div class="shortcontent">' + c +
+                            '</div><div class="allcontent">' + content +
+                            '</div><span><a href="javascript://nop/" class="morelink">' + config.moreText + '</a></span>';
 
-    // initialize clickable alarms
-    NETDATA.alarms.chart_div_offset = 100;
-    NETDATA.alarms.chart_div_id_prefix = 'chart_';
-    NETDATA.alarms.chart_div_animation_d0uration = 0;
+                    $this.html(html);
+                    $this.find(".allcontent").hide(); // Hide all text
+                    $('.shortcontent p:last', $this).css('margin-bottom', 0); //Remove bottom margin on last paragraph as it's likely shortened
+                }
+            });
 
-    NETDATA.pause(function() {
-        $("#loadOverlay").css("display","none");
+        };
+        $(".chart-message").shorten();
+        // ------------------------------------------------------------------------
 
-        NETDATA.alarms.callback = alarmsCallback;
+        // callback for us to track PanAndZoom operations
+        NETDATA.globalPanAndZoom.callback = netdataPanAndZoomCallback;
 
-        // download all the charts the server knows
-        NETDATA.chartRegistry.downloadAll(netdata_url, function(data) {
+        // let it run (update the charts)
+        NETDATA.unpause();
 
-            if(data !== null) {
-                options.hostname = data.hostname;
-                options.data = data;
+        // check if we have to jump to a specific section
+        scrollToId(urlOptions.hash.replace('#',''));
 
-                // create a chart_by_name index
-                data.charts_by_name = {};
-                var charts = data.charts;
-                var x;
-                for(x in charts) {
-                    var chart = charts[x];
-                    data.charts_by_name[chart.name] = chart;
-                }
+        if(urlOptions.chart !== null) {
+            NETDATA.alarms.scrollToChart(urlOptions.chart);
+            //urlOptions.hash = '#' + NETDATA.name2id('menu_' + charts[c].menu + '_submenu_' + charts[c].submenu);
+            //urlOptions.hash = '#chart_' + NETDATA.name2id(urlOptions.chart);
+            //console.log('hash = ' + urlOptions.hash);
+        }
 
-                // update the dashboard hostname
-                document.getElementById('hostname').innerHTML = options.hostname;
-                document.getElementById('hostname').href = NETDATA.serverDefault;
+        /* activate bootstrap sidebar (affix) */
+        $('#sidebar').affix({
+            offset: {
+                top: (isdemo())?150:0,
+                bottom: 0
+            }
+        });
 
-                // update the dashboard title
-                document.title = options.hostname + ' netdata dashboard';
+        /* fix scrolling of very long affix lists
+           http://stackoverflow.com/questions/21691585/bootstrap-3-1-0-affix-too-long
+         */
+        $('#sidebar').on('affixed.bs.affix', function() {
+            $(this).removeAttr('style');
+        });
 
-                // render all charts
-                renderChartsAndMenu(data);
-            }
+        /* activate bootstrap scrollspy (needed for sidebar) */
+        $(document.body).scrollspy({
+            target: '#sidebar',
+            offset: $(window).height() / 5 // controls the diff of the <hX> element to the top, to select it
         });
-    });
-}
-
-// ----------------------------------------------------------------------------
-
-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 {
-            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);
-    });
-}
-
-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);
-    });
-}
-
-function checkForUpdate(callback) {
-    getNetdataVersion(function(sha1) {
-        if(sha1 === null) callback(null, null);
-
-        getGithubLatestCommit(function(sha2) {
-            callback(sha1, sha2);
+
+        // change the URL based on the current position of the screen
+        $('#sidebar').on('activate.bs.scrollspy', function (e) {
+            // console.log(e);
+            var el = $(e.target);
+            //if(el.find('ul').size() == 0) {
+            var hash = el.find('a').attr('href');
+            if(typeof hash === 'string' && hash.substring(0, 1) === '#' && urlOptions.hash.startsWith(hash + '_submenu_') === false) {
+                urlOptions.hash = hash;
+                //console.log(urlOptions.hash);
+                netdataHashUpdate();
+            }
+            //else console.log('hash: not accepting ' + hash);
+            //}
+            //else console.log('el.find(): not found');
         });
-    });
 
-    return null;
-}
+        document.getElementById('footer').style.display = 'block';
 
-function notifyForUpdate(force) {
-    versionLog('<p>checking for updates...</p>');
+        var update_options_modal = function() {
+            // console.log('update_options_modal');
 
-    var now = new Date().getTime();
+            var sync_option = function(option) {
+                var self = $('#' + option);
 
-    if(typeof force === 'undefined' || force !== true) {
-        var last = loadLocalStorage('last_update_check');
+                if(self.prop('checked') !== NETDATA.getOption(option)) {
+                    // console.log('switching ' + option.toString());
+                    self.bootstrapToggle(NETDATA.getOption(option)?'on':'off');
+                }
+            }
 
-        if(typeof last === 'string')
-            last = parseInt(last);
-        else
-            last = 0;
+            var theme_sync_option = function(option) {
+                var self = $('#' + option);
 
-        if(now - last < 3600000 * 8) {
-            // no need to check it - too soon
-            return;
-        }
-    }
+                self.bootstrapToggle(netdataTheme === 'slate'?'on':'off');
+            }
 
-    checkForUpdate(function(sha1, sha2) {
-        var save = false;
+            sync_option('eliminate_zero_dimensions');
+            sync_option('destroy_on_hide');
+            sync_option('parallel_refresher');
+            sync_option('concurrent_refreshes');
+            sync_option('sync_selection');
+            sync_option('sync_pan_and_zoom');
+            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();
+            }
+            else {
+                $('#concurrent_refreshes_row').show();
+            }
+        };
+        NETDATA.setOption('setOptionCallback', update_options_modal);
+
+        // handle options changes
+        $('#eliminate_zero_dimensions').change(function()       { NETDATA.setOption('eliminate_zero_dimensions', $(this).prop('checked')); });
+        $('#destroy_on_hide').change(function()                 { NETDATA.setOption('destroy_on_hide', $(this).prop('checked')); });
+        $('#parallel_refresher').change(function()              { NETDATA.setOption('parallel_refresher', $(this).prop('checked')); });
+        $('#concurrent_refreshes').change(function()            { NETDATA.setOption('concurrent_refreshes', $(this).prop('checked')); });
+        $('#sync_selection').change(function()                  { NETDATA.setOption('sync_selection', $(this).prop('checked')); });
+        $('#sync_pan_and_zoom').change(function()               { NETDATA.setOption('sync_pan_and_zoom', $(this).prop('checked')); });
+        $('#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')); });
+        $('#show_help').change(function()                       {
+            urlOptions.help = $(this).prop('checked');
+            NETDATA.setOption('show_help', urlOptions.help);
+            netdataReload();
+        });
 
-        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();
+        // this has to be the last
+        // it reloads the page
+        $('#netdata_theme_control').change(function() {
+            urlOptions.theme = $(this).prop('checked')?'slate':'white';
+            if(setTheme(urlOptions.theme))
+                netdataReload();
+        });
 
-            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>');
+        $('#updateModal').on('shown.bs.modal', function() {
+            notifyForUpdate(true);
+        });
 
-            document.getElementById('update_badge').innerHTML = '!';
-        }
+        $('#alarmsModal').on('shown.bs.modal', function() {
+            NETDATA.pause(alarmsUpdateModal);
+        });
 
-        if(save)
-            saveLocalStorage('last_update_check', now.toString());
-    });
-}
-
-// ----------------------------------------------------------------------------
-
-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();
-
-    if(urlOptions.pan_and_zoom === true)
-        NETDATA.globalPanAndZoom.setMaster(NETDATA.options.targets[0], urlOptions.after, urlOptions.before);
-
-    // ------------------------------------------------------------------------
-    // https://github.com/viralpatel/jquery.shorten/blob/master/src/jquery.shorten.js
-    $.fn.shorten = function(settings) {
-        "use strict";
-
-        var config = {
-            showChars: 750,
-            minHideChars: 10,
-            ellipsesText: "...",
-            moreText: '<i class="fa fa-expand" aria-hidden="true"></i> show more information',
-            lessText: '<i class="fa fa-compress" aria-hidden="true"></i> show less information',
-            onLess: function() { NETDATA.onscroll(); },
-            onMore: function() { NETDATA.onscroll(); },
-            errMsg: null,
-            force: false
-        };
+        $('#alarmsModal').on('hidden.bs.modal', function() {
+            NETDATA.unpause();
+            document.getElementById('alarms_active').innerHTML =
+                    document.getElementById('alarms_all').innerHTML =
+                    document.getElementById('alarms_log').innerHTML =
+                            'loading...';
+        });
 
-        if (settings) {
-            $.extend(config, settings);
-        }
+        $('#deleteRegistryModal').on('hidden.bs.modal', function() {
+            deleteRegistryGuid = null;
+        });
+
+        if(isdemo()) {
+            if(urlOptions.nowelcome !== true) {
+                setTimeout(function() {
+                    $('#welcomeModal').modal();
+                }, 1000);
+            }
 
-        if ($(this).data('jquery.shorten') && !config.force) {
-            return false;
+            // google analytics when this is used for the home page of the demo sites
+            // this does not run on user's installations
+            setTimeout(function() {
+                (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+                (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+                m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+                })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
+
+                ga('create', 'UA-64295674-3', 'auto');
+                ga('send', 'pageview');
+            }, 2000);
         }
-        $(this).data('jquery.shorten', true);
+        else notifyForUpdate();
 
-        $(document).off("click", '.morelink');
+        if(urlOptions.show_alarms === true)
+            setTimeout(function() { $('#alarmsModal').modal('show'); }, 1000);
+    }
 
-        $(document).on({
-            click: function() {
+    function resetDashboardOptions() {
+        var help = NETDATA.options.current.show_help;
 
-                var $this = $(this);
-                if ($this.hasClass('less')) {
-                    $this.removeClass('less');
-                    $this.html(config.moreText);
-                    $this.parent().prev().animate({'height':'0'+'%'}, 0, function () { $this.parent().prev().prev().show(); }).hide(0, function() {
-                        config.onLess();
-                    });
-
-                } else {
-                    $this.addClass('less');
-                    $this.html(config.lessText);
-                    $this.parent().prev().animate({'height':'100'+'%'}, 0, function () { $this.parent().prev().prev().hide(); }).show(0, function() {
-                        config.onMore();
-                    });
-                }
-                return false;
-            }
-        }, '.morelink');
+        NETDATA.resetOptions();
+        if(setTheme('slate'))
+            netdataReload();
 
-        return this.each(function() {
-            var $this = $(this);
+        if(help !== NETDATA.options.current.show_help)
+            netdataReload();
+    }
 
-            var content = $this.html();
-            var contentlen = $this.text().length;
-            if (contentlen > config.showChars + config.minHideChars) {
-                var c = content.substr(0, config.showChars);
-                if (c.indexOf('<') >= 0) // If there's HTML don't want to cut it
-                {
-                    var inTag = false; // I'm in a tag?
-                    var bag = ''; // Put the characters to be shown here
-                    var countChars = 0; // Current bag size
-                    var openTags = []; // Stack for opened tags, so I can close them later
-                    var tagName = null;
+    // callback to add the dashboard info to the
+    // parallel javascript downloader in netdata
+    var netdataPrepCallback = function() {
+        NETDATA.requiredJs.push({
+            url: NETDATA.serverDefault + 'dashboard_info.js',
+            isAlreadyLoaded: function() { return false; }
+        })
+    }
 
-                    for (var i = 0, r = 0; r <= config.showChars; i++) {
-                        if (content[i] == '<' && !inTag) {
-                            inTag = true;
+    // our entry point
+    var netdataCallback = initializeDynamicDashboard;
 
-                            // This could be "tag" or "/tag"
-                            tagName = content.substring(i + 1, content.indexOf('>', i));
+</script>
 
-                            // If its a closing tag
-                            if (tagName[0] == '/') {
+<body data-spy="scroll" data-target="#sidebar">
+    <div id="loadOverlay" class="loadOverlay" style="background-color: #888; color: #888;">
+        netdata<br/><div style="font-size: 3vh;">Real-time performance monitoring, done right!</div>
+    </div>
+    <script type="text/javascript">
+        // change the loadOverlay colors ASAP to match the theme
+        document.getElementById('loadOverlay').style = (urlOptions.theme === 'slate')?"background-color:#272b30; color: #373b40;":"background-color:#fff; color: #ddd;";
+    </script>
+    <nav class="navbar navbar-default navbar-fixed-top" role="banner">
+        <div class="container">
+            <nav id="mynetdata_nav" class="collapse navbar-collapse navbar-left hidden-sm hidden-xs" role="navigation" style="padding-right: 20px;">
+                <ul class="nav navbar-nav">
+                    <li class="dropdown">
+                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="current_view">my-netdata <strong class="caret"></strong></a>
+                        <ul class="dropdown-menu scrollable-menu inpagemenu multi-column columns-2" role="menu">
+                            <div class="row">
+                                <div class="col-sm-6" style="width: 85%; padding-right: 0;">
+                                    <ul id="mynetdata_servers" class="multi-column-dropdown">
+                                        <li><a href="#" onclick="return false;" style="color: #999;">loading...</a></li>
+                                    </ul>
+                                </div>
+                                <div class="col-sm-3 hidden-xs" style="width: 15%; padding-left: 0;">
+                                    <ul id="mynetdata_actions1" class="multi-column-dropdown">
+                                    <li style="color: #999;">&nbsp;</li>
+                                    </ul>
+                                </div>
+                            </div>
+                        </ul>
+                    </li>
+                </ul>
+            </nav>
+            <div class="navbar-header">
+                <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".navbar-collapse">
+                    <span class="sr-only">Toggle navigation</span>
+                    <span class="icon-bar"></span>
+                    <span class="icon-bar"></span>
+                    <span class="icon-bar"></span>
+                </button>
+                <a href="/" class="navbar-brand" id="hostname" title="reload the dashboard">netdata</a>
+            </div>
+            <nav class="collapse navbar-collapse navbar-right" role="navigation">
+                <ul class="nav navbar-nav">
+                    <li><a href="#" class="btn" data-toggle="modal" data-target="#alarmsModal" title="alarms"><i class="fa fa-bell"></i></span>&nbsp;<span class="hidden-sm">Alarms&nbsp;</span><span id="alarms_count_badge" class="badge"></a></li>
+                    <li><a href="#" class="btn" data-toggle="modal" data-target="#optionsModal" title="dashboard settings"><i class="fa fa-sliders"></i>&nbsp;<span class="hidden-sm">Settings</span></a></li>
+                    <li><a href="https://github.com/firehol/netdata/wiki" class="btn" target="_blank" title="netdata community"><i class="fa fa-github"></i>&nbsp;<span class="hidden-sm hidden-md">Community</span></a></li>
+                    <li class="hidden-sm" id="updateButton"><a href="#" class="btn" data-toggle="modal" data-target="#updateModal" title="check for update"><i class="fa fa-cloud-download"></i><span id="update_badge" class="badge"></span>&nbsp;<span class="hidden-sm hidden-md">Update</span></a></li>
+                    <li class="hidden-sm"><a href="#" class="btn" data-toggle="modal" data-target="#helpModal" title="dashboard help"><i class="fa fa-question-circle"></i>&nbsp;<span class="hidden-sm hidden-md">Help</span></a></li>
+                    <!--
+                    <li class="dropdown hidden-md hidden-lg hidden-xs">
+                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="current_view">Menu <strong class="caret"></strong></a>
+                        <ul class="dropdown-menu scrollable-menu inpagemenu" role="menu">
+                            <li><a href="#" class="btn" data-toggle="modal" data-target="#alarmsModal"><i class="fa fa-bell"></i> alarms</a></li>
+                            <li><a href="#" class="btn" data-toggle="modal" data-target="#optionsModal"><i class="fa fa-sliders"></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><a href="#" class="btn" data-toggle="modal" data-target="#helpModal"><i class="fa fa-question-circle"></i> help</a></li>
+                        </ul>
+                    </li>
+                    -->
+                    <li class="dropdown hidden-sm hidden-md hidden-lg">
+                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="current_view">my-netdata <strong class="caret"></strong></a>
+                        <ul id="mynetdata_servers2" class="dropdown-menu scrollable-menu inpagemenu" role="menu">
+                            <li><a href="#" onclick="return false;" style="color: #999;">loading...</a></li>
+                        </ul>
+                    </li>
+                </ul>
+            </nav>
+    </nav>
+        </div>
+    </nav>
 
+    <div id="masthead" style="display: none;">
+        <div class="container">
+            <div class="row">
+                <div class="col-md-7">
+                    <h1>Netdata
+                        <p class="lead">Real-time performance monitoring, in the greatest possible detail</p>
+                    </h1>
+                </div>
+                <div class="col-md-5">
+                    <div class="well well-lg">
+                        <div class="row">
+                        <div class="col-md-6">
+                            <b>Drag</b> charts to pan.
+                            <b>Shift + wheel</b> on them, to zoom in and out.
+                            <b>Double-click</b> on them, to reset.
+                            <b>Hover</b> on them too!
+                            </div>
+                        <div class="col-md-6">
+                            <div data-netdata="system.intr" data-chart-library="dygraph" data-dygraph-theme="sparkline" data-dygraph-type="line" data-dygraph-strokewidth="3" data-dygraph-smooth="true" data-dygraph-highlightcirclesize="6" data-after="-90" data-height="60px" data-colors="#C66"></div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
 
-                                if (tagName != '/' + openTags[0]) {
-                                    config.errMsg = 'ERROR en HTML: the top of the stack should be the tag that closes';
-                                } else {
-                                    openTags.shift(); // Pops the last tag from the open tag stack (the tag is closed in the retult HTML!)
-                                }
+    <div class="container">
+        <div class="row">
+            <div class="charts-body" role="main">
+                <div id="charts_div"></div>
+            </div>
+            <div class="sidebar-body hidden-xs hidden-sm" role="complementary">
+                <nav class="dashboard-sidebar hidden-print hidden-xs hidden-sm" id="sidebar" role="menu"></nav>
+            </div>
+        </div>
+    </div>
 
-                            } else {
-                                // There are some nasty tags that don't have a close tag like <br/>
-                                if (tagName.toLowerCase() != 'br') {
-                                    openTags.unshift(tagName); // Add to start the name of the tag that opens
-                                }
-                            }
-                        }
-                        if (inTag && content[i] == '>') {
-                            inTag = false;
-                        }
+    <div id="footer" class="container" style="display: none;">
+        <div class="row">
+            <div class="col-md-10" role="main">
+                <div class="p">
+                    <big><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></big><br/>
+                    <i class="fa fa-copyright"></i> Copyright 2016, Costa Tsaousis.<br/>
+                    Released under <a href="http://www.gnu.org/licenses/gpl-3.0.en.html" target="_blank">GPL v3 or later</a>.<br/>
+                </div>
+                <div class="p">
+                    <small>
+                        <a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a> re-distributes these software tools:
 
-                        if (inTag) { bag += content.charAt(i); } // Add tag name chars to the result
-                        else {
-                            r++;
-                            if (countChars <= config.showChars) {
-                                bag += content.charAt(i); // Fix to ie 7 not allowing you to reference string characters using the []
-                                countChars++;
-                            } else // Now I have the characters needed
-                            {
-                                if (openTags.length > 0) // I have unclosed tags
-                                {
-                                    //console.log('They were open tags');
-                                    //console.log(openTags);
-                                    for (j = 0; j < openTags.length; j++) {
-                                        //console.log('Cierro tag ' + openTags[j]);
-                                        bag += '</' + openTags[j] + '>'; // Close all tags that were opened
+                        <i class="fa fa-circle"></i> The excellent <a href="http://dygraphs.com/" target="_blank">Dygraphs.com</a> web chart library,
+                        <i class="fa fa-copyright"></i> Copyright 2009, Dan Vanderkam, <a href="http://dygraphs.com/legal.html" target="_blank">MIT License</a>
 
-                                        // You could shift the tag from the stack to check if you end with an empty stack, that means you have closed all open tags
-                                    }
-                                    break;
-                                }
-                            }
-                        }
-                    }
-                    c = $('<div/>').html(bag + '<span class="ellip">' + config.ellipsesText + '</span>').html();
-                }else{
-                    c+=config.ellipsesText;
-                }
+                        <i class="fa fa-circle"></i> <a href="http://omnipotent.net/jquery.sparkline/" target="_blank">jQuery Sparklines</a> web chart library,
+                        <i class="fa fa-copyright"></i> Copyright 2009-2012, Splunk Inc., <a href="http://opensource.org/licenses/BSD-3-Clause" target="_blank">New BSD License</a>
 
-                var html = '<div class="shortcontent">' + c +
-                        '</div><div class="allcontent">' + content +
-                        '</div><span><a href="javascript://nop/" class="morelink">' + config.moreText + '</a></span>';
+                        <i class="fa fa-circle"></i> <a href="http://benpickles.github.io/peity/" target="_blank">Peity</a> web chart library,
+                        <i class="fa fa-copyright"></i> Copyright 2009-2015, Ben Pickles, <a href="https://github.com/benpickles/peity/blob/master/MIT-LICENCE" target="_blank">MIT License</a>
 
-                $this.html(html);
-                $this.find(".allcontent").hide(); // Hide all text
-                $('.shortcontent p:last', $this).css('margin-bottom', 0); //Remove bottom margin on last paragraph as it's likely shortened
-            }
-        });
+                        <i class="fa fa-circle"></i> <a href="https://rendro.github.io/easy-pie-chart/" target="_blank">Easy Pie Chart</a> web chart library,
+                        <i class="fa fa-copyright"></i> Copyright 2013, Robert Fleischmann, <a href="https://github.com/rendro/easy-pie-chart/blob/master/LICENSE" target="_blank">MIT License</a>
 
-    };
-    $(".chart-message").shorten();
-    // ------------------------------------------------------------------------
+                        <i class="fa fa-circle"></i> <a href="http://bernii.github.io/gauge.js/" target="_blank">Gauge.js</a> web chart library,
+                        <i class="fa fa-copyright"></i> Copyright, Bernard Kobos, <a href="http://bernii.github.io/gauge.js/" target="_blank">MIT License</a>
 
-    // callback for us to track PanAndZoom operations
-    NETDATA.globalPanAndZoom.callback = netdataPanAndZoomCallback;
+                        <i class="fa fa-circle"></i> <a href="https://jquery.org/" target="_blank">jQuery</a>,
+                        <i class="fa fa-copyright"></i> Copyright 2015, jQuery Foundation, <a href="https://jquery.org/license/" target="_blank">MIT License</a>
 
-    // let it run (update the charts)
-    NETDATA.unpause();
+                        <i class="fa fa-circle"></i> <a href="http://getbootstrap.com/getting-started/" target="_blank">Bootstrap</a>,
+                        <i class="fa fa-copyright"></i> Copyright 2015, Twitter, <a href="http://getbootstrap.com/getting-started/#license-faqs" target="_blank">MIT License</a>
 
-    // check if we have to jump to a specific section
-    scrollToId(urlOptions.hash.replace('#',''));
+                        <i class="fa fa-circle"></i> <a href="http://www.bootstraptoggle.com/" target="_blank">Bootstrap Toggle</a>,
+                        <i class="fa fa-copyright"></i> Copyright (c) 2011-2014 Min Hur, The New York Times Company, <a href="https://github.com/minhur/bootstrap-toggle/blob/master/LICENSE" target="_blank">MIT License</a>
 
-    if(urlOptions.chart !== null) {
-        NETDATA.alarms.scrollToChart(urlOptions.chart);
-        //urlOptions.hash = '#' + NETDATA.name2id('menu_' + charts[c].menu + '_submenu_' + charts[c].submenu);
-        //urlOptions.hash = '#chart_' + NETDATA.name2id(urlOptions.chart);
-        //console.log('hash = ' + urlOptions.hash);
-    }
+                        <i class="fa fa-circle"></i> <a href="https://jamesflorentino.github.io/nanoScrollerJS/" target="_blank">NanoScroller</a>,
+                        <i class="fa fa-copyright"></i> Copyright 2012, James Florentino, <a href="https://github.com/jamesflorentino/nanoScrollerJS/blob/master/LICENSE" target="_blank">MIT License</a>
 
-    /* activate bootstrap sidebar (affix) */
-    $('#sidebar').affix({
-        offset: {
-            top: (isdemo())?150:0,
-            bottom: 0
-        }
-    });
+                        <i class="fa fa-circle"></i> <a href="https://github.com/marcj/css-element-queries" target="_blank">CSS Element Queries</a>,
+                        <i class="fa fa-copyright"></i> Copyright Marc J. Schmidt, <a href="https://github.com/marcj/css-element-queries/blob/master/LICENSE" target="_blank">MIT License</a>
 
-    /* fix scrolling of very long affix lists
-       http://stackoverflow.com/questions/21691585/bootstrap-3-1-0-affix-too-long
-     */
-    $('#sidebar').on('affixed.bs.affix', function() {
-        $(this).removeAttr('style');
-    });
-
-    /* activate bootstrap scrollspy (needed for sidebar) */
-    $(document.body).scrollspy({
-        target: '#sidebar',
-        offset: $(window).height() / 5 // controls the diff of the <hX> element to the top, to select it
-    });
-
-    // change the URL based on the current position of the screen
-    $('#sidebar').on('activate.bs.scrollspy', function (e) {
-        // console.log(e);
-        var el = $(e.target);
-        //if(el.find('ul').size() == 0) {
-        var hash = el.find('a').attr('href');
-        if(typeof hash === 'string' && hash.substring(0, 1) === '#' && urlOptions.hash.startsWith(hash + '_submenu_') === false) {
-            urlOptions.hash = hash;
-            //console.log(urlOptions.hash);
-            netdataHashUpdate();
-        }
-        //else console.log('hash: not accepting ' + hash);
-        //}
-        //else console.log('el.find(): not found');
-    });
+                        <i class="fa fa-circle"></i> <a href="https://fortawesome.github.io/Font-Awesome/" target="_blank">FontAwesome</a>,
+                        <i class="fa fa-copyright"></i> Created by Dave Gandy, Font: <a href="http://scripts.sil.org/OFL" target="_blank">SIL OFL 1.1 License</a>, CSS: <a href="http://opensource.org/licenses/mit-license.html" target="_blank">MIT License</a>
 
-    document.getElementById('footer').style.display = 'block';
+                        <i class="fa fa-circle"></i> <a href="http://www.iconsdb.com/soylent-red-icons/seo-performance-icon.html" target="_blank">IconsDB.com Icons</a>, Icons provided as CC0 1.0 Universal (CC0 1.0) Public Domain Dedication.
 
-    var update_options_modal = function() {
-        // console.log('update_options_modal');
+                        <i class="fa fa-circle"></i> <a href="http://morrisjs.github.io/morris.js/" target="_blank">morris.js</a>,
+                        <i class="fa fa-copyright"></i> Copyright 2013, Olly Smith, <a href="http://morrisjs.github.io/morris.js/" target="_blank">Simplified BSD License</a>
 
-        var sync_option = function(option) {
-            var self = $('#' + option);
+                        <i class="fa fa-circle"></i> <a href="http://raphaeljs.com/" target="_blank">Raphaël</a>,
+                        <i class="fa fa-copyright"></i> Copyright 2008, Dmitry Baranovskiy, <a href="http://raphaeljs.com/license.html" target="_blank">MIT License</a>
 
-            if(self.prop('checked') !== NETDATA.getOption(option)) {
-                // console.log('switching ' + option.toString());
-                self.bootstrapToggle(NETDATA.getOption(option)?'on':'off');
-            }
-        }
+                        <i class="fa fa-circle"></i> <a href="http://C3js.org/" target="_blank">C3</a>,
+                        <i class="fa fa-copyright"></i> Copyright 2013, Masayuki Tanaka, <a href="https://github.com/masayuki0812/c3/blob/master/LICENSE" target="_blank">MIT License</a>
 
-        var theme_sync_option = function(option) {
-            var self = $('#' + option);
+                        <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>
 
-            self.bootstrapToggle(netdataTheme === 'slate'?'on':'off');
-        }
+                    </small>
+                </div>
+            </div>
+        </div>
+    </div>
 
-        sync_option('eliminate_zero_dimensions');
-        sync_option('destroy_on_hide');
-        sync_option('parallel_refresher');
-        sync_option('concurrent_refreshes');
-        sync_option('sync_selection');
-        sync_option('sync_pan_and_zoom');
-        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();
-        }
-        else {
-            $('#concurrent_refreshes_row').show();
-        }
-    };
-    NETDATA.setOption('setOptionCallback', update_options_modal);
-
-    // handle options changes
-    $('#eliminate_zero_dimensions').change(function()       { NETDATA.setOption('eliminate_zero_dimensions', $(this).prop('checked')); });
-    $('#destroy_on_hide').change(function()                 { NETDATA.setOption('destroy_on_hide', $(this).prop('checked')); });
-    $('#parallel_refresher').change(function()              { NETDATA.setOption('parallel_refresher', $(this).prop('checked')); });
-    $('#concurrent_refreshes').change(function()            { NETDATA.setOption('concurrent_refreshes', $(this).prop('checked')); });
-    $('#sync_selection').change(function()                  { NETDATA.setOption('sync_selection', $(this).prop('checked')); });
-    $('#sync_pan_and_zoom').change(function()               { NETDATA.setOption('sync_pan_and_zoom', $(this).prop('checked')); });
-    $('#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')); });
-    $('#show_help').change(function()                       {
-        urlOptions.help = $(this).prop('checked');
-        NETDATA.setOption('show_help', urlOptions.help);
-        netdataReload();
-    });
-
-    // this has to be the last
-    // it reloads the page
-    $('#netdata_theme_control').change(function() {
-        urlOptions.theme = $(this).prop('checked')?'slate':'white';
-        if(setTheme(urlOptions.theme))
-            netdataReload();
-    });
+    <div class="modal fade" id="welcomeModal" tabindex="-1" role="dialog" aria-labelledby="welcomeModalLabel">
+        <div class="modal-dialog modal-lg" 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="welcomeModalLabel">Welcome!</h4>
+                </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 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/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/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>
+                </div>
+                <div class="modal-footer">
+                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
+                </div>
+            </div>
+        </div>
+    </div>
 
-    $('#updateModal').on('shown.bs.modal', function() {
-        notifyForUpdate(true);
-    });
+    <div class="modal fade" id="helpModal" tabindex="-1" role="dialog" aria-labelledby="helpModalLabel">
+        <div class="modal-dialog modal-lg" 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="helpModalLabel">Dashboard Help</h4>
+                </div>
+                <div class="modal-body">
 
-    $('#alarmsModal').on('shown.bs.modal', function() {
-        NETDATA.pause(alarmsUpdateModal);
-    });
+                    <h4>Dygraphs (line, area and stacked area charts)</h4>
 
-    $('#alarmsModal').on('hidden.bs.modal', function() {
-        NETDATA.unpause();
-        document.getElementById('alarms_active').innerHTML =
-                document.getElementById('alarms_all').innerHTML =
-                document.getElementById('alarms_log').innerHTML =
-                        'loading...';
-    });
+                    <!-- Nav tabs -->
+                    <ul class="nav nav-tabs" role="tablist">
+                        <li role="presentation" class="active"><a href="#help_mouse" aria-controls="help_mouse" role="tab" data-toggle="tab">Mouse Interface</a></li>
+                        <li role="presentation"><a href="#help_touch" aria-controls="help_touch" role="tab" data-toggle="tab">Touch Interface</a></li>
+                    </ul>
 
-    $('#deleteRegistryModal').on('hidden.bs.modal', function() {
-        deleteRegistryGuid = null;
-    });
+                    <!-- Tab panes -->
+                    <div class="tab-content">
+                        <div role="tabpanel" class="tab-pane active" id="help_mouse">
+                            <div class="p">
+                                <h4>Mouse Over / Hover</h4>
+                                Mouse over on a chart to show, at its legend, the values for the timestamp under the mouse (the chart will also highlight the point at the chart).
+                                <br/>
+                                All the other visible charts will also show and highlight their values for the same timestamp.
+                            </div>
+                            <hr/>
+                            <div class="p">
+                                <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/>
+                                Once a chart is panned, auto refreshing stops for all charts. To enable it again, <b>double click</b> a panned chart.
+                            </div>
+                            <hr/>
+                            <div class="p">
+                                <h4>Double Click</h4>
+                                Double Click a chart to reset all the charts to their default auto-refreshing state.
+                            </div>
+                            <hr/>
+                            <div class="p">
+                                <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 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>SHIFT + Mouse Wheel <small>(does not work on firefox and IE/Edge)</small></h4>
+                                While pressing the shift key and the mouse pointer is over the contents of a chart, scroll the mouse wheel to zoom in or out. This kind of zooming is aligned to center below the mouse pointer. The other charts will follow too.
+                                <br/>
+                                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 / un-select this dimension.
+                                <br/>
+                                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 class="p">
+                                <h4>Single Tap</h4>
+                                Single Tap on the contents of a chart to show, at its legend, the values for the timestamp tapped (the chart will also highlight the point at the chart).
+                                <br/>
+                                All the other visible charts will also show and highlight their values for the same timestamp.
+                            </div>
+                            <hr/>
+                            <div class="p">
+                                <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/>
+                                Once a chart is panned, auto refreshing stops for all charts. To enable it again, <b>double tap</b> a panned chart.
+                            </div>
+                            <hr/>
+                            <div class="p">
+                                <h4>Double Tap</h4>
+                                Double tap a chart to reset all the charts to their default auto-refreshing state.
+                            </div>
+                            <hr/>
+                            <div class="p">
+                                <h4>Zoom <small>(does not work on firefox and IE/Edge)</small></h4>
+                                With two fingers, zoom in or out.
+                                <br/>
+                                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>
+                                Tap on the label or value of a dimension, will select / un-select this dimension.
+                            </div>
+                        </div>
+                    </div>
+                </div>
+                <div class="modal-footer">
+                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
+                </div>
+            </div>
+        </div>
+    </div>
 
-    if(isdemo()) {
-        if(urlOptions.nowelcome !== true) {
-            setTimeout(function() {
-                $('#welcomeModal').modal();
-            }, 1000);
-        }
+    <div class="modal fade" id="alarmsModal" tabindex="-1" role="dialog" aria-labelledby="alarmsModalLabel">
+        <div class="modal-dialog modal-lg" 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="alarmsModalLabel">netdata alarms</h4>
+                </div>
+                <div class="modal-body">
+                    <!-- Nav tabs -->
+                    <ul class="nav nav-tabs" role="tablist">
+                        <li role="presentation" class="active"><a href="#alarms_active" aria-controls="alarms_active" role="tab" data-toggle="tab">Active</a></li>
+                        <li role="presentation"><a href="#alarms_all" aria-controls="alarms_all" role="tab" data-toggle="tab">All</a></li>
+                        <li role="presentation"><a href="#alarms_log" aria-controls="alarms_log" role="tab" data-toggle="tab">Log</a></li>
+                    </ul>
 
-        // google analytics when this is used for the home page of the demo sites
-        // this does not run on user's installations
-        setTimeout(function() {
-            (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
-            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
-            m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
-            })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
+                    <!-- Tab panes -->
+                    <div class="tab-content">
+                        <div role="tabpanel" class="tab-pane active" id="alarms_active">
+                            loading...
+                        </div>
+                        <div role="tabpanel" class="tab-pane" id="alarms_all">
+                            loading...
+                        </div>
+                        <div role="tabpanel" class="tab-pane" id="alarms_log">
+                            loading...
+                        </div>
+                    </div>
+                </div>
+                <div class="modal-footer">
+                    <!-- <a href="#" onclick="alarmsUpdateModal(); return false;" type="button" class="btn btn-default">Update</a> -->
+                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
+                </div>
+            </div>
+        </div>
+    </div>
 
-            ga('create', 'UA-64295674-3', 'auto');
-            ga('send', 'pageview');
-        }, 2000);
-    }
-    else notifyForUpdate();
+    <div class="modal fade" id="optionsModal" tabindex="-1" role="dialog" aria-labelledby="optionsModalLabel">
+        <div class="modal-dialog modal-lg" 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="optionsModalLabel">netdata dashboard options</h4>
+                </div>
+                <div class="modal-body">
+                    <center>
+                        <small style="color: #BBBBBB;">These are browser settings. Each viewer has its own. They do not affect the operation of your netdata server.
+                        <br/>
+                        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>
 
-    if(urlOptions.show_alarms === true)
-        setTimeout(function() { $('#alarmsModal').modal('show'); }, 1000);
-}
+                    <!-- Nav tabs -->
+                    <ul class="nav nav-tabs" role="tablist">
+                        <li role="presentation" class="active"><a href="#settings_performance" aria-controls="settings_performance" role="tab" data-toggle="tab">Performance</a></li>
+                        <li role="presentation"><a href="#settings_sync" aria-controls="settings_sync" role="tab" data-toggle="tab">Synchronization</a></li>
+                        <li role="presentation"><a href="#settings_visual" aria-controls="settings_visual" role="tab" data-toggle="tab">Visual</a></li>
+                    </ul>
 
-function resetDashboardOptions() {
-    var help = NETDATA.options.current.show_help;
+                    <!-- Tab panes -->
+                    <div class="tab-content">
+                        <div role="tabpanel" class="tab-pane active" id="settings_performance">
+                            <form id="optionsForm1" method="get" class="form-horizontal">
+                                <div class="form-group">
+                                    <table>
+                                    <tr class="option-row">
+                                        <td class="option-control"><input id="stop_updates_when_focus_is_lost" type="checkbox" checked data-toggle="toggle" data-offstyle="danger" data-onstyle="success" data-on="On Focus" data-off="Always" data-width="110px"></td>
+                                        <td class="option-info"><strong>When to refresh the charts?</strong><br/>
+                                            <small>When set to <b>On Focus</b>, the charts will stop being updated if the page / tab does not have the focus of the user. When set to <b>Always</b>, the charts will always be refreshed. Set it to <b>On Focus</b> it to lower the CPU requirements of the browser (and extend the battery of laptops and tablets) when this page does not have your focus. Set to <b>Always</b> to work on another window (i.e. change the settings of something) and have the charts auto-refresh in this window.</small>
+                                        </td>
+                                        </tr>
+                                    <tr class="option-row">
+                                        <td class="option-control">
+                                        <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 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">
+                                        <td class="option-control"><input id="destroy_on_hide" type="checkbox" data-toggle="toggle" data-on="Destroy" data-off="Hide" data-width="110px"></td>
+                                        <td class="option-info"><strong>How to handle hidden charts?</strong><br/>
+                                            <small>When set to <b>Destroy</b>, charts that are not in the current viewport of the browser (are above, or below the visible area of the page), will be destroyed and re-created if and when they become visible again. When set to <b>Hide</b>, the not-visible charts will be just hidden, to simplify the DOM and speed up your browser. Set it to <b>Destroy</b>, to lower the memory requirements of your browser. Set it to <b>Hide</b> for smoother page scrolling.</small>
+                                        </td>
+                                        </tr>
+                                    </table>
+                                </div>
+                            </form>
+                        </div>
+                        <div role="tabpanel" class="tab-pane" id="settings_sync">
+                            <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="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>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">
+                                        <td class="option-control"></td>
+                                        <td class="option-info">
+                                            <table>
+                                            <tr class="option-row">
+                                            <td class="option-control">
+                                            <input id="concurrent_refreshes" type="checkbox" checked data-toggle="toggle" data-on="Resync" data-off="Best Effort" data-width="110px">
+                                            </td>
+                                            <td class="option-info">
+                                            <strong>Shall we re-sync chart refreshes?</strong><br/>
+                                            <small>When set to <b>Resync</b>, the dashboard will attempt to re-synchronize all the charts so that they are refreshed concurrently. When set to <b>Best Effort</b>, each chart may be refreshed with a little time difference to the others. Normally, the dashboard starts refreshing them in parallel, but depending on the speed of your computer and the network latencies, charts start having a slight time difference. Setting this to <b>Resync</b> will attempt to re-synchronize the charts on every update. Setting it to <b>Best Effort</b> may lower the pressure on your browser and the network.</small>
+                                            </td>
+                                            </tr>
+                                            </table>
+                                        </td>
+                                        </tr>
+                                    <tr class="option-row">
+                                        <td class="option-control"><input id="sync_selection" type="checkbox" checked data-toggle="toggle" data-on="Sync" data-off="Don't Sync" data-onstyle="success" data-offstyle="danger" data-width="110px"></td>
+                                        <td class="option-info"><strong>Sync hover selection on all charts?</strong><br/>
+                                            <small>When enabled, a selection on one chart will automatically select the same time on all other visible charts and the legends of all visible charts will be updated to show the selected values. When disabled, only the chart getting the user's attention will be selected. Enable it to get better insights of the data. Disable it if you are on a very slow computer that cannot actually do it.</small>
+                                        </td>
+                                        </tr>
+                                    <tr class="option-row">
+                                        <td class="option-control"><input id="sync_pan_and_zoom" type="checkbox" checked data-toggle="toggle"  data-on="Sync" data-off="Don't Sync" data-onstyle="success" data-offstyle="danger" data-width="110px"></td>
+                                        <td class="option-info"><strong>Sync pan and zoom on all charts?</strong><br/>
+                                            <small>When enabled, pan and zoom operations on a chart will be replicated to all charts (even the ones that are not currently visible - of course only when they will become visible). When disabled, pan and zoom operations will not be propagated to other charts.</small>
+                                        </td>
+                                        </tr>
+                                    </table>
+                                </div>
+                            </form>
+                        </div>
+                        <div role="tabpanel" class="tab-pane" id="settings_visual">
+                            <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/>
+                                            <small>When set to <b>Pad</b> the charts will be padded with more data, both before and after the visible area, thus giving the impression the whole database is loaded. This padding will happen only after the first pan or zoom operation on the chart (initially all charts have only the visible data). When set to <b>Don't Pad</b> only the visible data will be transfered from the netdata server, even after the first pan and zoom operation.</small>
+                                        </td>
+                                        </tr>
+                                    <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.
+                                            <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>
+                            </form>
+                        </div>
+                    </div>
+                </div>
+                <div class="modal-footer">
+                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
+                </div>
+            </div>
+        </div>
+    </div>
 
-    NETDATA.resetOptions();
-    if(setTheme('slate'))
-        netdataReload();
 
-    if(help !== NETDATA.options.current.show_help)
-        netdataReload();
-}
+    <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); return false;" 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>
 
-initializeDynamicDashboard();
+    <div class="modal fade" id="deleteRegistryModal" tabindex="-1" role="dialog" aria-labelledby="deleteRegistryModalLabel">
+        <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="deleteRegistryModalLabel">Delete <span id="deleteRegistryServerName"></span>?</h4>
+                </div>
+                <div class="modal-body">
+                    You are about to delete, from your personal list of netdata servers, the following server:
+                    <p style="text-align: center; padding-top: 10px; padding-bottom: 10px; line-height: 2;">
+                    <b><span id="deleteRegistryServerName2"></span></b>
+                    <br/>
+                    <b><span id="deleteRegistryServerURL"></span></b>
+                    </p>
+                    Are you sure you want to do this?
+                    <br/>
+                    <div style="padding: 10px;"></div>
+                    <small>Keep in mind, this server will be added back if and when you visit it again.</small>
+                    <br/>
+                    <div id="deleteRegistryResponse" style="display: block; width: 100%; text-align: center; padding-top: 20px;"></div>
+                </div>
+                <div class="modal-footer">
+                    <button type="button" class="btn btn-success" data-dismiss="modal">keep it</button>
+                    <a href="#" onclick="notifyForDeleteRegistry(true); return false;" type="button" class="btn btn-danger">delete it</a>
+                </div>
+            </div>
+        </div>
+    </div>
 
-</script>
+    <div class="modal fade" id="switchRegistryModal" tabindex="-1" role="dialog" aria-labelledby="switchRegistryModalLabel">
+        <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="switchRegistryModalLabel">Switch Netdata Registry Identity</h4>
+                </div>
+                <div class="modal-body">
+                    You can copy and paste the following ID to all your browsers (e.g. work and home).
+                    <br/>
+                    All the browsers with the same ID will identify <b>you</b>, so please don't share this with others.
+                    <p style="text-align: center; padding-top: 10px; padding-bottom: 10px; line-height: 2;">
+                    <form action="#">
+                    <input type="text" class="form-control" id="switchRegistryPersonGUID" placeholder="your personal ID" maxlength="36" autocomplete="off" style="text-align: center; font-size: 1.4em;">
+                    </form>
+                    </p>
+                    Either copy this ID and paste it to another browser, or paste here the ID you have taken from another browser.
+                    <p style="padding-top: 10px;"><small>
+                        Keep in mind that:
+                        <ul>
+                            <li>when you switch ID, your previous ID will be lost forever - this is irreversible.</li>
+                            <li>both IDs (your old and the new) must list this netdata at their personal lists.</li>
+                            <li>both IDs have to be known by the registry: <b><span id="switchRegistryURL"></span></b>.</li>
+                            <li>to get a new ID, just clear your browser cookies.</li>
+                        </ul>
+                    </small></p>
+                    <div id="switchRegistryResponse" style="display: block; width: 100%; text-align: center; padding-top: 20px;"></div>
+                </div>
+                <div class="modal-footer">
+                    <button type="button" class="btn btn-success" data-dismiss="modal">cancel</button>
+                    <a href="#" onclick="notifyForSwitchRegistry(true); return false;" type="button" class="btn btn-danger">impersonate</a>
+                </div>
+            </div>
+        </div>
+    </div>
 
+    <div class="modal fade" id="gotoServerModal" tabindex="-1" role="dialog" aria-labelledby="gotoServerModalLabel">
+        <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="gotoServerModalLabel"><span id="gotoServerName"></span></h4>
+                </div>
+                <div class="modal-body">
+                    Checking known URLs for this server...
+                    <div  style="padding-top: 20px;">
+                        <table id="gotoServerList">
+                        </table>
+                    </div>
+                    <p style="padding-top: 10px;"><small>
+                        Checks may fail if you are viewing an HTTPS page and the server to be checked is HTTP only.
+                    </small></p>
+                    <div id="gotoServerResponse" style="display: block; width: 100%; text-align: center; padding-top: 20px;"></div>
+                </div>
+                <div class="modal-footer">
+                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
+                </div>
+            </div>
+        </div>
+    </div>
 </body>
 </html>
+<script async type="text/javascript" src="dashboard.js?v54"></script>