|
18 | 18 | return this.name||nodeName; |
19 | 19 | }, |
20 | 20 | oneditprepare: function() { |
21 | | - debugger; |
22 | 21 | console.log("thing_id: " + this.thing); |
23 | 22 | console.log("property_id: " + this.property); |
24 | 23 | if (this.connection) { |
25 | 24 | initThings(this.connection, this.thing); |
26 | | - initProperties(this.connection, this.thing, this.property); |
| 25 | + initProperties(this.connection, this.thing, this.property,outs); |
27 | 26 | } |
28 | 27 | $("select#node-input-connection").change( () => { |
29 | 28 | const connection = $("#node-input-connection").val(); |
|
45 | 44 |
|
46 | 45 | const thing_id = $( "#node-input-thing" ).val(); |
47 | 46 | if (thing_id && thing_id !== "0") { |
48 | | - initProperties(this.connection, thing_id); |
| 47 | + initProperties(this.connection, thing_id, undefined, outs); |
49 | 48 | } else |
50 | 49 | $("select#node-input-property").empty(); |
51 | 50 | }); |
|
135 | 134 | } |
136 | 135 | }); |
137 | 136 | } |
138 | | - function initProperties(connection, thing_id, property_id) { |
| 137 | + function initProperties(connection, thing_id, property_id, outs) { |
139 | 138 | if (thing_id === "" || thing_id === "0") |
140 | 139 | return; |
141 | 140 |
|
|
151 | 150 | $.getJSON(`properties?clientid=${clientid}&clientsecret=${clientsecret}&thing_id=${thing_id}` , properties => { |
152 | 151 | $("<option value='" + 0 + "'> " + "Select a property" + "</option>").appendTo("#node-input-property"); |
153 | 152 | for (const p of properties) { |
154 | | - $("<option value='" + p.id + "'>" + p.name + "</option>").appendTo("#node-input-property"); |
| 153 | + if (outs > 0 || p.permission === "READ_WRITE") |
| 154 | + $("<option value='" + p.id + "'>" + p.name + "</option>").appendTo("#node-input-property"); |
155 | 155 | } |
156 | 156 | if (property_id) { |
157 | 157 | $("#node-input-property").val(property_id); |
|
0 commit comments