Adds proxying support into Pi-Hole widgets (#391)

This commit is contained in:
Alicia Sykes
2021-12-30 21:20:35 +00:00
parent 25fa6ebae8
commit d2ff1438e2
3 changed files with 20 additions and 28 deletions

View File

@@ -18,7 +18,7 @@
</template>
<script>
import axios from 'axios';
// import axios from 'axios';
import WidgetMixin from '@/mixins/WidgetMixin';
import ChartingMixin from '@/mixins/ChartingMixin';
import { capitalize } from '@/utils/MiscHelpers';
@@ -55,15 +55,9 @@ export default {
methods: {
/* Make GET request to local pi-hole instance */
fetchData() {
axios.get(this.endpoint)
this.makeRequest(this.endpoint)
.then((response) => {
this.processData(response.data);
})
.catch((dataFetchError) => {
this.error('Unable to fetch data', dataFetchError);
})
.finally(() => {
this.finishLoading();
this.processData(response);
});
},
/* Assign data variables to the returned data */