I have installed B&R Linux 12 on a PPC2220. I have also installed a PostgreSQL server on the system. mappDatabase can also access this via the IP 192.168.137.3. The SQL server has a WebFrontend which I would like to display in my mappView visualisation. Unfortunately I can’t do that. Neither via the src property nor via the host/path/port properties.
Hi … In the case you see the white space, please check the chrome console (press f12), I assume there is message related to cross-origin policy violation.
If you’re using the WebViewer widget with “useURL=true” (default), the url is built from the values stored in “host”, “path”, “port” and “query”. You first image indicates that you have set all these values to “empty” - but set the “src”, which will not be evaluated in this case.
The result is, that the default values will be used - which is “127.0.0.1:80” … so you’re prop. pointing back to your mapp View HMI, which results in “Visualization already open on this client …”
In your second image you have useURL=false, but which would require the “src” - but now you’re populating host, path, etc. … The result is that the WebViewer will not show anything, as the src is empty.
Potential solution: Simply flipp useURL.
But!
I tried it briefly myself with pg4admin running in a docker container.
It seems that pg4admin is setting “x-frame-options” to “same origin” per default … which will prevent the pg4admin web page from shown in an IFrame, if the “origin” is different - which seems to be the case on your side.
After adjusting the configuration in “config.py”, setting the x-frame-option to “”, pg4admin shows quite nicely in my HMI:
Christian, thank you very much for your detailed description and the tip with the pg4Admin frame options!
The pg4admin WebFontend is also displayed correctly in the mappView WebViewer widget on the PPC2200. The problem was really the useURL option.
The only problem I have now is that when I open the mappView visualisation on another client PC, for example my notebook, the WebFrontend is not displayed there and an error occurs again. With my notebook I only have access to the PLC (10.19.11.21 is the adress from the plc) part. The problem is probably that the WebViewer widget cannot reach 192.168.137.3, because this is the virtual network interface of the GPOS.
Is there any way that I can still display and use the Postgre WebFrontend from another client that does not have direct access to the GPS network?
For example, if I put ETHInternal in the PLC network circuit (10.19.11.x) then that should work, right?
Glad to here it works for you, at least partially.
I cannot really answer this, as I’m not familiar with the PLK configurations.
As general rule of thumb:
The WebViewer widget is nothing more than a “browser in a browser”. If you’re not able to reach the pg4Admin interface from your laptop, the WebViewer will also not be able. The WebViewer (or mapp View in general) does not act as proxy or router. Saying that, you need to configure the network of the GPOS in away that it is reachable from the outside world …
If you’re doing this, please also consider that you’re exposing the whole GPOS to the network, not sure if you want this!