Fix heatmap button args
This commit is contained in:
@@ -13,8 +13,7 @@ from keyboards import (
|
||||
system_logs_integrations_kb,
|
||||
system_logs_kb,
|
||||
openwrt_kb,
|
||||
docker_kb,
|
||||
backup_kb,
|
||||
docker_kb, backup_kb,
|
||||
)
|
||||
from system_checks import security, disks, hardware, list_disks, smart_last_test
|
||||
from services.http_checks import get_url_checks, check_url
|
||||
@@ -490,14 +489,15 @@ async def incidents_diff(msg: Message):
|
||||
async def alerts_heatmap(msg: Message):
|
||||
if not is_admin_msg(msg):
|
||||
return
|
||||
parts = msg.text.split()
|
||||
hours = 48
|
||||
category = None
|
||||
for part in parts[1:]:
|
||||
if part.isdigit():
|
||||
hours = max(1, int(part))
|
||||
else:
|
||||
category = part.lower()
|
||||
if msg.text.startswith("/alerts_heatmap"):
|
||||
parts = msg.text.split()
|
||||
for part in parts[1:]:
|
||||
if part.isdigit():
|
||||
hours = max(1, int(part))
|
||||
else:
|
||||
category = part.lower()
|
||||
rows = read_raw(cfg, hours=hours, limit=8000, include_old=True)
|
||||
buckets: dict[datetime, int] = {}
|
||||
for dt, line in rows:
|
||||
|
||||
Reference in New Issue
Block a user