diff --git a/src/App.vue b/src/App.vue
index 2893349..aa61b9c 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -8,7 +8,10 @@
-
+
+
+
+
@@ -17,6 +20,7 @@ import Loader from '@/components/Loader.vue';
import Header from '@/components/Header.vue';
import OverallStatus from '@/components/OverallStatus.vue';
import EndpointGroup from '@/components/EndpointGroup.vue';
+import RefreshSettings from '@/components/RefreshSettings.vue';
import Footer from '@/components/Footer.vue';
import axios from 'axios';
@@ -28,6 +32,7 @@ export default {
Header,
OverallStatus,
EndpointGroup,
+ RefreshSettings,
Footer
},
data() {
@@ -65,7 +70,13 @@ export default {
this.getApiData();
})
.catch(error => {
- console.log(error);
+ if (error.response.status === 404) {
+ console.warn('Could not find config.json. Using default values.');
+ this.config = {}
+ this.getApiData();
+ } else {
+ console.log("Error getting config: " + error);
+ }
});
},
getApiData() {
@@ -75,19 +86,20 @@ export default {
}
axios.get('/api/v1/endpoints/statuses')
.then(response => {
- this.apiData = response.data;
+ let data = response.data;
// Remove hidden groups if defined in config
if (this.config.hiddenGroups) {
- this.apiData = this.apiData.filter(endpoint => {
+ data = data.filter(endpoint => {
return !this.config.hiddenGroups.includes(endpoint.group);
});
}
// Remove hidden endpoints if defined in config
if (this.config.hiddenEndpoints) {
- this.apiData = this.apiData.filter(endpoint => {
+ data = data.filter(endpoint => {
return !this.config.hiddenEndpoints.includes(endpoint.name);
});
}
+ this.apiData = data;
this.loading = false;
})
.catch(error => {
@@ -140,6 +152,7 @@ html {
margin: 0;
--green: #00d560;
--orange: #ff9100;
+ --grey: #7d8187;
}
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
diff --git a/src/components/RefreshSettings.vue b/src/components/RefreshSettings.vue
new file mode 100644
index 0000000..8ee2b18
--- /dev/null
+++ b/src/components/RefreshSettings.vue
@@ -0,0 +1,80 @@
+
+
+
+ ↻
+
+
+
+
+
+
+
+
\ No newline at end of file