{{ c.fault_function }}
{% if c.fault_function_loc %}{{ c.fault_function_loc }}{% endif %}
{{ t.trace_id }}
{{ t.why }}
无匹配的知识库条目。
{% endif %} {% endmacro %} {% macro m_source(sc) %} {% if sc %} {% if sc.call_chain %}{{ node.function }}
{{ node.file }}{% if node.line %}:{{ node.line }}{% endif %}
{% if node.role_label %}{{ node.role_label }}{% endif %}
{{ para }}
{% endfor %}未获取到相关源码。可能原因:组件源码未拉取,或故障模式未关联源码文件。
{% endif %} {% endmacro %} {# ---- Donut chart macro: pure CSS conic-gradient pie, auto-completes remainder as "其他" ---- #} {% macro donut_chart(items, total='', total_label='') -%} {%- set palette = ['#4f7cff', '#37c7b5', '#8fb0ff', '#F59E0B', '#E5484D', '#8B5CF6', '#0EA5E9', '#EC4899'] -%} {%- set gray = '#C3CBD4' -%} {%- set ns = namespace(grad='', start=0.0) -%} {%- for item in items -%} {%- set end = ns.start + (item.pct | float) -%} {%- set ns.grad = ns.grad ~ palette[loop.index0 % (palette | length)] ~ ' ' ~ (ns.start | round(2)) ~ '% ' ~ (end | round(2)) ~ '%' -%} {%- if not loop.last %}{%- set ns.grad = ns.grad ~ ', ' -%}{% endif -%} {%- set ns.start = end -%} {%- endfor -%} {%- set remainder = (100 - ns.start) | round(2) -%} {%- if remainder > 0.5 -%}{%- set ns.grad = ns.grad ~ ', ' ~ gray ~ ' ' ~ (ns.start | round(2)) ~ '% 100%' -%}{%- endif -%}{{ f0.conclusion.fault_function }}
{% if f0.conclusion.fault_function_loc %}{{ f0.conclusion.fault_function_loc }}{% endif %}
| 编号 | 故障名称 | 角色 | 确认状态 | 严重级别 | 影响范围 | 置信度 |
|---|---|---|---|---|---|---|
| {{ f.id }} | {{ f.title }} | {% if f.role == 'primary' %}主故障{% elif f.role == 'secondary' %}次生故障{% else %}独立故障{% endif %} | {% if f.status == 'confirmed' %}已确认{% elif f.status == 'suspected' %}疑似{% elif f.status == 'excluded' %}已排除{% else %}{{ f.status }}{% endif %} | {% if f.severity %}{{ f.severity }}{% else %}—{% endif %} | {{ f.affected_scope or '—' }} | {% if f.confidence is number %}{{ f.confidence }}%{% else %}{{ f.confidence or '—' }}{% endif %} |
| 优先级 | 关联故障 | 处置操作 | 前置依赖 | 预期效果 | 验证标准 |
|---|---|---|---|---|---|
| {{ a.priority }} | {% for fid in a.fault_ids %}{% set fr = namespace(role='independent') %}{% for ff in fault_list %}{% if ff.id == fid %}{% set fr.role = ff.role %}{% endif %}{% endfor %}{{ fid }} {% endfor %} | {{ a.action }} | {{ a.depends_on or '—' }} | {{ a.expected_effect or '—' }} | {{ a.verify or '—' }} |