@@ -58,14 +61,14 @@
-
+
{{ group.name }}
@@ -76,12 +79,12 @@
class="columns is-multiline layout-vertical"
>
-
+
{{ group.name }}
{
- if (!response.ok) {
- throw Error(response.statusText);
- }
- return response.text().then((body) => {
+ getConfig: function (path = "assets/config.yml") {
+ return fetch(path).then((response) => {
+ if (response.redirected) {
+ // This allows to work with authentication proxies.
+ window.location.href = response.url;
+ return;
+ }
+ 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;
});
- })
- .catch((error) => {
- return this.handleErrors("â ï¸ Error loading configuration", error);
- });
+ });
},
matchesFilter: function (item) {
return (
@@ -215,6 +244,11 @@ export default {
},
};
},
+ createStylesheet: function (css) {
+ let style = document.createElement("style");
+ style.appendChild(document.createTextNode(css));
+ document.head.appendChild(style);
+ },
},
};