mirror of
https://github.com/prymitive/karma
synced 2026-05-07 03:26:52 +00:00
fix(ui): more strict value checking for silence start & end
This commit is contained in:
@@ -138,12 +138,11 @@ class SilenceFormStore {
|
||||
|
||||
incDuration(minutes) {
|
||||
this.endsAt = moment(this.endsAt).add(minutes, "minutes");
|
||||
this.verifyStarEnd();
|
||||
},
|
||||
decDuration(minutes) {
|
||||
const newEndsAt = moment(this.endsAt).subtract(minutes, "minutes");
|
||||
if (newEndsAt.isAfter(this.startsAt)) {
|
||||
this.endsAt = newEndsAt;
|
||||
}
|
||||
this.endsAt = moment(this.endsAt).subtract(minutes, "minutes");
|
||||
this.verifyStarEnd();
|
||||
},
|
||||
|
||||
get toAlertmanagerPayload() {
|
||||
@@ -163,7 +162,7 @@ class SilenceFormStore {
|
||||
.millisecond(0)
|
||||
.toISOString(),
|
||||
endsAt: this.endsAt
|
||||
.second(59)
|
||||
.second(0)
|
||||
.millisecond(0)
|
||||
.toISOString(),
|
||||
createdBy: this.author,
|
||||
|
||||
Reference in New Issue
Block a user