@@ -58,14 +61,14 @@
-
+
{{ group.name }}
@@ -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) {
@@ -209,6 +235,20 @@ export default {
},
];
},
+ 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);
+ },
},
};