{% extends 'layout.html' %} {% import '_macros.html' as macros %} {% block head %} {% if config.OFFLINE_MODE %} {% else %} {% endif %} {% endblock head %} {% block content %}

Compose

{% with messages = get_flashed_messages(with_categories=true) %} {% if messages %} {% for category, message in messages %}
{{ message }}
{% endfor %} {% endif %} {% endwith %}
{{ form.csrf_token }}
{{ form.query(autofocus="autofocus", rows=5, placeholder="nodes { certname = \"hostname\" }") }}
API Endpoint: {{ form.endpoints() }}
{{ form.rawjson(active=True) }} Raw (but pretty and colored) JSON
Submit
{% if result or zero_results or error_text %}

Result

{% if result %}

Number of results: {{ result | length }}

{% if form.rawjson.data %}

    
    {% else %}
    
        {% for column in columns %}
            
        {% endfor %}
        
{{ column }}
{% endif %} {% elif zero_results %}
Zero results

The query was successful but the response is empty. Please try changing query conditions.

{% elif error_text %}
Invalid query
{{ error_text }}
{% endif %}
{% endif %} {% endblock content %} {% block onload_script %} {% if not form.rawjson.data %} {% macro extra_options(caller) %} 'columns': [ {% for column in columns %} { "title": "{{ quote_columns_data(column) }}", {% if column in ['node', 'certname'] %} "render": function (data, type, full, meta) { return `${data}` }, {% endif %} }, {% endfor %} ], 'serverSide': false, {% endmacro %} {% if not result %} {% set result = [] %} {% endif %} {{ macros.datatable_init(table_html_id="query_table", ajax_url=None, data=result|tojson, default_length=config.NORMAL_TABLE_COUNT, length_selector=config.TABLE_COUNT_SELECTOR, extra_options=extra_options) }} {% endif %} {% endblock onload_script %}