@ -20,6 +20,39 @@
< / button >
< / div >
< div class = "my-4 pt-4" >
< h5 class = "my-4 settings-subheading" > { { $t ( "monitorToastMessagesLabel" ) } } < / h5 >
< p > { { $t ( "monitorToastMessagesDescription" ) } } < / p >
< div class = "my-4" >
< label for = "toastErrorTimeoutSecs" class = "form-label" >
{ { $t ( "toastErrorTimeout" ) } }
< / label >
< input
id = "toastErrorTimeoutSecs"
v - model = "toastErrorTimeoutSecs"
type = "number"
class = "form-control"
min = "-1"
step = "1"
/ >
< / div >
< div class = "my-4" >
< label for = "toastSuccessTimeoutSecs" class = "form-label" >
{ { $t ( "toastSuccessTimeout" ) } }
< / label >
< input
id = "toastSuccessTimeoutSecs"
v - model = "toastSuccessTimeoutSecs"
type = "number"
class = "form-control"
min = "-1"
step = "1"
/ >
< / div >
< / div >
< div class = "my-4 pt-4" >
< h5 class = "my-4 settings-subheading" > { { $t ( "settingsCertificateExpiry" ) } } < / h5 >
< p > { { $t ( "certificationExpiryDescription" ) } } < / p >
@ -58,6 +91,8 @@ export default {
data ( ) {
return {
toastSuccessTimeoutSecs : 20 ,
toastErrorTimeoutSecs : - 1 ,
/ * *
* Variable to store the input for new certificate expiry day .
* /
@ -77,6 +112,26 @@ export default {
} ,
} ,
watch : {
/ / P a r s e , s t o r e a n d a p p l y n e w t i m e o u t s e t t i n g s .
toastSuccessTimeoutSecs ( newTimeout ) {
const parsedTimeout = parseInt ( newTimeout ) ;
if ( parsedTimeout != null && ! Number . isNaN ( parsedTimeout ) ) {
localStorage . toastSuccessTimeout = newTimeout > 0 ? newTimeout * 1000 : newTimeout ;
}
} ,
toastErrorTimeoutSecs ( newTimeout ) {
const parsedTimeout = parseInt ( newTimeout ) ;
if ( parsedTimeout != null && ! Number . isNaN ( parsedTimeout ) ) {
localStorage . toastErrorTimeout = newTimeout > 0 ? newTimeout * 1000 : newTimeout ;
}
}
} ,
mounted ( ) {
this . loadToastTimeoutSettings ( ) ;
} ,
methods : {
/ * *
* Remove a day from expiry notification days .
@ -108,6 +163,27 @@ export default {
}
}
} ,
/ * *
* Loads toast timeout settings from storage to component data .
* /
loadToastTimeoutSettings ( ) {
const successTimeout = localStorage . toastSuccessTimeout ;
if ( successTimeout !== undefined ) {
const parsedTimeout = parseInt ( successTimeout ) ;
if ( parsedTimeout != null && ! Number . isNaN ( parsedTimeout ) ) {
this . toastSuccessTimeoutSecs = parsedTimeout > 0 ? parsedTimeout / 1000 : parsedTimeout ;
}
}
const errorTimeout = localStorage . toastErrorTimeout ;
if ( errorTimeout !== undefined ) {
const parsedTimeout = parseInt ( errorTimeout ) ;
if ( parsedTimeout != null && ! Number . isNaN ( parsedTimeout ) ) {
this . toastErrorTimeoutSecs = parsedTimeout > 0 ? parsedTimeout / 1000 : parsedTimeout ;
}
}
} ,
} ,
} ;
< / script >