diff options
author | Bastien Wirtz <bastien.wirtz@gmail.com> | 2018-11-12 21:14:38 -0800 |
---|---|---|
committer | Bastien Wirtz <bastien.wirtz@gmail.com> | 2018-11-12 21:30:24 -0800 |
commit | e41196e76e6b184fc918fb44adc9af0ff3fdae30 (patch) | |
tree | 58e759b9b8940d195ed666749e2cd0946e2abb86 /app.js | |
parent | 9ca12a40f404ba15d67068087dc521be7d69eefb (diff) | |
download | homer-e41196e76e6b184fc918fb44adc9af0ff3fdae30.tar.gz homer-e41196e76e6b184fc918fb44adc9af0ff3fdae30.tar.zst homer-e41196e76e6b184fc918fb44adc9af0ff3fdae30.zip |
Deps update & minor UI adjustments
Diffstat (limited to 'app.js')
-rw-r--r-- | app.js | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -4,13 +4,12 @@ var app = new Vue({ | |||
4 | config: null, | 4 | config: null, |
5 | filter: '' | 5 | filter: '' |
6 | }, | 6 | }, |
7 | beforeCreate () { | 7 | beforeCreate() { |
8 | let that = this; | 8 | let that = this; |
9 | 9 | ||
10 | return getConfig().then(function (config) { | 10 | return getConfig().then(function (config) { |
11 | console.log(config); | ||
12 | const size = 3; | 11 | const size = 3; |
13 | config.services.forEach(function(service) { | 12 | config.services.forEach(function (service) { |
14 | service.rows = []; | 13 | service.rows = []; |
15 | items = service.items; | 14 | items = service.items; |
16 | while (items.length) { | 15 | while (items.length) { |
@@ -18,7 +17,7 @@ var app = new Vue({ | |||
18 | } | 17 | } |
19 | 18 | ||
20 | if (service.rows.length) { | 19 | if (service.rows.length) { |
21 | let last = service.rows.length-1; | 20 | let last = service.rows.length - 1; |
22 | service.rows[last] = service.rows[last].concat(Array(size - service.rows[last].length)); | 21 | service.rows[last] = service.rows[last].concat(Array(size - service.rows[last].length)); |
23 | } | 22 | } |
24 | }); | 23 | }); |
@@ -31,13 +30,13 @@ var app = new Vue({ | |||
31 | 30 | ||
32 | 31 | ||
33 | function getConfig() { | 32 | function getConfig() { |
34 | return fetch('config.yml').then(function(response) { | 33 | return fetch('config.yml').then(function (response) { |
35 | if (response.status !== 200) { | 34 | if (response.status !== 200) { |
36 | return; | 35 | return; |
37 | } | 36 | } |
38 | 37 | ||
39 | return response.text().then(function(body){ | 38 | return response.text().then(function (body) { |
40 | return jsyaml.load(body); | 39 | return jsyaml.load(body); |
41 | }); | 40 | }); |
42 | }); | 41 | }); |
43 | } \ No newline at end of file | 42 | } |