Skip to content

Commit 12454e9

Browse files
committed
weblint
Signed-off-by: rakdutta <rakhibiswas@yahoo.com>
1 parent 25f5996 commit 12454e9

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
@@ -24108,7 +24108,9 @@ async function serverSideEditPromptsSearch(searchTerm) {
2410824108

2410924109
// Capture currently checked prompts BEFORE clearing the container
2411024110
const currentlyCheckedPrompts = new Set();
24111-
const existingCheckboxes = container.querySelectorAll('input[name="associatedPrompts"]:checked');
24111+
const existingCheckboxes = container.querySelectorAll(
24112+
'input[name="associatedPrompts"]:checked',
24113+
);
2411224114
existingCheckboxes.forEach((cb) => {
2411324115
currentlyCheckedPrompts.add(cb.value);
2411424116
});
@@ -24152,12 +24154,16 @@ async function serverSideEditPromptsSearch(searchTerm) {
2415224154
try {
2415324155
// Combine original server prompts with currently checked prompts
2415424156
const allSelectedPrompts = new Set(currentlyCheckedPrompts);
24155-
24156-
const dataAttr = container.getAttribute("data-server-prompts");
24157+
24158+
const dataAttr = container.getAttribute(
24159+
"data-server-prompts",
24160+
);
2415724161
if (dataAttr) {
2415824162
const serverPrompts = JSON.parse(dataAttr);
2415924163
if (Array.isArray(serverPrompts)) {
24160-
serverPrompts.forEach((p) => allSelectedPrompts.add(String(p)));
24164+
serverPrompts.forEach((p) =>
24165+
allSelectedPrompts.add(String(p)),
24166+
);
2416124167
}
2416224168
}
2416324169

@@ -24175,7 +24181,8 @@ async function serverSideEditPromptsSearch(searchTerm) {
2417524181
// Check by id first (string), then by name as a fallback
2417624182
if (
2417724183
allSelectedPrompts.has(promptId) ||
24178-
(promptName && allSelectedPrompts.has(String(promptName)))
24184+
(promptName &&
24185+
allSelectedPrompts.has(String(promptName)))
2417924186
) {
2418024187
cb.checked = true;
2418124188
}
@@ -24376,7 +24383,9 @@ async function serverSideEditResourcesSearch(searchTerm) {
2437624383

2437724384
// Capture currently checked resources BEFORE clearing the container
2437824385
const currentlyCheckedResources = new Set();
24379-
const existingCheckboxes = container.querySelectorAll('input[name="associatedResources"]:checked');
24386+
const existingCheckboxes = container.querySelectorAll(
24387+
'input[name="associatedResources"]:checked',
24388+
);
2438024389
existingCheckboxes.forEach((cb) => {
2438124390
currentlyCheckedResources.add(cb.value);
2438224391
});
@@ -24415,17 +24424,23 @@ async function serverSideEditResourcesSearch(searchTerm) {
2441524424

2441624425
// Update resource mapping
2441724426
updateResourceMapping(container);
24418-
24427+
2441924428
// Restore checked state for resources (both original server associations AND newly selected ones)
2442024429
try {
2442124430
// Combine original server resources with currently checked resources
24422-
const allSelectedResources = new Set(currentlyCheckedResources);
24423-
24424-
const dataAttr = container.getAttribute("data-server-resources");
24431+
const allSelectedResources = new Set(
24432+
currentlyCheckedResources,
24433+
);
24434+
24435+
const dataAttr = container.getAttribute(
24436+
"data-server-resources",
24437+
);
2442524438
if (dataAttr) {
2442624439
const serverResources = JSON.parse(dataAttr);
2442724440
if (Array.isArray(serverResources)) {
24428-
serverResources.forEach((r) => allSelectedResources.add(String(r)));
24441+
serverResources.forEach((r) =>
24442+
allSelectedResources.add(String(r)),
24443+
);
2442924444
}
2443024445
}
2443124446

@@ -24441,7 +24456,10 @@ async function serverSideEditResourcesSearch(searchTerm) {
2444124456
window.resourceMapping[cb.value]);
2444224457
if (
2444324458
allSelectedResources.has(resourceId) ||
24444-
(resourceName && allSelectedResources.has(String(resourceName)))
24459+
(resourceName &&
24460+
allSelectedResources.has(
24461+
String(resourceName),
24462+
))
2444524463
) {
2444624464
cb.checked = true;
2444724465
}

0 commit comments

Comments
 (0)