ansibleguy76 / ansibleforms

A webapplication to create pretty advanced forms to run ansible playbooks or awx templates.
https://ansibleforms.com/
GNU General Public License v3.0
66 stars 10 forks source link

Abillity to add buttons next to (expressions / text / enum) form fields and trigger some endpoint / external URL / fn / refresh #151

Open nikos445 opened 7 months ago

nikos445 commented 7 months ago

Feature:

Use case example:

ansibleguy76 commented 7 months ago

Can you give a more detailed example ? What data would be added to the database for example ? And what if a double click happens, should it add the data twice ? This wouldn't be such a big change, in the end the expression fields already to that (and not that you can have a post in the expressions. The post would then happen once or repost when a dependency changed. And there is a feature to refresh an expression too.

nikos445 commented 7 months ago

I don't have something specific currently in mind but, using ansible forms daily, I found that this sometimes would be awesome to have a button that calls an FN fuctnion.

  1. A quick example that comes in mind:

    • Lets say "want to add a new user" to a "database" with a "Restapi call" to a custom backend
    • A textfield with user email
    • [ + ] button next to it that calls the RestAPI with FN function.
    • Use User email in extra vars after to some ansible automation for granting priviledges to access a UI
  2. Another quick example that comes in mind:

    • Reset to default button value for a field.
    • Next to expression / text field
ansibleguy76 commented 7 months ago

that is a bit vague isn't it.

nikos445 commented 7 months ago

It is I agree, but good feature to be able to add buttons in a UI. I only suggest, your application, your choice for adding it or ignoring it! Happy to help! :)

nikos445 commented 7 months ago

Additionally, you can have a counter and allow the button to be clicked only once or twice or specific number of times