1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Fix Bug: Can not display node icon when npm package has scope (#1305) (#1309)

This commit is contained in:
Nguyen Thai Vinh 2017-06-30 22:49:35 +02:00 committed by Nick O'Leary
parent f3840512ba
commit 6db2c04585
2 changed files with 3 additions and 1 deletions

View File

@ -95,6 +95,7 @@ function init(_server,_runtime) {
}
editorApp.get("/",ensureRuntimeStarted,ui.ensureSlash,ui.editor);
editorApp.get("/icons/:module/:icon",ui.icon);
editorApp.get("/icons/:scope/:module/:icon",ui.icon);
theme.init(runtime);
editorApp.use("/theme",theme.app());
editorApp.use("/",ui.editorResources);

View File

@ -44,7 +44,8 @@ module.exports = {
},
icon: function(req,res) {
var icon = req.params.icon;
var module = req.params.module;
var scope = req.params.scope;
var module = scope ? scope + '/' + req.params.module : req.params.module;
var iconPath = redNodes.getNodeIconPath(module,icon);
res.sendFile(iconPath);
},