Disable search which is does not provide any
real functionality since you can't search
for unchanged, noop or changed, nor and can you filter
on <month> <date> since the data is in UTC.
Moved the page type to simple which only shows
<prev> and <next> buttons. Having <numbers>
here makes the tab to wide causing overlay onto the
next column.
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>
This fixes#258
URL quoting is now done in pypuppetdb >= 0.2.3 which contributed to the
metric URL being double-quoted by the time it reached PuppetDB, which
responds with a 404. Instead using the plain-text name to build the
link to metric()
This change is only useful for Docker image building, but for officially
supported packages in PIP this change will cause unnecessary breakage to
existing users. We will have to implement a different approach for configuring
settings in Docker images.
Adding a note to README.rst indicating that an officially supported Docker
image is planned.
Upgrading the following packages to the respected versions:
WTForms==2.1
Flask-WTF==0.12
Werkzeug==0.11.0
Passing newly required metadata to the QueryForm constructor in puppetboard/app.py
Apache >= 2.4 with mod_wsgi experienced a major issue where it would re-generate
the app's secret key on each request. The fix for this turned out to be placing
a permanent statis 'secret_key' value in the wsgi.py. Adding a block in README.rst
on how to implement the user's own secret_key
* puppetboard/app.py: Implementing and utilizing the new PyPuppetDB QueryBuilder
This fixes https://github.com/voxpupuli/puppetboard/issues/239
Replacing all the directly declared query strings with various objects
from the pypuppetdb.QueryBuilder sub-module. Using this Object-Oriented
functionality it is programmatically safer to construct large, complex
queries.
* puppetboard/app.py: Simplifying the environment logic in `node()`
The query in this function will now always be an `AndOperator()` object.
If a specific environment is queried then that constraint is added.
The resulting query difference will be:
env == 'production'
`["and",["=", "environment", "production"],["=", "certname", "puppet01.hammertime.local"]]`
env == '*'
`["and",["=", "certname", "puppet01.hammertime.local"]]`
* puppetboard/app.py: Minor code simplification for more accurate results.
In index() adding the configured OVERVIEW_FILTER query after adding the previous
constraints to num_nodes_query
In inventory() wrapping fact_query in an AndOperator() regardless of environment.
This update makes it more common with other endpoints that only add environment
constraints if an environment is selected.
* requirements.txt: Bumping the pypuppetdb version requirement
* requirements.txt: Bumping pypuppetdb version to new requirement.
* puppetboard/app.py: Fixing module load error.