Skip to content

Commit 24b22cc

Browse files
committed
Filterout read only prperties for output nodes
1 parent d8a0b3f commit 24b22cc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

arduino-cloud.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@
1818
return this.name||nodeName;
1919
},
2020
oneditprepare: function() {
21-
debugger;
2221
console.log("thing_id: " + this.thing);
2322
console.log("property_id: " + this.property);
2423
if (this.connection) {
2524
initThings(this.connection, this.thing);
26-
initProperties(this.connection, this.thing, this.property);
25+
initProperties(this.connection, this.thing, this.property,outs);
2726
}
2827
$("select#node-input-connection").change( () => {
2928
const connection = $("#node-input-connection").val();
@@ -45,7 +44,7 @@
4544

4645
const thing_id = $( "#node-input-thing" ).val();
4746
if (thing_id && thing_id !== "0") {
48-
initProperties(this.connection, thing_id);
47+
initProperties(this.connection, thing_id, undefined, outs);
4948
} else
5049
$("select#node-input-property").empty();
5150
});
@@ -135,7 +134,7 @@
135134
}
136135
});
137136
}
138-
function initProperties(connection, thing_id, property_id) {
137+
function initProperties(connection, thing_id, property_id, outs) {
139138
if (thing_id === "" || thing_id === "0")
140139
return;
141140

@@ -151,7 +150,8 @@
151150
$.getJSON(`properties?clientid=${clientid}&clientsecret=${clientsecret}&thing_id=${thing_id}` , properties => {
152151
$("<option value='" + 0 + "'> " + "Select a property" + "</option>").appendTo("#node-input-property");
153152
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");
155155
}
156156
if (property_id) {
157157
$("#node-input-property").val(property_id);

0 commit comments

Comments
 (0)