Files: 931ac024cad9b0e63311dd1a76de77d0490f8391 / 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