Description
In the Admin UI, clicking Save on the Add/Edit LLM Provider or Add/Edit LLM Model modals does nothing. The page silently reloads without saving.
Root Cause
In mcpgateway/templates/admin.html, both forms use bare function names in their onsubmit handlers:
<!-- Line ~2081 -->
<form id="llm-provider-form" onsubmit="saveLLMProvider(event)">
<!-- Line ~2179 -->
<form id="llm-model-form" onsubmit="saveLLMModel(event)">
However, saveLLMProvider and saveLLMModel are not exposed as global functions. They are only registered on the window.Admin namespace in admin.js:
Admin.saveLLMProvider = saveLLMProvider;
Admin.saveLLMModel = saveLLMModel;
When the form is submitted, the browser cannot resolve saveLLMProvider as a global, event.preventDefault() is never called, and the form falls back to a native HTML submission (page reload). No provider or model is ever saved.
Fix
Change both onsubmit attributes to use the Admin. prefix:
<form id="llm-provider-form" onsubmit="Admin.saveLLMProvider(event)">
<form id="llm-model-form" onsubmit="Admin.saveLLMModel(event)">
Steps to Reproduce
- Open the Admin UI → LLM Settings
- Click "Add Provider" and fill in the form
- Click "Save" — nothing happens, page reloads
Impact
The entire LLM provider and model management UI is non-functional. Users cannot add or edit providers/models through the admin interface.
Environment
Affects all deployments (Docker, PyPI). Bug is in the template source.
Description
In the Admin UI, clicking Save on the Add/Edit LLM Provider or Add/Edit LLM Model modals does nothing. The page silently reloads without saving.
Root Cause
In
mcpgateway/templates/admin.html, both forms use bare function names in theironsubmithandlers:However,
saveLLMProviderandsaveLLMModelare not exposed as global functions. They are only registered on thewindow.Adminnamespace inadmin.js:When the form is submitted, the browser cannot resolve
saveLLMProvideras a global,event.preventDefault()is never called, and the form falls back to a native HTML submission (page reload). No provider or model is ever saved.Fix
Change both
onsubmitattributes to use theAdmin.prefix:Steps to Reproduce
Impact
The entire LLM provider and model management UI is non-functional. Users cannot add or edit providers/models through the admin interface.
Environment
Affects all deployments (Docker, PyPI). Bug is in the template source.