diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-05-03 11:32:06 -1000 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-05-03 11:32:06 -1000 |
commit | d673cfb75088b40a7c099ba9538637a44726443a (patch) | |
tree | f11e529bb54eaf50b9e11e521c9a527ea7815dcc /lib | |
parent | bd9fdd3d21b5bad6f5e1d11a7196b899c8bcff05 (diff) | |
download | patchfoo-d673cfb75088b40a7c099ba9538637a44726443a.tar.gz patchfoo-d673cfb75088b40a7c099ba9538637a44726443a.zip |
Show git-upload payload size
Diffstat (limited to 'lib')
-rw-r--r-- | lib/render-msg.js | 4 |
1 files changed, 4 insertions, 0 deletions
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', |