Files: a5f729cb625d55f9a6700f99041f3adc9c2e8ffc / modules / versions.js
819 bytesRaw
1 | var h = require('hyperscript') |
2 | |
3 | exports.menu_items = function () { |
4 | return h('a', {href: '#/versions'}, '/versions') |
5 | } |
6 | |
7 | exports.screen_view = function (path) { |
8 | if(path !== '/versions') return |
9 | |
10 | if('undefined' === typeof WebBoot) |
11 | return h('h1', 'must run with web-boot enabled enviroment') |
12 | |
13 | var content = h('div.column') |
14 | |
15 | WebBoot.versions(function (err, log) { |
16 | log.forEach(function (e, i) { |
17 | content.appendChild( |
18 | h('div.row', |
19 | h('a', { |
20 | href: '#/run:'+e.value, |
21 | onclick: function () { |
22 | WebBoot.run(e.value, function () { |
23 | console.log('rebooting to:', e.value) |
24 | }) |
25 | } |
26 | }, ' ', e.value, ' ', new Date(e.ts)), |
27 | !i && h('label', '(current)') |
28 | ) |
29 | ) |
30 | }) |
31 | |
32 | }) |
33 | |
34 | return content |
35 | } |
36 | |
37 |
Built with git-ssb-web