dashy: merge link and description into one line with short date+time

This commit is contained in:
2026-08-16 15:52:28 +00:00
parent 1ec0179de7
commit 390916cf31
+2 -6
View File
@@ -35,17 +35,13 @@ def fetch_transitions():
def to_dashy_entry(t): def to_dashy_entry(t):
rule_name = t["summary"].removeprefix("Falco rule fired - ") rule_name = t["summary"].removeprefix("Falco rule fired - ")
status = t["new"]["status"] status = t["new"]["status"]
local_time = datetime.datetime.fromtimestamp(t["when"], LOCAL_TZ).strftime("%-I:%M %p") when = datetime.datetime.fromtimestamp(t["when"], LOCAL_TZ).strftime("%-m/%-d %-I:%M%p").lower()
return { return {
"link": { "link": {
"text": "View", "text": f"{when} - {status} - {rule_name}",
"url": f"{NETDATA_URL}/", "url": f"{NETDATA_URL}/",
"title": f"{status}: {rule_name}", "title": f"{status}: {rule_name}",
}, },
"value": {
"text": f"{local_time} - {status} - {rule_name}",
"title": "Falco",
},
"date": time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime(t["when"])), "date": time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime(t["when"])),
} }