Skip to content

Commit aceda48

Browse files
author
SealKrach
committed
fix: use Admin namespace for LLM provider/model form onsubmit handlers
The llm-provider-form and llm-model-form in admin.html called saveLLMProvider(event) and saveLLMModel(event) directly in their onsubmit attributes. These functions are not in the global scope — they are only registered on the window.Admin object in admin.js. This caused the browser to fail silently: event.preventDefault() was never called, the form fell back to native HTML submission (page reload), and no provider or model was ever saved. Fix: prefix both handlers with Admin. so they resolve correctly. Fixes #4662 Signed-off-by: SealKrach <[email protected]>
1 parent 47dfa0e commit aceda48

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

mcpgateway/templates/admin.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2078,7 +2078,7 @@ <h3 class="text-xl font-semibold text-gray-900 dark:text-white mb-2">
20782078
<div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" aria-hidden="true" onclick="Admin.closeLLMProviderModal()"></div>
20792079
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">&#8203;</span>
20802080
<div class="relative z-20 inline-block align-bottom bg-white dark:bg-gray-800 rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-2xl sm:w-full">
2081-
<form id="llm-provider-form" onsubmit="saveLLMProvider(event)">
2081+
<form id="llm-provider-form" onsubmit="Admin.saveLLMProvider(event)">
20822082
<input type="hidden" id="llm-provider-id" name="provider_id" value="">
20832083
<div class="bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
20842084
<h3 class="text-lg leading-6 font-medium text-gray-900 dark:text-white mb-4" id="llm-provider-modal-title">
@@ -2176,7 +2176,7 @@ <h4 class="text-sm font-medium text-gray-900 dark:text-white mb-3">Provider-Spec
21762176
<div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" aria-hidden="true" onclick="Admin.closeLLMModelModal()"></div>
21772177
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">&#8203;</span>
21782178
<div class="relative z-20 inline-block align-bottom bg-white dark:bg-gray-800 rounded-lg text-left overflow-visible shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-2xl sm:w-full">
2179-
<form id="llm-model-form" onsubmit="saveLLMModel(event)">
2179+
<form id="llm-model-form" onsubmit="Admin.saveLLMModel(event)">
21802180
<input type="hidden" id="llm-model-id" name="model_id" value="">
21812181
<div class="bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
21822182
<h3 class="text-lg leading-6 font-medium text-gray-900 dark:text-white mb-4" id="llm-model-modal-title">

0 commit comments

Comments
 (0)