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