@yemi33/minions 0.1.30 → 0.1.31
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/settings.js +26 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dashboard/js/settings.js
CHANGED
|
@@ -134,21 +134,35 @@ async function saveSettings() {
|
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
137
|
+
function addProject() {
|
|
138
|
+
document.getElementById('modal-title').textContent = 'Add Project';
|
|
139
|
+
document.getElementById('modal-body').innerHTML =
|
|
140
|
+
'<div style="display:flex;flex-direction:column;gap:12px">' +
|
|
141
|
+
'<label style="color:var(--text);font-size:var(--text-md)">Project Path' +
|
|
142
|
+
'<input id="add-project-path" style="display:block;width:100%;margin-top:4px;padding:8px 10px;background:var(--bg);border:1px solid var(--border);border-radius:var(--radius-sm);color:var(--text);font-size:13px;font-family:monospace" placeholder="C:\\Users\\you\\repos\\my-project">' +
|
|
143
|
+
'</label>' +
|
|
144
|
+
'<div style="font-size:11px;color:var(--muted)">Enter the full path to a git repository. The engine will auto-detect the repo host, branch, and project name.</div>' +
|
|
145
|
+
'<div style="display:flex;justify-content:flex-end;gap:8px">' +
|
|
146
|
+
'<button onclick="closeModal()" class="pr-pager-btn">Cancel</button>' +
|
|
147
|
+
'<button onclick="_submitAddProject()" style="padding:6px 16px;background:var(--blue);color:#fff;border:none;border-radius:var(--radius-sm);cursor:pointer">Add Project</button>' +
|
|
148
|
+
'</div>' +
|
|
149
|
+
'</div>';
|
|
150
|
+
document.getElementById('modal').classList.add('open');
|
|
151
|
+
setTimeout(() => document.getElementById('add-project-path')?.focus(), 100);
|
|
152
|
+
}
|
|
143
153
|
|
|
144
|
-
|
|
154
|
+
async function _submitAddProject() {
|
|
155
|
+
const pathInput = document.getElementById('add-project-path');
|
|
156
|
+
if (!pathInput?.value.trim()) { alert('Path is required'); return; }
|
|
157
|
+
try {
|
|
158
|
+
const res = await fetch('/api/projects/add', {
|
|
145
159
|
method: 'POST', headers: { 'Content-Type': 'application/json' },
|
|
146
|
-
body: JSON.stringify({ path:
|
|
160
|
+
body: JSON.stringify({ path: pathInput.value.trim() })
|
|
147
161
|
});
|
|
148
|
-
const
|
|
149
|
-
if (!
|
|
150
|
-
|
|
151
|
-
showToast('cmd-toast', 'Project "' +
|
|
162
|
+
const data = await res.json();
|
|
163
|
+
if (!res.ok) { alert('Failed: ' + (data.error || 'unknown')); return; }
|
|
164
|
+
closeModal();
|
|
165
|
+
try { showToast('cmd-toast', 'Project "' + data.name + '" added — restart engine to pick it up', true); } catch {}
|
|
152
166
|
refresh();
|
|
153
167
|
} catch (e) { alert('Error: ' + e.message); }
|
|
154
168
|
}
|
package/package.json
CHANGED