Initial release: generic CLI agent nodes for Nextcloud Node-RED
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (RED) {
|
||||
function AgentConfigNode(n) {
|
||||
RED.nodes.createNode(this, n);
|
||||
this.cliPath = n.cliPath || 'agent';
|
||||
this.workspaceDir = n.workspaceDir || '/data/agent-workspace';
|
||||
this.apiEndpoint = (n.apiEndpoint || 'http://localhost:3000').replace(/\/$/, '');
|
||||
this.apiKey = this.credentials.apiKey || '';
|
||||
this.autoStart = n.autoStart !== false;
|
||||
this.defaultArgs = n.defaultArgs || '';
|
||||
this.maxConcurrent = parseInt(n.maxConcurrent) || 3;
|
||||
}
|
||||
|
||||
RED.nodes.registerType('agent-config', AgentConfigNode, {
|
||||
credentials: {
|
||||
apiKey: { type: 'password' }
|
||||
}
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user