Modify Duet Web Control
-
Hey all!
So we have everything set up now and have used the Duet Web Control (DWC) to send gcode commands and gcode files to the Duet.
We plan on using the DWC but we would like to simplify the design quite a bit. For example, we want to take out the central "Head movement" spot to clean things up so that the user can have a simplified version of the interface.
I am assuming we would need to modify the source code and recompile? Looking for some info on this, thank you in advance!
-
You can find DWC at https://github.com/chrishamm/DuetWebControl. It's all written in html, Javascript and css. Most of the files are compressed using gzip for better loading speed, but you can use uncompressed files too
-
You can find DWC at https://github.com/chrishamm/DuetWebControl. It's all written in html, Javascript and css. Most of the files are compressed using gzip for better loading speed, but you can use uncompressed files too
Thank you!
If I wanted to edit in an IDE and remove the section I mentioned, the big block in the DWC that is the x-100, x-10, x-1 etc, where would I start?
-
I've recently done some mods to DWC.
I'd recommend the following:
-
Clone the github repository, and/or download it. The whole thing.
-
You will find that if you go into the "Core" directory and launch the "reprap.htm" page, it will run from your local file system, WITHOUT doing any of the build scripts, and without having to mess with any of the zip or gz files. Everything works in this mode, with the single exception of language support.
-
I highly, highly, highly recommend chrome, no matter what you use on a regular basis, because of its developer support. So I am going to assume that you use it.
-
In chrome, press F12, and then select "sources". The two tabs "sources" and "console" will represent 90% of what you want.
Beyond that, open the files in your favorite editor (sublime text for me, even though it does cost money, it is worth it), make changes, and refresh the browser.
As for your specific request, most of your editing will be in the repreap.htm file, with some in the various JS files (because things may break in the javascript when certain parts of the html are removed).
Those are my techniques for changing DWC. What the above is not is any kind of guide to html or javascript programming. That's WAY beyond forum comments.
-
-
Also, to your original question, there is no "recompile". Using the above, just change an html or js file in the editor, save it, refresh the browser.
When all your mods are finished, you may wish to compress and zip up YOUR version and put it on your Duet. You don't have to… it runs fine from a local PC file system. If you wish to put it on a duet, you can:
-
Follow the build scripts, which only run on Linux (not even a Mac!!). Then upload the resulting zip via DWC's standard upload.
-
Do the rough equivalent of the build scripts by hand. That is, compress and zip and gzip things. Personally, I'd skip all the minifiy stuff if I was the only person using it. Again, upload via DWC.
-
Don't even compress or anything, just load your files "as is" to the Duet SD. If you do this, there is one quirk to know about: If Duet sees a given file, say "reprap.htm" and the gzipped version of that same file, say "reprap.htm.gz", it will use the .gz. The easiest way round this is to put the SD card in a PC/Mac and completely clean out the /www directory, then put your files in /www.
Any of these three will work fine. I've done them all and verified that they work.
-
-
Also, to your original question, there is no "recompile". Using the above, just change an html or js file in the editor, save it, refresh the browser.
When all your mods are finished, you may wish to compress and zip up YOUR version and put it on your Duet. You don't have to… it runs fine from a local PC file system. If you wish to put it on a duet, you can:
-
Follow the build scripts, which only run on Linux (not even a Mac!!). Then upload the resulting zip via DWC's standard upload.
-
Do the rough equivalent of the build scripts by hand. That is, compress and zip and gzip things. Personally, I'd skip all the minifiy stuff if I was the only person using it. Again, upload via DWC.
-
Don't even compress or anything, just load your files "as is" to the Duet SD. If you do this, there is one quirk to know about: If Duet sees a given file, say "reprap.htm" and the gzipped version of that same file, say "reprap.htm.gz", it will use the .gz. The easiest way round this is to put the SD card in a PC/Mac and completely clean out the /www directory, then put your files in /www.
Any of these three will work fine. I've done them all and verified that they work.
Dude, I can't believe how helpful this is!! You're amazing!! Thank you so much, this is exactly what I am looking for.
The way our project is set up, we don't have physical access to all our gear (duet, rpi, etc) during the week since it stays in the boss-man's office, so that's why I spend all week asking questions, so when we meet in our weekly meeting we are ready and raring to go lol.
This is such a great few posts, thanks again!
-