mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-13 08:17:03 +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
|
// eslint-disable-next-line eqeqeq
|
||||||
if (newPeriod == "0") {
|
if (newPeriod == "0") {
|
||||||
this.heartbeatList = null;
|
this.heartbeatList = null;
|
||||||
this.$root.storage().removeItem(`chart-period-${this.monitorId}`);
|
this.$root.storage()["chart-period"] = newPeriod;
|
||||||
} else {
|
} else {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ export default {
|
||||||
this.$root.toastError(res.msg);
|
this.$root.toastError(res.msg);
|
||||||
} else {
|
} else {
|
||||||
this.chartRawData = res.data;
|
this.chartRawData = res.data;
|
||||||
this.$root.storage()[`chart-period-${this.monitorId}`] = newPeriod;
|
this.$root.storage()["chart-period"] = newPeriod;
|
||||||
}
|
}
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
|
@ -216,7 +216,7 @@ export default {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
// Load chart period from storage if saved
|
// 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) {
|
if (period != null) {
|
||||||
// Has this ever been not a string?
|
// Has this ever been not a string?
|
||||||
if (typeof period !== "string") {
|
if (typeof period !== "string") {
|
||||||
|
@ -224,7 +224,7 @@ export default {
|
||||||
}
|
}
|
||||||
this.chartPeriodHrs = period;
|
this.chartPeriodHrs = period;
|
||||||
} else {
|
} else {
|
||||||
this.chartPeriodHrs = "24";
|
this.chartPeriodHrs = "0";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeUnmount() {
|
beforeUnmount() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue