Files
puppetboard/puppetboard/forms.py
Corey Hammerton 9486adbd14 puppetboard: Squashed commit of the following:
b4f74e240d
Making catalog tables searchable

7a8ddde6ca
Navbar style/naming simplifications

e8fea997fd
Creating Semantic UI Menu for environment switching instead of select menu
2015-11-03 07:34:30 -05:00

34 lines
1.0 KiB
Python

from __future__ import unicode_literals
from __future__ import absolute_import
from flask.ext.wtf import Form
from wtforms import (
HiddenField, RadioField, SelectField,
TextAreaField, validators
)
class QueryForm(Form):
"""The form used to allow freeform queries to be executed against
PuppetDB."""
query = TextAreaField('Query', [validators.Required(
message='A query is required.')])
endpoints = RadioField('API endpoint', choices=[
('nodes', 'Nodes'),
('resources', 'Resources'),
('facts', 'Facts'),
('factsets', 'Fact Sets'),
('fact-paths', 'Fact Paths'),
('fact-contents', 'Fact Contents'),
('reports', 'Reports'),
('events', 'Events'),
('catalogs', 'Catalogs'),
('edges', 'Edges'),
('environments', 'Environments'),
])
class CatalogForm(Form):
"""The form used to compare the catalogs of different nodes."""
compare = HiddenField('compare')
against = SelectField('against')