Make counters configureable
This commit is contained in:
@@ -537,7 +537,7 @@ def reports_ajax(env, node_name):
|
||||
if total is None:
|
||||
total = puppetdb.total
|
||||
|
||||
metrics[report.hash_] = {'resources': {}, 'events': {}}
|
||||
metrics[report.hash_] = {}
|
||||
for m in report.metrics:
|
||||
if m['category'] not in metrics[report.hash_]:
|
||||
metrics[report.hash_][m['category']] = {}
|
||||
|
||||
@@ -18,6 +18,11 @@ LOGLEVEL = 'info'
|
||||
NORMAL_TABLE_COUNT = 100
|
||||
LITTLE_TABLE_COUNT = 10
|
||||
TABLE_COUNT_SELECTOR = [10, 20, 50, 100, 500]
|
||||
DISPLAYED_METRICS = ['resources.total',
|
||||
'events.failure',
|
||||
'events.success',
|
||||
'resources.skipped',
|
||||
'events.noop']
|
||||
OFFLINE_MODE = False
|
||||
ENABLE_CATALOG = False
|
||||
OVERVIEW_FILTER = None
|
||||
|
||||
@@ -44,7 +44,7 @@ h1.ui.header.no-margin-bottom {
|
||||
color: #AA4643;
|
||||
}
|
||||
|
||||
.ui.label.failed {
|
||||
.ui.label.failed, .ui.label.events.failure {
|
||||
background-color: #AA4643;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ h1.ui.header.no-margin-bottom {
|
||||
color: #4572A7;
|
||||
}
|
||||
|
||||
.ui.label.changed {
|
||||
.ui.label.changed, .ui.label.events.success {
|
||||
background-color: #4572A7;
|
||||
}
|
||||
|
||||
@@ -68,15 +68,11 @@ h1.ui.header.no-margin-bottom {
|
||||
color: #DB843D;
|
||||
}
|
||||
|
||||
.ui.label.noop {
|
||||
.ui.label.noop, .ui.label.events.noop {
|
||||
background-color: #DB843D;
|
||||
}
|
||||
|
||||
.ui.header.total {
|
||||
color: #989898;
|
||||
}
|
||||
|
||||
.ui.label.total {
|
||||
.ui.label.resources.total {
|
||||
background-color: #989898;
|
||||
}
|
||||
|
||||
@@ -88,7 +84,7 @@ h1.ui.header.no-margin-bottom {
|
||||
color: orange;
|
||||
}
|
||||
|
||||
.ui.label.skipped {
|
||||
.ui.label.skipped, .ui.label.resources.skipped {
|
||||
background-color: orange;
|
||||
}
|
||||
|
||||
|
||||
@@ -62,11 +62,11 @@
|
||||
{% if status == 'unreported' %}
|
||||
<span class="ui label status"> {{ unreported_time|upper }} </span>
|
||||
{% else %}
|
||||
<span title="Total resources" class="ui small count label{% if metrics.resources.total %} total">{{ metrics.resources.total }}{% else %}">0{% endif%}</span>
|
||||
<span title="Failure events" class="ui small count label{% if metrics.events.failure %} failed">{{ metrics.events.failure }}{% else %}">0{% endif%}</span>
|
||||
<span title="Success events" class="ui small count label{% if metrics.events.success %} changed">{{ metrics.events.success }}{% else %}">0{% endif%}</span>
|
||||
<span title="Skipped resources" class="ui small count label{% if metrics.resources.skipped %} skipped">{{ metrics.resources.skipped }}{% else %}">0{% endif%}</span>
|
||||
<span title="Noop events" class="ui small count label{% if metrics.events.noop %} noop">{{ metrics.events.noop }}{% else %}">0{% endif%}</span>
|
||||
{% for metric in config.DISPLAYED_METRICS %}
|
||||
{% set path = metric.split('.') %}
|
||||
{% set title = ' '.join(path) %}
|
||||
<span title="{{ title }}" class="ui small count label{% if metrics[path[0]] and metrics[path[0]][path[1]] %} {{ title }}">{{ "%.2g"|format(metrics[path[0]][path[1]]) }}{% else %}">0{% endif%}</span>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{%- endmacro %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user