mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Removing API key from export function
This commit is contained in:
@@ -85,11 +85,36 @@
|
||||
category: 'config',
|
||||
defaults: {
|
||||
server: {value:"http://localhost",required:true},
|
||||
apikey: {value:"",required:true},
|
||||
// apikey: {value:"",required:true},
|
||||
name: {value:""}
|
||||
},
|
||||
label: function() {
|
||||
return this.name||this.server;
|
||||
},
|
||||
oneditprepare: function() {
|
||||
$.getJSON('emoncms-server/'+this.id,function(data) {
|
||||
if (data.apikey) {
|
||||
$('#node-config-input-apikey').val(data.apikey);
|
||||
}
|
||||
});
|
||||
},
|
||||
oneditsave: function() {
|
||||
var newApikey = $('#node-config-input-apikey').val();
|
||||
var credentials = {};
|
||||
credentials.apikey = newApikey;
|
||||
$.ajax({
|
||||
url: 'emoncms-server/'+this.id,
|
||||
type: 'POST',
|
||||
data: credentials,
|
||||
success:function(result){}
|
||||
});
|
||||
},
|
||||
ondelete: function() {
|
||||
$.ajax({
|
||||
url: 'emoncms-server/'+this.id,
|
||||
type: 'DELETE',
|
||||
success: function(result) {}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user