node-red-contrib-self-healing
Version:
SHEN: Self-healing extensions for Node-RED.
80 lines (72 loc) • 2.19 kB
HTML
<script type="text/javascript">
RED.nodes.registerType("http-aware", {
category: "SHEN",
defaults: {
name: { value: "" },
baseip: { value: "192.168.0.1/24", required: true },
scanInterval: {
value: 300,
required: true,
validate: RED.validators.number(),
},
},
icon: "status.png",
color: "#74b9ff",
inputs: 1,
outputs: 1,
align: "left",
inputLabels: "triggerScan",
outputLabels: ["allDevices"],
label: function () {
return this.name || "http-aware";
},
});
</script>
<script type="text/html" data-template-name="http-aware">
<div class="form-row">
<label for="node-input-name">
<i class="fa fa-tag"></i>
<span data-i18n="node-red:common.label.name"></span>
</label>
<input
type="text"
id="node-input-name"
data-i18n="[placeholder]node-red:common.label.name"
/>
</div>
<div class="form-row">
<label for="node-input-baseip"> <i class="fa fa-tag"></i> Base IP </label>
<input id="node-input-baseip" placeholder="192.168.0.1/24" />
</div>
<div class="form-row">
<label for="node-input-scanInterval">
<i class="fa fa-tag"></i> scanInterval (s)
</label>
<input type="number" id="node-input-scanInterval" placeholder="300" />
</div>
</script>
<script type="text/html" data-help-name="http-aware">
<p>
A node to continuously scan the network to find working IPs at ports 8080,
443 and 80.
</p>
<h3>Properties</h3>
<dl class="message-properties">
<dt>name<span class="property-type">string</span></dt>
<dd>Name of node to be displayed in editor.</dd>
<dt>baseip<span class="property-type">string</span></dt>
<dd>Network IP to be scanned.</dd>
<dt>scanInterval<span class="property-type">number</span></dt>
<dd>Time interval between scans, in seconds.</dd>
</dl>
<h3>Inputs</h3>
<dl class="message-properties">
<p>Any message.</p>
</dl>
<h3>Outputs</h3>
<dl class="message-properties">
<p>If an IP:port is up, it sends a message.</p>
</dl>
<h3>Details</h3>
<p>Scans all the IPs of the given subnetwork and checks if they are up.</p>
</script>