mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-12 15:57:02 +00:00
Made chart-period global instead of individual (#6049)
Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
parent
4b5ff08cdd
commit
f027ce309e
1 changed files with 4 additions and 4 deletions
|
@ -182,7 +182,7 @@ export default {
|
|||
// eslint-disable-next-line eqeqeq
|
||||
if (newPeriod == "0") {
|
||||
this.heartbeatList = null;
|
||||
this.$root.storage().removeItem(`chart-period-${this.monitorId}`);
|
||||
this.$root.storage()["chart-period"] = newPeriod;
|
||||
} else {
|
||||
this.loading = true;
|
||||
|
||||
|
@ -199,7 +199,7 @@ export default {
|
|||
this.$root.toastError(res.msg);
|
||||
} else {
|
||||
this.chartRawData = res.data;
|
||||
this.$root.storage()[`chart-period-${this.monitorId}`] = newPeriod;
|
||||
this.$root.storage()["chart-period"] = newPeriod;
|
||||
}
|
||||
this.loading = false;
|
||||
});
|
||||
|
@ -216,7 +216,7 @@ export default {
|
|||
},
|
||||
created() {
|
||||
// Load chart period from storage if saved
|
||||
let period = this.$root.storage()[`chart-period-${this.monitorId}`];
|
||||
let period = this.$root.storage()["chart-period"];
|
||||
if (period != null) {
|
||||
// Has this ever been not a string?
|
||||
if (typeof period !== "string") {
|
||||
|
@ -224,7 +224,7 @@ export default {
|
|||
}
|
||||
this.chartPeriodHrs = period;
|
||||
} else {
|
||||
this.chartPeriodHrs = "24";
|
||||
this.chartPeriodHrs = "0";
|
||||
}
|
||||
},
|
||||
beforeUnmount() {
|
||||
|
|
Loading…
Add table
Reference in a new issue