Closed jmwright closed 6 months ago
It works!
Is it possible to add the assembly-docs folder to the cache? And then make a simple server route that serves from this directory? I think it would be great if once generated, the rack pops up and underneath there was a big button saying something like "Go to assembly documentation" and perhaps a smaller one that was "download zip".
Also.. the preview is upside down, but the controls are gimbal locked so you can't spin it the right way up.
Is it possible to add the assembly-docs folder to the cache? And then make a simple server route that serves from this directory?
That should be possible. I'll give it a try.
Also.. the preview is upside down, but the controls are gimbal locked so you can't spin it the right way up.
Yeah, I haven't figured out the model-viewer options to fix the gimbal lock yet. I can at least set the view to be right side up by default with the view direction settings.
@julianstirling I fixed the issue with the preview being upside down. Hosting the resulting assembly-docs
directory will take a little longer.
Something else that should not be too hard, is to start with no drop downs. There would be an add button for each component type, something like Add Access Point
, Add Router
, Add Server
and Add Switch
. Clicking an Add *
button would add a corresponding drop down. Then the rack can be built in any order, with any mix of components.
@julianstirling Your suggestions have been implemented.
In addition, I have renamed test_page
to configurator
because I think we've gone past the test_page
stage.
I think I'll go ahead and take a shot at making the drop downs configurable.
Ok, there are improvements that could be made, but I am going to stop and wait for feedback. The UI is dynamic now, allowing for arbitrarily complex racks to be configured. Setting a drop down to None
will cause it to be removed/ignored. There is no reordering of rack components, so you have to remove components and re-add them if you make a mistake in ordering.
One question I have is whether or not the rack's CAD model is being built in the right order relative to the order of the drop downs in the UI. I'm not sure if it should be bottom-up or top-down relative to how the controls are arranged in the UI.
@julianstirling If you want to completely clear the cache during testing (start from scratch), delete the contents of the _cache_
and server/static/builds
directories. I copy the cached assembly-docs
directories to the static directory for now rather than creating dynamic static directories via the web framework.
The cache is keyed on the existence of the build zip file that gets sent to the client, so a dirty cache clear can be completed by deleting the zip file, which should trigger a new build. All the other directories for that specific configuration should be re-created. If the order of the components in the config is changed, it should be treated as a completely different build.
How do I actually suggest code changes rather than just adding comments?
Click the commit diff button shown below and then edit the contents inside the suggestion
block.
@julianstirling I think all the comments have been resolved now. I also moved the loading spinner up to the same area as the 3D preview, and toggle the visibility now so that it does not look like a left-over preview belongs to a new config. It causes a quick flash when requesting a cached config while running locally, but I think that is the price we pay for making sure users are not seeing old previews for new configs while the new preview is loading.
Perfect. Merge is approved so feel free to merge when you are ready.
With the exception of allowing download of individual components (which might end up being a #wontfix anyway), the server is fixed and has a couple of new features.
devices.json
file, and any components that are missing necessary metadata ("HeightUnits") are filtered out so that you cannot generate a broken config.This is a contrived screenshot. The preview actually works, and has full 3D mouse controls.
This server is still a mess in some ways. The
generate
call blocks, and special care will be needed to make that work async without breaking the server framework (it is weird about spinning off threads from within it's own threads). This means that it is not ready for multiple simultaneous users. However, it should work fine for a local demo on a laptop.Caching is still in place, but works differently than before. Both the build zip file and the glTF file are both cached.
@julianstirling If you get a chance, you could see if you can get this running on your local machine. The
requirements.txt
in theserver
directory has been updated, and is what I am running on.