I have a React-Cockpit question. I kind of stuck with no good idea of
how to implement one thing...
The scenario I want to execute:
1. User clicks a button 'Run Full Report';
2. It creates a promise and checks through '.stream()' if the execution
requires user input;
3. If it requires - Show the input modal and wait for the user press
4. When the user enters the data (which I store in state) and confirms -
continue the execution in the existing '.stream()';
5. Repeat as many times as it requires (and it is dynamic because it
depends on the actual network state)
I have a few options but I am not sure which exactly React-Cockpit tools
I can use for that...
- Can I wait inside of cockpit.stream('here') for some state change? I
can wait for the React componentDidUpdate() but I am not sure how I
can connect this with exacting cockpit.stream('here') code.
- I have an ugly option with spawning a lot of promises to fetch user
data and then using it in the final report execution... But it looks
so ugly that I'd rather search for a 'smart' way...
If you can somehow direct me to a solution, it'll be most
appreciated. I've tried to search for the solution from different
angles but apparently I miss some React-Cockpit capabilities.