async-esp-fs-webserver icon indicating copy to clipboard operation
async-esp-fs-webserver copied to clipboard

Custom build of built in web pages do not function correctly

Open micgresham opened this issue 1 year ago • 3 comments

I followed the instructions to create a custom version of the edit pages using the instructions:

If you want customize /setup webpage (headers, logo etc etc):

edit the source files as your needs (setup.htm, app.js, style.css)
open a terminal in build_setup folder and run npm i to install all nodejs modules needed
run node minify.js
overwrite the content of setup_htm.h inside /src folder with the new generated file

But none of the JS elements work afterwards.

Suggestions?

micgresham avatar Mar 10 '24 17:03 micgresham

The script only works on the /setup page because it works specifically on the files on that page. If you want to use it with the /edit page you need to modify it appropriately.

My advice, however, is:

  • use online tools to minimize CSS and Javascript (optional, it is only for reducing the size of file)
  • create the gzip file of the minimized /edit page (for example using 7-Zip)
  • finally with this little program, create the C array to copy&paste into the library (the page is not updated, Bin2C is no longer a command line tool)

image

cotestatnt avatar Mar 11 '24 06:03 cotestatnt

I spoke in error. It is the/setup page I tried to customize. The changes worked, but none of the buttons (js) worked when it moved the setup.h as instructed.

micgresham avatar Mar 11 '24 21:03 micgresham

Check the browser dev-tools console (press key F12). You probably made some small mistake which interrupts the functioning of the js script.

When I want make changes to the /setup page, I copy the 3 files (setup.htm, app.js, style.css) into the microcontroller's flash memory and I modify directly using builtin /edit web page.

When everything works as I want, I minimize the sources and then create the setup.min.htm file. If this also works without problems, I proceed to create the .h file to insert into the library.

cotestatnt avatar Mar 12 '24 07:03 cotestatnt