Skip to main content

Switching Projects via a button in Reactor

Reactor allows to switch the current project via ana external HTTP POST request.Button.

TheTo endpointdo usedthis is:select /reactorapi/selectprojectthe IOReference "Reactor:CurrentProject" with a SKAARHOJ:SetValue Behavior and enter the name of your project into the MatchValue Field like so:

ThisEdit requestParameter allowsDialog:

projectswitch ioref.png

 

Inspector View:

projectswitch behavior.png

 

You should end up with a button like this:

 

projectswitch button.png

Keep in mind that selecting such a button will change the current project and might even disconnect the current controller if it is not configured in the other project. Make sure to useconfigure the skaarOSprojects authenticationyour via HTTP Basic Authentication (Use the latest version of system-managerswitching to allowso thisthat (v1.0.1-pre1you andcan higher))switch back.



Curl example:
curl

--location

 --request POST '192.168.0.20/reactorapi/selectproject' \
--header 'Authorization: Basic YWRtaW46c2thYXJob2o=' \
--header 'Content-Type: application/json' \
--data-raw '{"Filename":"MyProject"}'