[bug]: admin tab - externe Seite wird nicht angezeigt
No existing issues.
- [X] There is no existing issue for my problem.
Describe the bug
Als Beispiel nehme ich esphome, betrifft aber weitere Adapter.
Dieser Adapter stellt im linke Tabmenü eine Schaltfläche bereit mit dem man auf das Dashboard kommt. Wenn man auf diese klickt öffnen sich das Dashboard. Das geschieht jedoch nur wenn sowohl der verlinkte Dienst, als auch iobroker im selben Protokoll(http/https) unterwegs sind. Unterscheiden sich diese wird eine weiße Seite angezeigt.
To Reproduce
siehe oben
Expected behavior
Möglichkeiten:
- optional: in der io-package
adminTabsollte die Möglichkeit bestehen sowohl einen http link als auch einen https link anzugeben. - zwingend: Falls die verlinkte Seite nicht im iFrame dargestellt werden kann, sollte der Admin von sich aus diese in einem neuen Fenster öffnen.
Screenshots & Logfiles
Adapter version
6.12.5
js-controller version
latest
Node version
18.19.0
Operating system
proxmox
Additional context
Browser: Safari Version 17.0 (19616.1.27.211.1) OS: 14.0 (23A344)
Weitere Ideen:
- Admin könnte das http/https prefix "ignorieren" und versuchen die Zeilseite immer mit jenem Protokoll zu erreichen, das admin benutzt.
- Admin könnte immer eine neue Seite / neues Tab öffnen
- Admin könnte falls eine Darstellung als iframe nicht möglich ist dort einen Button "In neuem Fenster öffnen" anzeigen
Optimalerwesie sollten existiernede Einträge in io-package nicht angepasst werden müssen; sonst dauert die Korrektur Jahre :-)
Adapters can already determine the protocol dynamically: https://github.com/ioBroker/ioBroker.js-controller/blob/c96de55dd6c71b58537636aa6d6ceda8aec3f2e8/schemas/io-package.json#L937
I am not sure if any of the proposed heuristics has more benefits than downsides. Open in new Tab erases the whole idea of admin tabs. In cases where the embedded content is really currently unavailable the button solution would also be suboptimal.
The main problem with all the tab stuff is the potential mixed content and this cannot be solved that easily.
@foxriver76
"description": "Link for iframe in the TAB. You can use parameters replacement like this: \"https://%ip%:%port%\". IP will be replaced with host IP. \"port\" will be extracted from native.port.",
Wie? Welcher Code ist für http/https hier einzusetzen? In der Description steht nichts dazu.
You can use arbitrary values from your adapter native.
Wenn ich das richtig verstehe soll man halt sowas machen \"%protocol%://%ip%:%port%\" Nur woher soll der Adapter wissen welches Protokoll der Admin verwendet. Ich habe 2 Admin instancen eine http die andere https - Es ist nicht möglich da das "richtige" in die native zu schreiben, außer es gibt noch undokumentierte Funktionen.
if adminProtocol is not accessible yet, we could easy make it so, have to look into it - but thought it is. However, I do not think, that this will fix the real problem behind such situations.
Github suche findet weder im js-controller noch im admin den begriff adminProtocol.
Was denkst du den wie man das Problem beheben könnte?
if
adminProtocolis not accessible yet, we could easy make it so, have to look into it - but thought it is. However, I do not think, that this will fix the real problem behind such situations.
Using the same protocol as admin, will, of course, only work if the web page is served both as http and https.
* Admin könnte falls eine Darstellung als iframe nicht möglich ist dort einen Button "In neuem Fenster öffnen" anzeigen
Personally, I like this option best for the cases where it is not possible to show the page. Next to the button a short explanation or a link to an explanation could be added.
Looks like this lines are buggy?
https://github.com/ioBroker/ioBroker.admin/blob/761ded4f4947cef7d051dd74e11b5f785e652c25/packages/admin/src-admin/src/Utils.tsx#L376-L382
if native.secure is undefined, protocol will be undefined too?!