Skip to content

Commit

Permalink
ping_service information column, date formatting, other minor bugs an…
Browse files Browse the repository at this point in the history
…d improvements
  • Loading branch information
iloire committed Aug 22, 2012
1 parent 8a0cf68 commit d2e3e4c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion webserver/public/js/watchmen.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var watchmen_client = {
//------------------------------------------
if (display_data.services.length){
$("table.sorted").tablesorter({
headers: {7: {sorter: 'percent'}, 8: {sorter: false}},
headers: {8: {sorter: 'percent'}, 9: {sorter: false}},
sortList: self.currentSort
}).bind("sortEnd", function(sorter) {
self.currentSort = sorter.target.config.sortList;
Expand Down
4 changes: 2 additions & 2 deletions webserver/routes/reporting.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ module.exports.add_routes = function (app, storage){
//-------------------------------
app.get('/details', function(req, res){
var max = 100;
var host = req.query ['host'], url = req.query ['url'], port = req.query['port'];
var host = req.query ['host'], service_name = req.query ['service'];
var service = services_loader.load_services().filter(function(service){
return (service.host.host == host && service.url == url && service.host.port == port);
return (service.host.name === host && service.name === service_name);
});
if (!service.length){
return res.end('not found');
Expand Down
21 changes: 12 additions & 9 deletions webserver/views/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<table class="table sorted table-striped table-condensed">
<thead>
<th width="30"></th>
<th width="80">Ping type</th>
<th>Service</th>
<th width="10%"><span title="Average response time (milliseconds)">AVG res. (ms)</span></th>
<th width="70">outages</th>
<th width="15%">last outage</th>
<th width="14%">last outage</th>
<th width="80">warnings</th>
<th width="15%">last warning</th>
<th width="15%">uptime</th>

<th width="100"></th>
<th width="14%">last warning</th>
<th width="14%">uptime</th>
<th width="60"></th>
</thead>
<tbody>

Expand All @@ -22,17 +22,21 @@
<span>{{data.status}}</span>
</td>

<td style="text-align:center">
{{ping_service_name}}
</td>

<td class="hosturl">
<a target="_blank" href="{{host.protocol}}://{{host.host}}:{{host.port}}{{url}}">
{{host.name}} {{url}}
{{host.name}} / {{name}}
</a>
<br />
<span title="ping interval: {{ping_interval}} seconds" class="label">{{ping_interval}}</span>
{{#if warning_if_takes_more_than}}
<span title="response limit (warning): {{warning_if_takes_more_than}} milliseconds" class="label label-warning">{{warning_if_takes_more_than}}</span>
{{/if}}

<span title="successful responses count: {{ok_responses_count}}" class="label label-success">{{data.ok_responses_count}}</span>
<span title="{{data.ok_responses_count}} successful responses" class="label label-success">{{data.ok_responses_count}}</span>

<br />

Expand Down Expand Up @@ -88,11 +92,10 @@
</td>

<td>
<a class="btn primary" href="/details?url={{url}}&host={{host.host}}&port={{host.port}}">details</a>
<a class="btn primary" href="/details?service={{name}}&host={{host.name}}">details</a>
</td>
</tr>
{{/each}}

</tbody>
</table>
</script>
Expand Down
5 changes: 4 additions & 1 deletion webserver/views/partial/display_logs_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ <h3><%=log_type%></h3>
%>
<tr>
<td>
<time class="timeago" datetime="<%=new Date(parseFloat(log.timestamp)).toISOString()%>"><%=new Date(parseFloat(log.timestamp)).toISOString()%></time>
<time class="timeago" datetime="<%=dateformat(log.timestamp)%>">
<%=dateformat(log.timestamp, 'ago')%><br />
<%=dateformat(log.timestamp, 'MMM D YYYY, hh:mm')%>
</time>
</td>
<td>
<span class="<%=log.type%>"><%=log.msg%></span>
Expand Down

0 comments on commit d2e3e4c

Please sign in to comment.