]> arthur.barton.de Git - netdata.git/commitdiff
allow fireqos names to have in/out either as prefix or suffix #275
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Tue, 19 Apr 2016 17:19:13 +0000 (20:19 +0300)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Tue, 19 Apr 2016 17:19:13 +0000 (20:19 +0300)
.gitignore
web/index.html

index f4b9fe85e3ba6cab7bbe1b561feb812b530f9c80..72c79d863305dbcb8a0c616dd36016cf75223820 100644 (file)
@@ -60,6 +60,7 @@ web/version.txt
 
 system/netdata-openrc
 system/netdata-init-d
+system/netdata.logrotate
 
 netdata-installer.log
 netdata-uninstaller.sh
index 546196b87d443a59118a424ec9bec910d8f44880..6f6013da1d6a93f0ac701d58b17349c7caa7f9bf 100644 (file)
@@ -1357,11 +1357,22 @@ function enrichChartData(chart) {
                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--;