4.16.2: Упрощение админ-панели
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m18s

This commit is contained in:
poignatov
2026-02-04 17:26:52 +03:00
parent f1ee6082dd
commit e3e9084792
3 changed files with 2 additions and 107 deletions

View File

@@ -210,36 +210,6 @@
<h1>🎯 Play Life Backend - Admin Panel</h1>
<div class="grid">
<!-- Message Post Card -->
<div class="card">
<h2>
📨 Message Post
<span class="status" id="messageStatus" style="display: none;"></span>
</h2>
<textarea id="messageText" placeholder="Введите сообщение с паттернами **Project+10.5** или **Project-5.0**...
Пример:
Сегодня работал над проектами:
**Frontend+15.5**
**Backend+8.0**
**Design-2.5**"></textarea>
<button onclick="sendMessage()">Отправить сообщение</button>
<div id="messageResult"></div>
</div>
<!-- Daily Report Trigger Card -->
<div class="card">
<h2>
📈 Daily Report Trigger
<span class="status" id="dailyReportStatus" style="display: none;"></span>
</h2>
<p style="margin-bottom: 15px; color: #666;">
Нажмите кнопку для отправки ежедневного отчёта по Score и Целям в Telegram (обычно отправляется автоматически в 23:59).
</p>
<button onclick="triggerDailyReport()">Отправить отчёт</button>
<div id="dailyReportResult"></div>
</div>
<!-- Weekly Goals Setup Card -->
<div class="card">
<h2>
@@ -347,46 +317,6 @@
resultEl.appendChild(div);
}
async function sendMessage() {
const text = document.getElementById('messageText').value.trim();
if (!text) {
alert('Пожалуйста, введите сообщение');
return;
}
showStatus('messageStatus', 'loading', 'Отправка...');
showResult('messageResult', null, false, true);
try {
const response = await fetch(`${getApiUrl()}/message/post`, {
method: 'POST',
headers: getAuthHeaders(),
body: JSON.stringify({
body: {
text: text
}
})
});
if (handleAuthError(response)) {
return;
}
const data = await response.json();
if (response.ok) {
showStatus('messageStatus', 'success', 'Успешно');
showResult('messageResult', data, false);
} else {
showStatus('messageStatus', 'error', 'Ошибка');
showResult('messageResult', data, true);
}
} catch (error) {
showStatus('messageStatus', 'error', 'Ошибка');
showResult('messageResult', { error: error.message }, true);
}
}
async function setupWeeklyGoals() {
showStatus('goalsStatus', 'loading', 'Обновление...');
showResult('goalsResult', null, false, true);
@@ -416,41 +346,6 @@
}
}
async function triggerDailyReport() {
showStatus('dailyReportStatus', 'loading', 'Отправка...');
showResult('dailyReportResult', null, false, true);
try {
const response = await fetch(`${getApiUrl()}/daily-report/trigger`, {
method: 'POST',
headers: getAuthHeaders()
});
if (handleAuthError(response)) {
return;
}
const data = await response.json();
if (response.ok) {
showStatus('dailyReportStatus', 'success', 'Успешно');
showResult('dailyReportResult', data, false);
} else {
showStatus('dailyReportStatus', 'error', 'Ошибка');
showResult('dailyReportResult', data, true);
}
} catch (error) {
showStatus('dailyReportStatus', 'error', 'Ошибка');
showResult('dailyReportResult', { error: error.message }, true);
}
}
// Разрешаем отправку формы по Enter (Ctrl+Enter для textarea)
document.getElementById('messageText').addEventListener('keydown', function(e) {
if (e.ctrlKey && e.key === 'Enter') {
sendMessage();
}
});
</script>
</body>
</html>