mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Fix merge conflicts on i18n
This commit is contained in:
@@ -16,32 +16,29 @@
|
||||
|
||||
<script type="text/x-red" data-template-name="redis out">
|
||||
<div class="form-row node-input-hostname">
|
||||
<label for="node-input-hostname"><i class="fa fa-bookmark"></i> Host</label>
|
||||
<label for="node-input-hostname"><i class="fa fa-bookmark"></i> <span data-i18n="redisout.label.host"></span></label>
|
||||
<input class="input-append-left" type="text" id="node-input-hostname" placeholder="127.0.0.1" style="width: 40%;" ><button id="node-input-hostname-lookup" class="btn input-append-right"><span class="caret"></span></button>
|
||||
<label for="node-input-port" style="margin-left: 10px; width: 35px; "> Port</label>
|
||||
<label for="node-input-port" style="margin-left: 10px; width: 35px; "> <span data-i18n="redisout.label.port"></span></label>
|
||||
<input type="text" id="node-input-port" placeholder="6379" style="width:45px">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-key"><i class="fa fa-key"></i> Key</label>
|
||||
<input type="text" id="node-input-key" placeholder="Redis Key">
|
||||
<label for="node-input-key"><i class="fa fa-key"></i> <span data-i18n="redisout.label.key"></span></label>
|
||||
<input type="text" id="node-input-key">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-type"><i class="fa fa-th"></i> Type</label>
|
||||
<label for="node-input-type"><i class="fa fa-th"></i> <span data-i18n="redisout.label.type"></span></label>
|
||||
<select type="text" id="node-input-structtype" style="width: 150px;">
|
||||
<option value="string">String</option>
|
||||
<option value="hash">Hash</option>
|
||||
<option value="set">Set</option>
|
||||
<option value="list">List</option>
|
||||
<option value="string" data-i18n="redisout.type.string"></option>
|
||||
<option value="hash" data-i18n="redisout.type.hash"></option>
|
||||
<option value="set" data-i18n="redisout.type.set"></option>
|
||||
<option value="list" data-i18n="redisout.type.list"></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
||||
<input type="text" id="node-input-name" placeholder="Name">
|
||||
</div>
|
||||
<div class="form-tips">
|
||||
If key is blank, the topic will be used as the key.<br>
|
||||
If type is hash, payload should be an object or field=value string.
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
|
||||
<input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
|
||||
</div>
|
||||
<div class="form-tips"><span data-i18n="[html]redisout.tip"></span></div>
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-help-name="redis out">
|
||||
|
@@ -30,9 +30,6 @@ module.exports = function(RED) {
|
||||
connections[id].on("error",function(err) {
|
||||
RED.log.error(err);
|
||||
});
|
||||
connections[id].on("connect",function() {
|
||||
if (RED.settings.verbose) { RED.log.info("connected to "+host+":"+port); }
|
||||
});
|
||||
connections[id]._id = id;
|
||||
connections[id]._nodeCount = 0;
|
||||
}
|
||||
@@ -64,17 +61,17 @@ module.exports = function(RED) {
|
||||
this.client = redisConnectionPool.get(this.hostname,this.port);
|
||||
|
||||
if (this.client.connected) {
|
||||
this.status({fill:"green",shape:"dot",text:"connected"});
|
||||
this.status({fill:"green",shape:"dot",text:"node-red:common.status.connected"});
|
||||
} else {
|
||||
this.status({fill:"red",shape:"ring",text:"disconnected"},true);
|
||||
this.status({fill:"red",shape:"ring",text:"node-red:common.status.disconnected"},true);
|
||||
}
|
||||
|
||||
var node = this;
|
||||
this.client.on("end", function() {
|
||||
node.status({fill:"red",shape:"ring",text:"disconnected"});
|
||||
node.status({fill:"red",shape:"ring",text:"node-red:common.status.disconnected"});
|
||||
});
|
||||
this.client.on("connect", function() {
|
||||
node.status({fill:"green",shape:"dot",text:"connected"});
|
||||
node.status({fill:"green",shape:"dot",text:"node-red:common.status.connected"});
|
||||
});
|
||||
|
||||
this.on("input", function(msg) {
|
||||
@@ -90,7 +87,7 @@ module.exports = function(RED) {
|
||||
if (r) {
|
||||
this.client.hset(k,r[1],r[2]);
|
||||
} else {
|
||||
this.warn("Invalid payload for redis hash");
|
||||
this.warn(RED._("redisout.errors.invalidpayload"));
|
||||
}
|
||||
}
|
||||
} else if (this.structtype == "set") {
|
||||
@@ -99,7 +96,7 @@ module.exports = function(RED) {
|
||||
this.client.rpush(k,msg.payload);
|
||||
}
|
||||
} else {
|
||||
this.warn("No key or topic set");
|
||||
this.warn(RED._("redisout.errors.nokey"));
|
||||
}
|
||||
});
|
||||
this.on("close", function() {
|
||||
|
21
storage/redis/locales/en-US/65-redisout.json
Normal file
21
storage/redis/locales/en-US/65-redisout.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"redisout": {
|
||||
"label": {
|
||||
"host": "Host",
|
||||
"port": "Port",
|
||||
"key": "Key",
|
||||
"type": "Type"
|
||||
},
|
||||
"type": {
|
||||
"string": "String",
|
||||
"hash": "Hash",
|
||||
"set": "Set",
|
||||
"list": "List"
|
||||
},
|
||||
"tip": "If key is blank, the topic will be used as the key.<br>If type is hash, payload should be an object or field=value string.",
|
||||
"errors": {
|
||||
"invalidpayload": "Invalid payload for redis hash",
|
||||
"nokey": "No key or topic set"
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user