andrewdavidmackenzie / pigg

Raspberry Pi GPIO GUI
Apache License 2.0
156 stars 8 forks source link

Popup dialog to capture iroh-net connection parameters #222

Closed andrewdavidmackenzie closed 1 month ago

andrewdavidmackenzie commented 2 months ago

This is needed in order to complete #106

To connect to a remote Iroh-net node we need the Node ID . using NodeId::from_str(). e.g. "odvvntniz4qijaq6gdnsxuhe2wlhugiwdgkb7uqfw6zxhke7zxmq" So, we should have a text entry field of that length for it, with name "nodeid"

An additional field, with name "relay_url", that we can pre-fill before showing the dialog, but that the user can edit is also desired.

A small (x) to clear the text fields would be a nice touch, but not required.

A long text at the top of the dialog, that I will write, to explain what the parameters are for etc is also desired. If you create it with some placeholder multi-line text, I will re-write the message.

Then a button to connect, or a button to cancel.

When the "Connect" button is pressed, we should disable the button, and the text entry fields while it runs. we should show a spinner and a "Connecting to remote Pi" text.

A method will need to be called to "COnnect" when the connect button is pressed, that takes the nodeid and relay_url, and that may produce success or a failure.

On Success we should close the dialog.

On failure it should stay open, and display (red text at the bottom?) some error message. Then retry or cancel.

andrewdavidmackenzie commented 1 month ago

It will need to be a String, as per nodeid CL option, like: "qayqgh6n7voy7mskik6puouixvktqhumhwl7zrrixarv3jx4azdq"

We will need to add a method to set the HardwareTarget of HardwareView, so that the subscription tries to connect to it.

andrewdavidmackenzie commented 1 month ago

@sundaram123krishnan I have updated the description

sundaram123krishnan commented 1 month ago

Yes, got it