From b81a0d2a6cd38be7a8cc6c7431783353015f0486 Mon Sep 17 00:00:00 2001 From: Andreas Wrede Date: Fri, 8 May 2026 09:57:58 -0400 Subject: [PATCH] plugins: persist owner chip in glance strip across JS updates Store owner in data-owner attribute; updateHostHeader always prepends it so it survives innerHTML replacement. Render it immediately on page load before JS fetches plugin data. Co-Authored-By: Claude Sonnet 4.6 --- hbd/server/templates/plugins.html | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/hbd/server/templates/plugins.html b/hbd/server/templates/plugins.html index 23471b8..2d9db17 100644 --- a/hbd/server/templates/plugins.html +++ b/hbd/server/templates/plugins.html @@ -416,11 +416,9 @@ {{ host.name }} -
+
+ {% if current_user and current_user.admin and host.owner %}{{ host.owner }}{% endif %} - {% if current_user and current_user.admin and host.owner %} - {{ host.owner }} - {% endif %}
@@ -483,6 +481,7 @@ const GLANCE_PLUGINS = ['cpu_monitor','memory_monitor','disk_monitor', 'network_monitor','nagios_runner','os_info']; const SKIP_FIELDS = new Set(['id','name']); + const CURRENT_USER_ADMIN = {{ 'true' if current_user and current_user.admin else 'false' }}; // ── Cache ─────────────────────────────────────────────────────────────── @@ -561,6 +560,12 @@ const chips = []; + // Owner (admin only, static from server) + const owner = strip.dataset.owner; + if (CURRENT_USER_ADMIN && owner) { + chips.push(`${owner}`); + } + // CPU const cpu = getCache(hostname, 'cpu_monitor'); if (cpu) {