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

Function populateForm

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

Source from the content-addressed store, hash-verified

116}
117
118function populateForm() {
119 const config = state.config;
120 if (!config) return;
121
122 // Provider
123 if (config.provider && providerSelect) {
124 providerSelect.value = config.provider;
125 }
126 updateProviderUI();
127
128 setStatus("", "");
129
130 // API Key & BaseURL
131 if (config.hasApiKey && config.apiKey) {
132 apiKeyInput.value = config.apiKey;
133 } else if (config.hasApiKey) {
134 apiKeyInput.value = "***************************************************";
135 } else {
136 apiKeyInput.value = "";
137 }
138 if (baseUrlInput) {
139 baseUrlInput.value = config.baseUrl || "";
140 }
141 if (modelIdInput) {
142 modelIdInput.value = config.modelId || "";
143 }
144 if (protocolSelect) {
145 protocolSelect.value = config.apiProtocol || "openai-completions";
146 }
147
148 // OAuth Status
149 if (config.oauthConnected) {
150 updateOAuthUI(true);
151 } else {
152 updateOAuthUI(false);
153 }
154}
155
156function updateProviderUI() {
157 if (!providerSelect) return;

Callers 2

openFunction · 0.70
handleSaveFunction · 0.70

Calls 3

updateProviderUIFunction · 0.85
updateOAuthUIFunction · 0.85
setStatusFunction · 0.70

Tested by

no test coverage detected