добавил кнопки парсинга в редактировании базы для админов
This commit is contained in:
@@ -13,6 +13,10 @@
|
||||
--muted: #9aa4b2;
|
||||
--accent: #4f8cff;
|
||||
--accent-hover: #3e78e6;
|
||||
--success-bg: rgba(46, 204, 113, 0.12);
|
||||
--success-border: rgba(46, 204, 113, 0.35);
|
||||
--danger-bg: rgba(255, 99, 99, 0.12);
|
||||
--danger-border: rgba(255, 99, 99, 0.35);
|
||||
--shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
|
||||
--radius: 16px;
|
||||
}
|
||||
@@ -46,15 +50,24 @@
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
.tabs {
|
||||
.tabs,
|
||||
.parser-actions {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.tab-link {
|
||||
.parser-actions {
|
||||
margin-top: 18px;
|
||||
padding-top: 18px;
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.tab-link,
|
||||
.action-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 42px;
|
||||
padding: 0 16px;
|
||||
border-radius: 999px;
|
||||
@@ -63,13 +76,58 @@
|
||||
color: var(--text);
|
||||
text-decoration: none;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.tab-link:hover {
|
||||
.tab-link:hover,
|
||||
.action-btn:hover {
|
||||
background: var(--accent);
|
||||
border-color: var(--accent);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.action-form {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.log-block {
|
||||
margin-top: 20px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 14px;
|
||||
padding: 16px;
|
||||
background: var(--panel-2);
|
||||
}
|
||||
|
||||
.log-block.success {
|
||||
background: var(--success-bg);
|
||||
border-color: var(--success-border);
|
||||
}
|
||||
|
||||
.log-block.error {
|
||||
background: var(--danger-bg);
|
||||
border-color: var(--danger-border);
|
||||
}
|
||||
|
||||
.log-title {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.log-status {
|
||||
color: var(--muted);
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.log-output {
|
||||
margin: 0;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
font-family: Consolas, Monaco, monospace;
|
||||
font-size: 13px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -79,14 +137,45 @@
|
||||
|
||||
<div class="tabs">
|
||||
<a class="tab-link" href="/admin/db/players">Игроки</a>
|
||||
|
||||
<a class="tab-link" href="/admin/db/referees">Судьи</a>
|
||||
<a class="tab-link" href="/admin/db/teams">Команды</a>
|
||||
<a class="tab-link" href="/admin/db/coaches">Тренеры</a>
|
||||
<a class="tab-link" href="/admin/db/stadiums">Стадионы</a>
|
||||
<a class="tab-link" href="/admin/matches">Назад к матчам</a>
|
||||
</div>
|
||||
|
||||
<div class="parser-actions">
|
||||
<form method="post" action="/admin/db/run-parser" class="action-form">
|
||||
<input type="hidden" name="parser_name" value="players">
|
||||
<button type="submit" class="action-btn">Заграбить игроков</button>
|
||||
</form>
|
||||
|
||||
<form method="post" action="/admin/db/run-parser" class="action-form">
|
||||
<input type="hidden" name="parser_name" value="schedule">
|
||||
<button type="submit" class="action-btn">Заграбить расписание</button>
|
||||
</form>
|
||||
|
||||
<form method="post" action="/admin/db/run-parser" class="action-form">
|
||||
<input type="hidden" name="parser_name" value="standings">
|
||||
<button type="submit" class="action-btn">Заграбить турнирку</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{% if parser_output %}
|
||||
<div class="log-block {% if parser_success %}success{% else %}error{% endif %}">
|
||||
<div class="log-title">Итог парсинга{% if parser_name %}: {{ parser_name }}{% endif %}</div>
|
||||
<div class="log-status">
|
||||
Статус:
|
||||
{% if parser_success %}
|
||||
успешно
|
||||
{% else %}
|
||||
ошибка
|
||||
{% endif %}
|
||||
</div>
|
||||
<pre class="log-output">{{ parser_output }}</pre>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user