Skip to content

Commit fe168cc

Browse files
committed
weblint
Signed-off-by: rakdutta <rakhibiswas@yahoo.com>
1 parent 9e7cad2 commit fe168cc

File tree

1 file changed

+30
-12
lines changed

1 file changed

+30
-12
lines changed

mcpgateway/static/admin.js

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23468,7 +23468,9 @@ async function serverSideEditPromptsSearch(searchTerm) {
2346823468

2346923469
// Capture currently checked prompts BEFORE clearing the container
2347023470
const currentlyCheckedPrompts = new Set();
23471-
const existingCheckboxes = container.querySelectorAll('input[name="associatedPrompts"]:checked');
23471+
const existingCheckboxes = container.querySelectorAll(
23472+
'input[name="associatedPrompts"]:checked',
23473+
);
2347223474
existingCheckboxes.forEach((cb) => {
2347323475
currentlyCheckedPrompts.add(cb.value);
2347423476
});
@@ -23512,12 +23514,16 @@ async function serverSideEditPromptsSearch(searchTerm) {
2351223514
try {
2351323515
// Combine original server prompts with currently checked prompts
2351423516
const allSelectedPrompts = new Set(currentlyCheckedPrompts);
23515-
23516-
const dataAttr = container.getAttribute("data-server-prompts");
23517+
23518+
const dataAttr = container.getAttribute(
23519+
"data-server-prompts",
23520+
);
2351723521
if (dataAttr) {
2351823522
const serverPrompts = JSON.parse(dataAttr);
2351923523
if (Array.isArray(serverPrompts)) {
23520-
serverPrompts.forEach((p) => allSelectedPrompts.add(String(p)));
23524+
serverPrompts.forEach((p) =>
23525+
allSelectedPrompts.add(String(p)),
23526+
);
2352123527
}
2352223528
}
2352323529

@@ -23535,7 +23541,8 @@ async function serverSideEditPromptsSearch(searchTerm) {
2353523541
// Check by id first (string), then by name as a fallback
2353623542
if (
2353723543
allSelectedPrompts.has(promptId) ||
23538-
(promptName && allSelectedPrompts.has(String(promptName)))
23544+
(promptName &&
23545+
allSelectedPrompts.has(String(promptName)))
2353923546
) {
2354023547
cb.checked = true;
2354123548
}
@@ -23736,7 +23743,9 @@ async function serverSideEditResourcesSearch(searchTerm) {
2373623743

2373723744
// Capture currently checked resources BEFORE clearing the container
2373823745
const currentlyCheckedResources = new Set();
23739-
const existingCheckboxes = container.querySelectorAll('input[name="associatedResources"]:checked');
23746+
const existingCheckboxes = container.querySelectorAll(
23747+
'input[name="associatedResources"]:checked',
23748+
);
2374023749
existingCheckboxes.forEach((cb) => {
2374123750
currentlyCheckedResources.add(cb.value);
2374223751
});
@@ -23775,17 +23784,23 @@ async function serverSideEditResourcesSearch(searchTerm) {
2377523784

2377623785
// Update resource mapping
2377723786
updateResourceMapping(container);
23778-
23787+
2377923788
// Restore checked state for resources (both original server associations AND newly selected ones)
2378023789
try {
2378123790
// Combine original server resources with currently checked resources
23782-
const allSelectedResources = new Set(currentlyCheckedResources);
23783-
23784-
const dataAttr = container.getAttribute("data-server-resources");
23791+
const allSelectedResources = new Set(
23792+
currentlyCheckedResources,
23793+
);
23794+
23795+
const dataAttr = container.getAttribute(
23796+
"data-server-resources",
23797+
);
2378523798
if (dataAttr) {
2378623799
const serverResources = JSON.parse(dataAttr);
2378723800
if (Array.isArray(serverResources)) {
23788-
serverResources.forEach((r) => allSelectedResources.add(String(r)));
23801+
serverResources.forEach((r) =>
23802+
allSelectedResources.add(String(r)),
23803+
);
2378923804
}
2379023805
}
2379123806

@@ -23801,7 +23816,10 @@ async function serverSideEditResourcesSearch(searchTerm) {
2380123816
window.resourceMapping[cb.value]);
2380223817
if (
2380323818
allSelectedResources.has(resourceId) ||
23804-
(resourceName && allSelectedResources.has(String(resourceName)))
23819+
(resourceName &&
23820+
allSelectedResources.has(
23821+
String(resourceName),
23822+
))
2380523823
) {
2380623824
cb.checked = true;
2380723825
}

0 commit comments

Comments
 (0)