From 5374ccaf4ae7a3b9bd403b5475a2138e5a4b34c7 Mon Sep 17 00:00:00 2001 From: Kevin Bonnoron <2421321+KevinBonnoron@users.noreply.github.com> Date: Tue, 16 Jan 2024 09:05:55 +0000 Subject: [PATCH 1/3] fix: remove extra parameters for GET nodes --- src/nodes/connection/connection.js | 6 ++---- src/nodes/lan-browser/lan-browser.js | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/nodes/connection/connection.js b/src/nodes/connection/connection.js index 3613270..ba6c87d 100644 --- a/src/nodes/connection/connection.js +++ b/src/nodes/connection/connection.js @@ -8,12 +8,10 @@ module.exports = (RED) => { super(config, RED); } - getData(msg) { + getData() { return { - ...msg, url: '/connection', - method: 'GET', - payload: undefined + method: 'GET' } } } diff --git a/src/nodes/lan-browser/lan-browser.js b/src/nodes/lan-browser/lan-browser.js index 1fc381e..5fbe5fa 100644 --- a/src/nodes/lan-browser/lan-browser.js +++ b/src/nodes/lan-browser/lan-browser.js @@ -8,12 +8,10 @@ module.exports = (RED) => { super(config, RED); } - getData(msg) { + getData() { return { - ...msg, url: '/lan/browser/pub', - method: 'GET', - payload: undefined + method: 'GET' }; } } From 57264f200c080e89cca52128e96b4130e67ed01a Mon Sep 17 00:00:00 2001 From: Kevin Bonnoron <2421321+KevinBonnoron@users.noreply.github.com> Date: Tue, 16 Jan 2024 09:06:26 +0000 Subject: [PATCH 2/3] fix: remove logout as it can lead to crash --- src/nodes/freebox-server/freebox-server.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/nodes/freebox-server/freebox-server.js b/src/nodes/freebox-server/freebox-server.js index c42730b..b361856 100644 --- a/src/nodes/freebox-server/freebox-server.js +++ b/src/nodes/freebox-server/freebox-server.js @@ -46,7 +46,6 @@ module.exports = function (RED) { }; this._statusChanged = new EventEmitter(); - node.on('close', () => this.logout()); this.init(config); } @@ -206,18 +205,6 @@ module.exports = function (RED) { }); } - /** - * logout - * - * @return void - */ - logout() { - this.apiCall('/login/logout', { method: 'POST' }).then(() => { - RED.log.info('Session closed'); - this._statusChanged.emit('session.closed'); - }); - } - /** * apiCall * From 9745d0e8dcd9078d04167a25666ba8feba0f8e3a Mon Sep 17 00:00:00 2001 From: Kevin Bonnoron <2421321+KevinBonnoron@users.noreply.github.com> Date: Tue, 16 Jan 2024 09:06:37 +0000 Subject: [PATCH 3/3] feat: add some translations --- src/common/base.node.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/base.node.js b/src/common/base.node.js index a9d9fe0..ea3a6d1 100644 --- a/src/common/base.node.js +++ b/src/common/base.node.js @@ -2,8 +2,8 @@ const prettyDate = require('../helpers/date.helper'); const STATUSES = { - NOT_CONNECTED: { fill: 'red', shape: 'ring', text: 'not connected' }, - CONNECTED: { fill: 'green', shape: 'dot', text: 'connected' }, + NOT_CONNECTED: { fill: 'red', shape: 'ring', text: 'node-red:common.status.not-connected' }, + CONNECTED: { fill: 'green', shape: 'dot', text: 'node-red:common.status.connected' }, SERVER_VALIDATION_PENDING: { fill: 'yellow', shape: 'dot', text: 'server validation pending' }, SERVER_VALIDATION_TIMEOUT: { fill: 'orange', shape: 'dot', text: 'server validation timeout' }, INVALID_CONFIGURATION: { fill: 'red', shape: 'dot', text: 'invalid configuration' },