1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00
This commit is contained in:
Dave Conway-Jones 2021-04-12 12:16:32 +01:00
commit 55c2430671
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF
9 changed files with 14 additions and 12 deletions

View File

@ -90,7 +90,7 @@ function getToken(req,res,next) {
return server.token()(req,res,next); return server.token()(req,res,next);
} }
function login(req,res) { async function login(req,res) {
var response = {}; var response = {};
if (settings.adminAuth) { if (settings.adminAuth) {
var mergedAdminAuth = Object.assign({}, settings.adminAuth, settings.adminAuth.module); var mergedAdminAuth = Object.assign({}, settings.adminAuth, settings.adminAuth.module);
@ -116,8 +116,9 @@ function login(req,res) {
response.prompts[0].image = theme.serveFile('/login/',mergedAdminAuth.strategy.image); response.prompts[0].image = theme.serveFile('/login/',mergedAdminAuth.strategy.image);
} }
} }
if (theme.context().login && theme.context().login.image) { let themeContext = await theme.context();
response.image = theme.context().login.image; if (themeContext.login && themeContext.login.image) {
response.image = themeContext.login.image;
} }
} }
res.json(response); res.json(response);

View File

@ -186,8 +186,8 @@
<input type="text" id="node-config-input-port" data-i18n="[placeholder]mqtt.label.port" style="width:55px"> <input type="text" id="node-config-input-port" data-i18n="[placeholder]mqtt.label.port" style="width:55px">
</div> </div>
<div class="form-row" style="height: 34px;"> <div class="form-row" style="height: 34px;">
<input type="checkbox" id="node-config-input-usetls" style="height: 34px; margin: 0 0 0 104px; display: inline-block; width: auto; vertical-align: top;"> <input type="checkbox" id="node-config-input-usetls" style="height: 34px; margin: 0 5px 0 104px; display: inline-block; width: auto; vertical-align: top;">
<label for="node-config-input-usetls" style="width: 80px; line-height: 34px;"><span data-i18n="mqtt.label.use-tls"></span></label> <label for="node-config-input-usetls" style="width: 100px; line-height: 34px;"><span data-i18n="mqtt.label.use-tls"></span></label>
<span id="node-config-row-tls" class="hide"><input style="width: 320px;" type="text" id="node-config-input-tls"></span> <span id="node-config-row-tls" class="hide"><input style="width: 320px;" type="text" id="node-config-input-tls"></span>
</div> </div>
<div class="form-row"> <div class="form-row">

View File

@ -363,7 +363,7 @@
"keepalive": "Keep-Alive", "keepalive": "Keep-Alive",
"cleansession": "Bereinigte Sitzung (clean session) verwenden", "cleansession": "Bereinigte Sitzung (clean session) verwenden",
"cleanstart": "Verwende bereinigten Start", "cleanstart": "Verwende bereinigten Start",
"use-tls": "Sichere Verbindung (SSL/TLS) verwenden", "use-tls": "TLS",
"tls-config": "TLS-Konfiguration", "tls-config": "TLS-Konfiguration",
"verify-server-cert": "Server-Zertifikat überprüfen", "verify-server-cert": "Server-Zertifikat überprüfen",
"compatmode": "MQTT 3.1 unterstützen", "compatmode": "MQTT 3.1 unterstützen",

View File

@ -52,10 +52,11 @@
pass <code>msg</code> as a second argument to <code>node.error</code>:</p> pass <code>msg</code> as a second argument to <code>node.error</code>:</p>
<pre>node.error("Error",msg);</pre> <pre>node.error("Error",msg);</pre>
<h4>Accessing Node Information</h4> <h4>Accessing Node Information</h4>
<p>In the function block, id and name of the node can be referenced using the following properties:</p> <p>The following properties are available to access information about the node:</p>
<ul> <ul>
<li><code>node.id</code> - id of the node</li> <li><code>node.id</code> - id of the node</li>
<li><code>node.name</code> - name of the node</li> <li><code>node.name</code> - name of the node</li>
<li><code>node.outputCount</code> - number of node outputs</li>
</ul> </ul>
<h4>Using environment variables</h4> <h4>Using environment variables</h4>
<p>Environment variables can be accessed using <code>env.get("MY_ENV_VAR")</code>.</p> <p>Environment variables can be accessed using <code>env.get("MY_ENV_VAR")</code>.</p>

View File

@ -333,7 +333,7 @@
"port": "포트", "port": "포트",
"keepalive": "킵 얼라이브 시간", "keepalive": "킵 얼라이브 시간",
"cleansession": "세션 초기화", "cleansession": "세션 초기화",
"use-tls": "SSL/TLS접속을 사용", "use-tls": "사용TLS",
"tls-config": "TLS설정", "tls-config": "TLS설정",
"verify-server-cert": "서버인증서를 확인", "verify-server-cert": "서버인증서를 확인",
"compatmode": "구 MQTT 3.1서포트" "compatmode": "구 MQTT 3.1서포트"

View File

@ -352,7 +352,7 @@
"port": "Порт", "port": "Порт",
"keepalive": "Keep-alive время (сек)", "keepalive": "Keep-alive время (сек)",
"cleansession": "Использовать чистую сессию", "cleansession": "Использовать чистую сессию",
"use-tls": "Включить безопасное (SSL/TLS) соединение", "use-tls": "TLS",
"tls-config":"Конфигурация TLS", "tls-config":"Конфигурация TLS",
"verify-server-cert":"Проверить сертификат сервера", "verify-server-cert":"Проверить сертификат сервера",
"compatmode": "Использовать устаревшую поддержку MQTT 3.1" "compatmode": "Использовать устаревшую поддержку MQTT 3.1"

View File

@ -353,7 +353,7 @@
"port": "端口", "port": "端口",
"keepalive": "Keepalive计时(秒)", "keepalive": "Keepalive计时(秒)",
"cleansession": "使用新的会话", "cleansession": "使用新的会话",
"use-tls": "使用安全连接 (SSL/TLS)", "use-tls": "使用 TLS",
"tls-config": "TLS 设置", "tls-config": "TLS 设置",
"verify-server-cert": "验证服务器证书", "verify-server-cert": "验证服务器证书",
"compatmode": "使用旧式MQTT 3.1支持" "compatmode": "使用旧式MQTT 3.1支持"

View File

@ -353,7 +353,7 @@
"port": "埠", "port": "埠",
"keepalive": "Keepalive計時(秒)", "keepalive": "Keepalive計時(秒)",
"cleansession": "使用新的會話", "cleansession": "使用新的會話",
"use-tls": "使用安全連接 (SSL/TLS)", "use-tls": "使用 TLS",
"tls-config": "TLS 設置", "tls-config": "TLS 設置",
"verify-server-cert": "驗證伺服器憑證", "verify-server-cert": "驗證伺服器憑證",
"compatmode": "使用舊式MQTT 3.1支援" "compatmode": "使用舊式MQTT 3.1支援"

View File

@ -472,7 +472,7 @@ function getPackageList() {
try { try {
var userPackage = path.join(settings.userDir,"package.json"); var userPackage = path.join(settings.userDir,"package.json");
var pkg = JSON.parse(fs.readFileSync(userPackage,"utf-8")); var pkg = JSON.parse(fs.readFileSync(userPackage,"utf-8"));
return pkg.dependencies; return pkg.dependencies || {};
} catch(err) { } catch(err) {
log.error(err); log.error(err);
} }