Change address back to server for backwards compatibility

This commit is contained in:
Olivier Verhaegen 2023-04-14 16:51:10 +02:00 committed by GitHub
parent 8ab9aff3de
commit b764efdd5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -113,9 +113,9 @@
</script>
<script type="text/html" data-template-name="stomp-server">
<div class="form-row node-input-address">
<label for="node-config-input-address"><i class="fa fa-bookmark"></i> Address</label>
<input class="input-append-left" type="text" id="node-config-input-address" placeholder="localhost" style="width: 45%;" >
<div class="form-row node-input-server">
<label for="node-config-input-server"><i class="fa fa-bookmark"></i> Server</label>
<input class="input-append-left" type="text" id="node-config-input-server" placeholder="localhost" style="width: 45%;" >
<label for="node-config-input-port" style="margin-left: 10px; width: 35px; "> Port</label>
<input type="text" id="node-config-input-port" placeholder="Port" style="width:45px">
</div>
@ -157,7 +157,7 @@
RED.nodes.registerType('stomp-server',{
category: 'config',
defaults: {
address: {required:true},
server: {required:true},
port: {value:61613,required:true,validate:RED.validators.number()},
protocolVersion: {value:"1.0",required:true},
vhost: {},

View File

@ -90,7 +90,7 @@ module.exports = function(RED) {
}
// Apply property changes (only if the property exists in the options object)
setIfHasProperty(options, node, "address", init);
setIfHasProperty(options, node, "server", init);
setIfHasProperty(options, node, "port", init);
setIfHasProperty(options, node, "protocolVersion", init);
setIfHasProperty(options, node, "vhost", init);
@ -110,7 +110,7 @@ module.exports = function(RED) {
// Build options for passing to the stomp-client API
node.options = {
address: node.address,
address: node.server,
port: node.port * 1,
user: node.username,
pass: node.password,
@ -431,7 +431,7 @@ module.exports = function(RED) {
} else {
node.error("Missing server config");
}
node.on("close", function(removed, done) {
if (node.serverConnection) {
node.serverConnection.deregister(node, true, done);