Browse Source

[status page] fix monitor order

pull/124/head
LouisLam 3 years ago
parent
commit
0a5a6e6a4b
  1. 1
      server/model/group.js
  2. 2
      server/socket-handlers/status-page-socket-handler.js

1
server/model/group.js

@ -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,
])); ]));

2
server/socket-handlers/status-page-socket-handler.js

@ -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++;

Loading…
Cancel
Save