X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=web%2Findex.html;h=f0a3b75de60cf57ce562377d81771e474c02a471;hb=f6f73aeaba9eef3a7105c5b8bd389be49e0595b0;hp=cb92af5ab791d3d5148674dc8b6ebda74d9113bc;hpb=3c5a3cce8673f1b1228afe976700d90fe4d55418;p=netdata.git diff --git a/web/index.html b/web/index.html index cb92af5a..f0a3b75d 100644 --- a/web/index.html +++ b/web/index.html @@ -2,6 +2,7 @@ netdata dashboard + @@ -390,7 +391,7 @@ while(len--) { var u = machines[len]; found++; - el += '
  • ' + u.name + '
  • '; + el += '
  • ' + u.name + '
  • '; a1 += '
  • '; } } @@ -422,12 +423,14 @@ document.getElementById('mynetdata_servers').innerHTML = el; document.getElementById('mynetdata_servers2').innerHTML = el; document.getElementById('mynetdata_actions1').innerHTML = a1; + + gotoServerInit(); }; - + @@ -1019,6 +1022,8 @@ if(isdemo()) { document.getElementById('masthead').style.display = 'block'; } var gotoServerValidateRemaining = 0; +var gotoServerMiddleClick = false; +var gotoServerStop = false; function gotoServerValidateUrl(id, guid, url) { var penaldy = 0; if(document.location.toString().startsWith('http://') && url.toString().startsWith('https://')) @@ -1028,25 +1033,41 @@ function gotoServerValidateUrl(id, guid, url) { setTimeout(function() { document.getElementById('gotoServerList').innerHTML += '' + url + 'checking...'; + NETDATA.registry.hello(url, function(data) { if (data) { - console.log('OK ' + id + ' URL: ' + url); + // console.log('OK ' + id + ' URL: ' + url); document.getElementById(guid + '-' + id + '-status').innerHTML = "OK"; - document.location = url; + var hash = document.location.hash || ''; + + if(!gotoServerStop) { + gotoServerStop = true; + + if(gotoServerMiddleClick) { + window.open(url + hash, '_blank'); + gotoServerMiddleClick = false; + document.getElementById('gotoServerResponse').innerHTML = 'Opening new window to ' + NETDATA.registry.machines[guid].name + '
    ' + url + hash + '

    (check your pop-up blocker if it fails)'; + } + else + document.location = url + hash; + } } else { document.getElementById(guid + '-' + id + '-status').innerHTML = "failed!"; gotoServerValidateRemaining--; - if(gotoServerValidateRemaining <= 0) + if(gotoServerValidateRemaining <= 0) { + gotoServerMiddleClick = false; document.getElementById('gotoServerResponse').innerHTML = 'Sorry! I cannot find any operational URL for this server'; + } } }); }, (id * 50) + penaldy); } function gotoServerModalHandler(guid) { - console.log('goto server: ' + guid); + // console.log('goto server: ' + guid); + gotoServerStop = false; var len = NETDATA.registry.machines[guid].alternate_urls.length; document.getElementById('gotoServerResponse').innerHTML = ''; @@ -1061,6 +1082,20 @@ function gotoServerModalHandler(guid) { return false; } +function gotoServerInit() { + $(".registry_link").on('click', function(e) { + if(e.which === 2) { + e.preventDefault(); + gotoServerMiddleClick = true; + } + else { + gotoServerMiddleClick = false; + } + + return true; + }); +} + function switchRegistryModalHandler() { document.getElementById('switchRegistryPersonGUID').value = NETDATA.registry.person_guid; document.getElementById('switchRegistryURL').innerHTML = NETDATA.registry.server; @@ -1124,7 +1159,7 @@ var options = { chartsPerRow: 0, chartsMinWidth: 1450, chartsHeight: 180, - sparklinesHeight: 60 + sparklinesHeight: 60, }; // generate a sparkline @@ -1184,6 +1219,21 @@ function sortObjectByPriority(object) { 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) { @@ -1276,19 +1326,19 @@ var menuData = { 'apps': { title: 'Applications', - info: 'Per application statistics are collected using netdata\'s apps.plugin. This plugin walks through the entire /proc filesystem and aggregates statistics for applications of interest, defined in /etc/netdata/apps_groups.conf (the default is here). The plugin internally builds a process tree (much like ps fax 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).
    IMPORTANT: The values shown here are not 100% accurate. They only include values for the processes running. If an application is spawning children continuously, which are terminated in just a few milliseconds (like shell scripts do), the values reported will be inaccurate. Linux does report the values for the exited children of a process. However, these values are reported to the parent process only when the child exits. If these values, of the exited child processes, were also aggregated in the charts below, the charts would have been full of spikes, presenting unrealistic utilization for each process group. So, we decided to ignore these values and present only the utilization of the currently running processes.', + info: 'Per application statistics are collected using netdata\'s apps.plugin. This plugin walks through the entire /proc filesystem and aggregates statistics for applications of interest, defined in /etc/netdata/apps_groups.conf (the default is here). The plugin internally builds a process tree (much like ps fax 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 top, although the netdata plugin counts also the resources of exited children (unlike top 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', - info: 'Per user statistics are collected using netdata\'s apps.plugin. This plugin walks through the entire /proc filesystem and aggregates statistics per user.
    IMPORTANT: The values shown here are not 100% accurate. They only include values for the processes running. If an application is spawning children continuously, which are terminated in just a few milliseconds (like shell scripts do), the values reported will be inaccurate. Linux does report the values for the exited children of a process. However, these values are reported to the parent process only when the child exits. If these values, of the exited child processes, were also aggregated in the charts below, the charts would have been full of spikes, presenting unrealistic utilization for each process group. So, we decided to ignore these values and present only the utilization of the currently running processes.', + info: 'Per user statistics are collected using netdata\'s apps.plugin. This plugin walks through the entire /proc filesystem and aggregates statistics per user. The reported values are compatible with top, although the netdata plugin counts also the resources of exited children (unlike top 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', - info: 'Per user group statistics are collected using netdata\'s apps.plugin. This plugin walks through the entire /proc filesystem and aggregates statistics per user group.
    IMPORTANT: The values shown here are not 100% accurate. They only include values for the processes running. If an application is spawning children continuously, which are terminated in just a few milliseconds (like shell scripts do), the values reported will be inaccurate. Linux does report the values for the exited children of a process. However, these values are reported to the parent process only when the child exits. If these values, of the exited child processes, were also aggregated in the charts below, the charts would have been full of spikes, presenting unrealistic utilization for each process group. So, we decided to ignore these values and present only the utilization of the currently running processes.', + info: 'Per user group statistics are collected using netdata\'s apps.plugin. This plugin walks through the entire /proc filesystem and aggregates statistics per user group. The reported values are compatible with top, although the netdata plugin counts also the resources of exited children (unlike top 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 }, @@ -1312,10 +1362,25 @@ var menuData = { info: undefined }, + 'phpfpm': { + title: 'PHP-FPM', + info: undefined, + }, + + 'nginx': { + title: 'nginx', + info: undefined, + }, +/* + 'apache': { + title: 'Apache', + info: undefined, + },*/ + 'named': { title: 'named', info: undefined - }, + } }; var submenuData = { @@ -1751,6 +1816,9 @@ function enrichChartData(chart) { break; case 'mysql': + case 'phpfpm': +/* case 'nginx': + case 'apache':*/ case 'named': case 'cgroup': chart.menu = chart.type; @@ -1953,7 +2021,7 @@ function renderPage(menus, data) { // generate an entry at the main menu var menuid = name2id(menu); - sidebar += '
  • ' + menus[menu].title + '