@yemi33/minions 0.1.30 → 0.1.32
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/CHANGELOG.md +11 -0
- package/dashboard/js/settings.js +2 -3
- package/dashboard.js +16 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dashboard/js/settings.js
CHANGED
|
@@ -136,9 +136,9 @@ async function saveSettings() {
|
|
|
136
136
|
|
|
137
137
|
async function addProject() {
|
|
138
138
|
try {
|
|
139
|
-
showToast('cmd-toast', 'Opening folder picker...', true);
|
|
140
139
|
const browseRes = await fetch('/api/projects/browse', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: '{}' });
|
|
141
140
|
const browseData = await browseRes.json();
|
|
141
|
+
if (!browseRes.ok) { alert('Error: ' + (browseData.error || 'unknown')); return; }
|
|
142
142
|
if (browseData.cancelled || !browseData.path) return;
|
|
143
143
|
|
|
144
144
|
const addRes = await fetch('/api/projects/add', {
|
|
@@ -147,8 +147,7 @@ async function addProject() {
|
|
|
147
147
|
});
|
|
148
148
|
const addData = await addRes.json();
|
|
149
149
|
if (!addRes.ok) { alert('Failed: ' + (addData.error || 'unknown')); return; }
|
|
150
|
-
|
|
151
|
-
showToast('cmd-toast', 'Project "' + addData.name + '" added — restart engine to pick it up', true);
|
|
150
|
+
try { showToast('cmd-toast', 'Project "' + addData.name + '" added — restart engine to pick it up', true); } catch {}
|
|
152
151
|
refresh();
|
|
153
152
|
} catch (e) { alert('Error: ' + e.message); }
|
|
154
153
|
}
|
package/dashboard.js
CHANGED
|
@@ -2429,14 +2429,22 @@ What would you like to discuss or change? When you're happy, say "approve" and I
|
|
|
2429
2429
|
const { execSync } = require('child_process');
|
|
2430
2430
|
let selectedPath = '';
|
|
2431
2431
|
if (process.platform === 'win32') {
|
|
2432
|
-
//
|
|
2433
|
-
const
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2432
|
+
// PowerShell STA with topmost window as owner — forces folder dialog to foreground
|
|
2433
|
+
const ps = [
|
|
2434
|
+
'Add-Type -AssemblyName System.Windows.Forms',
|
|
2435
|
+
'$f = New-Object System.Windows.Forms.FolderBrowserDialog',
|
|
2436
|
+
'$f.Description = "Select project folder"',
|
|
2437
|
+
'$f.ShowNewFolderButton = $false',
|
|
2438
|
+
'$owner = New-Object System.Windows.Forms.Form',
|
|
2439
|
+
'$owner.TopMost = $true',
|
|
2440
|
+
'$owner.StartPosition = "CenterScreen"',
|
|
2441
|
+
'$owner.WindowState = "Minimized"',
|
|
2442
|
+
'$owner.Show()',
|
|
2443
|
+
'$owner.Hide()',
|
|
2444
|
+
'if ($f.ShowDialog($owner) -eq "OK") { Write-Output $f.SelectedPath }',
|
|
2445
|
+
'$owner.Dispose()',
|
|
2446
|
+
].join('; ');
|
|
2447
|
+
selectedPath = execSync(`powershell -STA -NoProfile -Command "${ps}"`, { encoding: 'utf8', timeout: 120000 }).trim();
|
|
2440
2448
|
} else if (process.platform === 'darwin') {
|
|
2441
2449
|
selectedPath = execSync(`osascript -e 'POSIX path of (choose folder with prompt "Select project folder")'`, { encoding: 'utf8', timeout: 120000 }).trim();
|
|
2442
2450
|
} else {
|
package/package.json
CHANGED