</script>
<!-- load the dashboard manager - it will do the rest -->
- <script type="text/javascript" src="dashboard.js?v30"></script>
+ <script type="text/javascript" src="dashboard.js?v34"></script>
</head>
<body data-spy="scroll" data-target="#sidebar">
</button>
<a href="/" class="navbar-brand" id="hostname">netdata</a>
</div>
+ <nav id="demosites_nav" class="collapse navbar-collapse navbar-left" role="navigation">
+ <ul class="nav navbar-nav">
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="current_view">demo sites <strong class="caret"></strong></a>
+ <ul class="dropdown-menu scrollable-menu inpagemenu" role="menu">
+ <li id="demo_eu"><a href="//netdata1.firehol.org?nowelcome">EU - London (DigitalOcean.com)</a></li>
+ <li id="demo_us"><a href="//netdata2.firehol.org?nowelcome">US - Atlanta (CDN77.com)</a></li>
+ <li id="demo_gr"><a href="//netdata3.firehol.org?nowelcome">EU - Greece</a></li>
+ <li role="separator" class="divider"></li>
+ <li id="demo_tv"><a href="tv.html">TV Dashboard for 2 servers</a></li>
+ <li id="demosites"><a href="demosites.html">Dashboard for monitoring netdata demo sites</a></li>
+ </ul>
+ </li>
+ </ul>
+ </nav>
<nav class="collapse navbar-collapse navbar-right" role="navigation">
<ul class="nav navbar-nav">
<li><a href="#" class="btn" data-toggle="modal" data-target="#optionsModal"><i class="fa fa-cog"></i> settings</a></li>
<script>
-var demo_hostname = 'netdata.firehol.org';
-// var demo_hostname = 'box';
+var this_is_demo = null;
+function isdemo() {
+ if(this_is_demo !== null) return this_is_demo;
+ this_is_demo = false;
+
+ try {
+ if(typeof document.location.hostname === 'string') {
+ if(document.location.hostname === 'netdata.firehol.org' || document.location.hostname === 'netdata1.firehol.org') {
+ document.getElementById("demo_eu").className = "active";
+ this_is_demo = true;
+ }
+ else if(document.location.hostname === 'netdata2.firehol.org') {
+ document.getElementById("demo_us").className = "active";
+ this_is_demo = true;
+ }
+ else if(document.location.hostname === 'netdata3.firehol.org') {
+ document.getElementById("demo_gr").className = "active";
+ this_is_demo = true;
+ }
+ }
+
+ if(!this_is_demo)
+ document.getElementById("demosites_nav").style.visibility = "hidden";
+ }
+ catch(error) {
+ ;
+ }
-if(document.location.hostname === demo_hostname) {
+ return this_is_demo;
+}
+
+if(isdemo()) {
document.getElementById('masthead').style.display = 'block';
}
title: 'Example Charts',
info: undefined
},
+
+ 'cgroup': {
+ title: 'Container',
+ info: undefined
+ },
+
+ 'mysql': {
+ title: 'MySQL',
+ info: undefined
+ },
+
+ 'named': {
+ title: 'named',
+ info: undefined
+ },
};
var submenuData = {
return def;
}
-function menuTitle(menu) {
- return anyAttribute(menuData, 'title', menu, menu);
+function menuTitle(chart) {
+ if(typeof chart.menu_pattern !== 'undefined') {
+ return anyAttribute(menuData, 'title', chart.menu_pattern, chart.menu_pattern).toString()
+ + ': ' + chart.type.slice(-(chart.type.length - chart.menu_pattern.length - 1)).toString();
+ }
+
+ return anyAttribute(menuData, 'title', chart.menu, chart.menu);
}
function menuInfo(menu) {
chart.menu = tmp;
break;
+ case 'mysql':
+ case 'named':
+ case 'cgroup':
+ chart.menu = chart.type;
+ chart.menu_pattern = tmp;
+ break;
+
case 'tc':
chart.menu = tmp;
- // find the interface name from the name
- if(typeof options.submenu_names[chart.family] === 'undefined' || options.submenu_names[chart.family] === chart.family)
- options.submenu_names[chart.family] = chart.name.split('.')[1].split('_')[0];
+ // find a name for this device from fireqos info
+ // we strip '_(in|out)' or '(in|out)_'
+ if(typeof options.submenu_names[chart.family] === 'undefined' || options.submenu_names[chart.family] === chart.family) {
+ var n = chart.name.split('.')[1];
+ if(n.endsWith('_in'))
+ options.submenu_names[chart.family] = n.slice(0, n.lastIndexOf('_in'));
+ else if(n.endsWith('_out'))
+ options.submenu_names[chart.family] = n.slice(0, n.lastIndexOf('_out'));
+ else if(n.startsWith('in_'))
+ options.submenu_names[chart.family] = n.slice(3, n.length);
+ else if(n.startsWith('out_'))
+ options.submenu_names[chart.family] = n.slice(4, n.length);
+ }
// increase the priority of IFB devices
+ // to have inbound appear before outbound
if(chart.id.match(/.*-ifb$/))
chart.priority--;
function name2id(s) {
return s
- .replace(' ', '_')
- .replace('(', '_')
- .replace(')', '_')
- .replace('.', '_')
- .replace('/', '_');
+ .replace(/ /g, '_')
+ .replace(/\(/g, '_')
+ .replace(/\)/g, '_')
+ .replace(/\./g, '_')
+ .replace(/\//g, '_');
}
function headMain(charts, duration) {
// generate an entry at the main menu
- sidebar += '<li class=""><a href="#' + menu + '">' + menus[menu].title + '</a><ul class="nav">';
+ sidebar += '<li class=""><a href="#' + name2id(menu) + '">' + menus[menu].title + '</a><ul class="nav">';
html += '<div role="section"><div role="sectionhead"><h1 id="' + menu + '" role="heading">' + menus[menu].title + '</h1></div><div id="' + menu + '" role="document">';
if(menus[menu].info !== null)
menus[charts[c].menu] = {
priority: charts[c].priority,
submenus: {},
- title: menuTitle(charts[c].menu),
+ title: menuTitle(charts[c]),
info: menuInfo(charts[c].menu),
height: menuHeight(charts[c].menu, options.chartsHeight)
};
menus[charts[c].menu].submenus[charts[c].submenu].charts.push(charts[c]);
}
+ // 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
// the Dom elements are initially zero-sized
NETDATA.parseDom();
- var before = 0, after = 0;
+ var before = 0, after = 0, nowelcome = 0;
after = getUrlParameter('force_after_ms');
before = getUrlParameter('force_before_ms');
+ nowelcome = (getUrlParameter('nowelcome') === true)?true:false;
- if(before > 0 && after > 0)
+ if(before > 0 && after > 0) {
+ nowelcome = true;
NETDATA.globalPanAndZoom.setMaster(NETDATA.options.targets[0], after, before);
+ }
// let it run (update the charts)
NETDATA.unpause();
/* activate bootstrap sidebar (affix) */
$('#sidebar').affix({
offset: {
- top: (document.location.hostname === demo_hostname)?150:0,
+ top: (isdemo())?150:0,
bottom: 0
}
});
// this has to be the last
// it reloads the page
$('#netdata_theme_control').change(function() {
- if(setTheme($(this).prop('checked')?'slate':'default'))
+ if(setTheme($(this).prop('checked')?'slate':'white'))
location.reload();
});
- if(document.location.hostname === demo_hostname) {
+ if(!nowelcome && isdemo()) {
setTimeout(function() {
$('#welcomeModal').modal();
}, 1000);