Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self-registering modules #1

Open
wifinigel opened this issue Oct 29, 2021 · 1 comment
Open

Self-registering modules #1

wifinigel opened this issue Oct 29, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@wifinigel
Copy link
Contributor

Move some of the internal features (e.g. modes) to dedicated, external self-registering packages.

Candidates for this work include AP mode, Server mode and wireless console.

If the modules are present, they will present a well defined data structure (maybe in JSON format) that can be used to integrate in to the FPMS menu system automatically.

@wifinigel wifinigel added the enhancement New feature or request label Oct 29, 2021
@wifinigel
Copy link
Contributor Author

Some initial thoughts on the registration process:

  1. Provide several folders which correspond to different leaves off the static menu system
  2. As a modules is installed on the wlanpi, it puts its menu registration YAML file in the appropriate leaf location
  3. Can support both shell & python module calls

Sample YAML files that would be parsed & grafted on to the menu system:

# a new menu item
name: Shutdown
action:
    call_type: shell
    call_location: /usr/bin
    call: 'shutdown -now'
# multiple options off new menu item
name: 'List services'
action:
    - {name: 'Show FPMS details', action: {call_type: shell, call_location: /usr/bin, call: 'ps -a | grep fpms'}}
    - {name: 'Show netinfo details', action: {call_type: shell, call_location: /usr/bin, call: 'ps -a | grep netinfo'}}
# a python call menu item (module is read in and provided function executed)
name: 'Do something python'
action:
    call_type: python
    call_location: /opt/wlanpi/util_folder/module.py
    call: do_something()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant