|
2 | 2 | window.connectionManager = []; |
3 | 3 |
|
4 | 4 | function validator(v) { |
5 | | - return (v !== null && v !== undefined && v !== ""); |
| 5 | + return (v !== null && v !== undefined && v !== "" && v !== "err"); |
6 | 6 | } |
7 | 7 |
|
8 | 8 | function validateConnection(v) { |
|
86 | 86 | $("select#node-input-property").empty(); |
87 | 87 | $("<option value='" + "" + "'> " + "No connection selected" + "</option>").appendTo("#node-input-property"); |
88 | 88 | $("#node-input-property").trigger("change"); |
89 | | - } else if (thing_id !== "updating" && property_id !== "updating" && thing_text !== " Wrong credentials or system unavailable.") { |
| 89 | + } else if (thing_id !== "updating" && property_id !== "updating" && thing_id !== "err") { |
90 | 90 | if (thing_id === undefined || thing_id === null || thing_id === "") { |
91 | 91 | $("select#node-input-property").empty(); |
92 | 92 | $("<option value='" + "" + "'> " + "No thing selected" + "</option>").appendTo("#node-input-property"); |
|
164 | 164 | $("select#node-input-thing").empty(); |
165 | 165 | if (things && typeof (things) == "object" && things.error) { |
166 | 166 | $("select#node-input-thing").empty(); |
167 | | - $("<option value='" + "" + "'> " + things.error + "</option>").appendTo("#node-input-thing"); |
| 167 | + $("<option value='" + "err" + "'> " + things.error + "</option>").appendTo("#node-input-thing"); |
168 | 168 | $("select#node-input-property").empty(); |
169 | 169 | $("<option value='" + "" + "'> " + things.error + "</option>").appendTo("#node-input-property"); |
170 | 170 | $("#node-input-thing").trigger("change"); |
|
200 | 200 | $.getJSON(`properties?${queryString}`, properties => { |
201 | 201 | $("select#node-input-property").empty(); |
202 | 202 | if (properties && typeof (properties) == "object" && properties.error) { |
203 | | - $("select#node-input-thing").empty(); |
204 | | - $("<option value='" + "" + "'> " + things.error + "</option>").appendTo("#node-input-thing"); |
205 | 203 | $("select#node-input-property").empty(); |
206 | | - $("<option value='" + "" + "'> " + things.error + "</option>").appendTo("#node-input-property"); |
| 204 | + $("<option value='" + "" + "'> " + properties.error + "</option>").appendTo("#node-input-property"); |
207 | 205 | } else if ((properties && Array.isArray(properties) && properties.length !== 0)) { |
208 | 206 | $("<option value='" + "" + "'> " + "Select a property" + "</option>").appendTo("#node-input-property"); |
209 | 207 | for (const p of properties) { |
|
0 commit comments