-
Notifications
You must be signed in to change notification settings - Fork 0
chore: fixed status-store node #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
alvarobernal2412
left a comment
There was a problem hiding this 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í |
There was a problem hiding this comment.
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
| 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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
| <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"> |
There was a problem hiding this comment.
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
| 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; |
There was a problem hiding this comment.
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;…ce/node-red-status into status-storer-fix
…ce/node-red-status into status-storer-fix
95b428b to
829a83e
Compare
b813d0b to
b661390
Compare
b8ab5ef to
730d151
Compare
No description provided.