Can a plugin config page be dynamic?

Hello,

I am writing a python program that controls volumio via keyboard. The program is almost done, I am now trying to make it into a volumio plugin. I need some help from wise experts on something I’m trying to achieve.

Disclaimer: I am NOT a web programmer. I have little experience on Javascript.

Question: Can a plugin’s configuration page be dynamic? By dynamic I mean it changes its contents while it is on display. I understand config page can be assembled dynamically at initialization by getUIConfig(), but I want to change its contents by user interaction.

Use case 1: A device selection. This configuration page lists keyboard devices connected to volumio host, with on-off switch. When user push “Refresh” button, it refreshes a list with updated devices, so user can plug/unplug keyboards, or in case of Bluetooth, user may want to wake it up from sleep mode. Device list is provided by external program.

Use case 2: Key mapping. When a user want to assign a function (play, pause…) to a key, there is a “Add Keymap” button. Pushing this button adds a row in keymap table, then it prompts a user to press a key on a keyboard. When user presses a key, the page displays the key name (provided by external program) and ask to assign a function to it.

Is there a way to achieve those scenarios from a plugin? Any suggestion will be appreciated.

Thanks in advance.