forked from jrobert-github/Node-Red-IoTBnB-API
-
Notifications
You must be signed in to change notification settings - Fork 1
/
iotbnb.html
executable file
·140 lines (136 loc) · 6.28 KB
/
iotbnb.html
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<script type="text/javascript">
function oneditprepare() {
//do nothing
}
RED.nodes.registerType('iotbnb',{
category: 'IoT standard',
color: '#00AFF0',
defaults: {
latitude: {value:""},
longitude: {value:""},
radius: {value:""},
name: {value:""},
operations: {value:""},
type1: {value:"all"},
price: {value:""},
reputation: {value:""},
service: {value:""},
},
inputs:1,
outputs:1,
icon: "feed.png",
label: function() {
return this.name||"iotbnb";
},
oneditprepare: function() {
var oper = $("#node-input-operations").val();
//var oper_readTypes = $("#node-input-readTypes").val();
if (oper == undefined) {
$(".node-input-Geo1").hide();
$(".node-input-Geo2").hide();
$(".node-input-Geo3").hide();
$(".node-input-type1").hide();
$(".node-input-price").hide();
$(".node-input-reputation").hide();
$(".node-input-service").hide();
}
},
/*oneditsave: function() {
var type = $("#node-input-readTypes").val();
if (type == "subscriboooe") {
console.log("totoooo");
}
},*/
labelStyle: function() {
return this.name?"node_label_italic":"";
}
//oneditprepare: oneditprepare
});
</script>
<script type="text/x-red" data-template-name="iotbnb">
<!--<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">-->
</div>
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" data-i18n="Name">
</div>
<div class="form-row">
<label for="node-input-operations"><i class="fa fa-envelope"></i> Interface</label>
<select type="text" id="node-input-operations" placeholder="Toto">
<option value="getAllServices">getAllServices</option>
<option value="searchServices">searchServices</option>
<option value="getServiceAccessInformation">getServiceAccessInformation</option>
</select>
</div>
<div class="form-row node-input-Geo1">
<label for="node-input-Geo1"><i class="fa fa-map-marker"></i> Geo-Filter</label> <span data-i18n="type1"></span></label>
<input type="text" id="node-input-latitude" placeholder="Set latitude (by default: n/a, i.e. parameter not used)">
</div>
<div class="form-row node-input-Geo2">
<label for="node-input-Geo2"> </label> <span data-i18n="type1"></span></label>
<input type="text" id="node-input-longitude" placeholder="Set longitude (by default: n/a, i.e. parameter not used)">
</div>
<div class="form-row node-input-Geo3">
<label for="node-input-Geo3"></label> <span data-i18n="type1"></span></label>
<input type="text" id="node-input-radius" placeholder="Set a radius (by default: 100m)">
</div>
<div class="form-row node-input-type1">
<label for="node-input-type1"><i class="fa fa-search"></i> Type</label> <span data-i18n="type1"></span></label>
<input type="text" id="node-input-type1" placeholder="Set an INSPIRE theme if desired (by default: all)">
</div>
<div class="form-row node-input-price">
<label for="node-input-price"><i class="fa fa-btc"></i> Price</label> <span data-i18n="price"></span></label>
<input type="text" id="node-input-price" placeholder="Set the price if you want to buy at a specific price (by default: 0)">
</div>
<div class="form-row node-input-reputation">
<label for="node-input-reputation"><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i> Reputation</label> <span data-i18n="reputation"></span></label>
<input type="text" id="node-input-reputation" placeholder="Set the reputation if desired (by default: all)">
</div>
<div class="form-row node-input-service">
<label for="node-input-service"><i class="fa fa-search"></i> Service</label> <span data-i18n="service"></span></label>
<input type="text" id="node-input-service" placeholder="Set a service">
</div>
<script>
$("#node-input-operations").change(function() {
var oper = $("#node-input-operations").val();
if (oper == "getAllServices") {
$(".node-input-Geo1").hide();
$(".node-input-Geo2").hide();
$(".node-input-Geo3").hide();
$(".node-input-type1").hide();
$(".node-input-price").hide();
$(".node-input-reputation").hide();
$(".node-input-service").hide();
} else if (oper == "searchServices") {
$(".node-input-Geo1").show();
$(".node-input-Geo2").show();
$(".node-input-Geo3").show();
$(".node-input-type1").show();
$(".node-input-price").show();
$(".node-input-reputation").show();
$(".node-input-service").hide();
}
else if (oper == "getServiceAccessInformation") {
$(".node-input-Geo1").hide();
$(".node-input-Geo2").hide();
$(".node-input-Geo3").hide();
$(".node-input-type1").hide();
$(".node-input-price").hide();
$(".node-input-reputation").hide();
$(".node-input-service").show();
}
});
</script>
</script>
<script type="text/x-red" data-help-name="iotbnb">
<p> operations= n.operations || msg.operations;
latitude= n.latitude || msg.latitude;
longitude= n.longitude || msg.longitude;
radius= n.radius || msg.radius;
price= n.price || msg.price;
type1= n.type1 || msg.type1;
reputation= n.reputation || msg.reputation;
service= n.service || msg.service;
</script>