andreisperid / E-TKT

open source embossed label maker
https://andreisperid.github.io/E-TKT/
MIT License
398 stars 19 forks source link

Move state handling into the webserver #15

Closed sabeechen closed 1 year ago

sabeechen commented 1 year ago

The main goal of this PR is to fix issue #12, which it accomplishes by making the webserver report its current state (busy, command, etc) through a simple JSON API, so the browser is no longer responsible for determining when the printer is working. This also allowed me to do some refactoring and simplification where it made sense in the context of my changes. In particular I've:

To the best of my ability this makes no change to the appearance or effective styling of the web interface. One benefit of this PR is that if the page is refreshed while printing its printing status will still be reflected after the refresh, ie preventing you from submitting a label until the previous one finishes. In such a case it won't show the proper label text, but I intend to address that in follow-up PR's as it requires more substantial refactoring to be done cleanly.

sabeechen commented 1 year ago

This PR is showing some differences from changes that have already been merged into main, so I'm going to close this and re-create it.