brendmanager/public/publish.html
2026-11-15 14:53:17 +05:00

16 lines
964 B
HTML

<!doctype html><meta charset="utf-8"><title>Журнал публикаций</title>
<h1>Публикации</h1>
<p id="s"></p>
<button onclick="act('stop')">Остановить</button> <button onclick="act('resume')">Возобновить</button>
<table border="1" cellpadding="4"><thead><tr><th>Время<th>Канал<th>Текст<th>Результат<th>Причина<tbody id="t"></table>
<script>
async function load(){
const s=await (await fetch('/api/publish/status')).json();
document.getElementById('s').textContent=(s.stopped?'ОСТАНОВЛЕНО':'Работает')+'; лимит: '+s.limit;
const l=await (await fetch('/api/publish/log')).json(), t=document.getElementById('t'); t.textContent='';
for(const e of l){const r=t.insertRow();for(const k of ['time','channel','text','result','reason'])r.insertCell().textContent=e[k];}
}
async function act(a){await fetch('/api/publish/'+a,{method:'POST'});load();}
load();
</script>