Панель: связи и журнал действий; статус спринта
Панель показывает ещё связи между карточками и таблицу действий сверки (что, куда, результат, статус). Проверено: 200, 5 блоков, цифры совпадают. Добавлен docs/SPRINT-STATUS.md — что уже работает и проверено, что ждёт участия владельца (ключи LLM, Telegram, DNS для новых доменов, MQTT в HA, камеры, доступ к определениям Prowlarr) и как проверить самому.
This commit is contained in:
1 parent
454140adf8
commit
8224f1df7a
2 files changed
+119
-1
No files matched your search
+15
-1
@@ -143,11 +143,16 @@ def render_panel():
|
||||
cur.execute("""select source, count(*) from events
|
||||
where at > now() - interval '24 hours' group by source order by 2 desc""")
|
||||
by_source = cur.fetchall()
|
||||
cur.execute("select count(*) from entity_links")
|
||||
links = cur.fetchone()[0]
|
||||
cur.execute("""select at, kind, target, detail, status from actions
|
||||
order by id desc limit 10""")
|
||||
actions = cur.fetchall()
|
||||
con.close()
|
||||
err = None
|
||||
except Exception as e:
|
||||
entities = events = events24 = open_problems = 0
|
||||
problems, recent, by_source = [], [], []
|
||||
problems, recent, by_source, actions, links = [], [], [], [], 0
|
||||
err = str(e)[:200]
|
||||
|
||||
def esc(x):
|
||||
@@ -158,6 +163,12 @@ def render_panel():
|
||||
f"<td>{esc(typ)}</td><td>{esc(title)}</td></tr>"
|
||||
for at, src, typ, title in recent) or "<tr><td colspan=4>событий пока нет</td></tr>"
|
||||
|
||||
arows = "".join(
|
||||
f"<tr><td>{esc(at.strftime('%d.%m %H:%M'))}</td><td>{esc(kind)}</td>"
|
||||
f"<td>{esc(target)}</td><td>{esc(detail)}</td>"
|
||||
f"<td class=\"{'bad' if st != 'done' else ''}\">{esc(st)}</td></tr>"
|
||||
for at, kind, target, detail, st in actions) or "<tr><td colspan=5>действий не было</td></tr>"
|
||||
|
||||
prow = "".join(
|
||||
f"<tr><td>{esc(name)}</td><td>{esc(detail)}</td></tr>"
|
||||
for name, detail, _ in problems) or "<tr><td colspan=2>открытых проблем нет</td></tr>"
|
||||
@@ -185,8 +196,11 @@ th{{color:#7d8b99;font-weight:500}}
|
||||
<div class="card"><b>{events}</b><span>событий всего</span></div>
|
||||
<div class="card"><b>{events24}</b><span>за 24 часа</span></div>
|
||||
<div class="card"><b class="{'bad' if open_problems else ''}">{open_problems}</b><span>проблем</span></div>
|
||||
<div class="card"><b>{links}</b><span>связей</span></div>
|
||||
</div>
|
||||
<h2>Проблемы</h2><table><tr><th>проверка</th><th>что не так</th></tr>{prow}</table>
|
||||
<h2>Действия сверки и автоисправлений</h2>
|
||||
<table><tr><th>когда</th><th>что</th><th>цель</th><th>результат</th><th>статус</th></tr>{arows}</table>
|
||||
<h2>Последние события</h2>
|
||||
<table><tr><th>когда</th><th>источник</th><th>тип</th><th>объект</th></tr>{rows}</table>
|
||||
<h2>Источники за сутки</h2><div>{srcs}</div>
|
||||
|
||||
Reference in new issue
Block a user