claude-opencode-viewer 2.1.1 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.html +1 -36
- package/package.json +1 -1
- package/server.js +2 -2
package/index.html
CHANGED
|
@@ -25,29 +25,6 @@
|
|
|
25
25
|
opacity: 0.3;
|
|
26
26
|
transition: opacity 0.3s ease;
|
|
27
27
|
}
|
|
28
|
-
#status {
|
|
29
|
-
padding: 4px;
|
|
30
|
-
background: #111;
|
|
31
|
-
font-size: 12px;
|
|
32
|
-
color: #888;
|
|
33
|
-
text-align: center;
|
|
34
|
-
flex-shrink: 0;
|
|
35
|
-
height: 32px;
|
|
36
|
-
line-height: 24px;
|
|
37
|
-
display: flex;
|
|
38
|
-
align-items: center;
|
|
39
|
-
justify-content: center;
|
|
40
|
-
gap: 8px;
|
|
41
|
-
}
|
|
42
|
-
#status.connected { color: #4ade80; }
|
|
43
|
-
#status.disconnected { color: #f87171; }
|
|
44
|
-
#mode-indicator {
|
|
45
|
-
font-size: 10px;
|
|
46
|
-
padding: 2px 6px;
|
|
47
|
-
background: #222;
|
|
48
|
-
border-radius: 3px;
|
|
49
|
-
color: #888;
|
|
50
|
-
}
|
|
51
28
|
#mode-switcher {
|
|
52
29
|
display: none;
|
|
53
30
|
background: #111;
|
|
@@ -136,11 +113,7 @@
|
|
|
136
113
|
</head>
|
|
137
114
|
<body>
|
|
138
115
|
<div id="terminal"></div>
|
|
139
|
-
|
|
140
|
-
<span id="status-text">● 未连接</span>
|
|
141
|
-
<span id="mode-indicator">-</span>
|
|
142
|
-
</div>
|
|
143
|
-
|
|
116
|
+
|
|
144
117
|
<div id="mode-switcher">
|
|
145
118
|
<select id="mode-select">
|
|
146
119
|
<option value="claude">Claude Code</option>
|
|
@@ -193,9 +166,6 @@
|
|
|
193
166
|
|
|
194
167
|
term.open(document.getElementById('terminal'));
|
|
195
168
|
|
|
196
|
-
var statusText = document.getElementById('status-text');
|
|
197
|
-
var modeIndicator = document.getElementById('mode-indicator');
|
|
198
|
-
var statusEl = document.getElementById('status');
|
|
199
169
|
var keybar = document.getElementById('virtual-keybar');
|
|
200
170
|
var modeSelect = document.getElementById('mode-select');
|
|
201
171
|
var terminalEl = document.getElementById('terminal');
|
|
@@ -425,15 +395,10 @@
|
|
|
425
395
|
ws = new WebSocket(proto + '//' + location.host + '/ws');
|
|
426
396
|
|
|
427
397
|
ws.onopen = function() {
|
|
428
|
-
statusText.textContent = '●';
|
|
429
|
-
statusEl.className = 'connected';
|
|
430
398
|
resize();
|
|
431
399
|
};
|
|
432
400
|
|
|
433
401
|
ws.onclose = function() {
|
|
434
|
-
statusText.textContent = '●';
|
|
435
|
-
statusEl.className = 'disconnected';
|
|
436
|
-
modeIndicator.textContent = '-';
|
|
437
402
|
ws = null;
|
|
438
403
|
setTimeout(connect, 2000);
|
|
439
404
|
};
|
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -146,7 +146,7 @@ async function spawnProcess(mode) {
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
currentProcess = proc;
|
|
149
|
-
console.log(`[
|
|
149
|
+
console.log(`[claude-opencode-viewer] ${mode === 'claude' ? 'Claude Code' : 'OpenCode'} 已启动 (PID: ${proc.pid})`);
|
|
150
150
|
return proc;
|
|
151
151
|
}
|
|
152
152
|
|
|
@@ -301,7 +301,7 @@ wss.on('connection', (ws, req) => {
|
|
|
301
301
|
server.listen(PORT, '0.0.0.0', async () => {
|
|
302
302
|
const ip = getLocalIp();
|
|
303
303
|
console.log('\n' + '='.repeat(50));
|
|
304
|
-
console.log('✅
|
|
304
|
+
console.log('✅ Claude OpenCode Viewer 已启动');
|
|
305
305
|
console.log('='.repeat(50));
|
|
306
306
|
console.log(`🖥️ 本地访问:http://127.0.0.1:${PORT}`);
|
|
307
307
|
console.log(`📱 手机访问:http://${ip}:${PORT}`);
|