Refactor Docker infrastructure dashboard by removing deprecated Portainer agent entities and associated button configurations. Update YAML files to streamline sections and enhance clarity, including the removal of redundant top chips includes across various sections.

pull/1590/head
Carlo Costanzo 1 month ago
parent d05b010be0
commit d980f602a7

@ -9,16 +9,6 @@
# Notes: Generated from core.entity_registry (platform: portainer).
######################################################################
- entity_id: button.91aca40203c0_portainer_agent_restart_container
options:
type: tile
name: 91aca40203c0_portainer_agent
hide_state: true
tap_action:
action: call-service
service: button.press
service_data:
entity_id: button.91aca40203c0_portainer_agent_restart_container
- entity_id: button.cloudflared_kch_restart_container
options:
type: tile

@ -9,15 +9,6 @@
# Notes: Generated from core.entity_registry + button restart entities.
######################################################################
- entity_id: binary_sensor.91aca40203c0_portainer_agent_status
options:
type: custom:button-card
template: bearstone_infra_container_row
name: 91aca40203c0_portainer_agent
icon: mdi:docker
variables:
restart_button: button.91aca40203c0_portainer_agent_restart_container
name: 91aca40203c0_portainer_agent
- entity_id: binary_sensor.cloudflared_kch_status
options:
type: custom:button-card

@ -10,8 +10,6 @@
# Notes: Uses Portainer entities (`binary_sensor.*_status`, `button.*_restart_container`).
######################################################################
- !include /config/dashboards/infrastructure/partials/infra_top_chips_section.yaml
- type: grid
column_span: 4
columns: 3

@ -7,13 +7,11 @@
# Desktop-first infra overview: full-width hero, exceptions-first alerts.
# -------------------------------------------------------------------
# Notes: Default/light theme only; no dark-mode specific styling.
# Notes: Always keep a full-width container directly below chips.
# Notes: Keep the first section full-width to avoid whitespace on desktop.
######################################################################
- !include /config/dashboards/infrastructure/partials/infra_top_chips_home_section.yaml
# -------------------------------------------------------------------
# Home hero (mandatory full-width container under chips)
# Home hero (mandatory first full-width container)
# -------------------------------------------------------------------
- type: grid
column_span: 4
@ -153,6 +151,17 @@
action: navigate
navigation_path: /dashboard-infrastructure/website-health
- type: custom:button-card
template: bearstone_infra_alert_row
entity: binary_sensor.bear_stone
name: Bear Stone is down
icon: mdi:web-cancel
variables:
alert_kind: binary_off
tap_action:
action: navigate
navigation_path: /dashboard-infrastructure/website-health
- type: custom:button-card
template: bearstone_infra_list_row
name: Domain expiration critical
@ -311,6 +320,32 @@
tap_action:
action: none
- type: custom:button-card
template: bearstone_infra_alert_row
entity: binary_sensor.node_proxmox1_updates_packages
name: Proxmox01 updates pending
icon: mdi:package-up
variables:
alert_kind: binary_on
tap_action:
action: navigate
navigation_path: /dashboard-infrastructure/proxmox
state_display: >
[[[ return 'UPDATES'; ]]]
- type: custom:button-card
template: bearstone_infra_alert_row
entity: binary_sensor.node_proxmox02_updates_packages
name: Proxmox02 updates pending
icon: mdi:package-up
variables:
alert_kind: binary_on
tap_action:
action: navigate
navigation_path: /dashboard-infrastructure/proxmox
state_display: >
[[[ return 'UPDATES'; ]]]
- type: custom:button-card
template: bearstone_infra_alert_row
entity: sensor.disk_use_percent

@ -9,8 +9,6 @@
# Notes: Stitch-inspired MariaDB layout (KPI strip + 3 panel columns).
######################################################################
- !include /config/dashboards/infrastructure/partials/infra_top_chips_section.yaml
- type: grid
column_span: 4
columns: 4

@ -9,8 +9,6 @@
# Notes: Uses `custom:pi-hole` with existing device_id.
######################################################################
- !include /config/dashboards/infrastructure/partials/infra_top_chips_section.yaml
- type: grid
column_span: 4
columns: 1

@ -9,8 +9,6 @@
# Notes: Standardized on `custom:button-card` + `custom:mini-graph-card` with `card_mod` polish.
######################################################################
- !include /config/dashboards/infrastructure/partials/infra_top_chips_section.yaml
- type: grid
column_span: 4
columns: 4

@ -6,13 +6,11 @@
# Infrastructure Partial - Website health sections
# Website uptime + domain expiry + certificate telemetry detail view.
# -------------------------------------------------------------------
# Notes: Keep a full-width container directly below chips to avoid whitespace.
# Notes: Keep the first section full-width to avoid whitespace.
######################################################################
- !include /config/dashboards/infrastructure/partials/infra_top_chips_section.yaml
# -------------------------------------------------------------------
# Website hero (mandatory full-width container under chips)
# Website hero (mandatory first full-width container)
# -------------------------------------------------------------------
- type: grid
column_span: 4

@ -144,191 +144,85 @@ template:
{% endif %}
automation:
- alias: "APT Update Report - docker_10"
id: apt_update_report_docker_10
description: "Receive docker_10 APT results and update helpers/logbook."
- alias: "APT Update Report - Docker Hosts"
id: apt_update_report_docker_hosts
description: "Receive docker host APT results and update helpers/logbook."
mode: queued
trigger:
- platform: webhook
webhook_id: !secret apt_webhook_docker_10
id: docker_10
allowed_methods:
- POST
local_only: true
variables:
payload: "{{ trigger.json | default({}) }}"
success: "{{ payload.get('success', true) | bool }}"
updated: "{{ payload.get('updated', false) | bool }}"
packages: "{{ payload.get('packages', 0) | int(0) }}"
message: "{{ payload.get('message', '') | string }}"
result: >-
{% if not success %}
ERROR{% if (message | trim) != '' %}: {{ message | trim }}{% endif %}
{% elif updated %}
UPDATED {{ packages }} PKGS
{% else %}
NO UPDATES
{% endif %}
log_message: >-
docker_10 updated {{ packages }} package{% if packages != 1 %}s{% endif %}.
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.apt_docker_10_last_check
data:
datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
- service: input_text.set_value
target:
entity_id: input_text.apt_docker_10_last_result
data:
value: "{{ result }}"
- choose:
- conditions: "{{ success and updated }}"
sequence:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.apt_docker_10_last_update
data:
datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
- service: script.send_to_logbook
data:
topic: "APT"
message: "{{ log_message }}"
- alias: "APT Update Report - docker_14"
id: apt_update_report_docker_14
description: "Receive docker_14 APT results and update helpers/logbook."
mode: queued
trigger:
- platform: webhook
webhook_id: !secret apt_webhook_docker_14
id: docker_14
allowed_methods:
- POST
local_only: true
variables:
payload: "{{ trigger.json | default({}) }}"
success: "{{ payload.get('success', true) | bool }}"
updated: "{{ payload.get('updated', false) | bool }}"
packages: "{{ payload.get('packages', 0) | int(0) }}"
message: "{{ payload.get('message', '') | string }}"
result: >-
{% if not success %}
ERROR{% if (message | trim) != '' %}: {{ message | trim }}{% endif %}
{% elif updated %}
UPDATED {{ packages }} PKGS
{% else %}
NO UPDATES
{% endif %}
log_message: >-
docker_14 updated {{ packages }} package{% if packages != 1 %}s{% endif %}.
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.apt_docker_14_last_check
data:
datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
- service: input_text.set_value
target:
entity_id: input_text.apt_docker_14_last_result
data:
value: "{{ result }}"
- choose:
- conditions: "{{ success and updated }}"
sequence:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.apt_docker_14_last_update
data:
datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
- service: script.send_to_logbook
data:
topic: "APT"
message: "{{ log_message }}"
- alias: "APT Update Report - docker_17"
id: apt_update_report_docker_17
description: "Receive docker_17 APT results and update helpers/logbook."
mode: queued
trigger:
- platform: webhook
webhook_id: !secret apt_webhook_docker_17
id: docker_17
allowed_methods:
- POST
local_only: true
variables:
payload: "{{ trigger.json | default({}) }}"
success: "{{ payload.get('success', true) | bool }}"
updated: "{{ payload.get('updated', false) | bool }}"
packages: "{{ payload.get('packages', 0) | int(0) }}"
message: "{{ payload.get('message', '') | string }}"
result: >-
{% if not success %}
ERROR{% if (message | trim) != '' %}: {{ message | trim }}{% endif %}
{% elif updated %}
UPDATED {{ packages }} PKGS
{% else %}
NO UPDATES
{% endif %}
log_message: >-
docker_17 updated {{ packages }} package{% if packages != 1 %}s{% endif %}.
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.apt_docker_17_last_check
data:
datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
- service: input_text.set_value
target:
entity_id: input_text.apt_docker_17_last_result
data:
value: "{{ result }}"
- choose:
- conditions: "{{ success and updated }}"
sequence:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.apt_docker_17_last_update
data:
datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
- service: script.send_to_logbook
data:
topic: "APT"
message: "{{ log_message }}"
- alias: "APT Update Report - docker_69"
id: apt_update_report_docker_69
description: "Receive docker_69 APT results and update helpers/logbook."
mode: queued
trigger:
- platform: webhook
webhook_id: !secret apt_webhook_docker_69
id: docker_69
allowed_methods:
- POST
local_only: true
variables:
host_id: "{{ trigger.id }}"
payload: "{{ trigger.json | default({}) }}"
success: "{{ payload.get('success', true) | bool }}"
updated: "{{ payload.get('updated', false) | bool }}"
reboot_required: "{{ payload.get('reboot_required', false) | bool }}"
packages: "{{ payload.get('packages', 0) | int(0) }}"
message: "{{ payload.get('message', '') | string }}"
helpers:
docker_10:
last_check: input_datetime.apt_docker_10_last_check
last_update: input_datetime.apt_docker_10_last_update
last_result: input_text.apt_docker_10_last_result
docker_14:
last_check: input_datetime.apt_docker_14_last_check
last_update: input_datetime.apt_docker_14_last_update
last_result: input_text.apt_docker_14_last_result
docker_17:
last_check: input_datetime.apt_docker_17_last_check
last_update: input_datetime.apt_docker_17_last_update
last_result: input_text.apt_docker_17_last_result
docker_69:
last_check: input_datetime.apt_docker_69_last_check
last_update: input_datetime.apt_docker_69_last_update
last_result: input_text.apt_docker_69_last_result
host_helpers: "{{ helpers[host_id] if host_id in helpers else none }}"
result: >-
{% if not success %}
ERROR{% if (message | trim) != '' %}: {{ message | trim }}{% endif %}
{% elif updated %}
UPDATED {{ packages }} PKGS
UPDATED {{ packages }} PKGS{% if reboot_required %} (REBOOT REQ){% endif %}
{% elif reboot_required %}
NO UPDATES (REBOOT REQ)
{% else %}
NO UPDATES
{% endif %}
log_message: >-
docker_69 updated {{ packages }} package{% if packages != 1 %}s{% endif %}.
{{ host_id }} updated {{ packages }} package{% if packages != 1 %}s{% endif %}{% if reboot_required %}; reboot required{% endif %}.
condition:
- condition: template
value_template: "{{ host_helpers is not none }}"
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.apt_docker_69_last_check
entity_id: "{{ host_helpers.last_check }}"
data:
datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
- service: input_text.set_value
target:
entity_id: input_text.apt_docker_69_last_result
entity_id: "{{ host_helpers.last_result }}"
data:
value: "{{ result }}"
- choose:
@ -336,7 +230,7 @@ automation:
sequence:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.apt_docker_69_last_update
entity_id: "{{ host_helpers.last_update }}"
data:
datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
- service: script.send_to_logbook

Loading…
Cancel
Save

Powered by TurnKey Linux.