Closed chapulina closed 5 years ago
Interesting observation.
If the location is solved during runtime, we don't have too many options. If we want to keep the file, we could keep it with no useful content, maybe just a comment like # Insert your configuration here
and catch that when loading. Then, the documentation in the README
file should do the rest to show how things work. WDYT?
How about keeping the file, but without any of the URL fields? Currently that clears the URLs though, so we'll need to add some logic not to set the URL if it's empty.
I think it can be done; right now the operation is straightforward because it's just converting the JSON to an object. If we go that way I'd temporarily store all the fields that we would like to preserve in case the new ones are empty before overwriting them, and in case they are erased I'd restore them. Does that make sense?
Edit: the only thing I don't like about this approach is that it adds something else to maintain (i.e. "fields that we don't want overwritten in case they are empty"), but I still think it's acceptable.
Yeah I think that could work
fields that we don't want overwritten in case they are empty
Would it make implementation simpler if that was the case for every field? That's probably the best thing to do.
Sounds good; let's try that!
https://github.com/osrf/rvizweb/pull/14 added a default configuration file which has some hardcoded URLs. However, when not running from
localhost
, like if you're inside docker, those URLs are wrong.In fact,
ros-rviz
by default fills the URLs with the current location on the browser, so by itself it works, and then the config file is actually overriding the correct URLs.I'm not sure what's the best solution here. We could just remove the default file and don't try to load it if it's an empty string. I like having the file as an example though, but I can't think of a convenient way of keeping it.
Thoughts, @jubeira ?