Switch the interface to Semantic-UI.

This commit is contained in:
Daniele Sluijters
2014-03-13 11:49:24 +01:00
parent ce4c7a26cd
commit bcb45c24a4
17 changed files with 327 additions and 408 deletions

View File

@@ -1,11 +1,5 @@
{% extends 'layout.html' %}
{% block row_fluid %}
<div class="container" style="margin-bottom:55px;">
<div class="row">
<div class="span12">
<h2>Bad Request</h2>
<p>The request sent to PuppetDB was invalid. This is usually caused by using an unsupported operator.</p>
</div>
</div>
</div>
{% block content %}
<h1>Bad Request</h1>
<p>The request sent to PuppetDB was invalid. This is usually caused by using an unsupported operator.</p>
{% endblock %}

View File

@@ -1,11 +1,5 @@
{% extends 'layout.html' %}
{% block row_fluid %}
<div class="container" style="margin-bottom:55px;">
<div class="row">
<div class="span12">
<h2>Permission Denied</h2>
<p>What you were looking for has been disabled by the administrator.</p>
</div>
</div>
</div>
{% block content %}
<h1>Permission Denied</h1>
<p>What you were looking for has been disabled by the administrator.</p>
{% endblock %}

View File

@@ -1,11 +1,5 @@
{% extends 'layout.html' %}
{% block row_fluid %}
<div class="container" style="margin-bottom:55px;">
<div class="row">
<div class="span12">
<h2>Not Found</h2>
<p>What you were looking for could not be found in PuppetDB.</p>
</div>
</div>
</div>
{% block content%}
<h1>Not Found</h1>
<p>What you were looking for could not be found in PuppetDB.</p>
{% endblock %}

View File

@@ -1,16 +1,10 @@
{% extends 'layout.html' %}
{% block row_fluid %}
<div class="container" style="margin-bottom:55px;">
<div class="row">
<div class="span12">
<h2>Internal Server Error</h2>
<p>This error usually occurs because:
<ul>
<li>We were unable to reach PuppetDB;</li>
<Li>The query to be executed was malformed resulting in an incorrectly encoded request.</li>
</ul></p>
<p>Please have a look at the log output for further information.</p>
</div>
</div>
</div>
{% block content %}
<h2>Internal Server Error</h2>
<p>This error usually occurs because:
<ul>
<li>We were unable to reach PuppetDB;</li>
<Li>The query to be executed was malformed resulting in an incorrectly encoded request.</li>
</ul></p>
<p>Please have a look at the log output for further information.</p>
{% endblock %}

View File

@@ -1,8 +1,8 @@
{% macro facts_table(facts, autofocus=False, condensed=False, show_node=False, show_value=True, link_facts=False, margin_top=20, margin_bottom=20) -%}
<div class="filter" style="margin-bottom:{{margin_bottom}}px;margin-top:{{margin_top}}px;">
<input {% if autofocus %} autofocus="autofocus" {% endif %} style="width:100%" type="text" class="filter-table input-medium search-query" placeholder="Type here to filter">
<div class="ui fluid icon input hide" style="margin-bottom:20px">
<input {% if autofocus %} autofocus="autofocus" {% endif %} class="filter-table" placeholder="Type here to filter...">
</div>
<table class="filter-table facts table table-striped {% if condensed %}table-condensed{% endif%}" style="table-layout:fixed">
<table class="filter-table facts ui basic table facts {% if condensed %}compact{% endif%}" style="table-layout: fixed;">
<thead>
<tr>
{% if show_node %}
@@ -96,10 +96,10 @@
{%- endmacro %}
{% macro reports_table(reports, nodename, condensed=False, hash_truncate=False, show_conf_col=True, show_agent_col=True, show_host_col=True) -%}
<div class="alert alert-info">
<div class="ui info message">
Only showing the last ten reports.
</div>
<table class='table table-striped {% if condensed %}table-condensed{% endif %}'>
<table class='ui table basic {% if condensed %}compact{% endif %}'>
<thead>
<tr>
<th>Start time</th>
@@ -119,7 +119,7 @@
<tbody>
{% for report in reports %}
{% if hash_truncate %}
{% set rep_hash = "%s&hellip;"|format(report.hash_[0:6])|safe %}
{% set rep_hash = "%s&hellip;"|format(report.hash_[0:10])|safe %}
{% else %}
{% set rep_hash = report.hash_ %}
{% endif %}
@@ -139,7 +139,7 @@
<td>{{report.agent_version}}</td>
{% endif %}
{% if show_host_col %}
<td>{{nodename}}</td>
<td><a href="{{url_for('node', node_name=report.node)}}">{{ report.node }}</a></td>
{% endif %}
</tr>
{% endfor %}

View File

@@ -2,8 +2,8 @@
{% import '_macros.html' as macros %}
{% block content %}
<h1>{{name}}{% if value %}/{{value}}{% endif %} ({{facts|length}})</h1>
{{macros.facts_graph(facts, autofocus=True, show_node=True, margin_bottom=10)}}
{{macros.facts_graph_value(facts, autofocus=True, show_node=True, margin_bottom=10)}}
{#{{macros.facts_graph(facts, autofocus=True, show_node=True, margin_bottom=10)}}#
{{macros.facts_graph_value(facts, autofocus=True, show_node=True, margin_bottom=10)}}#}
{% if value %}
{{macros.facts_table(facts, autofocus=True, show_node=True, show_value=False, margin_bottom=10)}}
{% else %}

View File

@@ -1,11 +1,11 @@
{% extends 'layout.html' %}
{% block content %}
<div class="hide" style="margin-bottom:20px">
<input autofocus="autofocus" style="width:100%" type="text" class="filter-list input-medium search-query" placeholder="Type here to filter">
<div class="ui fluid icon input hide" style="margin-bottom:20px">
<input autofocus="autofocus" class="filter-list" placeholder="Type here to filter...">
</div>
<div style="-moz-column-count:4; -webkit-column-count:4; column-count:4;">
{%- for key,facts_list in facts_dict %}
<span class='label label-success'>{{key}}</span>
<span class='ui label purple'>{{key}}</span>
<ul class="searchable">
{%- for fact in facts_list %}
<li><a href="{{url_for('fact', fact=fact)}}">{{fact}}</a></li>

View File

@@ -1,102 +1,106 @@
{% extends 'layout.html' %}
{% block row_fluid %}
<div class="container" style="margin-bottom:55px;">
<div class="row">
<div class="span12">
<div class="span4 stat">
<a href="nodes?status=failed">
<h1 class="error">{{stats['failed']}}
<small>{% if stats['failed']== 1 %} node {% else %} nodes {% endif %}</small>
</h1>
</a>
<span>with status failed</span>
</div>
<div class="span4 stat">
<a href="nodes?status=changed">
<h1 class="success">{{stats['changed']}}
<small>{% if stats['changed']== 1 %} node {% else %} nodes {% endif %}</small>
</h1>
</a>
<span>with status changed</span>
</div>
<div class="span4 stat">
<a href="nodes?status=unreported">
<h1 class="noop">{{ stats['unreported'] }}
<small>{% if stats['unreported']== 1 %} node {% else %} nodes {% endif %}</small>
</h1>
</a>
<span>
unreported in the last {{ config.UNRESPONSIVE_HOURS }} hours
</span>
</div>
{% block content %}
<div class="ui vertical grid">
<div class="three column row">
<div class="column">
<a href="nodes?status=failed">
<h1 class="ui red header no-margin-bottom">
{{stats['failed']}}
<small>{% if stats['failed']== 1 %} node {% else %} nodes {% endif %}</small>
</h1>
</a>
<span>with status failed</span>
</div>
<div class="column">
<a href="nodes?status=changed">
<h1 class="ui header green no-margin-bottom">
{{stats['changed']}}
<small>{% if stats['changed']== 1 %} node {% else %} nodes {% endif %}</small>
</h1>
</a>
<span>with status changed</span>
</div>
<div class="column">
<a href="nodes?status=unreported">
<h1 class="ui header black no-margin-bottom">
{{ stats['unreported'] }}
<small>{% if stats['unreported']== 1 %} node {% else %} nodes {% endif %}</small>
</h1>
</a>
<span>unreported in the last {{ config.UNRESPONSIVE_HOURS }} hours</span>
</div>
</div>
<div class="row">
<div class="span12">
<div class="span4 stat">
<h1>{{metrics['num_nodes']}}</h1>
<span>Population</span>
</div>
<div class="span4 stat">
<h1>{{metrics['num_resources']}}</h1>
<span>Resources managed</span>
</div>
<div class="span4 stat">
<h1>{{metrics['avg_resources_node']}}</h1>
<span>Avg. resources/node</span>
</div>
<div class="three column row">
<div class="column">
<h1 class="ui header purple no-margin-bottom">{{metrics['num_nodes']}}</h1>
<span>Population</span>
</div>
<div class="column">
<h1 class="ui header purple no-margin-bottom">{{metrics['num_resources']}}</h1>
<span>Resources managed</span>
</div>
<div class="column">
<h1 class="ui header purple no-margin-bottom">{{metrics['avg_resources_node']}}</h1>
<span>Avg. resources/node</span>
</div>
</div>
<div class="row">
<div class="span12">
<div class="ui divider">
</div>
<div class="one column row no-margin-top">
<div class="column">
{% if nodes %}
<h2>Nodes status detail ({{nodes|length}})</h2>
<table class='dashboard table table-striped table-condensed'>
<thead>
<tr>
<th style="min-width:220px;">Status</th>
<th style="width:600px;">Hostname</th>
<th style="width:120px;"></th>
</tr>
</thead>
<tbody class="searchable">
{% for node in nodes %}
{% if node.status != 'unchanged' %}
<tr>
<td>
<a href="{{url_for('report_latest', node_name=node.name)}}">
<span class="label label-status label-{{node.status}}">{{node.status}}</span>
</a>
{% if node.status=='unreported'%}
<span class="label label-time label-unreported"> {{ node.unreported_time }} </label>
{% else %}
{% if node.events['failures'] %}<span class="label label-important label-count">{{node.events['failures']}}</span>{% else %}<span class="label label-count">0</span>{% endif%}
{% if node.events['successes'] %}<span class="label label-success label-count">{{node.events['successes']}}</span>{% else %}<span class="label label-count">0</span>{% endif%}
{% endif %}
</td>
<td><a href="{{url_for('node', node_name=node.name)}}">{{ node.name }}</a></td>
<td>
{% if node.unreported_time != None or node.status != 'unreported' %}
<a class="btn btn-small btn-primary btn-lastreport" href="{{url_for('report_latest', node_name=node.name)}}">Latest Report</a>
{% else %}
<a class="btn btn-small btn-lastreport"> No Report </a>
<h2>Nodes status detail ({{nodes|length}})</h2>
<table class='ui compact basic table dashboard'>
<thead>
<tr>
<th class="five wide">Status</th>
<th class="ten wide">Hostname</th>
<th class="one wide"></th>
</tr>
</thead>
<tbody class="searchable">
{% for node in nodes %}
{% if node.status != 'unchanged' %}
<tr>
<td>
<a class="ui small status label
{% if node.status == 'failed' %}
red
{% elif node.status == 'changed' %}
green
{% elif node.status == 'unreported' %}
black
{% endif %}
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
" href="{{url_for('report_latest', node_name=node.name)}}">
{{node.status}}
</a>
{% if node.status=='unreported'%}
<span class="ui small label status"> {{ node.unreported_time }} </label>
{% else %}
{% if node.events['failures'] %}<span class="ui small count label red">{{node.events['failures']}}</span>{% else %}<span class="ui small count label">0</span>{% endif%}
{% if node.events['successes'] %}<span class="ui small count label green">{{node.events['successes']}}</span>{% else %}<span class="ui small count label">0</span>{% endif%}
{% endif %}
</td>
<td>
<a href="{{url_for('node', node_name=node.name)}}">{{ node.name }}</a>
</td>
<td>
<a title="Latest Report" href="{{url_for('report_latest', node_name=node.name)}}">
<i class="large tasks purple icon"></i>
</a>
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
{% else %}
<h2>Nodes status detail</h2>
<div class="alert alert-info">
Nothing seems to be changing.
</div>
<h2>Nodes status detail</h2>
<div class="ui info message">
Nothing seems to be changing.
</div>
{% endif %}
</div>
</div>
</div>
{% endblock row_fluid %}
{% endblock content %}

View File

@@ -2,66 +2,52 @@
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Puppet&#7427;oard</title>
<link href="//netdna.bootstrapcdn.com/bootswatch/2.3.2/flatly/bootstrap.min.css" rel="stylesheet">
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css" rel="stylesheet">
<link href="{{url_for('static', filename='css/puppetboard.css')}}" rel="stylesheet">
<title>Puppetboard</title>
<link href="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/0.12.0/css/semantic.min.css" rel="stylesheet">
<link href='//fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<link href="//cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.13.3/css/filter.formatter.css" rel="stylesheet">
<link href="{{ url_for('static', filename='css/puppetboard.css')}}" rel="stylesheet">
</head>
<body>
<div style="font-variant:small-caps" class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<span style="margin-top:-2px;" class="brand">Puppetboard</span>
<div class="nav-collapse collapse">
<ul class="nav">
{%- for endpoint, caption in [
('index', 'Overview'),
('nodes', 'Nodes'),
('facts', 'Facts'),
('reports', 'Reports'),
('metrics', 'Metrics'),
('query', 'Query'),
] %}
<li{% if endpoint == request.endpoint %} class=active{% endif
%}><a href="{{ url_for(endpoint) }}">{{ caption }}</a></li>
{%- endfor %}
</ul>
</div>
</div>
<nav class="ui fixed purple inverted menu">
<div class="title item">
Puppetboard
</div>
</div>
{% block container %}
<div class="container-fluid" style="margin-bottom:55px;">
<div class="row-fluid">
{% block row_fluid %}
<div class="span12">
{% block content %} {% endblock content %}
</div>
{% endblock row_fluid %}
</div>
</div>
{% endblock container %}
<div class="navbar navbar-fixed-bottom" style="background-color:rgb(249, 249, 249);">
<div class="navbar" style="height:55px;margin-bottom:0;">
<div class="container-fluid" style="line-height:55px;">
Copyright © 2013 <a href="https://github.com/daenney">Daniele Sluijters</a>. <span style="float:right">Live from PuppetDB.</span>
</div>
{%- for endpoint, caption in [
('index', 'Overview'),
('nodes', 'Nodes'),
('facts', 'Facts'),
('reports', 'Reports'),
('metrics', 'Metrics'),
('query', 'Query'),
] %}
<a {% if endpoint == request.endpoint %} class="active item" {% else %} class="item" {% endif %}
href="{{ url_for(endpoint) }}">{{ caption }}</a>
{%- endfor %}
</nav>
<div class="ui grid padding-bottom">
<div class="one wide column"></div>
<div class="fourteen wide column">
{% block content %} {% endblock content %}
</div>
<div class="one wide column"></div>
</div>
<script src="//code.jquery.com/jquery-1.10.0.min.js"></script>
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script src="//cdn.jsdelivr.net/tablesorter/2.0.3/jquery.tablesorter.min.js"></script>
<script src="{{ url_for('static', filename='js/moment.js')}}"></script>
<footer class="ui absolute fixed bottom">
<div>
Copyright © 2013-2014 <a href="https://github.com/daenney">Daniele Sluijters</a>. <span style="float:right">Live from PuppetDB.</span>
</div>
</footer>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/0.12.0/javascript/semantic.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.5.0/moment.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.13.3/jquery.tablesorter.min.js"></script>
<script src="{{ url_for('static', filename='js/timestamps.js')}}"></script>
<script src="{{url_for('static', filename='js/tables.js')}}"></script>
<script src="{{url_for('static', filename='js/lists.js')}}"></script>
<script src="{{url_for('static', filename='js/tables.js')}}"></script>
{% block script %} {% endblock script %}
</body>
</html>

View File

@@ -2,11 +2,21 @@
{% block content %}
<div class="page-header">
<h1>Metric
{% set name = "%s&hellip;"|format(name[:75])|safe if name|length > 75%}
{% if name|length > 75 %}
{% set name = "%s&hellip;"|format(name[:75])|safe %}
{% else %}
{% set name = name %}
{% endif %}
<small>{{name}}</small>
</h1>
</div>
<table class="table table-striped">
<table class="ui segment table">
<thead>
<tr>
<th>Option</th>
<th>Value</th>
</tr>
</thead>
<tbody>
{% for key,value in metric %}
<tr>

View File

@@ -1,37 +1,39 @@
{% extends 'layout.html' %}
{% import '_macros.html' as macros %}
{% block content %}
<div class="row-fluid">
<div class="span12">
<h1>Details</h1>
<table class="table table-striped table-condensed" style="table-layout:fixed">
<thead>
<tr>
<th>Hostname</th>
<th>Facts uploaded at</th>
<th>Catalog compiled at</th>
<th>Report uploaded at</th>
</tr>
</thead>
<tbody>
<tr>
<td style="word-wrap:break-word"><b>{{node.name}}</b></td>
<td rel="utctimestamp">{{node.facts_timestamp}}</td>
<td rel="utctimestamp">{{node.catalog_timestamp}}</td>
<td rel="utctimestamp">{{node.report_timestamp}}</td>
</tr>
</tbody>
</table>
<div class='ui two column grid'>
<div class='column'>
<div class='row'>
<h1>Details</h1>
<table class="ui table compact basic">
<tbody>
<tr>
<th>Hostname</th>
<td style="word-wrap:break-word"><b>{{node.name}}</b></td>
</tr>
<tr>
<th>Facts &nbsp;&nbsp;&nbsp;&nbsp;<i title='uploaded at' class=' upload icon'></i></th>
<td rel="utctimestamp">{{node.facts_timestamp}}</td>
</tr>
<tr>
<th>Catalog <i title='uploaded at' class=' upload icon'></i></th>
<td rel="utctimestamp">{{node.catalog_timestamp}}</td>
</tr>
<tr>
<th>Report &nbsp;<i title='uploaded at' class=' upload icon'></i></th>
<td rel="utctimestamp">{{node.report_timestamp}}</td>
</tr>
</tbody>
</table>
</div>
<div class='row'>
<h1>Reports</h1>
{{ macros.reports_table(reports, node.name, condensed=True, hash_truncate=True, show_conf_col=False, show_agent_col=False, show_host_col=False)}}
</div>
</div>
</div>
<div class="row-fluid">
<div class="span6">
<div class='column'>
<h1>Facts</h1>
{{macros.facts_table(facts, link_facts=True, condensed=True, margin_top=10)}}
</div>
<div class="span6">
<h1>Reports</h1>
{{ macros.reports_table(reports, node.name, condensed=True, hash_truncate=True, show_conf_col=False, show_agent_col=False, show_host_col=False)}}
{{macros.facts_table(facts, link_facts=True, condensed=True)}}
</div>
</div>
{% endblock content %}

View File

@@ -1,56 +1,53 @@
{% extends 'layout.html' %}
{% block content %}
<div class="alert alert-info">
PuppetDB currently only returns active nodes.
<div class="ui fluid icon input hide" style="margin-bottom:20px">
<input autofocus="autofocus" class="filter-table" placeholder="Type here to filter...">
</div>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
<div class="alert alert-{{category}}">
{{message}}
</div>
{% endfor %}
{% endif %}
{% endwith %}
<div class="hide" style="margin-bottom:20px">
<input autofocus="autofocus" style="width:100%" type="text" class="filter-table input-medium search-query" placeholder="Type here to filter">
</div>
<table class='nodes table table-striped table-condensed'>
<table class='ui compact basic table nodes'>
<thead>
<tr>
<th>Status</th>
<th>Hostname</th>
<th>Catalog compiled at</th>
<th>Last report</th>
<th>Catalog</th>
<th>Report</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody class="searchable">
{% for node in nodes %}
<tr>
<td><a href="{{url_for('report_latest', node_name=node.name)}}">
<span class="label label-status label-{{ node.status }}">{{ node.status }}</span>
</a>
{% if node.status=='unreported'%}
<span class="label label-time label-unreported"> {{ node.unreported_time }} </label>
{% else %}
{% if node.events['failures'] %}<span class="label label-count label-important">{{node.events['failures']}}</span>{% else %}<span class="label label-count">0</span>{% endif%}
{% if node.events['successes'] %}<span class="label label-count label-success">{{node.events['successes']}}</span>{% else %}<span class="label label-count">0</span>{% endif%}
{% endif %}
<td>
<a class="ui small status label
{% if node.status == 'failed' %}
red
{% elif node.status == 'changed' %}
green
{% elif node.status == 'unreported' %}
black
{% endif %}
" href="{{url_for('report_latest', node_name=node.name)}}">
{{node.status}}
</a>
{% if node.status=='unreported'%}
<span class="ui small label status"> {{ node.unreported_time }} </label>
{% else %}
<span>{% if node.events['failures'] %}<span class="ui small count label red">{{node.events['failures']}}</span>{% else %}<span class="ui small count label">0</span>{% endif%}
{% if node.events['successes'] %}<span class="ui small count label green">{{node.events['successes']}}</span>{% else %}<span class="ui small count label">0</span>{% endif%}</span>
{% endif %}
</td>
<td><a href="{{url_for('node', node_name=node.name)}}">{{node.name}}</a></td>
<td rel="utctimestamp">{{node.catalog_timestamp}}</td>
<td>
{% if node.report_timestamp %}
<span rel="utctimestamp">{{ node.report_timestamp }}</span>
<a href="{{url_for('report_latest', node_name=node.name)}}" rel='utctimestamp'>{{ node.report_timestamp }}</a>
{% else %}
<i class="icon icon-ban-circle"></i>
<i class="large ban circle icon"></i>
{% endif %}
</td>
<td>
{% if node.report_timestamp %}
<a class="btn btn-small btn-primary" href="{{url_for('report_latest', node_name=node.name)}}">Latest Report</a>
<a class="btn btn-small btn-primary" href="{{url_for('reports_node', node=node.name)}}">Reports</a>
<a title='Reports' href="{{url_for('reports_node', node=node.name)}}"><i class='large purple book icon'></i></a>
<i class='large purple trash icon'></i>
{% endif %}
</td>
</tr>

View File

@@ -1,61 +1,43 @@
{% extends 'layout.html' %}
{% block row_fluid %}
<div class="span12">
<div class="alert">
This is highly experimental and will likely set your server on fire.
</div>
{% block content %}
<h2>Compose</h2>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
<div class="ui {{category}} message">
{{message}}
</div>
<div class="container" style="margin-bottom:55px;">
<div class="row">
<div class="span12">
<h2>Compose</h2>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
<div class="alert alert-{{category}}">
{{message}}
{% endfor %}
{% endif %}
{% endwith %}
<div class="ui form">
<form method="POST" action="{{ url_for('query')}}"
{{ form.csrf_token }}
<div class="field {% if form.query.errors %} error {% endif %}">
{{form.query(autofocus="autofocus", rows=5, placeholder="Enter your query: [\"=\", \"name\", \"hostname\"]. You may omit the opening and closing bracket.")}}
</div>
<div class="inline fields">
{% for subfield in form.endpoints %}
<div class="field">
<div class="ui radio checkbox">
{{subfield }}
{{subfield.label}}
</div>
</div>
{% endfor %}
{% endif %}
{% endwith %}
<form class="form-horizontal" method="POST" action="{{ url_for('query')}}">
{{ form.csrf_token }}
<div class="control-group {% if form.query.errors %} error {% endif %}">
{{form.query.label(class_="control-label")}}
<div class="controls">
{{form.query(class_="input-block-level", autofocus="autofocus", rows=5, placeholder="\"=\", \"name\", \"hostname\"")}}
{% if form.query.errors %}
<span class="help-inline">{% for error in form.query.errors %}{{error}}{% endfor %}</span>
{% endif %}
</div>
</div>
<div class="control-group {% if form.endpoints.errors %} error {% endif %}">
{{form.endpoints.label(class_="control-label")}}
<div class="controls">
{% for subfield in form.endpoints %}
{{subfield.label(class_="radio inline")}}
{{subfield }}
{% endfor %}
{% if form.endpoints.errors %}
<span class="help-inline">{% for error in form.endpoints.errors %}{{error}}{% endfor %}</span>
{% endif %}
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary">Yes I'm sure</button>
<button type="button" class="btn">No thanks</button>
</div>
{{ form.hidden_tag() }}
</form>
</div>
</div>
{% if result %}
<div class="row">
<div class="span12">
<h2>Result</h2>
<pre><code>{{result|jsonprint}}</code></pre>
</div>
</div>
{% endif %}
{{ form.hidden_tag() }}
<input type=submit class="ui purple submit button" value='Submit'>
<input type=reset class="ui red submit button" value='Cancel'>
</form>
</div>
{% endblock row_fluid %}
{% if result %}
<div class="row">
<div class="span12">
<h2>Result</h2>
<pre><code>{{result|jsonprint}}</code></pre>
</div>
</div>
{% endif %}
{% endblock content %}

View File

@@ -1,7 +1,7 @@
{% extends 'layout.html' %}
{% block content %}
<h1>Summary</h1>
<table class='table table-striped'>
<table class='ui basic table'>
<thead>
<tr>
<th>Hostname</th>
@@ -27,7 +27,7 @@
</table>
<h1>Events</h1>
<table class='table table-striped table-condensed'>
<table class='ui basic table compact'>
<thead>
<tr>
<th>Resource</th>
@@ -39,22 +39,22 @@
<tbody>
{% for event in events %}
{% if not event.failed and event.item['old'] != event.item['new'] %}
<tr id='event-{{loop.index}}' class='success event'>
<tr id='event-{{loop.index}}' class='positive'>
{% elif event.failed %}
<tr id='event-{{loop.index}}' class='error event'>
<tr id='event-{{loop.index}}' class='error'>
{% endif %}
<td>{{event.item['type']}}[{{event.item['title']}}]</td>
<td>{{event.status}}</td>
<td>{{event.item['old']}}</td>
<td>{{event.item['new']}}</td>
</tr>
<tr>
{# <tr>
<td class='message' colspan='4'>
<div id='message-event-{{loop.index}}'>
{{event.item['message']}}
</div>
</td>
</tr>
</tr>#}
{% endfor %}
</tbody>
</table>

View File

@@ -1,6 +1,6 @@
{% extends 'layout.html' %}
{% block content %}
<div class="alert">
<div class="ui warning message">
Pending <a href="http://projects.puppetlabs.com/issues/21600">#21600</a>. You can access reports for a node or individual reports through the <a href="{{url_for('nodes')}}">Nodes</a> tab.
</div>
{% endblock content %}