hotNipi / node-red-contrib-ui-level

A linear level type widget to the Node-RED dashboard
MIT License
27 stars 7 forks source link

Horizontal Level always displayed as "Max" #20

Closed stephankessler closed 4 years ago

stephankessler commented 4 years ago

When i deploy a level bar, it is visually always "maxed" even if the actual values do not reflect that. This started after the upgrad to 0.25

Reproduce by: Place a horizontal level bar and send some values within the expected range.

Expected behavior Level displayed reflects actual value.

Screenshots image

Environment and versions (please complete the following information):

Additional context Thank you very much for your help!

hotNipi commented 4 years ago

Have you tried:

  1. clear browser cache
  2. Restart Node-RED
stephankessler commented 4 years ago

Thanks for the quick response, unfortunately, this did not help - i even tried different browsers to avoid any caching issue but this did not help either.

hotNipi commented 4 years ago

OK. Does the browser console show any errors?

hotNipi commented 4 years ago

And I hope, the version you have installed is 0.1.25 not the 0.25

stephankessler commented 4 years ago

Sorry my bad, yes i installed 0.1.25

The console shows an error indeed: GET https://NODE_RED_URL/ui/ui-level/js/gsap.min.js reports a 404

And subsequently: app.min.js:148 ReferenceError: gsap is not defined at updateLevel (eval at (app.min.js:596), :152:12) at eval (eval at (app.min.js:596), :220:10) at m.$digest (app.min.js:172) at m.$apply (app.min.js:176) at app.min.js:593 at r.t (app.min.js:594) at r.emit (index.js:83) at r.onevent (index.js:83) at r.onpacket (index.js:83) at r. (index.js:83)

Which indicates there is a missing file?

hotNipi commented 4 years ago

I know it may be painful but can you try to remove ui_level completely from Palette manager and then install it again?

stephankessler commented 4 years ago

No worries - this is quite quick :-)

However, it did not help either.

I digged i bit, the missing file gsap.min.js is on my file system in "node_modules/node-red-contrib-ui-level/lib/js". However there is a 404 if i try to get that with a browser https://NODE_RED_URL/ui/ui-level/js/gsap.min.js

hotNipi commented 4 years ago

Are you running locally or in cloud?

stephankessler commented 4 years ago

It is a quite complex setup: The Node Red instance is running on docker and is made availabe to the public through Apache2 Proxy. However, i got full access to the machine and docker host.

hotNipi commented 4 years ago

Having no experiences of such setups. If you can show the

hotNipi commented 4 years ago

Phone typing. Sorry. I wanted to see the node red settings file. If you can. Remove all sensitive data of course

stephankessler commented 4 years ago

settings.js.txt

Sure - however, there is not too much magic in that one.

What would be the appropriate path the module would look for the gsap.min.js file? Is the one correct? Is there maybe another file i could test?

Thanks!

stephankessler commented 4 years ago

I double checked if the proxy could be the issue, but also accessing the node red docker container directly returns a 404 when accessing http://localhost:../monitor/ui/ui-level/js/gsap.min.js

hotNipi commented 4 years ago

There was similar case for other ui nodes related to secured setups. https://discourse.nodered.org/t/node-red-ui-table-fails-when-httpnodeauth-enabled/22425/4 Seems to resolved by manually deleting the node-RED browser manifest May be it helps?

stephankessler commented 4 years ago

This does not help either. What i did now is that i downgraded to 0.1.24 and there is no issue - i see that after 0.1.24 the gsap.min.js file was new/moved - it looks like that is the issue. If i now check the browser log, i see 404s for https://NODE_RED/ui/ui-level/js/plugins/CSSPlugin.min.js so anything in this folder is not accessible from outside (which somehow is assumed that it is).

Do you have any idea?

hotNipi commented 4 years ago

Can you try with https://flows.nodered.org/node/node-red-contrib-ui-contextmenu If you haven't used it before, it has very good readme, should be easy to set up. It uses same sort of file include mechanism, so if it fails too, we can make some decisions about where to focus.

stephankessler commented 4 years ago

I tried 0.1.25 with a different setup (and without the proxies) and it worked, so definitely looks like an issue with my setup.

Sorry for the inconvenience and thank you very much for the support! I will close this and try to narrow down the issue.

hotNipi commented 4 years ago

Hi, I had chance to gather info about another complex setup and I've made some changes. It may be also work for you. I'll be glad if you can update to 0.1.27 and try again.

stephankessler commented 4 years ago

Perfect! It works like a charm, no more missing libraries and things - looks awesome.

Thank you so much! Really appreciated!

hotNipi commented 4 years ago

Good! Thank you for feedback.