summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-statistics
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-statistics')
-rw-r--r--applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/tcpconns.js29
-rw-r--r--applications/luci-app-statistics/root/etc/config/luci_statistics3
-rw-r--r--applications/luci-app-statistics/root/usr/share/luci/statistics/plugins/tcpconns.json2
3 files changed, 20 insertions, 14 deletions
diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/tcpconns.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/tcpconns.js
index 84471ebb87..526b10f3c3 100644
--- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/tcpconns.js
+++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/tcpconns.js
@@ -19,25 +19,30 @@ return baseclass.extend({
o = s.option(form.DynamicList, 'LocalPorts', _('Monitor local ports'));
o.optional = true;
o.datatype = 'port';
- o.default = '22 80';
- o.depends({ enable: '1', ListeningPorts: '0' });
+ o.default = '22';
+ o.depends('enable', '1');
o = s.option(form.DynamicList, 'RemotePorts', _('Monitor remote ports'));
o.optional = true;
o.datatype = 'port';
- o.depends({ enable: '1', ListeningPorts: '0' });
+ o.depends('enable', '1');
+
+ o = s.option(form.Flag, 'AllPortsSummary', _('Summary of all ports'));
+ o.rmempty = false;
+ o.depends('enable', '1');
},
configSummary: function(section) {
var lports = L.toArray(section.LocalPorts),
- rports = L.toArray(section.RemotePorts);
-
- if (section.ListeningPorts == '1')
- return _('Monitoring local listen ports');
- else
- return _('Monitoring %s and %s').format(
- N_(lports.length, 'one local port', '%d local ports').format(lports.length),
- N_(rports.length, 'one remote port', '%d remote ports').format(rports.length)
- );
+ rports = L.toArray(section.RemotePorts),
+ listen = section.ListeningPorts == '1',
+ summary = section.AllPortsSummary == '1';
+
+ return _('Monitoring %s and %s, %s %s').format(
+ N_(lports.length, 'one local', '%d local').format(lports.length),
+ N_(rports.length, 'one remote port', '%d remote ports').format(rports.length),
+ listen ? _('all local listening ports,') : '',
+ summary ? _('summary of all ports') : _('no summary')
+ );
}
});
diff --git a/applications/luci-app-statistics/root/etc/config/luci_statistics b/applications/luci-app-statistics/root/etc/config/luci_statistics
index bb9ca15e8e..2008a7966a 100644
--- a/applications/luci-app-statistics/root/etc/config/luci_statistics
+++ b/applications/luci-app-statistics/root/etc/config/luci_statistics
@@ -203,7 +203,8 @@ config statistics 'collectd_splash_leases'
config statistics 'collectd_tcpconns'
option enable '0'
option ListeningPorts '0'
- option LocalPorts '22 80'
+ list LocalPorts '22'
+ option AllPortsSummary '0'
config statistics 'collectd_thermal'
option enable '0'
diff --git a/applications/luci-app-statistics/root/usr/share/luci/statistics/plugins/tcpconns.json b/applications/luci-app-statistics/root/usr/share/luci/statistics/plugins/tcpconns.json
index f932994b43..e26e8acffb 100644
--- a/applications/luci-app-statistics/root/usr/share/luci/statistics/plugins/tcpconns.json
+++ b/applications/luci-app-statistics/root/usr/share/luci/statistics/plugins/tcpconns.json
@@ -3,7 +3,7 @@
"category": "network",
"legend": [
[],
- ["ListeningPorts"],
+ ["ListeningPorts", "AllPortsSummary"],
["LocalPorts", "RemotePorts"]
]
}