mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge branch 'master' into dev
This commit is contained in:
@@ -90,7 +90,7 @@ function getToken(req,res,next) {
|
||||
return server.token()(req,res,next);
|
||||
}
|
||||
|
||||
function login(req,res) {
|
||||
async function login(req,res) {
|
||||
var response = {};
|
||||
if (settings.adminAuth) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
if (theme.context().login && theme.context().login.image) {
|
||||
response.image = theme.context().login.image;
|
||||
let themeContext = await theme.context();
|
||||
if (themeContext.login && themeContext.login.image) {
|
||||
response.image = themeContext.login.image;
|
||||
}
|
||||
}
|
||||
res.json(response);
|
||||
|
@@ -129,6 +129,14 @@ module.exports = {
|
||||
}
|
||||
|
||||
themeContext.page.title = theme.page.title || themeContext.page.title;
|
||||
|
||||
// Store the resolved urls to these resources so nodes (such as Debug)
|
||||
// can access them
|
||||
theme.page._ = {
|
||||
css: themeContext.page.css,
|
||||
scripts: themeContext.page.scripts,
|
||||
favicon: themeContext.page.favicon
|
||||
}
|
||||
}
|
||||
|
||||
if (theme.header) {
|
||||
@@ -223,6 +231,8 @@ module.exports = {
|
||||
themePlugin.path
|
||||
);
|
||||
themeContext.page.css = cssFiles.concat(themeContext.page.css || [])
|
||||
theme.page = theme.page || {_:{}}
|
||||
theme.page._.css = cssFiles.concat(theme.page._.css || [])
|
||||
}
|
||||
if (themePlugin.scripts) {
|
||||
const scriptFiles = serveFilesFromTheme(
|
||||
@@ -232,6 +242,8 @@ module.exports = {
|
||||
themePlugin.path
|
||||
)
|
||||
themeContext.page.scripts = scriptFiles.concat(themeContext.page.scripts || [])
|
||||
theme.page = theme.page || {_:{}}
|
||||
theme.page._.scripts = cssFiles.concat(theme.page._.scripts || [])
|
||||
}
|
||||
}
|
||||
activeThemeInitialised = true;
|
||||
|
Reference in New Issue
Block a user