diff --git a/src/lib/Controller.js b/src/lib/Controller.js index 970e6f2..1ff2043 100644 --- a/src/lib/Controller.js +++ b/src/lib/Controller.js @@ -19,13 +19,19 @@ class Controller { ).reduce((acc, curr) => acc.concat(curr)) } + rebuildBlueprintsAsync () { + Object.values(this.fetchers).forEach(t => t._buildBlueprintsAsync()) + } + update () { + const me = this return Promise.all( Object.keys(this.fetchers).map(sheet => { return this.fetchers[sheet].update() }) ).then(results => { if (results.every(r => r)) { + me.rebuildBlueprintsAsync() return copy.success.update } else { throw new Error(copy.errors.update) diff --git a/views/blueprints.hbs b/views/blueprints.hbs index ce92a87..a0afe25 100644 --- a/views/blueprints.hbs +++ b/views/blueprints.hbs @@ -1,8 +1,50 @@ -

Blueprints

+

Available Endpoints

+
+
+ {{#each bps}} +
+
+
{{ tab }}
+
{{ source }}
+
+ {{#each urls}} +
{{ this }}
+ {{/each}} +
+ {{ else }} +
No endpoints found. Have you updated?
+ {{/each}} +
-{{#each bps}} -
Source: {{ source }}
-
Tab: {{ tab }}
-
URLS: {{ urls }}
-
-{{/each}} +