diff --git a/lib/riemann/dash/public/eventPane.js b/lib/riemann/dash/public/eventPane.js index e52aa77..ada8973 100644 --- a/lib/riemann/dash/public/eventPane.js +++ b/lib/riemann/dash/public/eventPane.js @@ -5,17 +5,19 @@ var eventPane = (function() { var fixedFields = ['host', 'service', 'time', 'state', 'metric', 'ttl', 'description', 'tags']; var fixedTemplate = _.template( - '
{{-host}}
' + - '
{{-service}}
' + - '
{{-state}}
' + - '
{{-metric}}
' + + '
' + + '{{-host}}' + + '{{-service}}' + + '{{-state}}' + + '{{-metric}}' + '' + - '
{{-ttl}}
' + - '
{{-tags}}
' + - '
{{-description}}'); + '{{-ttl}}' + + '{{-tags}}' + + '
' + + '
{{-description}}
'); var rowTemplate = - _.template("{{-field}}{{-value}}"); + _.template('{{-field}}{{-value}}'); // Hide the pane var hide = function() { @@ -45,14 +47,18 @@ var eventPane = (function() { tags: "nil", description: "nil"}))); - var table = el.append('
'); + var table = '' // Remaining fields _.each(event, function(value, field) { if (! _.contains(fixedFields, field)) { - table.append(rowTemplate({field: field, value: value})); + table += rowTemplate({field: field, value: value}); } }); + + table += '
'; + + el.append(table); }; // Hide on escape. diff --git a/lib/riemann/dash/public/format.js b/lib/riemann/dash/public/format.js index adb7b87..192a556 100644 --- a/lib/riemann/dash/public/format.js +++ b/lib/riemann/dash/public/format.js @@ -6,7 +6,11 @@ var format = (function() { } precision = precision || 2; var base = Math.pow(10, precision); - var val = Math.round(number * base) / base; + var val; + if (Math.round(number) == number) + val = number; + else + val = number.toFixed(precision); if(!commas) { return val; diff --git a/lib/riemann/dash/views/css.scss b/lib/riemann/dash/views/css.scss index a26bbac..66fe72e 100644 --- a/lib/riemann/dash/views/css.scss +++ b/lib/riemann/dash/views/css.scss @@ -147,7 +147,6 @@ html,table { } * { - float: left; padding: 3px; } @@ -168,12 +167,19 @@ html,table { .tags:before { color: $grey; - content: "tags: "; + content: "tags "; + } + + .field-name { + color: $grey; + text-align: right; } .description { + float: left; clear: both; white-space: pre-wrap; + margin: 3px; } }