Index.html.gz source

So I finally started looking at the source code of the webUI with the goal of implementing some of the quality of life features ( adding a bounding box / printing the max X and Y dimensions of the gcode, adding a command to jog the router to the extremeties to validate that the work piece is positioned correctly, etc.

However, I found the monstrosity called index.html : FluidNC/FluidNC/index.html at Maslow-Main · BarbourSmith/FluidNC · GitHub

As a software engineer, I fully understand feature creep. However, this feels completely unsupportable in the current state.

Is the main concern the total size it takes?
if so, I would recommend to split out the javascript to proper .js files (so each is nicely formatted and maintainable), and when creating index.html.gz, you can first run it through a javascript
minifier, and then just take the output and append to index.html before compressing it.

Are there any other considerations I should keep in mind before I attempt to set this up? Or would this work?

1 Like

So that index.html in the fluidnc project is actually a “fallback” ui. The one you want is in GitHub - BarbourSmith/ESP3D-WEBUI: A Web UI for ESP8266 or ESP32 based boards connected to 3D printers / CNC which has a build process that produces an index.html.gz to use for uploading.

Also, yea, its a constrained environment and also not what I’m used to (plain html/js only, simple bootstrap styles, a bunch more constraints). Feel free to reach out for pointers.

  • to build it, gulp package -en - output in dist
  • to run it without uploading, get python installed (probably a couple pip installs I forget) then run python fluidnc-web-sim.py maslow.local and point a browser to localhost:8080 (or whichever port it reports.

no hot-reload or any modern convenience for front end development :slight_smile:
, just repeat above to test changes.

2 Likes

This relates to how this environment ESP32 web server behaves with multiple file accesses like browsers like to do. best to (for now) keep it as one index.html.gz and have that be served from the firmware. I am sure more should be possible, but the ESP envornment (server) is NOT robust like we are all used to with proper web servers.

And… the above project does have things broken out a bit better.

1 Like

thanks for the pointer!
Good to know there’s a separate repo where I can actually orient myself and be able to improve it!

1 Like

Yep no worries! @md8n and I have another thread talking about improvements to this. I think we can work toward them, but also I know upstream there is a rewrite going on that I have not dived into yet.

3 Likes

I’m guessing it’s this thread: Making `index.html.gz` smaller - #7 by ronlawrence3

Also, sorry for the beginner question here: I see that GitHub - BarbourSmith/ESP3D-WEBUI: A Web UI for ESP8266 or ESP32 based boards connected to 3D printers / CNC is 3+ years old.

  1. is there some branch I should select for the most up-to-date maslow?
  2. I saw that some of the icons were updated recently, meaning I would expect a repo that was touched in the last 2 weeks…

nvm: found GitHub - BarbourSmith/ESP3D-WEBUI at Maslow-Main

question: are you planning on merging it back to master at some point?

1 Like

I was annoyed with that too and will someday just change the default branch on my fork of Bar’s fork :slight_smile:

I don’t imagine we will send any of the maslow stuff up to upstream though, so I’d think we don’t need to care about the other branches? (i.e. feature branch->Maslow-Main works?) I then PR to @bar against his Maslow-main

1 Like

I had dreams of giving back to FluidNC but I don’t know how realistic that is, that’s why we have our own main branch

Ron Lawrence wrote:

I don’t imagine we will send any of the maslow stuff up to upstream though, so
I’d think we don’t need to care about the other branches? (i.e. feature
branch->Maslow-Main works?) I then PR to @bar against his Maslow-main

We should, it will make it much easier to maintain in the long run.

It will require us to change some things to meet their standards and decouple
the hardware support from being maslow specific, but those are good changes
anyway.

but we need to get people cutting first :slight_smile:

David Lang

3 Likes

Could not agree more on that! :slight_smile:

3 Likes