This repository was archived by the owner on Feb 27, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathip.html
More file actions
68 lines (67 loc) · 3.02 KB
/
Copy pathip.html
File metadata and controls
68 lines (67 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<script type="text/x-red" data-template-name="ip">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label><i class="fa fa-home"></i> <span data-i18n="ip.label.internal"></span></label>
<input type="checkbox" id="node-input-internalIPv4" style="width:auto; margin-bottom: 5px;"/>
<label for="node-input-internalIPv4" style="width:45px;"><span data-i18n="ip.label.ipv4"></span></label>
<input type="checkbox" id="node-input-internalIPv6" style="width:auto; margin-bottom: 5px;"/>
<label for="node-input-internalIPv6" style="width:45px;"><span data-i18n="ip.label.ipv6"></span></label>
</div>
<div class="form-row">
<label><i class="fa fa-globe"></i> <span data-i18n="ip.label.public"></span></label>
<input type="checkbox" id="node-input-publicIPv4" style="width:auto; margin-bottom: 5px;"/>
<label for="node-input-publicIPv4" style="width:45px;"><span data-i18n="ip.label.ipv4"></span></label>
<input type="checkbox" id="node-input-publicIPv6" style="width:auto; margin-bottom: 5px;"/>
<label for="node-input-publicIPv6" style="width:45px;"><span data-i18n="ip.label.ipv6"></span></label>
<input type="checkbox" id="node-input-https" style="width:auto; margin-bottom: 5px;"/>
<label for="node-input-https" style="width:45px;"><span data-i18n="ip.label.https"></span></label>
<span data-i18n="ip.label.timeout"></span>
<input type="text" id="node-input-timeout" placeholder="5000" style="width:52px;"/>
<span data-i18n="ip.label.ms"></span>
</div>
</script>
<script type="text/javascript">
RED.nodes.registerType('ip',{
category: 'function',
color:"#3fadb5",
defaults: {
name: {value:"ip"},
https: {value:false},
timeout: {value: "5000", required:false, validate:RED.validators.number()},
internalIPv4: {value:true},
internalIPv6: {value:true},
publicIPv4: {value:true},
publicIPv6: {value:false}
},
inputs:1,
outputs:1,
icon: "bridge.png",
align: "right",
paletteLabel: function() {
return this._("ip.ip");
},
label: function() {
return this.name || this._("ip.ip");
},
labelStyle: function() {
return (this.name)?"node_label_italic":"";
},
oneditprepare: function() {
$("#node-input-timeout").spinner({
min:5000,
max:10000
});
},
oneditsave: function() {
var timeout = $("#node-input-timeout").val();
if(timeout < 5000){
$("#node-input-timeout").val(5000);
}else if(timeout > 10000){
$("#node-input-timeout").val(10000);
}
}
});
</script>