Skip to content

Commit 82ce81a

Browse files
author
Erwin Dondorp
committed
fix status line for hidden selection column (claude assisted)
1 parent ca007a8 commit 82ce81a

1 file changed

Lines changed: 24 additions & 15 deletions

File tree

saltgui/static/scripts/panels/Panel.js

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -914,35 +914,44 @@ export class Panel {
914914

915915
getFooterForNodeGroups () {
916916
if (this.selectionSessionKeys.includes("select_nodegroups")) {
917-
const lst_nodegroups = Utils.getStorageItem("session", "select_nodegroups", null);
918-
if (lst_nodegroups !== null && lst_nodegroups !== ",") {
919-
// so the "0" case actually does not occur here, adjust count for the extra ','s
920-
const nrSelected = lst_nodegroups.split(",").length - 2;
921-
return ", " + Utils.txtZeroOneMany(nrSelected, "no selected nodegroups", "{0} selected nodegroup", "{0} selected nodegroups");
917+
const selectVisible = Utils.getStorageItemBoolean("session", "select_visible", false);
918+
if (selectVisible) {
919+
const lst_nodegroups = Utils.getStorageItem("session", "select_nodegroups", null);
920+
if (lst_nodegroups !== null && lst_nodegroups !== ",") {
921+
// so the "0" case actually does not occur here, adjust count for the extra ','s
922+
const nrSelected = lst_nodegroups.split(",").length - 2;
923+
return ", " + Utils.txtZeroOneMany(nrSelected, "no selected nodegroups", "{0} selected nodegroup", "{0} selected nodegroups");
924+
}
922925
}
923926
}
924927
return "";
925928
}
926929

927930
getFooterForMinions () {
928931
if (this.selectionSessionKeys.includes("select_minions")) {
929-
const lst_minions = Utils.getStorageItem("session", "select_minions", null);
930-
if (lst_minions !== null && lst_minions !== ",") {
931-
// so the "0" case actually does not occur here, adjust count for the extra ','s
932-
const nrSelected = lst_minions.split(",").length - 2;
933-
return ", " + Utils.txtZeroOneMany(nrSelected, "no selected minions", "{0} selected minion", "{0} selected minions");
932+
const selectVisible = Utils.getStorageItemBoolean("session", "select_visible", false);
933+
if (selectVisible) {
934+
const lst_minions = Utils.getStorageItem("session", "select_minions", null);
935+
if (lst_minions !== null && lst_minions !== ",") {
936+
// so the "0" case actually does not occur here, adjust count for the extra ','s
937+
const nrSelected = lst_minions.split(",").length - 2;
938+
return ", " + Utils.txtZeroOneMany(nrSelected, "no selected minions", "{0} selected minion", "{0} selected minions");
939+
}
934940
}
935941
}
936942
return "";
937943
}
938944

939945
getFooterForKeys () {
940946
if (this.selectionSessionKeys.includes("select_keys")) {
941-
const lst_keys = Utils.getStorageItem("session", "select_keys", null);
942-
if (lst_keys !== null && lst_keys !== ",") {
943-
// so the "0" case actually does not occur here, adjust count for the extra ','s
944-
const nrSelected = lst_keys.split(",").length - 2;
945-
return ", " + Utils.txtZeroOneMany(nrSelected, "no selected keys", "{0} selected key", "{0} selected keys");
947+
const selectVisible = Utils.getStorageItemBoolean("session", "select_visible", false);
948+
if (selectVisible) {
949+
const lst_keys = Utils.getStorageItem("session", "select_keys", null);
950+
if (lst_keys !== null && lst_keys !== ",") {
951+
// so the "0" case actually does not occur here, adjust count for the extra ','s
952+
const nrSelected = lst_keys.split(",").length - 2;
953+
return ", " + Utils.txtZeroOneMany(nrSelected, "no selected keys", "{0} selected key", "{0} selected keys");
954+
}
946955
}
947956
}
948957
return "";

0 commit comments

Comments
 (0)