После перезагрузки хоста: docker не стартовал из-за битого CIDR (192.168.1.115.1/24), arr-сервисы висели из-за залипшего docker-proxy, Authentik был остановлен, 8 oauth2-proxy падали без него. Исправлено: корректный bip/fixed-cidr, рестарт контейнеров, запуск Authentik, остановка дубля Navidrome. Все сервисы 200, failed-юнитов нет. Устройства: device_ident.py опознаёт 106 клиентов (бренд по MAC, тип по имени/портам/бренду), пишет в ядро; добавлена страница /devices.html с фильтрами. В HA добавлен Google Cast и ping-сенсоры для 9 ключевых устройств. Ловушки: правки daemon.json проверять dockerd --validate; «порт слушается» не значит «отвечает»; nmap_tracker в HA 2026.2 не создаёт сущности ни из YAML, ни через config flow.
115 lines
4.6 KiB
HTML
115 lines
4.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="ru">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Устройства сети — Buryans Hub</title>
|
|
<style>
|
|
:root { --bg:#0d1117; --fg:#c9d1d9; --dim:#8b949e; --line:#30363d; --acc:#58a6ff; --ok:#3fb950; }
|
|
* { box-sizing:border-box; }
|
|
body { margin:0; background:var(--bg); color:var(--fg);
|
|
font:14px/1.5 -apple-system,"Segoe UI",Roboto,sans-serif; }
|
|
.wrap { max-width:1150px; margin:0 auto; padding:24px 18px 60px; }
|
|
h1 { font-size:20px; margin:0 0 4px; }
|
|
.sub { color:var(--dim); font-size:13px; margin-bottom:16px; }
|
|
.bar { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; align-items:center; }
|
|
.chip { background:#161b22; border:1px solid var(--line); color:var(--dim);
|
|
border-radius:999px; padding:5px 11px; font-size:13px; cursor:pointer; }
|
|
.chip.active { border-color:var(--acc); color:var(--fg); }
|
|
input { background:#161b22; border:1px solid var(--line); color:var(--fg);
|
|
border-radius:8px; padding:8px 11px; outline:none; min-width:220px; }
|
|
input:focus { border-color:var(--acc); }
|
|
table { width:100%; border-collapse:collapse; font-size:13px; }
|
|
th { text-align:left; color:var(--dim); font-weight:600; padding:8px 10px;
|
|
border-bottom:1px solid var(--line); font-size:12px; text-transform:uppercase; }
|
|
td { padding:7px 10px; border-bottom:1px solid #1b2129; }
|
|
tr:hover td { background:#12171e; }
|
|
.on { color:var(--ok); } .off { color:#484f58; }
|
|
.type { color:var(--acc); }
|
|
.muted { color:var(--dim); }
|
|
a { color:var(--acc); text-decoration:none; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="wrap">
|
|
<h1>Устройства сети</h1>
|
|
<div class="sub" id="sub">загрузка…</div>
|
|
<div class="bar" id="types"></div>
|
|
<div class="bar">
|
|
<input id="q" placeholder="поиск по имени, IP или MAC">
|
|
<span class="chip" id="online">только онлайн</span>
|
|
</div>
|
|
<table>
|
|
<thead><tr><th>IP</th><th>Имя</th><th>Тип</th><th>Бренд</th><th>MAC</th><th>Сеть</th></tr></thead>
|
|
<tbody id="rows"></tbody>
|
|
</table>
|
|
<p class="muted" style="margin-top:18px">
|
|
<a href="./">панель</a> · <a href="graph.html">граф</a> ·
|
|
<a href="ask.html">агент</a> · <a href="yandex.html">музыка</a>
|
|
</p>
|
|
</div>
|
|
<script>
|
|
let all = [], activeType = null, onlyOnline = false, query = "";
|
|
|
|
async function load(){
|
|
try {
|
|
const r = await fetch("data/devices");
|
|
const d = await r.json();
|
|
const items = (d.items || [])[0] || {};
|
|
all = (items.payload || {}).devices || [];
|
|
const byType = (items.payload || {}).by_type || {};
|
|
document.getElementById("sub").textContent =
|
|
all.length + " устройств · онлайн " + all.filter(x => x.online).length;
|
|
|
|
const chips = document.getElementById("types");
|
|
const types = Object.keys(byType).sort((a,b) => byType[b]-byType[a]);
|
|
chips.innerHTML = "";
|
|
const mk = (label, val) => {
|
|
const el = document.createElement("span");
|
|
el.className = "chip" + (activeType === val ? " active" : "");
|
|
el.textContent = label;
|
|
el.onclick = () => { activeType = val; render(); load(); };
|
|
chips.appendChild(el);
|
|
};
|
|
mk("все", null);
|
|
types.forEach(t => mk(t + " " + byType[t], t));
|
|
render();
|
|
} catch (e) {
|
|
document.getElementById("sub").textContent = "ошибка: " + e;
|
|
}
|
|
}
|
|
|
|
function render(){
|
|
const rows = all.filter(x => {
|
|
if (activeType && x.type !== activeType) return false;
|
|
if (onlyOnline && !x.online) return false;
|
|
if (query) {
|
|
const s = (x.name + " " + x.ip + " " + x.mac + " " + x.vendor + " " + x.type).toLowerCase();
|
|
if (!s.includes(query)) return false;
|
|
}
|
|
return true;
|
|
}).sort((a, b) => (b.online - a.online) || (a.type || "").localeCompare(b.type || ""));
|
|
|
|
document.getElementById("rows").innerHTML = rows.map(x => `
|
|
<tr>
|
|
<td class="${x.online ? 'on' : 'off'}">${x.ip || "—"}</td>
|
|
<td>${esc(x.name || "—")}</td>
|
|
<td class="type">${esc(x.type || "—")}</td>
|
|
<td class="muted">${esc((x.vendor || "—").slice(0, 30))}</td>
|
|
<td class="muted">${esc(x.mac)}</td>
|
|
<td class="${x.online ? 'on' : 'off'}">${x.online ? "●" : "○"}</td>
|
|
</tr>`).join("");
|
|
}
|
|
function esc(s){ return String(s).replace(/[&<>]/g, c => ({"&":"&","<":"<",">":">"}[c])); }
|
|
|
|
document.getElementById("q").addEventListener("input", e => { query = e.target.value.toLowerCase(); render(); });
|
|
document.getElementById("online").addEventListener("click", e => {
|
|
onlyOnline = !onlyOnline;
|
|
e.target.className = "chip" + (onlyOnline ? " active" : "");
|
|
render();
|
|
});
|
|
load();
|
|
</script>
|
|
</body>
|
|
</html>
|