claude-opencode-viewer 2.1.8 → 2.1.9
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 +4 -3
- package/package.json +1 -1
- package/server.js +2 -1
package/index.html
CHANGED
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
var isIOS = /iPhone|iPad|iPod/i.test(navigator.userAgent);
|
|
146
146
|
var MOBILE_COLS = 60;
|
|
147
147
|
var fontSize = isMobile ? 11 : 13;
|
|
148
|
-
var currentMode = '
|
|
148
|
+
var currentMode = 'opencode';
|
|
149
149
|
var isTransitioning = false;
|
|
150
150
|
|
|
151
151
|
var term = new Terminal({
|
|
@@ -369,13 +369,11 @@
|
|
|
369
369
|
function startTransition() {
|
|
370
370
|
isTransitioning = true;
|
|
371
371
|
terminalEl.classList.add('transitioning');
|
|
372
|
-
modeIndicator.textContent = '切换中...';
|
|
373
372
|
}
|
|
374
373
|
|
|
375
374
|
function endTransition(mode) {
|
|
376
375
|
currentMode = mode;
|
|
377
376
|
modeSelect.value = mode;
|
|
378
|
-
modeIndicator.textContent = mode === 'claude' ? 'Claude' : 'OpenCode';
|
|
379
377
|
terminalEl.classList.remove('transitioning');
|
|
380
378
|
isTransitioning = false;
|
|
381
379
|
}
|
|
@@ -390,6 +388,9 @@
|
|
|
390
388
|
switchMode(modeSelect.value);
|
|
391
389
|
});
|
|
392
390
|
|
|
391
|
+
// 设置初始选中项
|
|
392
|
+
modeSelect.value = currentMode;
|
|
393
|
+
|
|
393
394
|
function connect() {
|
|
394
395
|
var proto = location.protocol === 'https:' ? 'wss:' : 'ws:';
|
|
395
396
|
ws = new WebSocket(proto + '//' + location.host + '/ws');
|
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -30,6 +30,7 @@ let lastPtyRows = 30;
|
|
|
30
30
|
let activeWs = null;
|
|
31
31
|
const clientSizes = new Map();
|
|
32
32
|
const mobileClients = new Set();
|
|
33
|
+
let currentMode = 'opencode';
|
|
33
34
|
|
|
34
35
|
function getMobileSize() {
|
|
35
36
|
for (const mws of mobileClients) {
|
|
@@ -334,5 +335,5 @@ server.listen(PORT, '0.0.0.0', async () => {
|
|
|
334
335
|
console.log('='.repeat(50));
|
|
335
336
|
console.log('\n按 Ctrl+C 停止服务\n');
|
|
336
337
|
|
|
337
|
-
await spawnProcess('
|
|
338
|
+
await spawnProcess('opencode');
|
|
338
339
|
});
|