-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Automatic UI codegeneration #921
Conversation
Hello, You will not need anymore use online services for HTML regeneration, i.e. this https://github.com/Aircoookie/WLED/wiki/Add-own-functionality#web-ui In future, also pages can be made simpler and more modern, also locally test environment could be made possible to test WebUI before uploading to server. Bug fixes:
|
I also use this code for usermod WebUI changes, PNG to sprites generation here See video: https://www.youtube.com/watch?v=9BVHkfE_R_8&feature=youtu.be |
This is great. I suggest the wiki documentation get updated to reflect this. |
Thank you for this tool, it seems very useful! I will give the workflow a try and add the documentation to the wiki once I merge :) |
Updated upstream changes introduced by #964 for html_*.h |
Snippet for Wiki https://github.com/Aircoookie/WLED/wiki/Add-own-functionality Changing Web UIIn order to conserve space, the Web UI interface is represented as a series of wled00/html_ui.h, wled00/html_settings.h and wled00/html_other.h files which contain C/C++ strings with specific parts of the Web UI. These files are automatically created from source files available in wled00/data folder. To generate files, install NodeJS 11.0+ globally. After that, recreate html_*.h files by running in the repo directory: > npm install
> npm run build If you want to test changes to the UI, it is easiest to work with the local wled00/data/index.htm file. You just need to enter the IP address of a WLED 0.10.0 or newer instance into the popup. If you accidentally input an incorrect IP or want to test with a different instance, clear the local storage (in Chrome: Developer Tools -> Application -> Local Storage) If you continuously modify files in the wled00/data directory, you want to monitor these changes to make local html_*.h files being updated automatically. To do this, run this in repo directory: > npm run dev This will start monitoring wled00/data folder for changes. WARNING!!! Be careful with changing the javascript in HTML files! For example |
Replace outdated CSS in HTML by style.css import Fix missing button double press in time settings FIx missing meta utf-8 in WiFi and UI settings Modify cdata.js to add an info header to the top of auto-generated files
Awesome, thank you for the wiki documentation as well! |
Great news to have it merged! Sorry I miss my github notifications lately. |
Writes compressed C arrays of data files (web interface)
How to use it?
First install NodeJS 11+ and npm globally.
After that, run:
NOTE: If you change data folder often, you can run it in monitoring mode (it will recompile and update *.h on every file change)
How it works?
It uses NodeJS packages to inline, minify and GZIP files.
See
writeHtmlGzipped
andwriteChunks
invocations at the bottom of the page.