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

Function updateApiKeyButton

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

Source from the content-addressed store, hash-verified

85 * 根据当前连接状态更新按钮外观
86 */
87export function updateApiKeyButton() {
88 if (!openBtn) return;
89 const config = state.config;
90 const currentProvider = config?.provider || "openai";
91 const meta = config?.supportedProviders?.[currentProvider];
92
93 const connected = meta?.authType === "oauth"
94 ? config?.oauthConnected
95 : config?.hasApiKey;
96
97 if (connected) {
98 openBtn.classList.add("connected");
99 openBtn.querySelector(".action-btn-label").textContent = "Model Configured";
100 } else {
101 openBtn.classList.remove("connected");
102 openBtn.querySelector(".action-btn-label").textContent = "Provide Model Auth";
103 }
104}
105
106// --- Internal Helpers ---
107

Callers 5

initFunction · 0.90
handleSaveFunction · 0.85
handleOAuthLogoutFunction · 0.85
checkOAuthStatusFunction · 0.85
pollOAuthStatusFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected