node-red-contrib-uos-nats 0.2.58 → 0.2.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
<input type="text" id="node-input-connection">
|
|
32
32
|
</div>
|
|
33
33
|
<div class="form-row">
|
|
34
|
-
<label for="node-input-providerId"><i class="fa fa-
|
|
35
|
-
<input type="text" id="node-input-providerId" placeholder="Leave empty to use Client ID
|
|
34
|
+
<label for="node-input-providerId"><i class="fa fa-tag"></i> Provider ID</label>
|
|
35
|
+
<input type="text" id="node-input-providerId" placeholder="Leave empty to use Client ID">
|
|
36
36
|
</div>
|
|
37
37
|
</script>
|
|
38
38
|
|
package/nodes/datahub-output.js
CHANGED
|
@@ -64,7 +64,15 @@ module.exports = function (RED) {
|
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
66
|
// Retrieve configuration node
|
|
67
|
-
|
|
67
|
+
// Default to Connection's Client ID if providerId is empty/not set
|
|
68
|
+
const configClientId = connection.clientId || 'nodered';
|
|
69
|
+
let pId = (config.providerId || '').trim();
|
|
70
|
+
if (!pId) {
|
|
71
|
+
pId = configClientId;
|
|
72
|
+
// Strip non-alphanumeric chars if Client ID is a UUID/complex string?
|
|
73
|
+
// Usually Provider ID can be matching Client ID exactly.
|
|
74
|
+
}
|
|
75
|
+
this.providerId = pId;
|
|
68
76
|
// this.definitions = config.definitions || [];
|
|
69
77
|
|
|
70
78
|
const defMap = new Map();
|
package/nodes/uos-config.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
defaults: {
|
|
6
6
|
host: { value: '127.0.0.1', required: true },
|
|
7
7
|
port: { value: 49360, required: true, validate: RED.validators.number() },
|
|
8
|
-
clientName: { value: '
|
|
8
|
+
clientName: { value: '', required: true }, // No default, required
|
|
9
9
|
scope: { value: FIXED_SCOPE, required: true },
|
|
10
10
|
},
|
|
11
11
|
credentials: {
|
|
@@ -21,6 +21,10 @@
|
|
|
21
21
|
const $scopeDisplay = $('#uos-scope-display');
|
|
22
22
|
const $scopeSpinner = $('#uos-scope-spinner');
|
|
23
23
|
const $refresh = $('#uos-scope-refresh');
|
|
24
|
+
|
|
25
|
+
// Ensure red border for empty required fields is handled by Node-RED standard 'required: true'
|
|
26
|
+
// but we removed the default value for clientName so it starts empty.
|
|
27
|
+
|
|
24
28
|
const updateDisplay = (text, cls = '') => {
|
|
25
29
|
$scopeDisplay.text(text);
|
|
26
30
|
$scopeDisplay.removeClass('form-tips-warning form-tips-error');
|
|
@@ -69,6 +73,9 @@
|
|
|
69
73
|
const clientId = $('#node-config-input-clientId').val();
|
|
70
74
|
const clientSecret = $('#node-config-input-clientSecret').val();
|
|
71
75
|
|
|
76
|
+
// Show the status box
|
|
77
|
+
$testStatus.show();
|
|
78
|
+
|
|
72
79
|
if (!host || !clientId || !clientSecret) {
|
|
73
80
|
$testStatus.html('<span style="color:var(--red-ui-text-color-error)"><i class="fa fa-exclamation-triangle"></i> Please fill Host, Client ID and Secret</span>');
|
|
74
81
|
return;
|
|
@@ -137,7 +144,8 @@
|
|
|
137
144
|
<button class="red-ui-button" id="uos-config-test-connection" type="button" style="width:100%">
|
|
138
145
|
<i class="fa fa-plug"></i> Test Connection & List Providers
|
|
139
146
|
</button>
|
|
140
|
-
|
|
147
|
+
<!-- Initially hidden, only shown after click. Same width behavior inherited from container logic. -->
|
|
148
|
+
<div id="uos-test-status" class="form-tips" style="margin-top:5px; display:none;"></div>
|
|
141
149
|
</div>
|
|
142
150
|
</script>
|
|
143
151
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-uos-nats",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.60",
|
|
4
4
|
"description": "Node-RED nodes for Weidmüller u-OS Data Hub. Read, write, and provide variables via NATS protocol with OAuth2 authentication. Features: Variable Key resolution, custom icons, example flows, and provider definition caching.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "IoTUeli",
|