diff options
Diffstat (limited to 'applications/luci-app-statistics/htdocs')
15 files changed, 487 insertions, 148 deletions
diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/conntrack.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/conntrack.js index 9c54f5c914..35951dffba 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/conntrack.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/conntrack.js @@ -33,6 +33,7 @@ return baseclass.extend({ vlabel: "Percent", number_format: "%5.1lf%%", y_min: "0", + y_max: "2", alt_autoscale_max: true, data: { instances: { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpu.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpu.js index 7d0dc9a15a..bbd0e47642 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpu.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpu.js @@ -28,13 +28,13 @@ return baseclass.extend({ instances: { cpu: [ ...(show_idle ? ["idle"] : []), - "interrupt", "nice", - "softirq", - "steal", - "system", "user", - "wait" + "wait", + "system", + "softirq", + "interrupt", + "steal" ] }, options: { @@ -68,7 +68,7 @@ return baseclass.extend({ }, cpu_wait: { color: "ffb000", - title: "Wait" + title: "Wait I/O" } } } @@ -77,6 +77,7 @@ return baseclass.extend({ var percent = { title: title, y_min: "0", + y_max: "2", alt_autoscale_max: true, vlabel: "Percent", number_format: "%5.1lf%%", @@ -84,13 +85,13 @@ return baseclass.extend({ instances: { percent: [ ...(show_idle ? ["idle"] : []), - "interrupt", "nice", - "softirq", - "steal", - "system", "user", - "wait" + "wait", + "system", + "softirq", + "interrupt", + "steal" ] }, options: { @@ -124,7 +125,7 @@ return baseclass.extend({ }, percent_wait: { color: "ffb000", - title: "Wait" + title: "Wait I/O" } } } @@ -142,6 +143,7 @@ return baseclass.extend({ p = { title: title, y_min: "0", + y_max: "2", alt_autoscale_max: true, vlabel: "Percent", number_format: "%5.1lf%%", diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpufreq.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpufreq.js index 308d58dacf..a2cc1309e7 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpufreq.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpufreq.js @@ -26,6 +26,8 @@ return baseclass.extend({ detail: true, title: "%H: Frequency transitions - core %pi", alt_autoscale: true, + y_min: "0", + y_max: "2", vlabel: "Transitions", number_format: "%3.2lf%s", data: { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/dsl.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/dsl.js new file mode 100644 index 0000000000..87e2d989e4 --- /dev/null +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/dsl.js @@ -0,0 +1,193 @@ +/* Licensed to the public under the Apache License 2.0. */ + +'use strict'; + +return L.Class.extend({ + title: _('DSL'), + + rrdargs: function(graph, host, plugin, plugin_instance, dtype) { + var g = []; + var dtypes = graph.dataTypes(host, plugin, plugin_instance); + + const d_snr = { + title: _("DSL Signal"), + vlabel: "dB", + data: { + types: ["snr"], + options: { + snr_latn_up: { + title: _("Line Attenuation Up (LATN)"), + noarea: true, + overlay: true + }, + snr_latn_down: { + title: _("Line Attenuation Down (LATN)"), + noarea: true, + overlay: true + }, + snr_satn_up: { + title: _("Signal Attenuation Up (SATN)"), + noarea: true, + overlay: true + }, + snr_satn_down: { + title: _("Signal Attenuation Down (SATN)"), + noarea: true, + overlay: true + }, + snr_snr_up: { + title: _("Noise Margin Up (SNR)"), + noarea: true, + overlay: true + }, + snr_snr_down: { + title: _("Noise Margin Down (SNR)"), + noarea: true, + overlay: true + }, + } + } + }; + const d_uptime = { + title: _("DSL Line Uptime"), + vlabel: "seconds", + data: { + types: ["uptime"], + options: { + uptime: { + title: _("Uptime"), + noarea: true + } + } + } + }; + const d_flags = { + title: _("DSL Flags"), + data: { + instances: { + bool: [ + "bitswap_up", + "bitswap_down", + "vector_up", + "vector_down" + ] + }, + options: { + bool_bitswap_up: { + title: _("Bitswap Up"), + noarea: true, + overlay: true + }, + bool_bitswap_down: { + title: _("Bitswap Down"), + noarea: true, + overlay: true + }, + bool_vector_up: { + title: _("Vectoring Up"), + noarea: true, + overlay: true + }, + bool_vector_down: { + title: _("Vectoring Down"), + noarea: true, + overlay: true + }, + } + } + }; + const d_bitrate = { + title: _("Bitrate"), + vlabel: "b/s", + data: { + instances: { + bitrate: [ + "attndr_up", + "attndr_down", + "data_rate_up", + "data_rate_down" + ] + }, + options: { + bitrate_attndr_up: { + title: _("Max. Attainable Data Rate (ATTNDR) Up"), + noarea: true, + overlay: true + }, + bitrate_attndr_down: { + title: _("Max. Attainable Data Rate (ATTNDR) Down"), + noarea: true, + overlay: true + }, + bitrate_data_rate_up: { + title: _("Data Rate Up"), + noarea: true, + overlay: true + }, + bitrate_data_rate_down: { + title: _("Data Rate Down"), + noarea: true, + overlay: true + } + } + } + }; + const d_count = { + title: _("Errors"), + vlabel: "count", + data: { + types: ["errors"], + options: { + errors_rx_corrupted_far: { + title: _("Rx Corrupted Far"), + noarea: true, + overlay: true + }, + errors_rx_corrupted_near: { + title: _("Rx Corrupted Near"), + noarea: true, + overlay: true + }, + errors_rx_retransmitted_far: { + title: _("Rx Retransmitted Far"), + noarea: true, + overlay: true + }, + errors_tx_retransmitted_far: { + title: _("Tx Retransmitted Far"), + noarea: true, + overlay: true + }, + errors_rx_retransmitted_near: { + title: _("Rx Retransmitted Near"), + noarea: true, + overlay: true + }, + errors_tx_retransmitted_near: { + title: _("Tx Retransmitted Near"), + noarea: true, + overlay: true + }, + } + } + }; + + if (dtypes.includes("snr")) { + g.push(d_snr); + } + if (dtypes.includes("uptime")) { + g.push(d_uptime); + } + if (dtypes.includes("bool")) { + g.push(d_flags); + } + if (dtypes.includes("bitrate")) { + g.push(d_bitrate); + } + if (dtypes.includes("count")) { + g.push(d_count); + } + + return g; + } +}); diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/load.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/load.js index f1a8114463..f3af09895d 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/load.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/load.js @@ -11,6 +11,7 @@ return baseclass.extend({ title: "%H: Load", vlabel: "Load", y_min: "0", + y_max: "0.2", units_exponent: "0", number_format: "%5.2lf", data: { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/memory.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/memory.js index 9b0d179b0a..960d98c108 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/memory.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/memory.js @@ -5,12 +5,14 @@ 'use strict'; 'require baseclass'; +'require uci'; return baseclass.extend({ title: _('Memory'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { var p = []; + var hide_free = uci.get("luci_statistics", "collectd_memory", "HideFree") == "1" ? true : false; var memory = { title: "%H: Memory usage", @@ -21,7 +23,7 @@ return baseclass.extend({ data: { instances: { memory: [ - "free", + ...(hide_free ? [] : ["free"]), "buffered", "cached", "used" @@ -58,7 +60,7 @@ return baseclass.extend({ data: { instances: { percent: [ - "free", + ...(hide_free ? [] : ["free"]), "buffered", "cached", "used" diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/nut.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/nut.js index 5d7a92f7fb..dbd25f6c07 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/nut.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/nut.js @@ -7,125 +7,150 @@ return baseclass.extend({ title: _('UPS'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { - var voltages_ac = { - title: "%H: AC voltages on UPS \"%pi\"", - vlabel: "V", - number_format: "%5.1lfV", - data: { - instances: { - voltage: [ "input", "output" ] - }, - options: { - voltage_output : { color: "00e000", title: "Output voltage", noarea: true, overlay: true }, - voltage_input : { color: "ffb000", title: "Input voltage", noarea: true, overlay: true } + var definitions = []; + var instances; + + function find_instances(dtype, wanted) { + var matching = graph.dataInstances(host, plugin, plugin_instance, dtype).filter(function(instance) { + return wanted.indexOf(instance) > -1; + }); + + return matching.length ? { [dtype]: matching } : null; + } + + if ((instances = find_instances('voltage', [ 'input', 'output' ])) != null) { + definitions.push({ + title: "%H: AC voltages on UPS \"%pi\"", + vlabel: "V", + number_format: "%5.1lfV", + data: { + instances: instances, + options: { + voltage_output : { color: "00e000", title: "Output voltage", noarea: true, overlay: true }, + voltage_input : { color: "ffb000", title: "Input voltage", noarea: true, overlay: true } + } + } + }); + } + + if ((instances = find_instances('voltage', [ 'battery' ])) != null) { + definitions.push({ + title: "%H: Battery voltage on UPS \"%pi\"", + vlabel: "V", + number_format: "%5.1lfV", + data: { + instances: instances, + options: { + voltage: { color: "0000ff", title: "Battery voltage", noarea: true, overlay: true } + } } - } - }; + }); + } - var voltages_dc = { - title: "%H: Battery voltage on UPS \"%pi\"", - vlabel: "V", - number_format: "%5.1lfV", - data: { - instances: { - voltage: [ "battery" ] - }, - options: { - voltage: { color: "0000ff", title: "Battery voltage", noarea: true, overlay: true } + if ((instances = find_instances('current', [ 'battery', 'output' ])) != null) { + definitions.push({ + title: "%H: Current on UPS \"%pi\"", + vlabel: "A", + number_format: "%5.3lfA", + data: { + instances: instances, + options: { + current_output : { color: "00e000", title: "Output current", noarea: true, overlay: true }, + current_battery: { color: "0000ff", title: "Battery current", noarea: true, overlay: true } + } } - } - }; + }); + } - var currents = { - title: "%H: Current on UPS \"%pi\"", - vlabel: "A", - number_format: "%5.3lfA", - data: { - instances: { - current: [ "battery", "output" ] - }, - options: { - current_output : { color: "00e000", title: "Output current", noarea: true, overlay: true }, - current_battery: { color: "0000ff", title: "Battery current", noarea: true, overlay: true } + if ((instances = find_instances('percent', [ 'charge', 'load' ])) != null) { + definitions.push({ + title: "%H: Battery charge/load on UPS \"%pi\"", + vlabel: "Percent", + y_min: "0", + y_max: "100", + number_format: "%5.1lf%%", + data: { + instances: instances, + options: { + percent_charge: { color: "00ff00", title: "Charge level", noarea: true, overlay: true }, + percent_load: { color: "ff0000", title: "Load", noarea: true, overlay: true } + } } - } - }; + }); + } - var percentage = { - title: "%H: Battery charge/load on UPS \"%pi\"", - vlabel: "Percent", - y_min: "0", - y_max: "100", - number_format: "%5.1lf%%", - data: { - instances: { - percent: [ "charge", "load" ] - }, - options: { - percent_charge: { color: "00ff00", title: "Charge level", noarea: true, overlay: true }, - percent_load: { color: "ff0000", title: "Load", noarea: true, overlay: true } + if ((instances = find_instances('temperature', [ 'battery' ])) != null) { + /* Note: This is in ISO8859-1 for rrdtool. Welcome to the 20th century. */ + definitions.push({ + title: "%H: Battery temperature on UPS \"%pi\"", + vlabel: "\u00b0C", + number_format: "%5.1lf\u00b0C", + data: { + instances: instances, + options: { + temperature_battery: { color: "ffb000", title: "Battery temperature", noarea: true } + } } - } - }; + }); + } - /* Note: This is in ISO8859-1 for rrdtool. Welcome to the 20th century. */ - var temperature = { - title: "%H: Battery temperature on UPS \"%pi\"", - vlabel: "\u00b0C", - number_format: "%5.1lf\u00b0C", - data: { - instances: { - temperature: "battery" - }, - options: { - temperature_battery: { color: "ffb000", title: "Battery temperature", noarea: true } + if ((instances = find_instances('timeleft', [ 'battery' ])) != null) { + definitions.push({ + title: "%H: Time left on UPS \"%pi\"", + vlabel: "Minutes", + number_format: "%.1lfm", + data: { + instances: instances, + options: { + timeleft_battery: { color: "0000ff", title: "Time left", transform_rpn: "60,/", noarea: true } + } } - } - }; + }); + } - var timeleft = { - title: "%H: Time left on UPS \"%pi\"", - vlabel: "Minutes", - number_format: "%.1lfm", - data: { - instances: { - timeleft: [ "battery" ] - }, - options: { - timeleft_battery: { color: "0000ff", title: "Time left", transform_rpn: "60,/", noarea: true } + if ((instances = find_instances('power', [ 'watt-ups' ])) != null) { + definitions.push({ + title: "%H: Power on UPS \"%pi\"", + vlabel: "Watt", + number_format: "%5.1lf%%", + data: { + instances: instances, + options: { + ['power_watt-ups']: { color: "00ff00", title: "Power level (Watt)" } + } } - } - }; + }); + } - var power = { - title: "%H: Power on UPS \"%pi\"", - vlabel: "Power", - number_format: "%5.1lf%%", - data: { - instances: { - power: [ "ups" ] - }, - options: { - power_ups: { color: "00ff00", title: "Power level" } + if ((instances = find_instances('power', [ 'ups' ])) != null) { + definitions.push({ + title: "%H: Power on UPS \"%pi\"", + vlabel: "VA", + number_format: "%5.1lf%%", + data: { + instances: instances, + options: { + power_ups: { color: "00ff00", title: "Power level (VA)" } + } } - } - }; + }); + } - var frequencies = { - title: "%H: Frequencies on UPS \"%pi\"", - vlabel: "Hz", - number_format: "%5.1lfHz", - data: { - instances: { - frequency: [ "input", "output" ] - }, - options: { - frequency_output : { color: "00e000", title: "Output frequency", noarea: true, overlay: true }, - frequency_input : { color: "ffb000", title: "Input frequency", noarea: true, overlay: true } + if ((instances = find_instances('frequency', [ 'input', 'output' ])) != null) { + definitions.push({ + title: "%H: Frequencies on UPS \"%pi\"", + vlabel: "Hz", + number_format: "%5.1lfHz", + data: { + instances: instances, + options: { + frequency_output : { color: "00e000", title: "Output frequency", noarea: true, overlay: true }, + frequency_input : { color: "ffb000", title: "Input frequency", noarea: true, overlay: true } + } } - } - }; + }); + } - return [ voltages_ac, voltages_dc, currents, percentage, temperature, timeleft, power, frequencies ]; + return definitions; } }); diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/ping.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/ping.js index 27624828c2..335e976794 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/ping.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/ping.js @@ -28,6 +28,8 @@ return baseclass.extend({ var droprate = { title: "%H: ICMP Drop Rate", vlabel: "%", + y_min: "0", + y_max: "4", number_format: "%5.2lf %%", data: { types: [ "ping_droprate" ], @@ -45,6 +47,8 @@ return baseclass.extend({ var stddev = { title: "%H: ICMP Standard Deviation", vlabel: "ms", + y_min: "0", + y_max: "1", number_format: "%5.1lf ms", data: { types: [ "ping_stddev" ], diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/sensors.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/sensors.js index b3361e1bf4..f612e39f6b 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/sensors.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/sensors.js @@ -7,20 +7,112 @@ return baseclass.extend({ title: _('Sensors'), rrdargs: function(graph, host, plugin, plugin_instance, dtype) { - return { - per_instance: true, - title: "%H: %pi - %di", - vlabel: "\xb0C", - number_format: "%4.1lf\xb0C", - data: { - types: [ "temperature" ], - options: { - temperature__value: { - color: "ff0000", - title: "Temperature" + var rv = []; + var types = graph.dataTypes(host, plugin, plugin_instance); + + if (types.indexOf('temperature') > -1) { + rv.push({ + per_instance: true, + title: "%H: %pi - %di", + vlabel: "\xb0C", + number_format: "%4.1lf\xb0C", + data: { + types: [ "temperature" ], + options: { + temperature__value: { + color: "ff0000", + title: "Temperature" + } + } + } + }); + } + if (types.indexOf('humidity') > -1) { + rv.push({ + per_instance: true, + title: "%H: %pi - %di", + vlabel: "%RH", + number_format: "%4.1lf %%RH", + data: { + types: [ "humidity" ], + options: { + humidity__value: { + color: "0000ff", + title: "Humidity" + } + } + } + }); + } + if (types.indexOf('voltage') > -1) { + rv.push({ + per_instance: true, + title: "%H: %pi - %di", + vlabel: "V", + number_format: "%4.1lf V", + data: { + types: [ "voltage" ], + options: { + voltage__value: { + color: "0000ff", + title: "Voltage" + } + } + } + }); + } + if (types.indexOf('current') > -1) { + rv.push({ + per_instance: true, + title: "%H: %pi - %di", + vlabel: "A", + number_format: "%4.1lf A", + data: { + types: [ "current" ], + options: { + current__value: { + color: "00ff00", + title: "Current" + } + } + } + }); + } + if (types.indexOf('power') > -1) { + rv.push({ + per_instance: true, + title: "%H: %pi - %di", + vlabel: "W", + number_format: "%4.1lf W", + data: { + types: [ "power" ], + options: { + power__value: { + color: "ff0000", + title: "Power" + } } } - } - }; + }); + } + if (types.indexOf('fanspeed') > -1) { + rv.push({ + per_instance: true, + title: "%H: %pi - %di", + vlabel: "rpm", + number_format: "%4lf rpm", + data: { + types: [ "fanspeed" ], + options: { + fanspeed__value: { + color: "0000ff", + title: "Fan speed" + } + } + } + }); + } + + return rv; } }); diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/graphs.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/graphs.js index a3189143eb..db24d18592 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/graphs.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/graphs.js @@ -182,7 +182,7 @@ return view.extend({ E('button', { 'class': 'cbi-button', 'click': function(ev) { location.href = 'collectd' } - }, [ _('Setup collectd') ]) + }, [ _('Set up collectd') ]) ]) ]); }, diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/memory.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/memory.js index a4a8eb2761..864857faa3 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/memory.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/memory.js @@ -11,6 +11,11 @@ return baseclass.extend({ o = s.option(form.Flag, 'enable', _('Enable this plugin')); + o = s.option(form.Flag, 'HideFree', _('Hide free memory'), + _('Hiding the free memory item makes the graph to scale to actual memory usage, not to 100%.')); + o.default = '0'; + o.rmempty = false; + o = s.option(form.Flag, 'ValuesAbsolute', _('Absolute values'), _('When set to true, we request absolute values')); o.default = '1'; o.depends('enable', '1'); diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/ping.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/ping.js index e08ff6497b..0c827e8a0b 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/ping.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/ping.js @@ -34,9 +34,9 @@ return baseclass.extend({ o.depends('enable', '1'); o=s.option(form.Value,'MaxMissed',_('Maximum Missed Packets'), - _('When a host has not replied to this number of packets in a row, re-resolve the hostname in DNS. Useful for dynamic DNS hosts.')); - o.placeholder = '10'; - o.datatype = 'uinteger'; + _('When a host has not replied to this number of packets in a row, re-resolve the hostname in DNS. Useful for dynamic DNS hosts. Default is -1 = disabled.')); + o.placeholder = '-1'; + o.datatype = 'and(min(-1),integer)' o.optional = true; o.depends('enable', '1'); }, diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/rrdtool.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/rrdtool.js index c1eb171ee7..7e2704a2c3 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/rrdtool.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/rrdtool.js @@ -16,6 +16,11 @@ return baseclass.extend({ o.default = '/tmp/rrd'; o.depends('enable', '1'); + o = s.option(form.Flag, 'backup', _('Backup RRD statistics'), + _('Backup and restore RRD statistics to/from non-volatile storage around shutdown, reboot, and/or sysupgrade')); + o.default = '0'; + o.depends('enable', '1'); + o = s.option(form.Value, 'StepSize', _('RRD step interval'), _('Seconds')); o.placeholder = '30'; o.datatype = 'uinteger'; @@ -50,7 +55,7 @@ return baseclass.extend({ }; o = s.option(form.Value, 'RRARows', _('Rows per RRA')); - o.default = '144'; + o.default = '288'; o.datatype = 'min(1)'; o.depends('enable', '1'); diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/sensors.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/sensors.js index 8424966d2d..a55be1f4f4 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/sensors.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/sensors.js @@ -8,6 +8,8 @@ var sensorTypes = [ /^(?:ain|in|vccp|vdd|vid|vin|volt|voltbatt|vrm)[0-9]*$/, 'voltage', /^(?:cpu_temp|remote_temp|temp)[0-9]*$/, 'temperature', /^(?:fan)[0-9]*$/, 'fanspeed', + /^(?:humidity)[0-9]*$/, 'humidity', + /^(?:curr)[0-9]*$/, 'current', /^(?:power)[0-9]*$/, 'power' ]; 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') + ); } }); |