Skip to content

Commit 628cab1

Browse files
rakduttacrivetimihai
authored andcommitted
select all
Signed-off-by: rakdutta <[email protected]>
1 parent c304d9d commit 628cab1

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

mcpgateway/static/admin.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6840,7 +6840,28 @@ function initPromptSelect(
68406840
'input[type="checkbox"]',
68416841
);
68426842
const checked = Array.from(checkboxes).filter((cb) => cb.checked);
6843-
const count = checked.length;
6843+
6844+
// Determine count: if Select All mode is active, use the stored allPromptIds
6845+
const selectAllInput = container.querySelector(
6846+
'input[name="selectAllPrompts"]',
6847+
);
6848+
const allIdsInput = container.querySelector(
6849+
'input[name="allPromptIds"]',
6850+
);
6851+
6852+
let count = checked.length;
6853+
if (
6854+
selectAllInput &&
6855+
selectAllInput.value === "true" &&
6856+
allIdsInput
6857+
) {
6858+
try {
6859+
const allIds = JSON.parse(allIdsInput.value);
6860+
count = allIds.length;
6861+
} catch (e) {
6862+
console.error("Error parsing allPromptIds:", e);
6863+
}
6864+
}
68446865

68456866
// Rebuild pills safely - show first 3, then summarize the rest
68466867
pillsBox.innerHTML = "";

0 commit comments

Comments
 (0)