Closed hardillb closed 1 week ago
@joepavitt this is what's needed to make UI builder work
@totallyinformation has just signed up to FlowFuse, so if we can get this in soon, it'd be great for him to have a play and see what he could build
He has 😁, and thanks Joe for your support. If we get get this working, I can also write up something about use of the FF authentication with UIBUILDER. Hopefully document a decent flow.
The trick here will be working out the path for the localfs version, we can't just hardcode /data/storage
as the path
Can it be based around the existing userDir setting?
But even if not, as long as we get the location in a variable that can be accessed by node runtimes, we can work with it. Currently, UIBUILDER uses the userDir as the base folder and adds the sub-folder uibuilder
. Everything else for it sits under that. However, uibuilder already allows for changing that folder to anywhere using the settings.js file.
@hardillb if the storage
directory is predictably adjacent to the location of settings.js
, we'll know the relative location to the settings file - so can do something like the following inside the generated settings.js file:
const path = require('path')
const persistentStorageDir = path.join(__dirname, 'storage')
We get the projects root in the settings from the driver at start up so we can build it all if needed, but the relative path of settings.js
is cleaner and will work the same for all.
Once I fix my dev env I'll get a PR opened
@TotallyInformation is there a settings.js option to disable the VSCODE button? Since if I understand correctly that won't work with a remote host (the link appears to open the folder directly as if it's on the local machine).
Or does that only show up if the hostname is localhost?
@hardillb No, not currently. And yes, currently it only shows up for localhost
However, v7 also introduces an advanced setting to allow the edit button link to be customised and also adjusts the link to a VScode remote link if it recognises that the server is remote to the Editor client. So the button appears for remote as well as local installs.
So is there a good way to know if Node-RED is running under a FlowFuse environment?
If there is, I can automate turning off for v7 which is close to release.
There are a number of environment variables that will be in scope e.g. FF_INSTANCE_ID
@TotallyInformation just so you know, while this is merged, it is not deployed to the production FlowFuse Cloud yet.
We will double check kick the tires on our staging env tomorrow and then decide when it will be deployed to production.
Thanks @hardillb - great to see things moving rapidly. I'll be ready to test whenever.
The library examples have plenty of content for testing a lot of the features.
Description
https://totallyinformation.github.io/node-red-contrib-uibuilder/#/
Requested By