From d673cfb75088b40a7c099ba9538637a44726443a Mon Sep 17 00:00:00 2001 From: cel Date: Wed, 3 May 2017 11:32:06 -1000 Subject: Show git-upload payload size --- lib/render-msg.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/render-msg.js b/lib/render-msg.js index d7820b4..7911765 100644 --- a/lib/render-msg.js +++ b/lib/render-msg.js @@ -467,10 +467,14 @@ RenderMsg.prototype.gitRepo = function (cb) { RenderMsg.prototype.gitUpdate = function (cb) { var self = this // h('a', {href: self.toUrl(self.c.repo)}, 'ssb://' + self.c.repo), + var size = [].concat(self.c.packs, self.c.indexes) + .map(function (o) { return o.size }) + .reduce(function (total, s) { return total + s }) self.link(self.c.repo, function (err, a) { if (err) return cb(err) self.wrap(h('div.ssb-git-update', 'git push ', a, ' ', + !isNaN(size) ? [self.render.formatSize(size), ' '] : '', self.c.refs ? h('ul', Object.keys(self.c.refs).map(function (ref) { var id = self.c.refs[ref] return h('li', -- cgit v1.2.3