diff --git a/server/model/group.js b/server/model/group.js index 8e61f938f..567f3865b 100644 --- a/server/model/group.js +++ b/server/model/group.js @@ -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, ])); diff --git a/server/socket-handlers/status-page-socket-handler.js b/server/socket-handlers/status-page-socket-handler.js index c8ca2e248..5826277c7 100644 --- a/server/socket-handlers/status-page-socket-handler.js +++ b/server/socket-handlers/status-page-socket-handler.js @@ -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++;