mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-09 16:59:43 +02:00
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:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user