- Add message-accumulator.js: cascades diff-based message accumulation - Add 3-second cascade polling with broadcastToAll (was undefined!) - Add /api/bridge/approve endpoint: tries accept/reject Step→Command→Terminal - Add persistent approve/reject buttons in chat header toolbar - Frontend: loadSessionMessages (trajectory + accumulated), applyNewMessages (WS push) - Status change detection: _prevStatusKey tracking prevents unnecessary re-renders - actionInProgress flag prevents DOM replacement during button fetch - Known issues: Trajectory 341 hard limit, Cascade no command-approval state
169 lines
6.9 KiB
HTML
169 lines
6.9 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="ko">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Gravity Web — Antigravity Remote Control</title>
|
|
<meta name="description" content="Antigravity IDE 원격 제어 대시보드">
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link
|
|
href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap"
|
|
rel="stylesheet">
|
|
<link rel="stylesheet" href="css/style.css">
|
|
</head>
|
|
|
|
<body>
|
|
<div id="app">
|
|
<!-- Header -->
|
|
<header class="header">
|
|
<div class="header-left">
|
|
<div class="logo">
|
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
<circle cx="12" cy="12" r="10" stroke="url(#grad)" stroke-width="2" />
|
|
<circle cx="12" cy="12" r="4" fill="url(#grad)" />
|
|
<defs>
|
|
<linearGradient id="grad" x1="0" y1="0" x2="24" y2="24">
|
|
<stop offset="0%" stop-color="#818cf8" />
|
|
<stop offset="100%" stop-color="#6366f1" />
|
|
</linearGradient>
|
|
</defs>
|
|
</svg>
|
|
<span class="logo-text">Gravity<span class="logo-accent">Web</span></span>
|
|
</div>
|
|
</div>
|
|
<div class="header-right">
|
|
<div class="connection-status" id="connectionStatus">
|
|
<span class="status-dot"></span>
|
|
<span class="status-text">연결 중...</span>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<!-- Main Layout -->
|
|
<main class="main-layout">
|
|
<!-- Sidebar: Session List -->
|
|
<aside class="sidebar" id="sidebar">
|
|
<div class="sidebar-header">
|
|
<h2>세션</h2>
|
|
<button class="btn-icon" id="addSessionBtn" title="세션 추가">
|
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
<line x1="12" y1="5" x2="12" y2="19" />
|
|
<line x1="5" y1="12" x2="19" y2="12" />
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
<div class="session-list" id="sessionList">
|
|
<!-- sessions rendered here -->
|
|
</div>
|
|
</aside>
|
|
|
|
<!-- Chat Area -->
|
|
<section class="chat-area">
|
|
<!-- No session selected state -->
|
|
<div class="empty-state" id="emptyState">
|
|
<div class="empty-icon">
|
|
<svg width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1"
|
|
opacity="0.3">
|
|
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />
|
|
</svg>
|
|
</div>
|
|
<h3>세션을 선택하세요</h3>
|
|
<p>좌측에서 세션을 선택하거나 + 버튼으로 새 세션을 추가하세요</p>
|
|
</div>
|
|
|
|
<!-- Active chat -->
|
|
<div class="chat-container" id="chatContainer" style="display:none;">
|
|
<div class="chat-header" id="chatHeader">
|
|
<div class="chat-session-info">
|
|
<span class="chat-session-name" id="chatSessionName">—</span>
|
|
<span class="chat-session-status" id="chatSessionStatus"></span>
|
|
</div>
|
|
<div class="chat-actions">
|
|
<div class="view-tabs" id="viewTabs">
|
|
<button class="view-tab active" data-view="chat" id="tabChat">💬 채팅</button>
|
|
<button class="view-tab" data-view="mirror" id="tabMirror">🖥️ 미러</button>
|
|
</div>
|
|
<div class="approve-controls" id="approveControls">
|
|
<button class="btn-approve" id="btnApprove" title="현재 요청 승인">✅ 승인</button>
|
|
<button class="btn-reject" id="btnReject" title="현재 요청 거절">❌ 거절</button>
|
|
</div>
|
|
<button class="btn-sm" id="screenshotBtn" title="스크린샷">📷</button>
|
|
<button class="btn-sm" id="reconnectBtn" title="재연결">🔄</button>
|
|
</div>
|
|
</div>
|
|
<div class="chat-messages" id="chatMessages">
|
|
<div class="chat-welcome">
|
|
<p>대화를 불러오는 중...</p>
|
|
</div>
|
|
</div>
|
|
<div class="chat-input-area">
|
|
<textarea id="chatInput" placeholder="Antigravity에 보낼 메시지를 입력하세요..." rows="1"></textarea>
|
|
<button class="btn-send" id="sendBtn" title="전송">
|
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
<line x1="22" y1="2" x2="11" y2="13" />
|
|
<polygon points="22 2 15 22 11 13 2 9 22 2" />
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Mirror view (Phase 2) -->
|
|
<div class="mirror-container" id="mirrorContainer" style="display:none;">
|
|
<canvas id="mirrorCanvas"></canvas>
|
|
<div class="mirror-hint" id="mirrorHint">미러링 연결 중...</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Screenshot overlay -->
|
|
<div class="screenshot-overlay" id="screenshotOverlay" style="display:none;">
|
|
<div class="screenshot-content">
|
|
<div class="screenshot-header">
|
|
<span>스크린샷 미리보기</span>
|
|
<button class="btn-icon" id="closeScreenshot">✕</button>
|
|
</div>
|
|
<img id="screenshotImage" alt="Antigravity Screenshot" />
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</main>
|
|
|
|
<!-- Add Session Modal -->
|
|
<div class="modal-backdrop" id="addSessionModal" style="display:none;">
|
|
<div class="modal">
|
|
<div class="modal-header">
|
|
<h3>세션 추가</h3>
|
|
<button class="btn-icon" id="closeModal">✕</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="form-group">
|
|
<label for="sessionName">세션 이름</label>
|
|
<input type="text" id="sessionName" placeholder="예: 프로젝트-A" autofocus>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="sessionHost">호스트</label>
|
|
<input type="text" id="sessionHost" value="localhost">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="sessionPort">CDP 포트</label>
|
|
<input type="number" id="sessionPort" value="9000" min="1024" max="65535">
|
|
</div>
|
|
<p class="form-hint">
|
|
Antigravity를 <code>antigravity . --remote-debugging-port=9000</code> 으로 실행해야 합니다
|
|
</p>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button class="btn btn-secondary" id="cancelModal">취소</button>
|
|
<button class="btn btn-primary" id="confirmAddSession">연결</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="js/session-panel.js"></script>
|
|
<script src="js/chat-panel.js"></script>
|
|
<script src="js/mirror-panel.js"></script>
|
|
<script src="js/app.js"></script>
|
|
</body>
|
|
|
|
</html> |