Skip to content

Commit

Permalink
refactoring ui
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffsu committed Sep 12, 2012
1 parent f3d8952 commit eac83e1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
1 change: 0 additions & 1 deletion www/htime.ms
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export class HumanTime {
var ret = [];
foreach (var v:i in VALS) {
var amount = Math.floor(ms / v);
console.log(UNITS[i], ms / v, ms, v);
ms -= amount * v;
if (amount > 0 || i == 3) ret.push(amount + UNITS[i]);
}
Expand Down
3 changes: 2 additions & 1 deletion www/views/_services.jade
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ table.table.table-condensed.table-bordered
tr.success
th Service
th Sensor
th Status
th(colspan=2) Status
th Pass/Total
th Last Pass
th Last Failure
Expand All @@ -22,6 +22,7 @@ table.table.table-condensed.table-bordered
td(style="padding-left: 20px"): a(href="/services/#{sname}/sensors/#{name}?time=min")= name
td
!= health(sensor.isHealthy)
td
span.inlinesparkline= sensor.getAvgResponse('hour').join(',');
td #{sensor.passCount}/#{sensor.totalCount}
td= htime.humanizeAgo(sensor.lastPass);
Expand Down
8 changes: 2 additions & 6 deletions www/views/sensor.jade
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,10 @@ block content
tr
th Uptime
td
| Total: #{sensor.getUpTime()}ms
if sensor.isHealthy
| since #{(new Date).getTime() - sensor.lastChange}ms ago
| #{htime.humanize(sensor.getUpTime())}
th Downtime
td
| Total: #{sensor.getDownTime()}ms
unless sensor.isHealthy
| since #{(new Date).getTime() - sensor.lastChange}ms ago
| #{htime.humanize(sensor.getDownTime())}
tr
td(colspan=4)= "Options: " + JSON.stringify(sensor.options);

Expand Down

0 comments on commit eac83e1

Please sign in to comment.