Giter VIP home page Giter VIP logo

Comments (8)

SybexX avatar SybexX commented on August 16, 2024

I think it's because of Firefox, because in my opinion the page is updated using a cookie.

the errors it gives:

Synchronous XMLHttpRequests on the main thread should no longer be used because it has detrimental effects on the end user experience. For further help see https://xhr.spec.whatwg.org/#sync-warning readconfigcommon.js

The page cookie does not have a valid value for the SameSite attribute. Soon, cookies without the "SameSite" attribute or with an invalid value for it will be treated as "Lax". This means the cookie is no longer sent to contexts belonging to a third party. If your application requires the cookie in these contexts, please add the "SameSite=None" attribute to it. For more information about the SameSite attribute, see https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite.

from ai-on-the-edge-device.

caco3 avatar caco3 commented on August 16, 2024

Ich denke, das hat nichts mit den cookies zu tun. Das cookie haben wir ja nur, damit wir bei einem Page refresh wieder auf dem gleichen Tab landen.

Das Problem mit den Synchronous XMLHttpRequests ist, dass sie synchron sind. D.h., wenn man einen Request sendet, bleibt das ganze WebUI blockiert, bis die Antwort oder Timeout kommt. Das ist leider nicht sehr responsive, und ist nicht mehr zeitgemäss.

Eigentlich sollten wir das UI umbauen, dass das alles asynchron passiert. Aber das ist leider einiges an Arbeit, weshalb ich das von meiner Seite auf die lange Bank geschoben habe ala, geht ja auch ohne.

Aber zu deinem Problem:
Ich meine auch, dass das mal funktioniert hat. Ich würde erwarten, dass das Web UI einen Timer hat (Javascript setInterval()), der die relevanten Daten periodisch auffrischt. Aber ich finde nichts dazu und sehe auch nicht, dass da mal etwas entfernt wurde :(
Weist Du noch, was alles aktualisiert wurde? War es einfach alles auf der Overview-Seite?

from ai-on-the-edge-device.

Slider0007 avatar Slider0007 commented on August 16, 2024

Hier wird das Refresh der overview page realisiert.
https://github.com/jomjol/AI-on-the-edge-device/blob/rolling/sd-card%2Fhtml%2Foverview.html#L172

from ai-on-the-edge-device.

SybexX avatar SybexX commented on August 16, 2024

Diese Funktion ist ja immer noch vorhanden, nur scheint dies nicht zu funktionieren. Ich habe mal im Internet nach Refresh gesucht und auch was funktionierendes gefunden, nur kamm jedes mal beim Refresh eine Meldung seitens Firefox und deshalb habe ich alles verworfen. Denn ob ich jetzt jedes mal beim Firefox auf "zulassen" klicke oder auf den Reiter Overview um die Seite zu aktuallisieren, macht für mich kein Unterschied/Sinn.

from ai-on-the-edge-device.

friedpa avatar friedpa commented on August 16, 2024

Es war nur die Overview Seite die Refreshed wurde. Ich habe meine zwei Systeme auf einem Übersichtsmonitor im Büro angezeigt und das war halt praktisch mit dem AutoRefresh. Man kann das Problem in Firefox aber auch so lösen, dass man ein Addon wie TabReloader verwendet.

from ai-on-the-edge-device.

caco3 avatar caco3 commented on August 16, 2024

Hier wird das Refresh der overview page realisiert. https://github.com/jomjol/AI-on-the-edge-device/blob/rolling/sd-card%2Fhtml%2Foverview.html#L172

Danke!
Und soweit ich sehen kann, funktioniert es auch noch, zumindest unter Linux mit Firefox 124:
grafik

Der richtige Weg wäre, wo etwas mittels Websocket zu lösen. Ich hatte das mal in #2370 versucht, allerdings lief es nicht stabil. Vermutlich passen einige Thread sizes noch nicht (obwohl ich da recht rumgespielt habe).

Langfristig müssen wir aber auch auf asynchronous wechseln :(

from ai-on-the-edge-device.

SybexX avatar SybexX commented on August 16, 2024

jetz weiß ich weshalb Autorefresh nicht geht^^
in der overview, index und einigen anderen Dateien wurde aus "xhttp.open("GET", url, false);" auf "xhttp.open("GET", url, true);" gestellt, das wurde bestimmt gemacht um den Fehler "Synchronous XMLHttpRequests" zu beseitigen, nur verursacht dies halt Probleme.

from ai-on-the-edge-device.

Slider0007 avatar Slider0007 commented on August 16, 2024

Und soweit ich sehen kann, funktioniert es auch noch, zumindest unter Linux mit Firefox 124:

Ich habe den gleichen Refresh Algo bei mir auch im Einsatz. Mit Firefox damit aber keine Probleme. Wenn Probleme, dann müsste es im Aufruf-Kontext irgendwo haken.

Der richtige Weg wäre, wo etwas mittels Websocket zu lösen. Ich hatte das mal in #2370 versucht, allerdings lief es nicht stabil. Vermutlich passen einige Thread sizes noch nicht (obwohl ich da recht rumgespielt habe).

Langfristig müssen wir aber auch auf asynchronous wechseln :(

Meiner Meinung nach muss es nicht zwingend Websocket sein, sondern nur eine effizientere Polling Strategie (mit so wenig Requests wie möglich, da der Webserver immer nur einen Request verarbeiten kann) und asynchronem Update des Contents anstatt die gesamte Seite zu refreshen. Hiermit lässt sich eine sehr niedrige Update Rate und annehmbare Responiveness realisieren.

So habe ich das in meinem Fork realisiert: Demo Sequenz einer Runde

Wenn Umstellung auf async requests, dann sollte auch gleich auf Fetch API umgestellt werden (zukunftfähiger). Das habe ich mir auch noch vorgenommen, bin aber noch nicht dazu gekommen. Async bringt schon etwas Responsiveness, auf jeden Fall gefühlt, da die Seite nicht mehr blockiert wird.

from ai-on-the-edge-device.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.