Skip to content

Commit

Permalink
feat: new option to to get some delay on server close
Browse files Browse the repository at this point in the history
feat: new tab limits in server
  • Loading branch information
biancode committed Oct 16, 2018
1 parent 5905d0d commit 0f89d73
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 33 deletions.
3 changes: 2 additions & 1 deletion src/locales/en-US/opcua-iiot-server.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"users": "Users & Sets",
"settings": "Settings",
"security": "Security",
"discovery": "Discovery"
"discovery": "Discovery",
"limits": "Limits"
}
}
}
61 changes: 32 additions & 29 deletions src/opcua-iiot-server.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
capabilitiesForMDNS: {value: ''},
maxNodesPerRead: {value: 1000, validate:function(v) { return ((v === '') || (RED.validators.number(v) && (v > 0) && (v <= 100000))) }},
maxNodesPerBrowse: {value: 2000, validate:function(v) { return ((v === '') || (RED.validators.number(v) && (v > 0) && (v <= 200000))) }},
delayToClose: {value: 500, validate:function(v) { return ((v === '') || (RED.validators.number(v) && (v >= 100) && (v <= 15000))) }}
delayToClose: {value: 100, validate:function(v) { return ((v === '') || (RED.validators.number(v) && (v >= 100) && (v <= 15000))) }}
},
inputs: 1,
outputs: 1,
Expand Down Expand Up @@ -66,6 +66,11 @@
label: this._("opcua-iiot-contrib.tabs-label.settings")
})

tabs.addTab({
id: "opcuaiiot-server-tab-limits",
label: this._("opcua-iiot-contrib.tabs-label.limits")
})

tabs.addTab({
id: "opcuaiiot-server-tab-security",
label: this._("opcua-iiot-contrib.tabs-label.security")
Expand Down Expand Up @@ -327,10 +332,6 @@
})
})

if (node.asoDemo === null || typeof node.asoDemo === 'undefined') {
asoDemo = true
}

// console.log('well done editsave ...')
}
})
Expand All @@ -352,33 +353,13 @@
<input type="text" id="node-input-endpoint" placeholder="UA/NodeREDIIoTServer">
</div>
<div class="form-row">
<label for="node-input-maxAllowedSessionNumber"><i class="icon-list"></i> <span data-i18n="opcua-iiot-contrib.label.maxAllowedSessionNumber"></span></label>
<input type="text" id="node-input-maxAllowedSessionNumber" placeholder="10" style="width:80px">
</div>
<div class="form-row">
<label for="node-input-maxConnectionsPerEndpoint"><i class="icon-list"></i> <span data-i18n="opcua-iiot-contrib.label.maxConnectionsPerEndpoint"></span></label>
<input type="text" id="node-input-maxConnectionsPerEndpoint" placeholder="10" style="width:80px">
</div>
<div class="form-row">
<label for="node-input-maxAllowedSubscriptionNumber"><i class="icon-list"></i> <span data-i18n="opcua-iiot-contrib.label.maxAllowedSubscriptionNumber"></span></label>
<input type="text" id="node-input-maxAllowedSubscriptionNumber" placeholder="50" style="width:80px">
</div>
<div class="form-row">
<label for="node-input-maxNodesPerRead"><i class="icon-list"></i> <span data-i18n="opcua-iiot-contrib.label.maxNodesPerRead"></span></label>
<input type="text" id="node-input-maxNodesPerRead" placeholder="10" style="width:80px">
</div>
<div class="form-row">
<label for="node-input-maxNodesPerBrowse"><i class="icon-list"></i> <span data-i18n="opcua-iiot-contrib.label.maxNodesPerBrowse"></span></label>
<input type="text" id="node-input-maxNodesPerBrowse" placeholder="10" style="width:80px">
</div>
<div class="form-row">
<label for="node-input-delayToClose"><i class="icon-time"></i> <span data-i18n="opcua-iiot-contrib.label.delayToClose"></span></label>
<input type="text" id="node-input-delayToClose" placeholder="500" style="width:80px">
<label for="node-input-alternateHostname"><i class="fa fa-server"></i> <span data-i18n="opcua-iiot-contrib.label.alternateHostname"></span></label>
<input type="text" id="node-input-alternateHostname" placeholder="">
</div>
<hr>
<div class="form-row">
<label for="node-input-alternateHostname"><i class="fa fa-server"></i> <span data-i18n="opcua-iiot-contrib.label.alternateHostname"></span></label>
<input type="text" id="node-input-alternateHostname" placeholder="">
<label for="node-input-delayToClose"><i class="icon-time"></i> <span data-i18n="opcua-iiot-contrib.label.delayToClose"></span></label>
<input type="text" id="node-input-delayToClose" placeholder="100" style="width:80px">
</div>
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
Expand Down Expand Up @@ -407,6 +388,28 @@
<input type="checkbox" id="node-input-showErrors" style="max-width:30px">
</div>
</div>
<div id="opcuaiiot-server-tab-limits" style="display:none">
<div class="form-row">
<label for="node-input-maxAllowedSessionNumber"><i class="icon-list"></i> <span data-i18n="opcua-iiot-contrib.label.maxAllowedSessionNumber"></span></label>
<input type="text" id="node-input-maxAllowedSessionNumber" placeholder="10" style="width:80px">
</div>
<div class="form-row">
<label for="node-input-maxConnectionsPerEndpoint"><i class="icon-list"></i> <span data-i18n="opcua-iiot-contrib.label.maxConnectionsPerEndpoint"></span></label>
<input type="text" id="node-input-maxConnectionsPerEndpoint" placeholder="10" style="width:80px">
</div>
<div class="form-row">
<label for="node-input-maxAllowedSubscriptionNumber"><i class="icon-list"></i> <span data-i18n="opcua-iiot-contrib.label.maxAllowedSubscriptionNumber"></span></label>
<input type="text" id="node-input-maxAllowedSubscriptionNumber" placeholder="50" style="width:80px">
</div>
<div class="form-row">
<label for="node-input-maxNodesPerRead"><i class="icon-list"></i> <span data-i18n="opcua-iiot-contrib.label.maxNodesPerRead"></span></label>
<input type="text" id="node-input-maxNodesPerRead" placeholder="1000" style="width:80px">
</div>
<div class="form-row">
<label for="node-input-maxNodesPerBrowse"><i class="icon-list"></i> <span data-i18n="opcua-iiot-contrib.label.maxNodesPerBrowse"></span></label>
<input type="text" id="node-input-maxNodesPerBrowse" placeholder="2000" style="width:80px">
</div>
</div>
<div id="opcuaiiot-server-tab-security" style="display:none">
<div class="form-row">
<!-- SecurityPolicy enum via REST -->
Expand Down
2 changes: 1 addition & 1 deletion src/opcua-iiot-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module.exports = function (RED) {
// limits
this.maxNodesPerRead = config.maxNodesPerRead || 1000
this.maxNodesPerBrowse = config.maxNodesPerBrowse || 2000
this.delayToClose = config.delayToClose || 500
this.delayToClose = config.delayToClose || 100

let node = this
node.initialized = false
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/opcua-iiot-connector-e2e.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ describe('OPC UA Connector node e2e Testing', function () {
n2.on('input', function (msg) {
expect(msg.payload).toBe(1000)
expect(msg.topic).toBe('TestTopicWrite')
done()
setTimeout(done, 3000)
})
})
})
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/opcua-iiot-listener-e2e.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ describe('OPC UA Listener monitoring node e2e Testing', function () {
expect(msg.topic).toBe('TestTopicSubscribe')
expect(msg.payload.value.dataType).toBe('Int32')
expect(msg.payload.statusCode).toBeDefined()
setTimeout(done, 2000)
setTimeout(done, 3000)
}
})
})
Expand Down

0 comments on commit 0f89d73

Please sign in to comment.