Removing API key from export function

This commit is contained in:
henols
2014-02-10 15:54:36 +01:00
parent dc13290f97
commit 84f5d7513b
2 changed files with 66 additions and 2 deletions

View File

@@ -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>