MCPcopy Create free account
hub / github.com/CreminiAI/skillpack / updateProviderUI

Function updateProviderUI

web/js/api-key-dialog.js:156–193  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

154}
155
156function updateProviderUI() {
157 if (!providerSelect) return;
158 const p = providerSelect.value;
159 const meta = state.config?.supportedProviders?.[p];
160
161 if (!meta) return;
162
163 if (meta.authType === "oauth") {
164 // Show OAuth section, hide API Key section
165 if (apikeySection) apikeySection.style.display = "none";
166 if (oauthSection) oauthSection.style.display = "";
167 if (saveBtn) saveBtn.style.display = "none";
168 checkOAuthStatus();
169 } else {
170 // Show API Key section, hide OAuth section
171 if (apikeySection) apikeySection.style.display = "";
172 if (oauthSection) oauthSection.style.display = "none";
173 if (saveBtn) saveBtn.style.display = "";
174
175 // Toggle BaseURL input
176 if (baseUrlGroup) {
177 baseUrlGroup.style.display = meta.supportsBaseUrl ? "" : "none";
178 }
179
180 if (baseUrlInput) {
181 baseUrlInput.placeholder =
182 meta.baseUrlPlaceholder || "https://api.openai.com/v1";
183 }
184
185 // Show model name field only when a custom base URL is filled in
186 updateModelIdVisibility();
187
188 // Update placeholder
189 if (apiKeyInput) {
190 apiKeyInput.placeholder = meta.placeholder || "sk-...";
191 }
192 }
193}
194
195function updateModelIdVisibility() {
196 if (!modelIdGroup) return;

Callers 1

populateFormFunction · 0.85

Calls 2

checkOAuthStatusFunction · 0.85
updateModelIdVisibilityFunction · 0.85

Tested by

no test coverage detected