Initial commit of AthonetTools
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
// static/js/wizard/step3_deploy.js
|
||||
export function mountStep3Deploy() {
|
||||
const btn = document.getElementById('btn-run-gaf');
|
||||
const outputDiv = document.getElementById('gaf-output');
|
||||
if (!btn || !outputDiv) return;
|
||||
|
||||
btn.onclick = null;
|
||||
btn.addEventListener('click', async () => {
|
||||
btn.disabled = true;
|
||||
btn.textContent = 'Running…';
|
||||
outputDiv.textContent = '';
|
||||
try {
|
||||
const res = await fetch('/api/ansible/deploy', { method: 'POST' });
|
||||
const text = await res.text();
|
||||
outputDiv.textContent = text;
|
||||
btn.textContent = 'Run';
|
||||
btn.disabled = false;
|
||||
} catch (err) {
|
||||
outputDiv.textContent = `Error: ${err.message || err}`;
|
||||
btn.textContent = 'Run';
|
||||
btn.disabled = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user