mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
make Prowl consistent with Pushbullet
This commit is contained in:
parent
2c80c90f84
commit
3a4f870257
@ -32,6 +32,7 @@
|
|||||||
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
|
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
|
||||||
<input type="text" id="node-input-name" placeholder="Name">
|
<input type="text" id="node-input-name" placeholder="Name">
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-tips" id="node-tip"><b>Note:</b> Using credentials from global pushkey.js file.</div>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/x-red" data-help-name="prowl">
|
<script type="text/x-red" data-help-name="prowl">
|
||||||
@ -69,6 +70,8 @@
|
|||||||
} else {
|
} else {
|
||||||
$('#node-config-input-pushkey').val('');
|
$('#node-config-input-pushkey').val('');
|
||||||
}
|
}
|
||||||
|
if (data.global) $('#node-tip').show();
|
||||||
|
else $('#node-tip').hide();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
oneditsave: function() {
|
oneditsave: function() {
|
||||||
|
@ -75,7 +75,13 @@ RED.httpAdmin.get('/prowl/:id',function(req,res) {
|
|||||||
var credentials = RED.nodes.getCredentials(req.params.id);
|
var credentials = RED.nodes.getCredentials(req.params.id);
|
||||||
if (credentials) {
|
if (credentials) {
|
||||||
res.send(JSON.stringify({hasPassword:(credentials.pushkey&&credentials.pushkey!="")}));
|
res.send(JSON.stringify({hasPassword:(credentials.pushkey&&credentials.pushkey!="")}));
|
||||||
} else {
|
}
|
||||||
|
else if (pushkeys && pushkeys.prowlkey) {
|
||||||
|
RED.nodes.addCredentials(req.params.id,{pushkey:pushkeys.prowlkey,global:true});
|
||||||
|
credentials = RED.nodes.getCredentials(req.params.id);
|
||||||
|
res.send(JSON.stringify({hasPassword:(credentials.pushkey&&credentials.pushkey!=""),global:credentials.global}));;
|
||||||
|
}
|
||||||
|
else {
|
||||||
res.send(JSON.stringify({}));
|
res.send(JSON.stringify({}));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user