Skip to content

Commit

Permalink
closes mailhog/MailHog#63 - add message size
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-kent committed Oct 6, 2015
1 parent 7450db0 commit ebdfa0f
Show file tree
Hide file tree
Showing 5 changed files with 261 additions and 200 deletions.
445 changes: 246 additions & 199 deletions assets/assets.go

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions assets/js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,10 @@ mailhogApp.controller('MailCtrl', function ($scope, $http, $sce, $timeout) {
}, 10);
}

$scope.fileSize = function(bytes) {
return filesize(bytes)
}

$scope.tryDecodeContent = function(message) {
var charset = "UTF-8"
if(message.Content.Headers["Content-Type"][0]) {
Expand Down
6 changes: 6 additions & 0 deletions assets/js/filesize-3.1.2.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion assets/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,16 @@
</div>
</div>

<div class="col-md-6">
<div class="col-md-5">
<span class="subject unread">{{ tryDecodeMime(message.Content.Headers["Subject"][0]) }}</span>
</div>

<div class="col-md-3 text-right">
{{ getMoment(date(message.Created)).fromNow() }}
</div>
<div class="col-md-1 text-right">
{{ fileSize(message.Raw.Data.length) }}
</div>
</div>
</div>

Expand Down
1 change: 1 addition & 0 deletions assets/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ <h3>Jim</h3>
<script src="js/bootstrap-3.3.2.min.js"></script>
<script src="js/angular-1.3.8.js"></script>
<script src="js/moment-2.8.4.js"></script>
<script src="js/filesize-3.1.2.min.js"></script>
<script src="js/strutil.js"></script>
<script src="js/controllers.js"></script>
<script>
Expand Down

0 comments on commit ebdfa0f

Please sign in to comment.