[status page] fix monitor order

pull/124/head
LouisLam 3 years ago
parent fe0fc63843
commit 0a5a6e6a4b

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

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

Loading…
Cancel
Save