[status page] fix monitor order

This commit is contained in:
LouisLam 2021-09-22 15:23:58 +08:00
parent fe0fc63843
commit 0a5a6e6a4b
2 changed files with 3 additions and 0 deletions

View File

@ -24,6 +24,7 @@ class Group extends BeanModel {
SELECT monitor.* FROM monitor, monitor_group SELECT monitor.* FROM monitor, monitor_group
WHERE monitor.id = monitor_group.monitor_id WHERE monitor.id = monitor_group.monitor_id
AND group_id = ? AND group_id = ?
ORDER BY monitor_group.weight
`, [ `, [
this.id, this.id,
])); ]));

View File

@ -124,6 +124,8 @@ module.exports.statusPageSocketHandler = (socket) => {
]); ]);
let monitorOrder = 1; let monitorOrder = 1;
console.log(group.monitorList);
for (let monitor of group.monitorList) { for (let monitor of group.monitorList) {
let relationBean = R.dispense("monitor_group"); let relationBean = R.dispense("monitor_group");
relationBean.weight = monitorOrder++; relationBean.weight = monitorOrder++;