mirror of https://github.com/bastienwirtz/homer
Lint & updates
parent
f9cc1d27cc
commit
c06c0cdf9b
|
@ -9,12 +9,12 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fortawesome/fontawesome-free": "^5.15.3",
|
"@fortawesome/fontawesome-free": "^5.15.3",
|
||||||
"bulma": "^0.9.2",
|
"bulma": "^0.9.3",
|
||||||
"core-js": "^3.10.1",
|
"core-js": "^3.15.2",
|
||||||
"js-yaml": "^4.0.0",
|
"js-yaml": "^4.1.0",
|
||||||
"lodash.merge": "^4.6.2",
|
"lodash.merge": "^4.6.2",
|
||||||
"register-service-worker": "^1.7.2",
|
"register-service-worker": "^1.7.2",
|
||||||
"vue": "^2.6.12"
|
"vue": "^2.6.14"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vue/cli-plugin-babel": "~4.5.0",
|
"@vue/cli-plugin-babel": "~4.5.0",
|
||||||
|
|
|
@ -51,9 +51,9 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fetchStatus: async function () {
|
fetchStatus: async function () {
|
||||||
this.status = await fetch(
|
this.status = await fetch(`${this.item.url}/control/status`).then(
|
||||||
`${this.item.url}/control/status`
|
(response) => response.json()
|
||||||
).then((response) => response.json());
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -52,20 +52,22 @@ export default {
|
||||||
if (this.item.subtitle != null) return; // omitting unnecessary ajax call as the subtitle is showing
|
if (this.item.subtitle != null) return; // omitting unnecessary ajax call as the subtitle is showing
|
||||||
var apikey = this.item.apikey;
|
var apikey = this.item.apikey;
|
||||||
if (!apikey) {
|
if (!apikey) {
|
||||||
console.error("apikey is not present in config.yml for the paperless entry!");
|
console.error(
|
||||||
|
"apikey is not present in config.yml for the paperless entry!"
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const url = `${this.item.url}/api/documents/`;
|
const url = `${this.item.url}/api/documents/`;
|
||||||
this.api = await fetch(url, {
|
this.api = await fetch(url, {
|
||||||
headers: {
|
headers: {
|
||||||
"Authorization": "Token " + this.item.apikey
|
Authorization: "Token " + this.item.apikey,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
.then(function(response) {
|
.then(function (response) {
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error("Not 2xx response")
|
throw new Error("Not 2xx response");
|
||||||
} else {
|
} else {
|
||||||
return response.json()
|
return response.json();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((e) => console.log(e));
|
.catch((e) => console.log(e));
|
||||||
|
|
|
@ -53,8 +53,8 @@ export default {
|
||||||
fetchStatus: async function () {
|
fetchStatus: async function () {
|
||||||
const url = `${this.item.url}`;
|
const url = `${this.item.url}`;
|
||||||
this.api.status = await fetch(url)
|
this.api.status = await fetch(url)
|
||||||
.then((response) => "enabled")
|
.then(() => "enabled")
|
||||||
.catch((e) => "disabled");
|
.catch(() => "disabled");
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue