{# SPDX-License-Identifier: Apache-2.0 #} {# Copyright (C) 2025 Marcin Zieba #} {% comment %} State badge from a raw status. Expects `status`. Owned (NetBox is the source of truth) is derived from owned statuses and shown as a shield. changed/conflict = not-owned drift; drifted/accepted = owned -> pending apply. {% endcomment %} {% if status == "changed" or status == "conflict" %}drift {% elif status == "drifted" or status == "accepted" %}pending apply {% elif status == "apply_failed" %}apply failed {% elif status == "deploying" %}deploying {% elif status == "in_sync" or status == "imported" %}{% if compact %}{% if status == "in_sync" %}{% endif %}{% else %}in sync{% endif %} {% elif status == "error" %}error {% else %}{{ status }}{% endif %} {% if status == "in_sync" or status == "accepted" or status == "drifted" or status == "deploying" or status == "apply_failed" %}{% endif %} {% if residue %}removal residue{% endif %}