feat: operational panel UI - active-scope dashboard, drill-down cards, scoped Agents/Blockers/Jobs, PT-BR labels, responsive CSS
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -99,3 +99,34 @@ def health_label(value) -> str:
|
||||
return "-"
|
||||
text = str(value)
|
||||
return _HEALTH_LABELS.get(text.upper(), text)
|
||||
|
||||
|
||||
def _human_label(value, labels):
|
||||
if not value:
|
||||
return "Não informado"
|
||||
text = str(value).upper()
|
||||
return labels.get(text, str(value).replace("_", " ").lower().capitalize())
|
||||
|
||||
|
||||
def fiscal_status_label(value):
|
||||
return _human_label(value, {"BLOCKED": "Bloqueado", "COMPLETE": "Completo", "INCOMPLETE": "Incompleto", "UNKNOWN": "Não informado"})
|
||||
|
||||
|
||||
def job_status_label(value):
|
||||
return _human_label(value, {"PENDING": "Pendente", "RUNNING": "Executando", "COMPLETED": "Concluído", "FAILED": "Falhou"})
|
||||
|
||||
|
||||
def job_kind_label(value):
|
||||
return _human_label(value, {"SYNC_INCREMENTAL": "Sincronização incremental", "INITIAL_SYNC": "Sincronização inicial", "REPROCESS_ALL": "Reprocessar tudo", "REPROCESS_PRODUCTS": "Reprocessar produtos"})
|
||||
|
||||
|
||||
def blocker_type_label(value):
|
||||
return _human_label(value, {"BLOCKED_MISSING_EVIDENCE": "Evidência fiscal ausente", "MISSING_EVIDENCE": "Evidência fiscal ausente", "TECHNICAL_FAILURE": "Falha técnica", "CONNECTION_ERROR": "Erro de conexão"})
|
||||
|
||||
|
||||
def blocker_reason_label(value):
|
||||
return _human_label(value, {"INVALID_NCM": "NCM inválido", "INSUFFICIENT_EVIDENCE": "Evidência insuficiente", "MISSING_CONTEXT": "Contexto fiscal ausente", "NO_EVIDENCE": "Sem evidência"})
|
||||
|
||||
|
||||
def priority_label(value):
|
||||
return _human_label(value, {"CRITICAL": "Crítica", "HIGH": "Alta", "NORMAL": "Média", "MEDIUM": "Média", "LOW": "Baixa"})
|
||||
|
||||
Reference in New Issue
Block a user