Skip to content

Commit

Permalink
show an indication for offline minions that is also visible when cach…
Browse files Browse the repository at this point in the history
…ed info is used
  • Loading branch information
Erwin Dondorp committed Dec 28, 2023
1 parent afda032 commit 3ad2188
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ The display of the IP-numbers can simply be disabled by choosing a non-existing
SaltGUI will retrieve cached grains information when variable `saltgui_use_cache_for_grains` is set to `true`.
In that case, unreachable minions will appear without warnings for that.
In all cases, the information may be less accurate.
A warning for offline minions is only shown on the Minions panel.

## Pillars
Pillars potentially contain security senstitive information.
Expand All @@ -298,6 +299,7 @@ saltgui_public_pillars:
SaltGUI will retrieve cached pillar information when variable `saltgui_use_cache_for_pillar` is set to `true`.
In that case, unreachable minions will appear without warnings for that.
In all cases, the information may be less accurate.
A warning for offline minions is only shown on the Minions panel.

## Nodegroups
The Nodegroups page shows all minions, but groups the minions by their nodegroup.
Expand Down
4 changes: 3 additions & 1 deletion saltgui/static/scripts/panels/Minions.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ export class MinionsPanel extends Panel {
const minionIds = pWheelMinionsConnectedData.return[0].data.return;

for (const tr of this.table.tBodies[0].childNodes) {
if (minionIds.indexOf(tr.dataset.minionId) >= 0) {
tr.dataset.isConnected = minionIds.indexOf(tr.dataset.minionId) >= 0;

if (tr.dataset.isConnected) {
// skip the connected minions
continue;
}
Expand Down
13 changes: 12 additions & 1 deletion saltgui/static/scripts/panels/Panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,10 @@ export class Panel {

const minionTr = this.getElement(Utils.getIdFromMinionId(pMinionId));

minionTr.appendChild(Utils.createTd("minion-id", pMinionId));
const minionSpan = Utils.createSpan("minion-id", pMinionId);
const minionTd = Utils.createTd();
minionTd.append(minionSpan);
minionTr.appendChild(minionTd);

// which grain to use for IP-number display
// typical choices are "fqdn_ip4", "ipv4", "fqdn_ip6" or "ipv6"
Expand Down Expand Up @@ -611,6 +614,14 @@ export class Panel {
minionTr.appendChild(accepted);
}

if (minionTr.dataset.isConnected === "false") {
Panel.addPrefixIcon(minionSpan, Character.WARNING_SIGN);
Utils.addToolTip(
minionSpan,
"This minion is currently not connected",
"bottom-left");
}

minionTr.dataset.minionId = pMinionId;

let saltversion = Character.EM_DASH;
Expand Down

0 comments on commit 3ad2188

Please sign in to comment.