cat / goq
clone

turns a linux box into a private steam streaming appliance: plug in, tap your key, play from another computer

ux: remove bottom-left keyhome label, remove stop button, unify disconnect

dami etoile committed 0af1ed0
- Remove 'keyhome »' prompt from bottom bar (brand is already in topbar)
- Remove 'stop' button from hosting state
- When hosting: show disconnect button labeled 'stop hosting'
- When connected: show disconnect button labeled 'disconnect'
- When idle: hide disconnect button, show host/register
- disconnect() now handles both hosting (calls stopHost) and connected states
commit
0af1ed0c0be78931e62c76f400915593f065759b
parent
97a9c55eae74e8ebcaa35a136748c12a867d2b5a
author
dami etoile <dami.etoile@gmail.com>
1 file changed, +17 -6
Msrc/ui/index.html23+++++++++++++++++------
M src/ui/index.html +17 -6
@@ -465,10 +465,8 @@
465465 466466 <!-- Bottom bar -->467467 <div class="bottombar">468- <span class="prompt">keyhome</span>469- <span class="sep">»</span>470468 <span class="action primary" id="action-main" onclick="mainAction()">host</span>471- <span class="sep">·</span>469+ <span class="sep hidden" id="sep-disconnect-main">·</span>472470 <span class="action danger hidden" id="action-disconnect" onclick="disconnect()">disconnect</span>473471 <span class="sep hidden" id="sep-disconnect">·</span>474472 <span class="action" id="action-unreg" onclick="unregister()">unregister</span>
@@ -658,7 +656,11 @@
658656 setStatus('ok', 'hosting');659657 document.getElementById('node-id-text').textContent =660658 result.node_id.substring(0, 16) + '...';661- document.getElementById('action-main').textContent = 'stop';659+ // Show "stop hosting" disconnect button, hide main action660+ document.getElementById('action-disconnect').textContent = 'stop hosting';661+ document.getElementById('action-disconnect').classList.remove('hidden');662+ document.getElementById('sep-disconnect-main').classList.remove('hidden');663+ document.getElementById('action-main').style.display = 'none';662664 document.getElementById('action-unreg').style.display = 'none';663665 // Show host info panel, hide placeholder664666 document.getElementById('placeholder').classList.add('hidden');
@@ -683,8 +685,11 @@
683685 } catch (e) { console.error(e); }684686 hosting = false;685687 setStatus('', 'idle');688+ document.getElementById('action-main').style.display = '';686689 document.getElementById('action-main').textContent = registered ? 'host' : 'register';687690 document.getElementById('action-unreg').style.display = registered ? '' : 'none';691+ document.getElementById('action-disconnect').classList.add('hidden');692+ document.getElementById('sep-disconnect-main').classList.add('hidden');688693 document.getElementById('host-info').classList.add('hidden');689694 document.getElementById('placeholder').classList.remove('hidden');690695 document.getElementById('pin-label').classList.remove('hidden');
@@ -695,7 +700,8 @@
695700 // ─── Main action (host/stop/register) ───────────────────────────────696701 async function mainAction() {697702 if (hosting) {698- await stopHost();703+ // Hosting state uses disconnect button, not main action704+ return;699705 } else if (registered) {700706 await startHost();701707 } else {
@@ -722,8 +728,9 @@
722728 document.getElementById('frame-canvas').style.display = 'block';723729 document.getElementById('placeholder').classList.add('hidden');724730 document.getElementById('control-bar').classList.add('visible');725- // Show disconnect, hide connect731+ // Show disconnect, hide connect + main action726732 document.getElementById('action-connect').style.display = 'none';733+ document.getElementById('action-disconnect').textContent = 'disconnect';727734 document.getElementById('action-disconnect').classList.remove('hidden');728735 document.getElementById('sep-disconnect').classList.remove('hidden');729736 document.getElementById('action-main').style.display = 'none';
@@ -736,6 +743,10 @@
736743 }737744 738745 async function disconnect() {746+ if (hosting) {747+ await stopHost();748+ return;749+ }739750 try {740751 await invoke('iroh_client_disconnect');741752 } catch (e) { console.error(e); }