Skip to content

Conversation

@rakdutta
Copy link
Collaborator

@rakdutta rakdutta commented Dec 8, 2025

closes issue #1566
This PR adds gateway-based filtering support to Admin search endpoints for Tools, Resources, and Prompts, allowing filtering by one or more gateway IDs—including items with no gateway (NULL).

It also improves Admin UI clarity by updating the gateway label and fixes a selection persistence issue on the Add/Edit Virtual Server pages.


✅ Changes Introduced

🛠 API Enhancements – Gateway Filtering

  • Added a new optional gateway_id query parameter (comma-separated) to:

    • admin_search_tools
    • admin_search_resources
    • admin_search_prompts
  • Supports:

    • ✅ Filtering by multiple gateway IDs
    • ✅ Filtering for items with no gateway using "null"
  • Updated:

    • 📄 Endpoint docstrings

    • ⚙️ SQL filtering logic to correctly handle:

      • Multiple IDs
      • NULL gateway values

🎨 Admin UI Improvements

  • Updated the gateway filter label:

    • "REST" → "REST/A2A"
  • Clarifies that the option includes both REST and A2A gateways


🐞 Bug Fixes

  • Fixed tool/prompt/resource selection persistence in:

    • ✅ Add Virtual Server
    • ✅ Edit Virtual Server

🔍 How to Test – Virtual Server (Selection Persistence)

  1. Navigate to Admin → Virtual Server → Add/Edit page.

  2. Apply a gateway filter using:

    • A single gateway ID
    • Multiple gateway IDs (comma-separated)
    • "null" to include items with no assigned gateway
  3. Verify that the displayed results match the applied filter conditions.

  4. Search for a tool, prompt, or resource and select one or more items.

  5. Clear the search keyword from the search box.

  6. Change the selected gateway ID and repeat the above steps.

  7. Confirm that the selected tools, prompts, and resources persist correctly.

@rakdutta rakdutta force-pushed the fix_virtual-server-selection-persistence branch from 79267fa to 020316e Compare December 8, 2025 11:56
@rakdutta rakdutta changed the title Fix virtual server selection persistence Admin: Enable gateway filtering for search & fix selection persistence Dec 8, 2025
@rakdutta rakdutta marked this pull request as ready for review December 8, 2025 12:22
Copy link
Collaborator

@MohanLaksh MohanLaksh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested changes

Works as intended.

GOOD TO MERGE!

@rakdutta rakdutta force-pushed the fix_virtual-server-selection-persistence branch from fe168cc to 12454e9 Compare December 11, 2025 10:59
Add gateway-based filtering support to Admin search endpoints for Tools,
Resources, and Prompts. This allows filtering by one or more gateway IDs,
including items with no gateway (NULL).

API Changes:
- Add optional gateway_id query parameter to admin_search_tools,
  admin_search_resources, and admin_search_prompts endpoints
- Support filtering by multiple gateway IDs (comma-separated)
- Support filtering for NULL gateway using literal 'null' string

UI Changes:
- Update gateway filter label from 'REST' to 'REST/A2A' for clarity
- Fix tool/resource/prompt selection persistence on Add/Edit Virtual
  Server pages when changing filters or clearing search

Technical Details:
- Store selections in data-selected-* attributes and window fallbacks
- Restore selections after HTMX content replacement
- Fix parseInt usage for UUID values (use string comparison instead)
- Pass gateway_id parameter through all search API calls

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
@crivetimihai crivetimihai force-pushed the fix_virtual-server-selection-persistence branch from 12454e9 to a9cb061 Compare December 12, 2025 21:16
@crivetimihai crivetimihai merged commit 531c0c7 into main Dec 12, 2025
52 checks passed
@crivetimihai crivetimihai deleted the fix_virtual-server-selection-persistence branch December 12, 2025 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants