@yemi33/minions 0.1.51 → 0.1.52
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 +5 -0
- package/dashboard/js/render-plans.js +25 -10
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -469,9 +469,14 @@ async function planView(file) {
|
|
|
469
469
|
|
|
470
470
|
async function planApprove(file) {
|
|
471
471
|
try {
|
|
472
|
-
await fetch('/api/plans/approve', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ file }) });
|
|
473
|
-
|
|
474
|
-
|
|
472
|
+
const res = await fetch('/api/plans/approve', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ file }) });
|
|
473
|
+
if (res.ok) {
|
|
474
|
+
showToast('cmd-toast', 'Plan approved — work will begin on next engine tick', true);
|
|
475
|
+
refreshPlans();
|
|
476
|
+
} else {
|
|
477
|
+
const d = await res.json().catch(() => ({}));
|
|
478
|
+
alert('Approve failed: ' + (d.error || 'unknown'));
|
|
479
|
+
}
|
|
475
480
|
} catch (e) { showToast('cmd-toast', 'Error: ' + e.message, false); }
|
|
476
481
|
}
|
|
477
482
|
|
|
@@ -496,10 +501,15 @@ async function planDelete(file) {
|
|
|
496
501
|
|
|
497
502
|
async function planPause(file) {
|
|
498
503
|
try {
|
|
499
|
-
await fetch('/api/plans/pause', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ file }) });
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
504
|
+
const res = await fetch('/api/plans/pause', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ file }) });
|
|
505
|
+
if (res.ok) {
|
|
506
|
+
showToast('cmd-toast', 'Plan paused — no new items will be dispatched', true);
|
|
507
|
+
refreshPlans();
|
|
508
|
+
refresh();
|
|
509
|
+
} else {
|
|
510
|
+
const d = await res.json().catch(() => ({}));
|
|
511
|
+
alert('Pause failed: ' + (d.error || 'unknown'));
|
|
512
|
+
}
|
|
503
513
|
} catch (e) { showToast('cmd-toast', 'Error: ' + e.message, false); }
|
|
504
514
|
}
|
|
505
515
|
|
|
@@ -507,9 +517,14 @@ async function planReject(file) {
|
|
|
507
517
|
if (!confirm('Reject this plan? It will not be executed.')) return;
|
|
508
518
|
const reason = prompt('Reason for rejection (optional):') || '';
|
|
509
519
|
try {
|
|
510
|
-
await fetch('/api/plans/reject', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ file, reason }) });
|
|
511
|
-
|
|
512
|
-
|
|
520
|
+
const res = await fetch('/api/plans/reject', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ file, reason }) });
|
|
521
|
+
if (res.ok) {
|
|
522
|
+
showToast('cmd-toast', 'Plan rejected', true);
|
|
523
|
+
refreshPlans();
|
|
524
|
+
} else {
|
|
525
|
+
const d = await res.json().catch(() => ({}));
|
|
526
|
+
alert('Reject failed: ' + (d.error || 'unknown'));
|
|
527
|
+
}
|
|
513
528
|
} catch (e) { showToast('cmd-toast', 'Error: ' + e.message, false); }
|
|
514
529
|
}
|
|
515
530
|
|
package/package.json
CHANGED