attack now button

This commit is contained in:
2026-05-01 02:37:46 +03:00
parent ae37674bcc
commit efa63f761f
4 changed files with 66 additions and 0 deletions

View File

@@ -341,6 +341,11 @@
<button class="save-btn" onclick="saveBotSettings()">💾 Αποθήκευση</button>
<span class="save-status" id="bot-save-status">✓ Αποθηκεύτηκε</span>
<div style="margin-top: 1rem; border-top: 1px solid #1a3040; padding-top: 1rem;">
<button class="save-btn" id="bootcamp-attack-btn" onclick="attackBootcampNow()" style="background: linear-gradient(135deg, #7a2a2a, #cc4a4a); width: 100%;">⚔️ Επίθεση Τώρα</button>
<div style="text-align: center; margin-top: 5px;"><span class="save-status" id="bootcamp-attack-status">Εντολή εστάλη!</span></div>
</div>
<h3 style="margin-top:1.5rem;font-size:0.9rem;color:#aaa;">📋 Ιστορικό</h3>
<div id="bootcamp-log" style="background:#0a1520;border:1px solid #1a3040;border-radius:8px;padding:10px;max-height:180px;overflow-y:auto;font-size:0.78rem;font-family:monospace;color:#8ab4d0;">
<span style="color:#444;">Αναμονή δεδομένων...</span>
@@ -600,6 +605,31 @@
});
}
function attackBootcampNow() {
const btn = document.getElementById('bootcamp-attack-btn');
const status = document.getElementById('bootcamp-attack-status');
const originalText = btn.innerText;
btn.innerText = '⏳ Αποστολή...';
btn.disabled = true;
fetch('/dashboard/bootcamp-attack-now', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ player_id: PLAYER_ID })
})
.then(r => r.json())
.then(() => {
btn.innerText = '✓ Εστάλη!';
status.style.opacity = '1';
setTimeout(() => {
btn.innerText = originalText;
btn.disabled = false;
status.style.opacity = '0';
}, 2000);
});
}
async function checkWarehouseStatus() {
try {
const res = await fetch(`/api/farm_status?player_id=${PLAYER_ID}`);