Commit 13d54825caa9906484c32c0b3ba3483fcc7f1923
Render npm packages more
cel committed on 9/1/2018, 1:55:40 AMParent: 1a47f5f10e7f528233fc2adfe33565b40ecb322f
Files changed
render.js | changed |
render.js | |||
---|---|---|---|
@@ -506,9 +506,17 @@ | |||
506 | 506 … | var host = c.address && c.address.host | |
507 | 507 … | return h('span.status', 'Connected to the pub ' + host); | |
508 | 508 … | } | |
509 | 509 … | else if (c.type == "npm-packages") { | |
510 | - return [h('span.status', 'Pushed npm packages')]; | ||
510 … | + return h('div.status', 'Pushed npm packages', | ||
511 … | + Array.isArray(c.mentions) ? h('ul', c.mentions.map(function (link) { | ||
512 … | + var name = link && link.name | ||
513 … | + var m = name && /^npm:([^:]*):([^:]*)(?::([^:]*)(?:\.tgz)?)?$/.exec(name) | ||
514 … | + if (!m) return | ||
515 … | + var [, name, version, tag] = m | ||
516 … | + return h('li', name + ' v' + version + (tag ? ' (' + tag + ')' : '')) | ||
517 … | + })) : '' | ||
518 … | + ); | ||
511 | 519 … | } | |
512 | 520 … | else if (c.type == "channel" && c.subscribed) | |
513 | 521 … | return h('span.status', | |
514 | 522 … | 'Subscribed to channel ', |
Built with git-ssb-web