diff --git a/templates/index.html b/templates/index.html index f4e43b2..3b68434 100644 --- a/templates/index.html +++ b/templates/index.html @@ -266,8 +266,20 @@
-
-
+
+
+
+ +
+ +
+
+
+
+ +
+ +
{% else %} @@ -473,12 +485,18 @@ let cpuDistributionChart = null; function setStat(key, text) { - var el = document.querySelector('[data-stats="' + key + '"]'); - if (el) { el.textContent = text; el.classList.remove('animate-pulse'); } + document.querySelectorAll('[data-stats="' + key + '"]').forEach(function(el) { + el.textContent = text; + el.classList.remove('animate-pulse'); + }); } function setProgress(key, value) { - var el = document.querySelector('[data-stats="' + key + '"]'); - if (el && el.tagName === 'PROGRESS') { el.value = value; el.classList.remove('animate-pulse'); } + document.querySelectorAll('[data-stats="' + key + '"]').forEach(function(el) { + if (el.tagName === 'PROGRESS') { + el.value = value; + el.classList.remove('animate-pulse'); + } + }); } function renderStats(data) { @@ -529,6 +547,10 @@ var vmCount = data.vm && data.vm.count ? data.vm.count : 0; var firstCount = data.flavors && data.flavors.first_common_flavor ? data.flavors.first_common_flavor.count : 0; setStat('flavors.first_share', (vmCount ? Math.round(firstCount / vmCount * 100) : 0) + '%'); + setStat('flavors.second_name', data.flavors && data.flavors.second_common_flavor ? data.flavors.second_common_flavor.name : '—'); + setStat('flavors.second_count', data.flavors && data.flavors.second_common_flavor ? String(data.flavors.second_common_flavor.count) : '—'); + setStat('flavors.third_name', data.flavors && data.flavors.third_common_flavor ? data.flavors.third_common_flavor.name : '—'); + setStat('flavors.third_count', data.flavors && data.flavors.third_common_flavor ? String(data.flavors.third_common_flavor.count) : '—'); document.querySelectorAll('[data-stats]').forEach(function(n) { n.classList.remove('animate-pulse'); }); } diff --git a/watcher_visio/settings.py b/watcher_visio/settings.py index 74a2f9f..8211dc2 100644 --- a/watcher_visio/settings.py +++ b/watcher_visio/settings.py @@ -69,6 +69,9 @@ MIDDLEWARE = [ 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] +# COOP ignored on non-HTTPS / non-localhost; disable to avoid console warning +SECURE_CROSS_ORIGIN_OPENER_POLICY = None + ROOT_URLCONF = 'watcher_visio.urls' TEMPLATES = [