Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion app/views/report.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@
</div>
</div>
<h3>Logs</h3>
<% if @@config['enable_report_highlighting'] %>
<div class='log'>
<% @response['report']['logs'].each do |msg| %><span style="<% if msg['level'] == 'warning' %>color: #c09853;<% elsif msg['level'] == 'err' %>color: #b94a48;<% else %><% end %>"><%= msg['level'] %>: <%= msg['source'] %>: <%= Rack::Utils.escape_html(msg['message']) %></span>
<% @response['report']['logs'].each do |msg| %><span style="<% if msg['level'] == 'warning' %>color: #c09853;<% elsif msg['level'] == 'err' %>color: #b94a48;<% else %><% end %>"><%= msg['level'] %>: <%= msg['source'] %>: <% Rack::Utils.escape_html(msg['message']).each_line do |line| %><% if line != nil %><% if line[0] == '+' %><span class="highlight-add"><%= line %></span><% elsif line[0] == '-' %><span class="highlight-delete"><%= line %></span><% else %><%= line %><% end %><% end %><% end %></span>
<% end %>
</div>
<% else %>
<div class='log'>
<% @response['report']['logs'].each do |msg| %><span style="<% if msg['level'] == 'warning' %>color: #c09853;<% elsif msg['level'] == 'err' %>color: #b94a48;<% else %><% end %>"><%= msg['level'] %>: <%= msg['source'] %>: <%= Rack::Utils.escape_html(msg['message']) %><% end %></span>
</div>
<% end %>
<% if @response['report']['status'] != 'failed' %>
<h3>Time</h3>
<div class='tabular'>
Expand Down
8 changes: 8 additions & 0 deletions public/stylesheet.css
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,11 @@ table > tbody > tr:nth-of-type(odd) {
padding: 3px;
font-family: "Monaco", "Courier New", Courier, fixed-width;
}

.highlight-add {
background-color: #006600;
}

.highlight-delete {
background-color: #880000;
}
3 changes: 3 additions & 0 deletions puppet-singularity.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@
# Will gzip every report. Saves a lot of space and does not generate a lot more viewing overhead.
compress_every_report: true

# Highlight file additions and deletions in report view
enable_report_highlighting: false

reports_dir: /var/puppet-singularity/reports
error_dir: /var/puppet/singularity/errors