帮助

Welcome!

This community is for professionals and enthusiasts of our products and services.
Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

0

Node-Red配置

形象
叶朝辉

​Node-Red配置文件settings.js位于/root/.node-red/目录下,如果挂载了数据卷则在对应挂载路径/nodered/下,修改文件后重启容器生效。

1. 静态文件路径

​修改settings.js文件中的httpStatic,代表加载的静态资源目录,该目录下的文件可以直接在node-red中引用。

2. 增加登录验证

​修改settings.js文件中的adminAuth,修改用户名密码,密码需要使用密文(bcrypt加密),如下:

​adminAuth: {

​type: "credentials",

​users: [{

​username: "admin",

​password: "$2a$08$zZWtXTja0fB1pzD4sHCMyOCMYz2Z6dNbM6tl8sJogENOMcxWV9DN",

​permissions: "*"

​}]

3. 修改主题

​分为标题栏主题和浏览器标签主题两种,同样打开settings.js文件,找到标签editorTheme,在其内部加入一段JSON,title标题、favicon图标、css样式、image标题栏图片,url超链接。

​// 页面主题

​page: {  

​title: "WCS Link",

​favicon: "/absolute/path/to/theme/icon",

​css: "/absolute/path/to/custom/css/file",

​},

​// 标题栏主题

​header: {

​    title: "WCS Link",

​    image: "",

​    url: "http://nodered.org"

​},

4. 登录框图片修改

​图片源代码地址不一定都一样,可以通过find / -name node-red-256.svg直接搜索对应文件地址,将你的svg格式图片替换即可。

​/usr/src/node-red/node_modules/@node-red/editor-client/public/red/images/node-red-256.svg

​/usr/local/lib/node_modules/node-red/node_modules/@node-red/editor-client/public/red/images/node-red-256.svg

5. 登录框图片样式

​css文件位于下面这个路径,也可以通过find / -name style.min.css直接搜索对应文件地址。打开文件,Find / -name auto搜索第一个auto, 大括号内加上margin-bottom:30%;,也可以自行调整百分比。

​/usr/local/lib/node_modules/node-red/node_modules/@node-red/editor-client/public/red/style.min.css

形象
丢弃