node-red-contrib-linux-network-stats
Version:
collect linux networks stats
58 lines (54 loc) • 1.87 kB
HTML
<script>
RED.nodes.registerType(
'network_stats',
{
category: 'performance',
color: '#58afe0',
defaults: {
name: {
value: ''
},
receivedBytesSec: {
value: true
},
transmittedBytesSec: {
value: true
}
},
inputs: 1,
outputs: 1,
icon: 'network-stats.png',
label: function () {
return this.name || 'Network Stats'
},
oneditprepare: function () {
// select defaults
// traffic
if (typeof this.receivedBytesSec === 'undefined') {
$('#node-input-receivedBytesSec').prop('checked', true)
}
if (typeof this.transmittedBytesSec === 'undefined') {
$('#node-input-transmittedBytesSec').prop('checked', true)
}
}
}
)
</script>
<script type="text/x-red" data-template-name="network_stats">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<h4>Traffic</h4>
<div class="form-row">
<label for="node-input-receivedBytesSec" style="width: auto; margin-right: 1em;"><i class="icon-check"></i> Display received bytes per second</label>
<input type="checkbox" id="node-input-receivedBytesSec" style="display: inline-block; width: auto; vertical-align: top;">
</div>
<div class="form-row">
<label for="node-input-transmittedBytesSec" style="width: auto; margin-right: 1em;"><i class="icon-check"></i> Display transmitted bytes per second</label>
<input type="checkbox" id="node-input-transmittedBytesSec" style="display: inline-block; width: auto; vertical-align: top;">
</div>
</script>
<script type="text/x-red" data-help-name="network_stats">
<p>A node to monitor system network stats</p>
</script>