mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-28 01:04:05 +00:00
Update Maintenance list order by status
This commit is contained in:
parent
c84de4d259
commit
d5c02fc627
1 changed files with 12 additions and 1 deletions
|
@ -83,6 +83,13 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
selectedMaintenanceID: undefined,
|
selectedMaintenanceID: undefined,
|
||||||
|
statusOrderList: {
|
||||||
|
"under-maintenance": 1000,
|
||||||
|
"scheduled": 900,
|
||||||
|
"inactive": 800,
|
||||||
|
"ended": 700,
|
||||||
|
"unknown": 0,
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -90,7 +97,11 @@ export default {
|
||||||
let result = Object.values(this.$root.maintenanceList);
|
let result = Object.values(this.$root.maintenanceList);
|
||||||
|
|
||||||
result.sort((m1, m2) => {
|
result.sort((m1, m2) => {
|
||||||
|
if (this.statusOrderList[m1.status] === this.statusOrderList[m2.status]) {
|
||||||
return m1.title.localeCompare(m2.title);
|
return m1.title.localeCompare(m2.title);
|
||||||
|
} else {
|
||||||
|
return this.statusOrderList[m1.status] < this.statusOrderList[m2.status];
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in a new issue