Add status progress for batch tool operations
This commit is contained in:
@@ -103,13 +103,16 @@ export function openSendToMobile(context: vscode.ExtensionContext) {
|
||||
return;
|
||||
}
|
||||
const files: SharedFile[] = [];
|
||||
for (const filePath of filePaths) {
|
||||
for (let i = 0; i < filePaths.length; i++) {
|
||||
const filePath = filePaths[i];
|
||||
if (!filePath || !fs.existsSync(filePath)) {
|
||||
panel.webview.postMessage({ type: 'error', message: 'File missing.' });
|
||||
return;
|
||||
}
|
||||
panel.webview.postMessage({ type: 'status', message: `Loading ${i + 1}/${filePaths.length} ${path.basename(filePath)}` });
|
||||
files.push({ buf: fs.readFileSync(filePath), filename: path.basename(filePath) });
|
||||
}
|
||||
panel.webview.postMessage({ type: 'status', message: 'Starting server...' });
|
||||
const token = crypto.randomBytes(6).toString('base64url');
|
||||
|
||||
const cfg = vscode.workspace.getConfiguration('hplToolbox.sendToMobile');
|
||||
@@ -549,6 +552,9 @@ ${getToolWebviewStyles()}
|
||||
selectedPaths = selectedFiles.map(f => f.path);
|
||||
selectedPage = 0;
|
||||
renderSelection();
|
||||
} else if (m.type === 'status') {
|
||||
statusEl.textContent = m.message;
|
||||
statusEl.className = 'status-panel is-busy';
|
||||
} else if (m.type === 'sharing') {
|
||||
statusEl.classList.remove('is-busy');
|
||||
currentUrls = m.urls;
|
||||
|
||||
Reference in New Issue
Block a user