Closed udo1toni closed 5 years ago
Just for the record: https://community.openhab.org/t/vs-code-openhab-extension/30205/268?u=confectrician
We have to change the complete previewHTML part to a webview as described here: https://code.visualstudio.com/docs/extensions/webview
I have tried to replace the command "previewHTML" by a webview. This work fine for displaying the sitemap, but it fails when I try to open PaperUI:
The console shows this angular message;
Maybe somebody has an idea how to to solve this problem. If not we should better disable the option to show PaperUI within VSCode.
I am already in discussion with kuba on this and did a try on y branch of my fork too. Unfortunately there seems to be some difficulties with the scripts, even if you allow them within the extension.
Did you go for an iframe (that was my first try) or did you make an http request and display the raw html?
also did you enable script usage?
Yes, I User an IFRAME with Scripting enabled. This worked very well with the sitemap display. It's quite strange that it does not work with Angular and I assume that it won't Work with raw html either. I have tried the same html code with the iframe directly in Chrome and it worked. I don't know what the Webview ist doing here.
Ok so we're nearly at the same state.
I would then prefer to remove this option for paper UI (at least temporary)
I agree. Are you already working on a PR, @Confectrician ? If not I can try to create a PR until next weekend. I would also try to implement an auto update function (see #10).
I am working on a (very small) fix for that misleading setting description and could remove that too. Alltough i am quite busy too within this week. Feel free to work on the auto update function, i didn't invest time in that yet.
I was diligent meanwhile and took care of getting the needed vs marketplace accesses, so that we are able to publish a new release with those small fixes directly. 🙂
I have started #117 and will add some more things within the next days.
While looking through the code, we could also just remove the configuration for "paperInBrowser" and let open the paperUi in an external browser on default.
So we would still have a quick access to paper UI. It only wouldn't be embedded in vscode.
Hey @MHerbst could you please check if your webview works when you choose a "thing" to show in paper ui?
I have discovered that the simple mode of paper UI can block things. Reference: #118 for a more detailed explanation.
Maybe the webview works and we just weren't able to acces sthe edit page because of that setting.
@Confectrician I have tested it and Things don't work either :-(.
Also "simple mode" is always disabled in my test environment.
It seems to be a general problem. If I find some time this weekend I will setup VSCode in a Linux VM and test whether this is a Windows-specific problem.
I am developing on ubuntu and testing with my oh environment on a raspberry. I can't confirm that now, since my webview branch is also the one where the show in paper ui command has changed to external on default.
We can add paperui back at any time if we find a solution. :)
Let's focus on some fixes we can push through the pipe in the nearer future and work on the bigger problems afterwards.
I am currently refactoring the webview stuff to a separate class to keep it adaptable and extendable in the future. If that works fine and looks well, we should push a release first.
OK, I agree :-). Before I work on any changes I will wait for your refactoring. In the meantime, I'm going to familiarize myself with the code and typescript.
I'm going to familiarize myself with the code and typescript
I am doing this while i am coding.:smile: You can already take a look at my PR and check if a am doing something wrong, or if there's something looking strange for you.
Hopefully i can add the webview commit later already.
Adressed in #117
Since 0.4.0 links for opening item or thing in paper ui does not work any more.
Expected Behavior
A click at the context menu in items/things list (Show in Paper UI) should open corresponding page in Paper UI
Current Behavior
Action does result in an error notification:
<item/thing name> - Paper UI could not be opened: resource is not available
See https://community.openhab.org/t/vs-code-openhab-extension/30205/265?u=udo_hartmann and following...
Your Environment
openHAB2:
VSCode: