Interface Management #70
Interface Management #70markqvist merged 7 commits intomarkqvist:masterfrom RFnexus:interface-management
Conversation
|
This is looking great so far! |
|
This looks fantastic @RFnexus! Amazing piece of work! The comprehensive interface editing is just brilliant, and the live graphs is terminal eye-candy, in addition to being very useful. Here's a few issues I came across when testing it:
Minor/personal comments:
|
|
Oh, and also: If nomadnet is connected to a master RNS instance, and that instance disappears (ie., program is closed, |
|
I've worked through the list of feedback and have completed the outstanding tasks.
I've now marked the PR as ready for review |
|
Thank you so much @RFnexus! Merged now :) I fixed some minor stuff (urwid Screen object being initialised many times, leading to weird issues over time) and added formatted labels to the charts. |
This PR adds comprehensive interface management to NomadNet. It allows the user to create, edit, disable / enable, and monitor interfaces in realtime under the
[ Interfaces ]tab. Currently it's submitted as a draft for review and feedback.Adding interfaces
Ctrl + A lets the user add a new interface. The user selects in a dialog the interface type, then proceeds to the
AddInterfaceView. TheINTERFACE_FIELDSdict defines the behavior for how input is validated and transformed based interface on type. Common interface fields are defined inCOMMON_INTERFACE_OPTIONSwhich display under "Show more options" in the add dialog.A set of Urwid form widget classes has been added in
FormWidgets.pyfor this purpose. This can also be extended to allow the user to edit the NomadNet, LXMF, or RNS config interactively from the application itself.Certain interface types will have custom options inside of the Add and Edit views. For example, interfaces with a port field have an interactive port picker with the option to refresh ports and when

pyserialis available. The RNodeInterface has a built in on-air parameter calculator that updates as the fields are changed, showing bitrate and link budget calculations.Each interface type in
INTERFACE_FIELDScan haveadditional_optionswhich are shown undre "Show more options".All fields are validated based on an array of set rules, for example
['required', 'float']. Any validation errors will be shown to the user. The behavior of the values from each FormWidget input is described in thetransformkey. For example, on the RNodeInterfacefrequencyis entered in MHz as opposed to Hz for ease of use. The transform key is:"transform": lambda x: int(float(x.strip()) * 1000000)Viewing interfaces
Pressing "Enter" on the selected interface will bring you to the ShowInterface view. This view contains the Interface information and interactive charts that display the RX and TX traffic over a set history length.

From here the interface can be enabled / disabled, and edited. The shortcuts are displayed below in the shortcut bar.
The chart system is derived from pyasciichart and supports both unicode and plain characters. It is also supported on lower-width terminals. Pressing
vwill toggle a vertical view, while pressinghwill toggle a horizontal view. This may be expanded in the future to contain more interactive charts, such as noise floor and channel capacity for RNodes.Editing interfaces
Editing interfaces is identical to adding interfaces, except the fields are automatically populated.
EditInterfaceViewis a child ofAddInterfaceViewInterfaces can also be edited and removed directly from the list using keyboard shortcuts when they are selected.

Remaining Tasks:
If there are any features you want added or changed, let me know. Thanks!