mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-09-28 07:36:38 +08:00
fix(monitor): hide remote nodes from monitor view
This commit is contained in:
@@ -12,6 +12,7 @@ func (r *Repository) ListMonitorNodes() ([]model.Node, error) {
|
|||||||
}
|
}
|
||||||
var nodes []model.Node
|
var nodes []model.Node
|
||||||
err := r.db.Select("id", "inx", "name", "status", "updated_time").
|
err := r.db.Select("id", "inx", "name", "status", "updated_time").
|
||||||
|
Where("is_remote = ?", 0).
|
||||||
Order("inx ASC, id ASC").
|
Order("inx ASC, id ASC").
|
||||||
Find(&nodes).Error
|
Find(&nodes).Error
|
||||||
return nodes, err
|
return nodes, err
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# 057 Hide Remote Nodes from Monitor View
|
||||||
|
|
||||||
|
## Goal
|
||||||
|
Do not display remote nodes on the Monitoring page.
|
||||||
|
|
||||||
|
## Changes Made
|
||||||
|
- Modified `ListMonitorNodes` in `go-backend/internal/store/repo/repository_monitor_nodes.go` by adding a `.Where("is_remote = ?", 0)` constraint so that remote nodes (imported via Federation feature) are entirely excluded from the returned payload for API `/api/v1/monitor/nodes`.
|
||||||
|
- This efficiently removes remote nodes from both the grid/list displaying Node stats in the Monitoring tab and also eliminates remote nodes from the selection dropdown when creating new Service Monitors.
|
||||||
|
|
||||||
|
## Checklist
|
||||||
|
- [x] Identify how "remote node" is defined in the database structure (`IsRemote` = 1 or 0).
|
||||||
|
- [x] Add SQL query constraint to filter out remote nodes from the `/monitor/nodes` API response.
|
||||||
|
- [x] Verify changes compile successfully.
|
||||||
Reference in New Issue
Block a user