Add OpenWrt SSH status

This commit is contained in:
2026-02-08 02:54:09 +03:00
parent fc061ece30
commit 5e01a8d596
6 changed files with 223 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ from services.updates import list_updates, apply_updates
from services.runner import run_cmd
from services.npmplus import fetch_certificates, format_certificates, list_proxy_hosts, set_proxy_host
from services.gitea import get_gitea_health
from services.openwrt import get_openwrt_status
import state
from state import UPDATES_CACHE, REBOOT_PENDING
from services.metrics import summarize
@@ -194,6 +195,23 @@ async def smart_status(msg: Message):
await msg.answer("\n".join(lines), reply_markup=system_info_kb)
@dp.message(F.text == "📡 OpenWrt")
async def openwrt_status(msg: Message):
if not is_admin_msg(msg):
return
await msg.answer("⏳ Checking OpenWrt…", reply_markup=system_info_kb)
async def worker():
try:
text = await get_openwrt_status(cfg)
except Exception as e:
text = f"⚠️ OpenWrt error: {e}"
await msg.answer(text, reply_markup=system_info_kb)
asyncio.create_task(worker())
@dp.message(F.text == "🧾 Audit")
async def audit_log(msg: Message):
if not is_admin_msg(msg):