Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] Customizable favorites #136

Open
FreezyExp opened this issue Jun 9, 2019 · 1 comment
Open

[Request] Customizable favorites #136

FreezyExp opened this issue Jun 9, 2019 · 1 comment

Comments

@FreezyExp
Copy link

Adding a page where a 'simpler then simple' remote controller can be configured.
I think a page with big buttons (configurable size?), would prove very useful in daily operation.

I would like to dumb down the interface, without losing any of the goodies it can offer.
I could add a duplicate of simple.html and edit it to what I need, but what of features not yet configurable?

Proposal:
quick.html page, with buttons to all the pre-configured favorites.
a setupQuick.html page that handles adding / editing / removing favorites.

@FreezyExp
Copy link
Author

FreezyExp commented Oct 5, 2019

Adding CORS support to the websockets, allowed me to run the website locally and still be able to control it from modern browsers.
This makes the UI both easier to update and faster to control.

So I added a function to send the CORS headers and added a call to it in all the .on events, except the ones that were obviously not in need of this.

webServer.on("...", HTTP_POST, []() {
    sendCors();

void sendCors()
{
  if (webServer.hasHeader("origin")) {
      String originValue = webServer.header("origin");
      webServer.sendHeader("Access-Control-Allow-Origin", originValue);
      webServer.sendHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization");
      webServer.sendHeader("Access-Control-Allow-Methods", "GET,POST,OPTIONS");
      webServer.sendHeader("Access-Control-Max-Age", "600");
      webServer.sendHeader("Vary", "Origin");
  }
}

Someone that actually understands what this is supposed to do, might be able to limit it to just the light unit. But this worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants