如何更改 node-red 页面标题

How to change node-red page title

如何更改 node-red 页面标题?

我在 node-red 的 github 页面上看到了关于此的问题。但是我不明白我需要修改哪个文件。

Here is that issue on github.

Same thing on node-red web site configuration section.

需要更改哪个文件?编辑主题需要安装节点吗?

从文档中您 link 到:

When run as a standalone application, these properties are read from the settings.js file. The location of this file is determined in the order:

  • set using the --settings|-s command-line argument
  • in the user directory if it was specified by the --userDir|-u command-line argument
  • in the default user directory: $HOME/.node-red/settings.js
  • in the node-red install directory

当您 运行 node-red 时,它会记录它正在使用的确切设置文件的路径,例如:

5 Feb 14:59:12 - [info] Settings file  : /Users/nol/.node-red/settings.js

在该文件中,您将在开始的块中看到默认设置集:

module.exports = {


}

您需要在该块中添加 editorTheme 属性 - 请记住使其成为有效的 javascript 语句,因此您需要一个逗号 (, ) 在这个和之前的设置之间。

例如:

module.exports = {
    ... all your existing settings ...

    editorTheme: {
        page: {
            title: "My own Node-RED title"
        }
    }
}

编辑文件后,重新启动 Node-RED 以使更改生效。