bugy / script-server

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

Bug with multiselect parameter #612

Open raszuk opened 1 year ago

raszuk commented 1 year ago

When multiselect contains the same repetitive entries (for example to force execution in a different pattern) checking one automatically checks out all but only one is passed to the script.

Only unchecking one of those auto checked values causes list of the rest of checked elements to be passed as parameter.

Default (loaded from file with cat):

image

Checking one item:

image

Passed to script:

ALL COMMANDS: paginate false

Unchecking one results in 4 elements passed to script:

ALL COMMANDS: paginate false paginate false paginate false paginate false

bugy commented 1 year ago

Hi @raszuk why do you need duplicated elements? I mean, if i would fix it in script server, i would just remove duplicates, as it's not very use friendly

raszuk commented 1 year ago

The duplicate entries are what I need in order to apply a specific sequence of commands to be executed via script-server. So for me this is really required behaviour.

The parameters here are actions to be run on routers in specific sequences

bugy commented 1 year ago

Well, I'll be honest here, I don't think that I'm going to support this use case, unless there are some other votes for it.

In this particular case, If I understood your use case correctly, I would do it differently: I would add separate parameters for each command, e.g.:

Select Nodes       Command 1       Command 2       Command 3
   Node 1       paginate false      show int        -

Of course, if different nodes have a different number of commands, this won't be possible.

raszuk commented 1 year ago

Well what you are proposing is something different which of course I also support as part of my work.

But here even for single node I often need to run the same command before and after some action. So sequence of repetitive commands is a norm in router world :)

But I am not really reporting a new use case ... I found it during some testing that the reported output is not deterministic or in fact surprising ... especially when deletion of one checkbox item results of increase of reported parameters :) That's all.

I am not asking to fix it ... just more logging for awareness of others playing with multiselect.