From c407f6c483515d293cc5f8141bc6a1a17555c70c Mon Sep 17 00:00:00 2001 From: LukeMackin Date: Wed, 22 Jul 2026 17:51:49 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20Terminal=20Tab=20=E2=80=94=20=E8=BF=9C?= =?UTF-8?q?=E7=A8=8Bexec=E5=91=BD=E4=BB=A4=E6=89=A7=E8=A1=8C=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Terminal标签: 命令输入+Run按钮+输出区域 - 等宽字体+绿字黑底终端风格 - 5个Tab: Chat/Term/Gateway/Device/Connection --- packages/client-android/App.tsx | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/packages/client-android/App.tsx b/packages/client-android/App.tsx index e0849f6..6065f75 100644 --- a/packages/client-android/App.tsx +++ b/packages/client-android/App.tsx @@ -11,7 +11,7 @@ import { DEFAULT_GATEWAY_CONFIG } from '@yuzu-gca/shared'; type Msg = { role: 'user' | 'assistant'; text: string; ts: number }; export default function App() { - const [tab, setTab] = useState<'chat' | 'settings' | 'device' | 'connection'>('chat'); + const [tab, setTab] = useState<'chat' | 'terminal' | 'settings' | 'device' | 'connection'>('chat'); // Chat state const [messages, setMessages] = useState([]); @@ -85,10 +85,10 @@ export default function App() { {/* Tabs */} - {(['chat', 'settings', 'device', 'connection'] as const).map(t => ( + {(['chat', 'terminal', 'settings', 'device', 'connection'] as const).map(t => ( setTab(t)} style={[styles.tab, tab === t && styles.tabActive]}> - {t === 'chat' ? 'Chat' : t === 'settings' ? 'Gateway' : t === 'device' ? 'Device' : (connStatus === 'connected' ? '🟢' : '⚫')} + {t === 'chat' ? 'Chat' : t === 'terminal' ? 'Term' : t === 'settings' ? 'Gateway' : t === 'device' ? 'Device' : (connStatus === 'connected' ? '🟢' : '⚫')} ))} @@ -128,6 +128,29 @@ export default function App() { )} + {/* ── Terminal Tab ── */} + {tab === 'terminal' && ( + + + + Execute remote commands via Gateway MCP.{'\n'}Type a shell command and press Execute.{'\n'} + + + + + + Run + + + + )} + {/* ── Settings Tab ── */} {tab === 'settings' && ( @@ -245,6 +268,8 @@ const styles = StyleSheet.create({ conn_error: { backgroundColor: '#7f1d1d' }, conn_disconnected: { backgroundColor: '#1e293b' }, connText: { fontSize: 16, color: '#e2e8f0' }, + termOutput: { flex: 1, backgroundColor: '#0a0f1a', margin: 8, borderRadius: 8, padding: 12 }, + termText: { fontFamily: 'monospace', fontSize: 12, color: '#22c55e', lineHeight: 18 }, btn: { borderRadius: 8, padding: 14, marginTop: 16, alignItems: 'center' }, btnPrimary: { backgroundColor: '#1e40af' }, btnDanger: { backgroundColor: '#991b1b' },