Add display of timestamps for when we receive the message

It doesn't look like we can know from the Message in Kafka when it was actually
received by Kafka, so this will be enough to give us some semblence of time

FIxes #20
This commit is contained in:
R. Tyler Croy 2015-09-02 08:18:43 -07:00
parent d15f1adb5e
commit 9bdcb2138d
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
4 changed files with 15 additions and 1 deletions

View File

@ -36,6 +36,7 @@
{{=<% %>=}}
<script id="message-display-template" type="text/x-handlebars-template">
<div id="{{message_id}}" class="list-group-item message-container">
<div class="message-timestamp">{{timestamp}}</div>
<code>{{topic}}:{{partition}}</code>
<span class="offset">(offset: {{offset}})</span>
<pre class="pre-scrollable message-raw">{{raw}}</pre>
@ -47,6 +48,7 @@
</script>
<%={{ }}=%>
<script src="/js/moment.min.js"></script>
<script src="/js/ws.js"></script>
<script type="text/javascript">
watchTopic("{{name}}");

View File

@ -22,3 +22,7 @@ body {
font-family: monospace;
font-size: 0.7em;
}
.message-timestamp {
float: right;
}

7
src/ratpack/public/js/moment.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -23,7 +23,8 @@ function watchTopic(name) {
partition: data.partition,
offset: data.offset,
raw: data.raw,
b64: data.b64
b64: data.b64,
timestamp: moment(data.tstamp, 'x').format('MMM Do YYYY, H:mm:ss')
}));
$("#" + el_id).click(function(ev) {