feat(web): sources, crawlers, metrics on tailwind
This commit is contained in:
+49
-51
@@ -1,92 +1,89 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Краулеры{% endblock %}
|
||||
{% block content %}
|
||||
<h4 class="mb-3">🤖 Краулеры</h4>
|
||||
<h4 class="text-xl font-semibold mb-4">🤖 Краулеры</h4>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-3">
|
||||
<div class="card text-center">
|
||||
<div class="card-body">
|
||||
<h6 class="card-title text-muted">Очередь (pending)</h6>
|
||||
<h3 class="mb-0">{{ pending }}</h3>
|
||||
</div>
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3 mb-4">
|
||||
<div class="card card-outline bg-white text-center">
|
||||
<div class="card-content">
|
||||
<h6 class="card-title justify-center text-neutral-500 text-sm">Очередь (pending)</h6>
|
||||
<h3 class="text-2xl font-semibold m-0">{{ pending }}</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="card text-center">
|
||||
<div class="card-body">
|
||||
<h6 class="card-title text-muted">В обработке (processing)</h6>
|
||||
<h3 class="mb-0">{{ processing }}</h3>
|
||||
</div>
|
||||
<div class="card card-outline bg-white text-center">
|
||||
<div class="card-content">
|
||||
<h6 class="card-title justify-center text-neutral-500 text-sm">В обработке (processing)</h6>
|
||||
<h3 class="text-2xl font-semibold m-0">{{ processing }}</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="card text-center">
|
||||
<div class="card-body">
|
||||
<h6 class="card-title text-muted">Обработано сегодня</h6>
|
||||
<h3 class="mb-0">{{ done_today }}</h3>
|
||||
</div>
|
||||
<div class="card card-outline bg-white text-center">
|
||||
<div class="card-content">
|
||||
<h6 class="card-title justify-center text-neutral-500 text-sm">Обработано сегодня</h6>
|
||||
<h3 class="text-2xl font-semibold m-0">{{ done_today }}</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="card text-center">
|
||||
<div class="card-body">
|
||||
<h6 class="card-title text-muted">Источники</h6>
|
||||
<h3 class="mb-0">{{ alive }}<small class="text-muted">/{{ total_sources}}</small>
|
||||
{% if dead %} <span class="badge bg-danger">{{ dead }} dead</span>{% endif %}</h3>
|
||||
</div>
|
||||
<div class="card card-outline bg-white text-center">
|
||||
<div class="card-content">
|
||||
<h6 class="card-title justify-center text-neutral-500 text-sm">Источники</h6>
|
||||
<h3 class="text-2xl font-semibold m-0 flex items-center justify-center gap-1">
|
||||
{{ alive }}<small class="text-neutral-500 font-normal text-base">/{{ total_sources}}</small>
|
||||
{% if dead %} <span class="badge badge-error">{{ dead }} dead</span>{% endif %}
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex gap-2 mb-3">
|
||||
<form method="post" action="/crawlers/run" class="d-inline">
|
||||
<label class="me-1"><small>воркеры</small>
|
||||
<input type="number" name="workers" value="8" min="1" max="32" class="form-control form-control-sm d-inline-block" style="width:70px">
|
||||
<div class="flex flex-wrap items-end gap-2 mb-4">
|
||||
<form method="post" action="/crawlers/run" class="flex items-end gap-2">
|
||||
<label class="flex flex-col gap-1 text-sm">воркеры
|
||||
<input type="number" name="workers" value="8" min="1" max="32" class="input input-sm w-[70px]">
|
||||
</label>
|
||||
<label class="me-2"><small>лимит</small>
|
||||
<input type="number" name="limit" value="200" min="1" max="1000" class="form-control form-control-sm d-inline-block" style="width:80px">
|
||||
<label class="flex flex-col gap-1 text-sm">лимит
|
||||
<input type="number" name="limit" value="200" min="1" max="1000" class="input input-sm w-[80px]">
|
||||
</label>
|
||||
<button class="btn btn-success btn-sm">▶ Запустить воркер</button>
|
||||
</form>
|
||||
<form method="post" action="/crawlers/reset" class="d-inline">
|
||||
<form method="post" action="/crawlers/reset">
|
||||
<button class="btn btn-warning btn-sm">↻ Сбросить dead</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{% if request.query_params.get('run') == 'started' %}
|
||||
<div class="alert alert-success py-2">Воркер запущен ({{ request.query_params.get('workers') }} потоков, лимит {{ request.query_params.get('limit') }}). Следите за processing → done.</div>
|
||||
<div class="alert alert-success mb-3">Воркер запущен ({{ request.query_params.get('workers') }} потоков, лимит {{ request.query_params.get('limit') }}). Следите за processing → done.</div>
|
||||
{% elif request.query_params.get('run') == 'error' %}
|
||||
<div class="alert alert-danger py-2">Ошибка запуска: {{ request.query_params.get('msg') }}</div>
|
||||
<div class="alert alert-error mb-3">Ошибка запуска: {{ request.query_params.get('msg') }}</div>
|
||||
{% elif request.query_params.get('reset') %}
|
||||
<div class="alert alert-info py-2">Сброшено {{ request.query_params.get('reset') }} source(s) в alive.</div>
|
||||
<div class="alert alert-info mb-3">Сброшено {{ request.query_params.get('reset') }} source(s) в alive.</div>
|
||||
{% endif %}
|
||||
|
||||
<h5 class="mt-4">Источники</h5>
|
||||
<table class="table table-sm table-striped">
|
||||
<thead><tr><th>Источник</th><th>Тип</th><th>Статус</th><th>Последний сбор</th><th>Ошибки</th><th>Приоритет</th></tr></thead>
|
||||
<h5 class="text-lg font-semibold mt-6 mb-2">Источники</h5>
|
||||
<div class="overflow-x-auto card card-outline bg-white">
|
||||
<table class="table table-sm table-zebra">
|
||||
<thead class="bg-neutral-100"><tr><th>Источник</th><th>Тип</th><th>Статус</th><th>Последний сбор</th><th>Ошибки</th><th>Приоритет</th></tr></thead>
|
||||
<tbody>
|
||||
{% for s in sources %}
|
||||
<tr>
|
||||
<td><b>{{ s.name }}</b><br><small class="text-muted">{{ s.slug }}</small></td>
|
||||
<td><span class="badge bg-secondary">{{ s.crawler }}</span></td>
|
||||
<td><b>{{ s.name }}</b><br><small class="text-neutral-500">{{ s.slug }}</small></td>
|
||||
<td><span class="badge badge-neutral">{{ s.crawler }}</span></td>
|
||||
<td>
|
||||
{% if s.status == 'dead' %}<span class="badge bg-danger">dead</span>
|
||||
{% elif s.enabled %}<span class="badge bg-success">alive</span>
|
||||
{% else %}<span class="badge bg-secondary">off</span>{% endif %}
|
||||
{% if s.status == 'dead' %}<span class="badge badge-error">dead</span>
|
||||
{% elif s.enabled %}<span class="badge badge-success">alive</span>
|
||||
{% else %}<span class="badge badge-neutral">off</span>{% endif %}
|
||||
</td>
|
||||
<td>{{ s.last_fetch | dt if s.last_fetch else '—' }}</td>
|
||||
<td>{% if s.error_count %}<span class="text-danger">{{ s.error_count }}</span>{% else %}—{% endif %}
|
||||
{% if s.last_error %}<br><small class="text-muted">{{ s.last_error }}</small>{% endif %}</td>
|
||||
<td>{% if s.error_count %}<span class="text-red-600">{{ s.error_count }}</span>{% else %}—{% endif %}
|
||||
{% if s.last_error %}<br><small class="text-neutral-500">{{ s.last_error }}</small>{% endif %}</td>
|
||||
<td>{{ s.priority }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<h5 class="mt-4">Последние запуски</h5>
|
||||
<table class="table table-sm table-striped">
|
||||
<thead><tr><th>Время</th><th>Источник</th><th>Статус</th><th>Постов</th><th>Длительность</th></tr></thead>
|
||||
<h5 class="text-lg font-semibold mt-6 mb-2">Последние запуски</h5>
|
||||
<div class="overflow-x-auto card card-outline bg-white">
|
||||
<table class="table table-sm table-zebra">
|
||||
<thead class="bg-neutral-100"><tr><th>Время</th><th>Источник</th><th>Статус</th><th>Постов</th><th>Длительность</th></tr></thead>
|
||||
<tbody>
|
||||
{% for r in runs %}
|
||||
<tr><td>{{ r.started_at | dt }}</td><td>{{ r.source_name or r.source_id }}</td>
|
||||
@@ -95,4 +92,5 @@
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
+12
-12
@@ -1,27 +1,27 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Метрики{% endblock %}
|
||||
{% block content %}
|
||||
<h4 class="mb-3">Метрики</h4>
|
||||
<div class="row">
|
||||
<h4 class="text-xl font-semibold mb-4">Метрики</h4>
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-3">
|
||||
{% for d in dirs %}
|
||||
<div class="col-md-4 mb-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h6 class="card-title">{{ d.direction or 'без направления' }} / {{ d.cnt }}</h6>
|
||||
<small>👁 просмотров: {{ d.views or 0 }} · средние реакции: {{ "%.1f"|format(d.avg_reactions or 0) }}</small>
|
||||
</div>
|
||||
<div class="card card-outline bg-white mb-3">
|
||||
<div class="card-content">
|
||||
<h6 class="card-title">{{ d.direction or 'без направления' }} / {{ d.cnt }}</h6>
|
||||
<small class="text-neutral-500">👁 просмотров: {{ d.views or 0 }} · средние реакции: {{ "%.1f"|format(d.avg_reactions or 0) }}</small>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<h5 class="mt-4">Последние запуски</h5>
|
||||
<table class="table table-sm table-striped">
|
||||
<thead><tr><th>Время</th><th>Источник</th><th>Стаус</th><th>Пстов</th></tr></thead>
|
||||
<h5 class="text-lg font-semibold mt-6 mb-2">Последние запуски</h5>
|
||||
<div class="overflow-x-auto card card-outline bg-white">
|
||||
<table class="table table-sm table-zebra">
|
||||
<thead class="bg-neutral-100"><tr><th>Время</th><th>Источник</th><th>Стаус</th><th>Пстов</th></tr></thead>
|
||||
<tbody>
|
||||
{% for r in runs %}
|
||||
<tr><td>{{ r.started_at | dt }}</td><td>{{ r.source_id }}</td><td>{{ r.status }}</td><td>{{ r.posts_new }}/{{ r.posts_fetched }}</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
+66
-67
@@ -1,64 +1,64 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Источники{% endblock %}
|
||||
{% block content %}
|
||||
<h4 class="mb-3">📡 Источники <a href="/crawlers" class="btn btn-sm btn-outline-secondary ms-2">Статус краулеров →</a></h4>
|
||||
<h4 class="text-xl font-semibold mb-4 flex items-center gap-2 flex-wrap">📡 Источники
|
||||
<a href="/crawlers" class="btn btn-sm btn-outline">Статус краулеров →</a>
|
||||
</h4>
|
||||
|
||||
{% if did %}
|
||||
<div class="alert alert-{{ 'success' if not did.startswith('error') else 'danger' }} py-2 small">
|
||||
<div class="alert alert-{{ 'success' if not did.startswith('error') else 'error' }} mb-4 text-sm">
|
||||
{{ did }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Форма добавления -->
|
||||
<div class="card mb-3">
|
||||
<div class="card-header py-2"><b>➕ Добавить источник</b></div>
|
||||
<div class="card-body py-2">
|
||||
<form method="post" action="/sources/add" class="row g-2 align-items-end">
|
||||
<div class="col-auto">
|
||||
<label class="form-label mb-0 small">slug</label>
|
||||
<input type="text" name="slug" class="form-control form-control-sm" placeholder="my_channel" required>
|
||||
<div class="card card-outline mb-4 bg-white">
|
||||
<div class="border-b border-neutral-200 px-4 py-2 font-bold">➕ Добавить источник</div>
|
||||
<div class="card-content p-4">
|
||||
<form method="post" action="/sources/add" class="flex flex-wrap items-end gap-2">
|
||||
<div class="flex flex-col gap-1">
|
||||
<label class="text-xs text-neutral-500 mb-0" for="add_slug">slug</label>
|
||||
<input id="add_slug" type="text" name="slug" class="input input-sm w-40" placeholder="my_channel" required>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<label class="form-label mb-0 small">Название</label>
|
||||
<input type="text" name="name" class="form-control form-control-sm" placeholder="My Channel">
|
||||
<div class="flex flex-col gap-1">
|
||||
<label class="text-xs text-neutral-500 mb-0" for="add_name">Название</label>
|
||||
<input id="add_name" type="text" name="name" class="input input-sm w-48" placeholder="My Channel">
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<label class="form-label mb-0 small">Address</label>
|
||||
<input type="text" name="address" class="form-control form-control-sm"
|
||||
placeholder="@handle, t.me/name, https://t.me/name или https://.../rss" id="add_address">
|
||||
<div class="flex flex-col gap-1">
|
||||
<label class="text-xs text-neutral-500 mb-0" for="add_address">Address</label>
|
||||
<input id="add_address" type="text" name="address" class="input input-sm w-72"
|
||||
placeholder="@handle, t.me/name, https://t.me/name или https://.../rss">
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary" id="btn_fetch"
|
||||
<div>
|
||||
<button type="button" class="btn btn-sm btn-outline" id="btn_fetch"
|
||||
onclick="fetchSourcePreview()">🔎 Найти</button>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<label class="form-label mb-0 small">crawler</label>
|
||||
<select name="crawler" class="form-select form-select-sm">
|
||||
<div class="flex flex-col gap-1">
|
||||
<label class="text-xs text-neutral-500 mb-0" for="add_crawler">crawler</label>
|
||||
<select id="add_crawler" name="crawler" class="select select-sm w-32">
|
||||
<option value="telegram">telegram</option>
|
||||
<option value="rss">rss</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<label class="form-label mb-0 small">direction</label>
|
||||
<input type="text" name="direction" class="form-control form-control-sm" placeholder="linux" list="dirs">
|
||||
<div class="flex flex-col gap-1">
|
||||
<label class="text-xs text-neutral-500 mb-0" for="add_direction">direction</label>
|
||||
<input id="add_direction" type="text" name="direction" class="input input-sm w-32" placeholder="linux" list="dirs">
|
||||
<datalist id="dirs">
|
||||
{% for d in directions %}<option value="{{ d }}">{% endfor %}
|
||||
</datalist>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<label class="form-label mb-0 small">priority</label>
|
||||
<select name="priority" class="form-select form-select-sm">
|
||||
<div class="flex flex-col gap-1">
|
||||
<label class="text-xs text-neutral-500 mb-0" for="add_priority">priority</label>
|
||||
<select id="add_priority" name="priority" class="select select-sm w-20">
|
||||
<option value="P0">P0</option><option value="P1" selected>P1</option>
|
||||
<option value="P2">P2</option><option value="P3">P3</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="form-check form-switch mt-3">
|
||||
<input class="form-check-input" type="checkbox" name="enabled" id="add_en" checked>
|
||||
<label class="form-check-label small" for="add_en">enabled</label>
|
||||
</div>
|
||||
<div class="flex items-center gap-2 pb-2">
|
||||
<input class="size-4" type="checkbox" name="enabled" id="add_en" checked>
|
||||
<label class="text-sm mb-0" for="add_en">enabled</label>
|
||||
</div>
|
||||
<div class="col-auto"><button class="btn btn-sm btn-primary">Добавить</button></div>
|
||||
<div><button class="btn btn-sm btn-primary">Добавить</button></div>
|
||||
</form>
|
||||
<script>
|
||||
const addCrawler = document.querySelector('form[action="/sources/add"] select[name="crawler"]');
|
||||
@@ -93,41 +93,40 @@
|
||||
</div>
|
||||
|
||||
<!-- Таблица источников -->
|
||||
<div class="card">
|
||||
<div class="card-header py-2"><b>🗂️ Таблица ({{ sources|length }})</b>
|
||||
<span class="text-muted small">источник истины: sources.yaml (правки пишутся в yaml + БД)</span>
|
||||
<div class="card card-outline bg-white">
|
||||
<div class="border-b border-neutral-200 px-4 py-2 flex items-center gap-2 flex-wrap">
|
||||
<b>🗂️ Таблица ({{ sources|length }})</b>
|
||||
<span class="text-neutral-500 text-sm">источник истины: sources.yaml (правки пишутся в yaml + БД)</span>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-sm table-hover align-middle mb-0">
|
||||
<thead class="table-light">
|
||||
<div class="overflow-x-auto">
|
||||
<table class="table table-sm table-hover">
|
||||
<thead class="bg-neutral-100">
|
||||
<tr>
|
||||
<th>slug</th><th>Название</th><th>crawler</th><th>direction</th><th>lang</th>
|
||||
<th>priority</th><th>enabled</th><th class="text-end">статус</th><th>послед. запуск</th><th class="text-end">действия</th>
|
||||
<th>priority</th><th>enabled</th><th class="text-right">статус</th><th>послед. запуск</th><th class="text-right">действия</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for s in sources %}
|
||||
<tr class="{{ 'text-muted' if not s['enabled'] }}">
|
||||
<td><code>{{ s['slug'] }}</code></td>
|
||||
<tr class="{{ 'text-neutral-500' if not s['enabled'] }}">
|
||||
<td><code class="text-xs">{{ s['slug'] }}</code></td>
|
||||
<td>
|
||||
<form method="post" action="/sources/{{ s['id'] }}/edit" class="row g-1 align-items-center">
|
||||
<div class="col-auto">
|
||||
<input type="text" name="name" value="{{ s['name'] or '' }}" class="form-control form-control-sm source-name" style="width:170px">
|
||||
</div>
|
||||
<div class="col-auto"><button class="btn btn-sm btn-outline-secondary">💾</button></div>
|
||||
<form method="post" action="/sources/{{ s['id'] }}/edit" class="flex items-center gap-1">
|
||||
<input type="text" name="name" value="{{ s['name'] or '' }}" class="input input-sm source-name w-[170px]">
|
||||
<button class="btn btn-sm btn-outline">💾</button>
|
||||
</form>
|
||||
</td>
|
||||
<td><span class="badge text-bg-secondary">{{ s['crawler'] }}</span>
|
||||
{% if s['crawler'] == 'rss' and s['feed_url'] %}<br><small class="text-muted">{{ s['feed_url'] }}</small>{% endif %}
|
||||
{% if s['crawler'] == 'telegram' and s['channel'] %}<br><small class="text-muted">{{ s['channel'] }}</small>{% endif %}
|
||||
<td><span class="badge badge-neutral">{{ s['crawler'] }}</span>
|
||||
{% if s['crawler'] == 'rss' and s['feed_url'] %}<br><small class="text-neutral-500">{{ s['feed_url'] }}</small>{% endif %}
|
||||
{% if s['crawler'] == 'telegram' and s['channel'] %}<br><small class="text-neutral-500">{{ s['channel'] }}</small>{% endif %}
|
||||
</td>
|
||||
<td>{{ s['direction'] or '—' }}
|
||||
{% if s['error_count'] %}<br><small class="text-danger">{{ s['error_count'] }} err</small>{% endif %}
|
||||
{% if s['error_count'] %}<br><small class="text-red-600">{{ s['error_count'] }} err</small>{% endif %}
|
||||
</td>
|
||||
<td>{{ s['lang'] or 'ru' }}</td>
|
||||
<td>
|
||||
<form method="post" action="/sources/{{ s['id'] }}/edit" class="d-inline">
|
||||
<select name="priority" class="form-select form-select-sm" style="width:auto" onchange="this.form.submit()">
|
||||
<form method="post" action="/sources/{{ s['id'] }}/edit" class="inline-block">
|
||||
<select name="priority" class="select select-sm w-auto" onchange="this.form.submit()">
|
||||
{% for p in ['P0','P1','P2','P3'] %}
|
||||
<option value="{{ p }}" {{ 'selected' if s['priority'] == p else '' }}>P{{ loop.index0 }}</option>
|
||||
{% endfor %}
|
||||
@@ -135,28 +134,28 @@
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge {{ 'text-bg-success' if s['enabled'] else 'text-bg-secondary' }}">
|
||||
<span class="badge {{ 'badge-success' if s['enabled'] else 'badge-neutral' }}">
|
||||
{{ 'вкл' if s['enabled'] else 'пауза' }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
{% if s['status'] == 'dead' %}<span class="badge text-bg-danger">dead</span>
|
||||
{% elif s['status'] == 'alive' %}<span class="badge text-bg-success">alive</span>
|
||||
{% elif s['status'] == 'new' %}<span class="badge text-bg-info">new</span>
|
||||
{% else %}<span class="badge text-bg-secondary">{{ s['status'] }}</span>{% endif %}
|
||||
{% if s['enabled'] == 0 %}<span class="badge text-bg-warning">пауза</span>{% endif %}
|
||||
<td class="text-right">
|
||||
{% if s['status'] == 'dead' %}<span class="badge badge-error">dead</span>
|
||||
{% elif s['status'] == 'alive' %}<span class="badge badge-success">alive</span>
|
||||
{% elif s['status'] == 'new' %}<span class="badge badge-info">new</span>
|
||||
{% else %}<span class="badge badge-neutral">{{ s['status'] }}</span>{% endif %}
|
||||
{% if s['enabled'] == 0 %}<span class="badge badge-warning">пауза</span>{% endif %}
|
||||
</td>
|
||||
<td class="small text-muted">{{ s['last_fetch'] or '—' }}{% if s['last_error'] %}<br><span class="text-danger">{{ s['last_error'][:40] }}</span>{% endif %}</td>
|
||||
<td class="text-end">
|
||||
<form method="post" action="/sources/{{ s['id'] }}/toggle" class="d-inline">
|
||||
<button class="btn btn-sm {{ 'btn-outline-warning' if s['enabled'] else 'btn-outline-success' }}"
|
||||
<td class="text-sm text-neutral-500">{{ s['last_fetch'] or '—' }}{% if s['last_error'] %}<br><span class="text-red-600">{{ s['last_error'][:40] }}</span>{% endif %}</td>
|
||||
<td class="text-right whitespace-nowrap">
|
||||
<form method="post" action="/sources/{{ s['id'] }}/toggle" class="inline-block">
|
||||
<button class="btn btn-sm btn-outline {{ 'text-amber-600' if s['enabled'] else 'text-green-600' }}"
|
||||
title="{{ 'Пауза' if s['enabled'] else 'Возобновить' }}">
|
||||
{{ '⏸' if s['enabled'] else '▶' }}
|
||||
</button>
|
||||
</form>
|
||||
<form method="post" action="/sources/{{ s['id'] }}/delete" class="d-inline"
|
||||
<form method="post" action="/sources/{{ s['id'] }}/delete" class="inline-block"
|
||||
onsubmit="return confirm('Удалить источник {{ s['slug'] }}? Это уберёт его из sources.yaml и БД (посты останутся).')">
|
||||
<button class="btn btn-sm btn-outline-danger" title="Удалить">🗑</button>
|
||||
<button class="btn btn-sm btn-outline text-red-600" title="Удалить">🗑</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -165,4 +164,4 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user