Adicionar botão Interromper no terminal e corrigir botão Retomar
- Botão Interromper na toolbar do terminal para matar execuções ativas - Endpoint POST /executions/cancel-all para cancelar agentes e pipelines - Botão aparece/esconde automaticamente conforme execuções ativas - Corrigir condição do botão Retomar para pipelines antigas sem failedAtStep
This commit is contained in:
@@ -555,6 +555,18 @@ const App = {
|
||||
|
||||
on('pipeline-execute-submit', 'click', () => PipelinesUI._executeFromModal());
|
||||
|
||||
on('terminal-stop-btn', 'click', async () => {
|
||||
try {
|
||||
await API.system.cancelAll();
|
||||
Terminal.stopProcessing();
|
||||
Terminal.addLine('Todas as execuções foram interrompidas.', 'error');
|
||||
Toast.warning('Execuções interrompidas');
|
||||
App._updateActiveBadge();
|
||||
} catch (err) {
|
||||
Toast.error(`Erro ao interromper: ${err.message}`);
|
||||
}
|
||||
});
|
||||
|
||||
on('terminal-clear-btn', 'click', () => {
|
||||
Terminal.clear();
|
||||
Terminal.disableChat();
|
||||
@@ -960,6 +972,9 @@ const App = {
|
||||
if (countEl) countEl.textContent = count;
|
||||
if (badge) badge.style.display = count > 0 ? 'flex' : 'none';
|
||||
|
||||
const stopBtn = document.getElementById('terminal-stop-btn');
|
||||
if (stopBtn) stopBtn.hidden = count === 0;
|
||||
|
||||
const terminalSelect = document.getElementById('terminal-execution-select');
|
||||
if (terminalSelect && Array.isArray(active)) {
|
||||
const existing = new Set(
|
||||
|
||||
Reference in New Issue
Block a user