🚀 Auto-deploy: BrainSteel Fin atualizado em 20/05/2026 17:16:15
This commit is contained in:
@@ -22,6 +22,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
loadTokenChart();
|
||||
loadConfig();
|
||||
loadMultiStratChart('live');
|
||||
loadPortfolio();
|
||||
loadActivityLog();
|
||||
updateStatus('Sistema operacional', 'online');
|
||||
});
|
||||
|
||||
@@ -373,6 +375,37 @@ function addLog(agent, message) {
|
||||
while (container.children.length > 50) container.removeChild(container.lastChild);
|
||||
}
|
||||
|
||||
function loadActivityLog() {
|
||||
fetch('/api/history')
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
const container = document.getElementById('logContainer');
|
||||
if (!container) return;
|
||||
if (data.length === 0) {
|
||||
container.innerHTML = `
|
||||
<div class="log-entry system">
|
||||
<span class="log-time">--:--</span>
|
||||
<span class="log-agent">SYS</span>
|
||||
<span class="log-message">Nenhum log gravado ainda. Os agentes precisam rodar.</span>
|
||||
</div>`;
|
||||
return;
|
||||
}
|
||||
container.innerHTML = data.map(log => {
|
||||
const ts = log.timestamp ? log.timestamp.slice(11, 19) : '--:--';
|
||||
const agent = (log.agent || 'SYS').toUpperCase();
|
||||
const cls = log.status === 'success' ? 'success' : log.status === 'error' ? 'error' : '';
|
||||
const agentColor = AGENT_COLORS[log.agent?.toLowerCase()] || 'var(--accent-blue)';
|
||||
return `
|
||||
<div class="log-entry ${cls}">
|
||||
<span class="log-time">${ts}</span>
|
||||
<span class="log-agent" style="color: ${agentColor}">${agent}</span>
|
||||
<span class="log-message"><b>${log.action}</b>: ${log.result || ''}</span>
|
||||
</div>`;
|
||||
}).join('');
|
||||
})
|
||||
.catch(err => console.error('Error loading activity log:', err));
|
||||
}
|
||||
|
||||
// Refresh all sections periodically
|
||||
setInterval(() => {
|
||||
loadAgentRegistry();
|
||||
@@ -380,6 +413,7 @@ setInterval(() => {
|
||||
loadServices();
|
||||
loadPipelineVisual();
|
||||
loadPortfolio();
|
||||
loadActivityLog();
|
||||
}, 15000);
|
||||
|
||||
// ── Portfolio ───────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
# ---------------------------------------------------------
|
||||
# BRAINSTEEL FIN: SCRIPT DE DEPLOY TOTAL & SINCRONIZAÇÃO AUTOMÁTICA
|
||||
# ---------------------------------------------------------
|
||||
|
||||
CYAN='\033[0;36m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
RED='\033[0;31m'
|
||||
NC='\033[0m'
|
||||
|
||||
echo -e "\n${CYAN}🚀 Iniciando Ciclo Automático de Deploy BrainSteel Fin...${NC}"
|
||||
|
||||
# 1. Sincronização com Repositório (Git - Gitea)
|
||||
echo -e "${YELLOW}📝 Sincronizando código com o Gitea...${NC}"
|
||||
git add .
|
||||
|
||||
if git diff-index --quiet HEAD --; then
|
||||
echo -e "${GREEN}✨ Código local já está sincronizado com o último commit.${NC}"
|
||||
else
|
||||
TIMESTAMP=$(date +"%d/%m/%Y %H:%M:%S")
|
||||
echo -e "${CYAN}📤 Enviando alterações (Auto-update $TIMESTAMP)...${NC}"
|
||||
git commit -m "🚀 Auto-deploy: BrainSteel Fin atualizado em $TIMESTAMP"
|
||||
git push origin main
|
||||
fi
|
||||
|
||||
# 2. Gatilho de Deploy no Coolify (API Oficial v1)
|
||||
COOLIFY_RESOURCE_UUID="ldirzpst39xk99ikf9cjw1qr"
|
||||
echo -e "${YELLOW}🔄 Disparando Deploy via API Oficial no Coolify...${NC}"
|
||||
COOLIFY_TOKEN="12|wbepNILQe24LAOjfEUmMROgU93F6uG1zuwPLwrRi786bca03"
|
||||
|
||||
curl -s -X GET "https://painel.reifonas.cloud/api/v1/deploy?uuid=${COOLIFY_RESOURCE_UUID}&force=false" \
|
||||
-H "Authorization: Bearer $COOLIFY_TOKEN"
|
||||
|
||||
echo -e "\n${GREEN}✅ Deploy oficial via API engatilhado (Hash Sincronizado).${NC}"
|
||||
echo -e "${GREEN}🏁 Ciclo concluído com sucesso.${NC}\n"
|
||||
Reference in New Issue
Block a user