The Overview will display a bar chart of daily runs, categorized by
report status (changed, unchanged, failed).
The chart data is loaded asynchronously from JSON so it doesn't provoke
a delay in the page load. The data is JSON enconded.
This feature was in the original Puppet Dashboard. The change was
proposed and discussed in issue #308 .
Application changes:
- app.py: New view daily_reports_chart to serve the chart data as JSON.
- dailychart.py: Submodule to query and format the chart data.
Template changes:
- layout.html: New block to add more elements to the HTML header.
- index.html, node.html: Add C3 CSS in header block, add DIV placeholder
for the chart in content block, add dailychart.js (and dependencies)
in script block.
Settings:
- DAILY_REPORTS_CHART_ENABLED: New setting to turn off the charts. By
default is on.
- DAILY_REPORTS_CHART_DAYS: Changes the range of days to display in the
charts.
Javascript changes:
- dailychart.js: New script that loads the JSON data for the chart and
calls C3 to generate a bar chart.
CSS changes:
- puppetboard.css: Set fixed height to the chart container to avoid a
page resize after the chart is loaded.