mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-28 01:04:05 +00:00
perf: only do one filter instead of 3 in editMonitor
This commit is contained in:
parent
9a46b50989
commit
aee4c22dee
1 changed files with 7 additions and 3 deletions
|
@ -760,9 +760,13 @@ message HealthCheckResponse {
|
|||
sortedMonitorList() {
|
||||
let result = Object.values(this.$root.monitorList);
|
||||
console.log(this.monitor.childrenIDs);
|
||||
result = result.filter(monitor => monitor.type === "group");
|
||||
result = result.filter(monitor => monitor.id !== this.monitor.id);
|
||||
result = result.filter(monitor => !this.monitor.childrenIDs?.includes(monitor.id));
|
||||
|
||||
// Only groups, not itself, not a decendant
|
||||
result = result.filter(
|
||||
monitor => monitor.type === "group" &&
|
||||
monitor.id !== this.monitor.id &&
|
||||
!this.monitor.childrenIDs?.includes(monitor.id)
|
||||
);
|
||||
|
||||
result.sort((m1, m2) => {
|
||||
|
||||
|
|
Loading…
Reference in a new issue