mirror of https://github.com/lissy93/dashy
✨ Adds frontend functionality for status checks max redirects (Re@ #494)
This commit is contained in:
parent
5ff099ea1f
commit
9e383e0638
|
@ -96,6 +96,7 @@ export default {
|
||||||
statusCheckInterval: Number, // Num seconds beteween repeating checks
|
statusCheckInterval: Number, // Num seconds beteween repeating checks
|
||||||
statusCheckAllowInsecure: Boolean, // Status check ignore SSL certs
|
statusCheckAllowInsecure: Boolean, // Status check ignore SSL certs
|
||||||
statusCheckAcceptCodes: String, // Allow status checks to pass with a code other than 200
|
statusCheckAcceptCodes: String, // Allow status checks to pass with a code other than 200
|
||||||
|
statusCheckMaxRedirects: Number, // Specify max number of redirects
|
||||||
parentSectionTitle: String, // Title of parent section (for add new)
|
parentSectionTitle: String, // Title of parent section (for add new)
|
||||||
isAddNew: Boolean, // Only set if 'fake' item used as Add New button
|
isAddNew: Boolean, // Only set if 'fake' item used as Add New button
|
||||||
},
|
},
|
||||||
|
@ -237,7 +238,12 @@ export default {
|
||||||
/* Pulls together all user options, returns URL + Get params for ping endpoint */
|
/* Pulls together all user options, returns URL + Get params for ping endpoint */
|
||||||
makeApiUrl() {
|
makeApiUrl() {
|
||||||
const {
|
const {
|
||||||
url, statusCheckUrl, statusCheckHeaders, statusCheckAllowInsecure, statusCheckAcceptCodes,
|
url,
|
||||||
|
statusCheckUrl,
|
||||||
|
statusCheckHeaders,
|
||||||
|
statusCheckAllowInsecure,
|
||||||
|
statusCheckAcceptCodes,
|
||||||
|
statusCheckMaxRedirects,
|
||||||
} = this;
|
} = this;
|
||||||
const encode = (str) => encodeURIComponent(str);
|
const encode = (str) => encodeURIComponent(str);
|
||||||
this.statusResponse = undefined;
|
this.statusResponse = undefined;
|
||||||
|
@ -251,9 +257,10 @@ export default {
|
||||||
// Deterimine if user disabled security
|
// Deterimine if user disabled security
|
||||||
const enableInsecure = statusCheckAllowInsecure ? '&enableInsecure=true' : '';
|
const enableInsecure = statusCheckAllowInsecure ? '&enableInsecure=true' : '';
|
||||||
const acceptCodes = statusCheckAcceptCodes ? `&acceptCodes=${statusCheckAcceptCodes}` : '';
|
const acceptCodes = statusCheckAcceptCodes ? `&acceptCodes=${statusCheckAcceptCodes}` : '';
|
||||||
|
const maxRedirects = statusCheckMaxRedirects ? `&maxRedirects=${statusCheckMaxRedirects}` : '';
|
||||||
// Construct the full API endpoint's URL with GET params
|
// Construct the full API endpoint's URL with GET params
|
||||||
return `${baseUrl}${serviceEndpoints.statusCheck}/${urlToCheck}`
|
return `${baseUrl}${serviceEndpoints.statusCheck}/${urlToCheck}`
|
||||||
+ `${headers}${enableInsecure}${acceptCodes}`;
|
+ `${headers}${enableInsecure}${acceptCodes}${maxRedirects}`;
|
||||||
},
|
},
|
||||||
/* Checks if a given service is currently online */
|
/* Checks if a given service is currently online */
|
||||||
checkWebsiteStatus() {
|
checkWebsiteStatus() {
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
:statusCheckInterval="statusCheckInterval"
|
:statusCheckInterval="statusCheckInterval"
|
||||||
:statusCheckAllowInsecure="item.statusCheckAllowInsecure"
|
:statusCheckAllowInsecure="item.statusCheckAllowInsecure"
|
||||||
:statusCheckAcceptCodes="item.statusCheckAcceptCodes"
|
:statusCheckAcceptCodes="item.statusCheckAcceptCodes"
|
||||||
|
:statusCheckMaxRedirects="item.statusCheckMaxRedirects"
|
||||||
@itemClicked="$emit('itemClicked')"
|
@itemClicked="$emit('itemClicked')"
|
||||||
@triggerModal="triggerModal"
|
@triggerModal="triggerModal"
|
||||||
:isAddNew="false"
|
:isAddNew="false"
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
:enableStatusCheck="shouldEnableStatusCheck(item.statusCheck)"
|
:enableStatusCheck="shouldEnableStatusCheck(item.statusCheck)"
|
||||||
:statusCheckAllowInsecure="item.statusCheckAllowInsecure"
|
:statusCheckAllowInsecure="item.statusCheckAllowInsecure"
|
||||||
:statusCheckAcceptCodes="item.statusCheckAcceptCodes"
|
:statusCheckAcceptCodes="item.statusCheckAcceptCodes"
|
||||||
|
:statusCheckMaxRedirects="item.statusCheckMaxRedirects"
|
||||||
:statusCheckInterval="getStatusCheckInterval()"
|
:statusCheckInterval="getStatusCheckInterval()"
|
||||||
@itemClicked="$emit('itemClicked')"
|
@itemClicked="$emit('itemClicked')"
|
||||||
@triggerModal="triggerModal"
|
@triggerModal="triggerModal"
|
||||||
|
|
Loading…
Reference in New Issue