mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-20 11:40:47 +08:00
Made chart-period global instead of individual (#6049)
Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
committed by
GitHub
parent
4b5ff08cdd
commit
f027ce309e
@@ -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() {
|
||||
|
Reference in New Issue
Block a user