mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-21 23:43:27 +01:00
ui: Use localStorage instead of sessionStorage for refresh interval + collapsed groups
Fixes #509 Supersedes #510
This commit is contained in:
parent
315f9b7792
commit
71c4d3ade1
@ -60,7 +60,7 @@ export default {
|
|||||||
},
|
},
|
||||||
toggleGroup() {
|
toggleGroup() {
|
||||||
this.collapsed = !this.collapsed;
|
this.collapsed = !this.collapsed;
|
||||||
sessionStorage.setItem(`gatus:endpoint-group:${this.name}:collapsed`, this.collapsed);
|
localStorage.setItem(`gatus:endpoint-group:${this.name}:collapsed`, this.collapsed);
|
||||||
},
|
},
|
||||||
showTooltip(result, event) {
|
showTooltip(result, event) {
|
||||||
this.$emit('showTooltip', result, event);
|
this.$emit('showTooltip', result, event);
|
||||||
@ -80,7 +80,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
unhealthyCount: 0,
|
unhealthyCount: 0,
|
||||||
collapsed: sessionStorage.getItem(`gatus:endpoint-group:${this.name}:collapsed`) === "true"
|
collapsed: localStorage.getItem(`gatus:endpoint-group:${this.name}:collapsed`) === "true"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ export default {
|
|||||||
props: {},
|
props: {},
|
||||||
methods: {
|
methods: {
|
||||||
setRefreshInterval(seconds) {
|
setRefreshInterval(seconds) {
|
||||||
sessionStorage.setItem('gatus:refresh-interval', seconds);
|
localStorage.setItem('gatus:refresh-interval', seconds);
|
||||||
let that = this;
|
let that = this;
|
||||||
this.refreshIntervalHandler = setInterval(function () {
|
this.refreshIntervalHandler = setInterval(function () {
|
||||||
that.refreshData();
|
that.refreshData();
|
||||||
@ -78,7 +78,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
refreshInterval: sessionStorage.getItem('gatus:refresh-interval') < 10 ? 300 : parseInt(sessionStorage.getItem('gatus:refresh-interval')),
|
refreshInterval: localStorage.getItem('gatus:refresh-interval') < 10 ? 300 : parseInt(localStorage.getItem('gatus:refresh-interval')),
|
||||||
refreshIntervalHandler: 0,
|
refreshIntervalHandler: 0,
|
||||||
darkMode: true
|
darkMode: true
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user