vg-coder-cli 2.0.35 → 2.0.36
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/dist/vg-coder-bundle.js +3 -3
- package/package.json +1 -1
- package/src/server/api-server.js +19 -0
- package/src/server/views/css/shortcuts-help.css +165 -0
- package/src/server/views/dashboard.html +19 -0
- package/src/server/views/js/api.js +13 -0
- package/src/server/views/js/features/keyboard-shortcuts.js +333 -0
- package/src/server/views/js/features/terminal.js +74 -1
- package/src/server/views/js/features/tool-window.js +7 -1
- package/src/server/views/js/handlers.js +21 -5
- package/src/server/views/js/main.js +4 -0
|
@@ -170,7 +170,8 @@ export async function testExecute(event) {
|
|
|
170
170
|
export async function executeFromClipboard(event) {
|
|
171
171
|
const btn = event?.target?.closest('.btn');
|
|
172
172
|
const bashInput = getById('execute-bash');
|
|
173
|
-
|
|
173
|
+
|
|
174
|
+
// Don't return early if bashInput is missing - it's optional when called from bubble menu
|
|
174
175
|
|
|
175
176
|
if (btn) showLoading(btn, btn.innerHTML);
|
|
176
177
|
try {
|
|
@@ -180,13 +181,25 @@ export async function executeFromClipboard(event) {
|
|
|
180
181
|
if (btn) resetButton(btn);
|
|
181
182
|
return;
|
|
182
183
|
}
|
|
183
|
-
|
|
184
|
+
|
|
185
|
+
// Only populate bashInput if it exists (when called from dashboard)
|
|
186
|
+
if (bashInput) {
|
|
187
|
+
bashInput.value = clipboardText;
|
|
188
|
+
}
|
|
189
|
+
|
|
184
190
|
const data = await executeScript(clipboardText);
|
|
185
|
-
|
|
191
|
+
|
|
192
|
+
// Only show response in execute-response container if it exists
|
|
193
|
+
const responseContainer = getById('execute-response');
|
|
194
|
+
if (responseContainer) {
|
|
195
|
+
showResponse('execute-response', data, !data.success);
|
|
196
|
+
}
|
|
186
197
|
|
|
187
198
|
if (data.success) {
|
|
188
199
|
showToast('Thực thi OK', 'success');
|
|
189
|
-
bashInput
|
|
200
|
+
if (bashInput) {
|
|
201
|
+
bashInput.value = '';
|
|
202
|
+
}
|
|
190
203
|
} else {
|
|
191
204
|
data.syntaxError ? showToast('Lỗi syntax script', 'error') : showToast('Thực thi thất bại', 'error');
|
|
192
205
|
}
|
|
@@ -194,7 +207,10 @@ export async function executeFromClipboard(event) {
|
|
|
194
207
|
if (err.name === 'NotAllowedError') {
|
|
195
208
|
showToast('Không có quyền clipboard', 'error');
|
|
196
209
|
} else {
|
|
197
|
-
|
|
210
|
+
const responseContainer = getById('execute-response');
|
|
211
|
+
if (responseContainer) {
|
|
212
|
+
showResponse('execute-response', { error: err.message }, true);
|
|
213
|
+
}
|
|
198
214
|
showToast('Lỗi: ' + err.message, 'error');
|
|
199
215
|
}
|
|
200
216
|
}
|
|
@@ -10,6 +10,7 @@ import { initResizeHandler } from './features/resize.js';
|
|
|
10
10
|
import { initSavedCommands } from './features/commands.js';
|
|
11
11
|
import './features/structure.js';
|
|
12
12
|
import { initBubble } from './features/bubble.js';
|
|
13
|
+
import { initKeyboardShortcuts } from './features/keyboard-shortcuts.js';
|
|
13
14
|
|
|
14
15
|
// NEW: Import Tool Window modules
|
|
15
16
|
import { initToolWindow } from './features/tool-window.js';
|
|
@@ -46,6 +47,9 @@ export async function initMain() {
|
|
|
46
47
|
|
|
47
48
|
// Init Bubble (will use event protocol)
|
|
48
49
|
initBubble();
|
|
50
|
+
|
|
51
|
+
// Initialize keyboard shortcuts (global hotkeys for Shadow DOM)
|
|
52
|
+
initKeyboardShortcuts();
|
|
49
53
|
|
|
50
54
|
console.log('✅ VG Coder: Initialization Complete');
|
|
51
55
|
} catch (e) {
|