mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-10-21 21:12:01 +00:00
Load bounded recovery predicate only for recovery presentation
This commit is contained in:
@@ -2070,8 +2070,9 @@ def render_template(event_type: str, data: Dict[str, Any],
|
|||||||
return ''
|
return ''
|
||||||
|
|
||||||
safe_vars = _SafeDict(variables)
|
safe_vars = _SafeDict(variables)
|
||||||
|
if event_type == 'error_resolved':
|
||||||
from health_recovery import presents_recovery
|
from health_recovery import presents_recovery
|
||||||
if event_type == 'error_resolved' and presents_recovery(data):
|
if presents_recovery(data):
|
||||||
safe_vars['_health_title'] = runtime_message('healthRecovery.title', language, **variables)
|
safe_vars['_health_title'] = runtime_message('healthRecovery.title', language, **variables)
|
||||||
safe_vars['_health_body'] = runtime_message('healthRecovery.body', language, **variables)
|
safe_vars['_health_body'] = runtime_message('healthRecovery.body', language, **variables)
|
||||||
template['title'] = '{_health_title}'
|
template['title'] = '{_health_title}'
|
||||||
@@ -2532,8 +2533,9 @@ def enrich_with_emojis(event_type: str, title: str, body: str,
|
|||||||
severity = data.get('severity', 'INFO')
|
severity = data.get('severity', 'INFO')
|
||||||
|
|
||||||
icon = EVENT_EMOJI.get(event_type) or CATEGORY_EMOJI.get(group) or SEVERITY_ICONS.get(severity, '')
|
icon = EVENT_EMOJI.get(event_type) or CATEGORY_EMOJI.get(group) or SEVERITY_ICONS.get(severity, '')
|
||||||
|
if event_type == 'error_resolved':
|
||||||
from health_recovery import presents_recovery
|
from health_recovery import presents_recovery
|
||||||
if event_type == 'error_resolved' and presents_recovery(data):
|
if presents_recovery(data):
|
||||||
icon = '✅'
|
icon = '✅'
|
||||||
if event_type == 'backup_complete':
|
if event_type == 'backup_complete':
|
||||||
icon = {
|
icon = {
|
||||||
|
|||||||
Reference in New Issue
Block a user