fix(welcome): gate Gemini button on availability, drop unconditional tunnel button

- Remove the always-visible Cloudflare Tunnel welcome button and QR
  widget; offering it regardless of whether cloudflared is installed
  is a bad default.
- Hide the "Run Gemini" welcome button by default and only show it
  when /api/gemini/status reports available:true, via new
  loadGeminiAvailability() called from showWelcome().
This commit is contained in:
timkjr
2026-08-04 16:21:55 -05:00
parent 529d8fa8ea
commit 62008fb408
3 changed files with 15 additions and 9 deletions
+13
View File
@@ -694,6 +694,19 @@ Object.assign(CodemanApp.prototype, {
this._updatePollTimer = setInterval(poll, 1500);
},
async loadGeminiAvailability() {
const btn = document.getElementById('welcomeGeminiBtn');
if (!btn) return;
try {
const res = await fetch('/api/gemini/status');
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');