node-red / node-red-ui-nodes

Additional nodes for Node-RED Dashboard
Apache License 2.0
118 stars 81 forks source link

node-red-node-ui-table: Cannot GET /endpoint/ui/ui-table/js/tabulator.js (404) #27

Closed bjobo closed 4 years ago

bjobo commented 4 years ago

Which node are you reporting an issue on?

node-red-node-ui-table

What are the steps to reproduce?

What happens?

Dashboard ist loading, but table is not shown. The Browser log shows an error.

Browser

https://HOSTNAME:1880/endpoint/ui/ui-table/css/tabulator.min.css
Cannot GET /endpoint/ui/ui-table/css/tabulator.min.css
404 GET https://HOSTNAME:1880/endpoint/ui/ui-table/js/tabulator.js
Cannot GET /endpoint/ui/ui-table/js/tabulator.js

node-red log file:

[17/Feb/2020:20:02:22 +0100] 404 -(192.168.179.22) GET /endpoint/ui/ui-table/css/tabulator.min.css HTTP/2.0 (Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0)
[17/Feb/2020:19:58:43 +0100] 404 -(192.168.179.22) GET /endpoint/ui/ui-table/js/tabulator.js HTTP/2.0 (Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0)

What do you expect to happen?

Show the table

Please tell us about your environment:

Solution:

I was able to resolve the problem by changing the following lines in node_modules/node-red-node-ui-table/node.js:

// Original: Not working
// var fullPath = path.join(RED.settings.httpNodeRoot, uipath, '/ui-table/*').replace(/\\/g, '/');;

// Fix: Had to remove RED.settings.httpNodeRoot from path and add a leading slash
// Note: httpNodeRoot is also not used in node-red-dashboard!
var fullPath = path.join('/', uipath, '/ui-table/*').replace(/\\/g, '/');

Note: RED.settings.httpNodeRoot does resolves to /endpoint/

dceejay commented 4 years ago

Many thanks for the issue and fix