mirror of
https://github.com/bastienwirtz/homer.git
synced 2024-11-07 08:44:00 +01:00
Lint & updates
This commit is contained in:
parent
f9cc1d27cc
commit
c06c0cdf9b
@ -9,12 +9,12 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-free": "^5.15.3",
|
||||
"bulma": "^0.9.2",
|
||||
"core-js": "^3.10.1",
|
||||
"js-yaml": "^4.0.0",
|
||||
"bulma": "^0.9.3",
|
||||
"core-js": "^3.15.2",
|
||||
"js-yaml": "^4.1.0",
|
||||
"lodash.merge": "^4.6.2",
|
||||
"register-service-worker": "^1.7.2",
|
||||
"vue": "^2.6.12"
|
||||
"vue": "^2.6.14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "~4.5.0",
|
||||
|
@ -51,9 +51,9 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
fetchStatus: async function () {
|
||||
this.status = await fetch(
|
||||
`${this.item.url}/control/status`
|
||||
).then((response) => response.json());
|
||||
this.status = await fetch(`${this.item.url}/control/status`).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
|
||||
var apikey = this.item.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;
|
||||
}
|
||||
const url = `${this.item.url}/api/documents/`;
|
||||
this.api = await fetch(url, {
|
||||
headers: {
|
||||
"Authorization": "Token " + this.item.apikey
|
||||
}
|
||||
Authorization: "Token " + this.item.apikey,
|
||||
},
|
||||
})
|
||||
.then(function (response) {
|
||||
if (!response.ok) {
|
||||
throw new Error("Not 2xx response")
|
||||
throw new Error("Not 2xx response");
|
||||
} else {
|
||||
return response.json()
|
||||
return response.json();
|
||||
}
|
||||
})
|
||||
.catch((e) => console.log(e));
|
||||
|
@ -53,8 +53,8 @@ export default {
|
||||
fetchStatus: async function () {
|
||||
const url = `${this.item.url}`;
|
||||
this.api.status = await fetch(url)
|
||||
.then((response) => "enabled")
|
||||
.catch((e) => "disabled");
|
||||
.then(() => "enabled")
|
||||
.catch(() => "disabled");
|
||||
},
|
||||
},
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user