Fix 412 template to use standard styling that the other 400 templates use.
Update forbidden error to return status code 403 instead of 400.
Signed-off-by: Mike Terzo <mike@terzo.org>
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.
* Create a custom class to handle aborting 204 properly. If this isn't
covered the server will send a 500 due to a python exception
* Moved py.test configuration under tool:pytest, this was causing a
warning. This is new to 3.0.1 which is now the pinned version
* Unittest for puppetboard.utils
This resolves#276
Current behaviour of the Facts page would query the fact_names endpoint
regardless of environment. This update would query the Facts endpoint,
extracting each unique fact name known to the environment.
This fixed#290
To help make it more obvious for users to see what the current environment
is replacing the original text of the Environments dropdown menu from
'Environments' to the current environment.
The other suggestion was to make the active item stand out more but that
would require custom CSS that may conflict with the Sementic UI.
* puppetboard/app.py: Simplifying the code generating and rendering the Inventory
This resolves#275
This update eliminates one iteration over the resulting inventory facts
that generates a multidimensional dictionary keyed by the node's certname
to another dictionary of key-value pairs of the fact name and fact value.
* puppetboard/templates/inventory.html: Wrapping the fact values in links to the Node page
This comes as a request from #280
* puppetboard/app.py: Enhancing queries for Node and Report states
This resolves#264
On the Nodes and Reports tabs when the user adds a status query string
argument additional query clauses are generated based on its value.
Can be one of failed, changed, unchanged, noop or unreported (for Nodes
only)
No query clause is generated for noop on the Nodes tab. The query field
latest_report_noop was added in PuppetDB 4.1 and we do not want to break
compatability between minor or bug-fix versions.
* puppetboard/app.py: Simplifying the query logic in nodes()
The new logic starts with a blank `AndOperator()` object then proceeds
to build the query based on environment and status values. After all
after all checking if there are no operations declare the object as
None.
* puppetboard/app.py: Simplifying the query logic for reports()
Similar to the work done for nodes()
* puppetboard/app.py: Fixing pep8 formatting in nodes()
* Add pagination to reports/<node>