Dashboards created with node-red-dashboards all have the same favicon
You can easily change this by changing the icons in the .node-red/node-modules/node-red-dashboard/dist
, but this change will be lost the next time you update node-red-dashboard
.
To get a permanent change, add your icon as files icon64x64.png
, icon120x120.png
, and icon192x192.png
to a folder of your choice, e.g. /home/
nodereduser/.node-red/icons
, where nodereduser is the user executing node-red
.
Then stop node-red
and add this to .node-red/settings.js
- Updated Version w/o full path
ui: {
middleware: function (req, res, next) {
if (['/icon64x64.png', '/icon120x120.png', '/icon192x192.png'].includes(req.url)) {
res.sendFile(path.resolve(path.join(__dirname, 'icons', req.url)))
} else {
next()
}
}
},
- Old Version
ui: {
middleware: function (req, res, next) {
path = require('path')
if (['/icon64x64.png', '/icon120x120.png', '/icon192x192.png'].includes(req.url)) {
res.sendFile(path.resolve(path.join('/home/nodereduser/.node-red/icons', req.url)))
} else {
next()
}
}
},
Start node-red again, clear caches on all clients, and enjoy your changes favicons.
Item #1: I made several test but nothing. Following are the main ones:
.......
} else if (['/**red/images/node-red-256.png'].includes(req.url)){
res.sendFile(path.resolve(path.join('C:\\Users\\Me\.node-red\\icons', req.url)))
//res.sendFile('C:\\Users\\Me\.node-red\\icons\\node-red-256.png')
//res.sendFile('C:\\Users\\Me\.node-red\\icons\')
} else {
next()
} ,
......
From what i understand, if I'm not wrong, the problem could be that this login form doesn't come with the ui dashboard, as it is related to login for the working environment. So, maybe the ui section is not the right place where to put it. What do you think?
Item #2: Yes, I thought to something like that, but I don't know how passing the correct set of Icons, since they are named differently: icon_A_64x64.png ... (for Aflows.json) and icon_B_64x64.png .... (for Bflows.json)