-
-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Facts revamp with datatables. #357
Conversation
Port of #356 fix with the new template. Add this case to the tests. |
1 similar comment
On #356 subject. Python3 returned me
Solved by adding a jinja2 filter used in a map before groupby. |
Rebased. |
JSON is a first class citizen in Python, why choose to generate JSON in a template rather than pure Python code in the fact_ajax function? |
Honestly, I don't know. Now that you said it, it really seems legit. |
If the data isn't quite the same as you want in the client the template makes some sense. |
No preference on my side. Let me know if you prefer me to amend those PR's or if you think we can postpone it to do all of these in one pass. |
puppetboard/app.py
Outdated
node for which this fact is known. | ||
|
||
:param env: Searches for facts in this environment | ||
:type env: :obj:`string` | ||
:param fact: Find all facts with this name | ||
:type fact: :obj:`string` | ||
:param fact: Find all facts with this value | ||
:type fact: :obj:`string` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doc should reference the value
parameter, not the fact
parameter.
In the long run if the python can directly output JSON data then that's far less code for this project to maintain. |
Removed facts query to let only fact-names. facts query time grow pretty quickly with number of nodes. Drawback: no filter on environment (which seems acceptable) Add testing about view and column repartition (broken in jinja2 2.9.X / inner loop variables). Rework facts page (jinja 2.9 compliant)
Created a custom template_filter as in python3, the groupby filter cannot order Bool vs Str. Needed to push format before the groupby which is not currently possible in jinja.
1 similar comment
Refactored JSON generation in python. It is cleaner than jinja for sure. Also rebased on master. |
Like inventory, ordering by fact value is not possible for facts.
On /facts -
On /fact
On /node