bugy / script-server

Web UI for your scripts with execution management
Other
1.59k stars 247 forks source link

non-editable parameter #644

Open antonellocaroli opened 1 year ago

antonellocaroli commented 1 year ago

Hi @bugy , I don't know if this question has already been asked.

I was wondering if this possibility existed, I'll give an example.

Let's say I have two parameters

Parameter1 and Parameter2

Parameter2 should only be editable if Parameter1 is equal to a certain value.

I can only do this if Parameter2 is of type "list". by exploiting

"default": {
        "script": "................... '${Param1}'"
      },

So if Parameter1 is equal to something it shows me the list otherwise the field appears as uneditable.

But I cannot do this when the parameter is of type "txt" or "int".

The only thing I can do is that it shows me a message like "NO EDIT". but still the user can edit it if they wish.

bugy commented 1 year ago

Hi @antonellocaroli this is not possible, but you can use include feature with parameters. You would create a separate configuration file, called smth like Conf certain value.json, this file would contain this extra parameter. And then in the main config, you would specify "include": "Conf ${Parameter1}.json".