Skip to content

Conversation

@tirirote
Copy link
Collaborator

No description provided.

Copy link
Member

@alvarobernal2412 alvarobernal2412 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have revised a part of the node, however, due to its fragility it is better to revise it again in a meeting after making these corrections.

defaults: {
name: { value: "" },
backendUrl: { value: "" },
backendUrl: { value: "http://status-backend:3001/api/v1/computations/bulk" }, // Default en JS y aquí
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment should be removed

Comment on lines 9 to 12
bufferSize: { value: 2, validate: RED.validators.number() }, // Validar como número
flushInterval: { value: 2000, validate: RED.validators.number() }, // Validar como número

// Nuevas propiedades para la configuración global de la computación
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These comments should be removed

},
inputs: 1,
outputs: 1,
outputs: 1, // El nodo ahora puede enviar mensajes de error/éxito por su salida
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment should be removed

return this.name || 'status-storer';
},
oneditprepare: function () {
// No hay lógica compleja de UI por ahora, pero se puede añadir aquí si es necesario
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment should be removed

// No hay lógica compleja de UI por ahora, pero se puede añadir aquí si es necesario
},
oneditsave: function () {
// Lógica al guardar los cambios del nodo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment should be removed or written in English

// Lógica al guardar los cambios del nodo
},
oneditcancel: function () {
// Lógica al cancelar los cambios del nodo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment should be removed or written in English

Comment on lines -53 to -54
<label for="node-input-controlId"><i class="fa fa-id-badge"></i> Control ID</label>
<input type="text" id="node-input-controlId" placeholder="Control Identifier">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The controlId should not be removed from the config parameters

Comment on lines +9 to +18
let backendUrl = config.backendUrl || "http://status-backend:3001/api/v1/computations/bulk";
let accessToken = config.accessToken || '';
let bufferSize = parseInt(config.bufferSize || 2);
let flushInterval = parseInt(config.flushInterval || 2000);

// Default properties for a computation group, if not provided per message.
let defaultComputationGroup = config.computationGroup || '';
let defaultFrom = config.from || null;
let defaultTo = config.to || null;
let defaultControlId = config.controlId || null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the config parameters given by the node-red node must. handle the req.body option, so that if the system sends those parameters in the body, the node still works.

Example for parameter eventAName:

let eventAName = msg.req?.body?.eventAName ?? config.eventAName;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants