X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FApp.vue;h=d97df0cc18d1f5ad5ff1af3ba5f8c8b1a059619c;hb=d1b29caaa62ef19e9dd68babf334ec25a966f945;hp=f7fd34adc30729e6b40790cb6141aea2fe427d52;hpb=b9c5fcf085bed9c6100283133531b36bfbb06cf0;p=github%2Fbastienwirtz%2Fhomer.git diff --git a/src/App.vue b/src/App.vue index f7fd34a..d97df0c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,7 +5,7 @@ :class="[ `theme-${config.theme}`, isDark ? 'is-dark' : 'is-light', - !config.footer ? 'no-footer' : '' + !config.footer ? 'no-footer' : '', ]" > @@ -13,7 +13,7 @@
@@ -26,7 +26,7 @@ @@ -40,16 +40,19 @@
- +
@@ -58,14 +61,14 @@
@@ -76,12 +79,12 @@ class="columns is-multiline layout-vertical" >

- + {{ group.name }}

{ + if (response.redirected) { + // This allows to work with authentication proxies. + window.location.href = response.url; return; } - return response.text().then(function (body) { - return jsyaml.load(body); - }); + if (!response.ok) { + throw Error(`${response.statusText}: ${response.body}`); + } + + const that = this; + return response + .text() + .then((body) => { + return jsyaml.load(body); + }) + .then(function (config) { + if (config.externalConfig) { + return that.getConfig(config.externalConfig); + } + return config; + }); }); }, matchesFilter: function (item) { @@ -205,10 +231,24 @@ export default { { name: filter, icon: "fas fa-search", - items: searchResultItems - } + items: searchResultItems, + }, ]; - } - } + }, + handleErrors: function (title, content) { + return { + message: { + title: title, + style: "is-danger", + content: content, + }, + }; + }, + createStylesheet: function (css) { + let style = document.createElement("style"); + style.appendChild(document.createTextNode(css)); + document.head.appendChild(style); + }, + }, };