Merge pull request #200 from timkjr/pr/gate-gemini-drop-tunnel-button

fix(welcome): gate CLI welcome buttons on actual availability
This commit is contained in:
Codeman maintainer
2026-08-05 01:40:44 +02:00
5 changed files with 51 additions and 12 deletions
+25
View File
@@ -718,6 +718,31 @@ Object.assign(CodemanApp.prototype, {
this._updatePollTimer = setInterval(poll, 1500);
},
async loadGeminiAvailability() {
await this._loadCliAvailability('welcomeGeminiBtn', '/api/gemini/status');
},
async loadClaudeAvailability() {
await this._loadCliAvailability('welcomeClaudeBtn', '/api/claude/status');
},
async loadOpencodeAvailability() {
await this._loadCliAvailability('welcomeOpencodeBtn', '/api/opencode/status');
},
async _loadCliAvailability(buttonId, statusUrl) {
const btn = document.getElementById(buttonId);
if (!btn) return;
try {
const res = await fetch(statusUrl);
const env = await res.json();
const status = env?.success === true ? env.data : env;
btn.style.display = status?.available ? 'flex' : 'none';
} catch {
btn.style.display = 'none';
}
},
async loadTunnelStatus() {
try {
const res = await fetch('/api/tunnel/status');