Skip to content

How to quickly select multiple target minions#837

Draft
erwindon wants to merge 22 commits intomasterfrom
minion_select
Draft

How to quickly select multiple target minions#837
erwindon wants to merge 22 commits intomasterfrom
minion_select

Conversation

@erwindon
Copy link
Owner

I have installed and started using SaltGUI. I would like to thank the author—it is very easy to deploy and has freed me from the terminal command line. Operating via the web interface is much easier and simpler.
I have a suggestion I hope you will consider. We often need to execute commands on multiple specified minions simultaneously. Currently, when I type the name of the first minion, the system can automatically match the connected minions, making target selection very convenient.
However, the problem arises when I want to add more minions; at this point, I can no longer use the dropdown list for automatic filtering. I have to switch to the Keys page, find the target minions, and manually copy the names one by one.
Therefore, I suggest optimizing the program so that when selecting multiple minions, users can quickly find targets via a dropdown menu, or provide a list allowing users to select via checkboxes. This would greatly improve the efficiency of selecting target minions. I hope this can be implemented in a future version. Thank you!

@sx98083714
Copy link
Author

👍 :)

@erwindon
Copy link
Owner

I would like to thank the author

From the manual:
This excellent frontend is originally written by @oliverdunk.
It was then further developed by @mj026.
It is currently maintained by @erwindon.

@erwindon
Copy link
Owner

@sx98083714
I'll look into this.
Main problem is to come up with a gui addition that is:

  • simple to build
  • simple to maintain
  • easy to understand
  • easy to use

Do you have references to websites/programs that have a similar feature?
Are you using the same subsets of hosts often? In that case defining nodegroups (in file /etc/salt/master) may be more useful.

@erwindon erwindon assigned sx98083714 and unassigned erwindon Mar 10, 2026
@sx98083714
Copy link
Author

sx98083714 commented Mar 11, 2026

@sx98083714 I'll look into this. Main problem is to come up with a gui addition that is:

  • simple to build
  • simple to maintain
  • easy to understand
  • easy to use

Do you have references to websites/programs that have a similar feature? Are you using the same subsets of hosts often? In that case defining nodegroups (in file /etc/salt/master) may be more useful.

Thank you for your reply! You are absolutely right. For some frequently used hosts, I can indeed use Nodegroups to simplify minion selection. However, most of my operations are random and irregular. For instance, when I need to update a program's version across all minions, some minions inevitably fail to complete the upgrade due to various reasons (like network issues). I then have to locate these failed minions to rerun the task. Since the failed minions are different each time, I can't use Nodegroups to quickly target them.

Regarding the implementation, this is actually a very common approach. Simply adding a checkbox at the beginning of each row in the minion list page would make it much more convenient.

Thanks again for your reply and your efforts. Wishing you smooth work and a happy life!

@erwindon
Copy link
Owner

I then have to locate these failed minions to rerun the task [...]

That is where "states" are used for. Just define a desired state and let a scheduled 'highstate' do all the work until all is done. You then only fix the impediments until all succeed. (also: easier said than done).

Regarding the implementation, this is actually a very common approach.
Simply adding a checkbox at the beginning of each row in the minion list page would make it much more convenient.

Sounds reasonable!
I'll investigate that (and that may take a few days)

@sx98083714
Copy link
Author

@erwindon Thank you for your reply and the tips. I'll definitely look into and learn more about this. I really appreciate everything you've done!

@erwindon
Copy link
Owner

The idea in this GitHub issues is actually better then I thought.

One of the goals for SaltGUI is to keep the user interface simple.
A whole new permanent column of check-boxes is already too much (for me). But see below.

I'm currently thinking of the following:

  • The functionality is limited to the selection of minions. This also excludes the Keys screen because the rows there are keys, not minions. It also excludes the Nodegroups screen because of potential duplicate rows and the extra group-header-rows.
  • Add a button [✓] in the list of buttons behind the page title. e.g. on the Minions screen: [☰] [🔍] [✓]. The button hides/shows a column of check-boxes at the beginning of each table row.
  • The selection status of the minions is maintained in a session-cookie so that the selection can be re-used after page-navigation.
  • The title row of the table will also get a [✓], this time not for sorting, but for a select-all/select-none function.
  • The check-boxes will be totally ignored when they are not also shown.
  • The command-box icon [>_] will use the list of selected minions.
  • This also happens for commands selected from the page menu [☰]. This actually only applies to [Apply state] and [Test state] commands so far.
  • Any changes made in the target-field of the command-box has no effect on the state of the check-boxes.
  • The command-box will automatically switch to "list" mode when a list is used (might not even need a change for that).
  • Since all the command-box fields and the attached code takes up memory space, a global setting will be added (in /etc/salt/master) to suppress this feature. This is a valid concern for people that have hundreds of minions, causing slow pages or even out-of-memory. Note that SaltGUI does not have a paging facility to otherwise reduce the number of rows.

@erwindon
Copy link
Owner

I converted this GitHub issue to a pull request.
The corresponding branch is completely experimental (but strictly related to the functionality that is discussed here).
Feel free to use it.
Use SHIFT-refresh from the browser each time you use this to fetch updated files after a local git pull to update source code)

@erwindon
Copy link
Owner

(PROBLEM 1)
so far, the CommandBox retains the values for field "target" and also for field "command".
with the minion-selection logic in place, we would overwrite the value of field "target" (implementation A).
alternatively, we can add a new item to the field-dropdown-menu with the magic value "##selected-minions". when chosen, the field value is replaced with the list of selected minions only when that menu item is selected. (implementation B). but this has a remaining problem: the field-dropdown-menu is filtered by the browser and would not always show the menu item. so implementation B is not chosen.
are there other alternatives?
[this github text field will be updated when new solutions become available or until we make a decision]

@erwindon erwindon force-pushed the minion_select branch 13 times, most recently from ddf2159 to c9ce3ce Compare March 15, 2026 13:13
@erwindon
Copy link
Owner

erwindon commented Mar 16, 2026

@sx98083714
I added the selectAll / selectNone / invertSelection logic.
It is explained in the tooltip.

I've updated the documentation for it also.

Unfortunately the column now behaves as a sortable column. I'll fix that later... --> fixed

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants