mirror of
https://github.com/bastienwirtz/homer.git
synced 2024-11-07 08:44:00 +01:00
PR review: use API const and lint
This commit is contained in:
parent
16d3f4f53a
commit
018344d911
@ -52,29 +52,24 @@ export default {
|
|||||||
created: function () {
|
created: function () {
|
||||||
this.fetchConfig();
|
this.fetchConfig();
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
apiPath() {
|
|
||||||
return API;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
fetchConfig: function () {
|
fetchConfig: function () {
|
||||||
const handleError = (e) => {
|
const handleError = (e) => {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
this.serverError = true;
|
this.serverError = true;
|
||||||
}
|
};
|
||||||
this.fetch(`${this.apiPath}/health?apikey=${this.item.apikey}`)
|
this.fetch(`${API}/health?apikey=${this.item.apikey}`)
|
||||||
.then((health) => {
|
.then((health) => {
|
||||||
this.warnings = health.filter(h => h.type === 'warning').length;
|
this.warnings = health.filter((h) => h.type === "warning").length;
|
||||||
this.errors = health.filter(h => h.type === 'errors').length;
|
this.errors = health.filter((h) => h.type === "errors").length;
|
||||||
})
|
})
|
||||||
.catch(handleError);
|
.catch(handleError);
|
||||||
this.fetch(`${this.apiPath}/queue?apikey=${this.item.apikey}`)
|
this.fetch(`${API}/queue?apikey=${this.item.apikey}`)
|
||||||
.then((queue) => {
|
.then((queue) => {
|
||||||
this.activity = queue.totalRecords;
|
this.activity = queue.totalRecords;
|
||||||
})
|
})
|
||||||
.catch(handleError);
|
.catch(handleError);
|
||||||
this.fetch(`${this.apiPath}/wanted/missing?apikey=${this.item.apikey}`)
|
this.fetch(`${API}/wanted/missing?apikey=${this.item.apikey}`)
|
||||||
.then((missing) => {
|
.then((missing) => {
|
||||||
this.missing = missing.totalRecords;
|
this.missing = missing.totalRecords;
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user