]> arthur.barton.de Git - netdata.git/commitdiff
fixed minor issue in app_groups; prevent refreshing the charts if the page does not...
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Fri, 3 Oct 2014 20:25:43 +0000 (23:25 +0300)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Fri, 3 Oct 2014 20:25:43 +0000 (23:25 +0300)
conf.d/apps_groups.conf
web/index.js [changed mode: 0644->0755]

index 7d8015aba77a85afdef718cbee953789d5248989..53446158f3d50d36e8d916212b8433ea679dabef 100755 (executable)
 # If a group_name starts with a -, the dimension will be hidden (cpu chart only)
 #
 
-media: mplayer vlc xine mediatomb
+compile: cc1 cc1plus as gcc 
+media: mplayer vlc xine mediatomb omxplayer omxplayer.bin
 squid: squid squid2 squid3
 apache: apache apache2
-mysql: mysqld as mysql
+mysql: mysqld mysql
 asterisk: asterisk
 opensips: opensips opensips-mi-pro stund
 radius: radiusd radiusclient
@@ -46,7 +47,7 @@ vbox: vboxwebsrv VBoxXPCOMIPCD VBoxSVC
 log: ulogd syslogd syslog-ng rsyslogd logrotate
 nms: snmpd vnstatd smokeping zabbix_agentd monit munin-node mon openhpid
 ppp: ppp pppd pptpd pptpctrl
-inetd: inetd xinetd as inetd
+inetd: inetd xinetd
 openvpn: openvpn
 cron: cron atd
 ha: corosync hs_logd ha_logd stonithd
old mode 100644 (file)
new mode 100755 (executable)
index e242225..9f7becb
@@ -1,3 +1,5 @@
+var page_is_visible = 1;\r
+\r
 var TARGET_THUMB_GRAPH_WIDTH = 500;            // thumb charts width will range from 0.5 to 1.5 of that\r
 var MINIMUM_THUMB_GRAPH_WIDTH = 400;   // thumb chart will generally try to be wider than that\r
 var TARGET_THUMB_GRAPH_HEIGHT = 180;   // the height of the thumb charts\r
@@ -504,14 +506,19 @@ function checkRefreshThread() {
 // never call it directly, or new javascript threads will be spawn\r
 var timeout = null;\r
 function chartsRefresh() {\r
+       last_refresh = new Date().getTime();\r
+       \r
+       if(!page_is_visible) {\r
+               timeout = setTimeout(triggerRefresh, 500);\r
+               return;\r
+       }\r
+\r
        if(resize_request) {\r
                resizeCharts();\r
                resize_request = false;\r
                // refresh_mode = REFRESH_ALWAYS;\r
        }\r
 \r
-       last_refresh = new Date().getTime();\r
-\r
        if(refresh_mode == REFRESH_PAUSED) {\r
                if(mode == MODE_MAIN && mainchart.last_updated == 0) {\r
                        mainChartRefresh();\r
@@ -991,6 +998,15 @@ function initCharts() {
        });\r
 }\r
 \r
+$(window).blur(function() {\r
+       page_is_visible = 0;\r
+       mylog('blur');\r
+});\r
+\r
+$(window).focus(function() {\r
+       page_is_visible = 1;\r
+       mylog('focus');\r
+});\r
+\r
 // Set a callback to run when the Google Visualization API is loaded.\r
 google.setOnLoadCallback(initCharts);\r
-\r