aboutsummaryrefslogtreecommitdiffhomepage
path: root/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'app.js')
-rw-r--r--app.js13
1 files changed, 6 insertions, 7 deletions
diff --git a/app.js b/app.js
index ffb5007..fda16b2 100644
--- a/app.js
+++ b/app.js
@@ -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
33function getConfig() { 32function 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}