mirror of
https://github.com/Lissy93/dashy.git
synced 2025-07-25 22:55:32 +02:00
✨ Re #35: Lets user specify custom headers and statusCheck url
This commit is contained in:
parent
c7f165273f
commit
b80b2f54b4
@ -67,6 +67,8 @@ export default {
|
|||||||
},
|
},
|
||||||
itemSize: String,
|
itemSize: String,
|
||||||
enableStatusCheck: Boolean,
|
enableStatusCheck: Boolean,
|
||||||
|
statusCheckHeaders: Object,
|
||||||
|
statusCheckUrl: String,
|
||||||
statusCheckInterval: Number,
|
statusCheckInterval: Number,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@ -141,8 +143,10 @@ export default {
|
|||||||
checkWebsiteStatus() {
|
checkWebsiteStatus() {
|
||||||
this.statusResponse = undefined;
|
this.statusResponse = undefined;
|
||||||
const baseUrl = process.env.VUE_APP_DOMAIN || window.location.origin;
|
const baseUrl = process.env.VUE_APP_DOMAIN || window.location.origin;
|
||||||
const endpoint = `${baseUrl}/ping?url=${this.url}`;
|
const urlToCheck = this.statusCheckUrl || this.url;
|
||||||
axios.get(endpoint)
|
const headers = this.statusCheckHeaders || {};
|
||||||
|
const endpoint = `${baseUrl}/ping?url=${urlToCheck}`;
|
||||||
|
axios.get(endpoint, { headers })
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
if (response.data) this.statusResponse = response.data;
|
if (response.data) this.statusResponse = response.data;
|
||||||
})
|
})
|
||||||
|
@ -27,6 +27,8 @@
|
|||||||
:target="item.target"
|
:target="item.target"
|
||||||
:color="item.color"
|
:color="item.color"
|
||||||
:backgroundColor="item.backgroundColor"
|
:backgroundColor="item.backgroundColor"
|
||||||
|
:statusCheckUrl="item.statusCheckUrl"
|
||||||
|
:statusCheckHeaders="item.statusCheckHeaders"
|
||||||
:itemSize="newItemSize"
|
:itemSize="newItemSize"
|
||||||
:enableStatusCheck="shouldEnableStatusCheck(item.statusCheck)"
|
:enableStatusCheck="shouldEnableStatusCheck(item.statusCheck)"
|
||||||
:statusCheckInterval="getStatusCheckInterval()"
|
:statusCheckInterval="getStatusCheckInterval()"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user