mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
parent
a3958ac24c
commit
e0799bbc59
1 changed files with 2 additions and 2 deletions
|
|
@ -402,7 +402,7 @@ func (d *Datastore) ListLabelsForHost(hid uint) ([]*fleet.Label, error) {
|
||||||
// with fleet.Label referened by Label ID
|
// with fleet.Label referened by Label ID
|
||||||
func (d *Datastore) ListHostsInLabel(filter fleet.TeamFilter, lid uint, opt fleet.HostListOptions) ([]*fleet.Host, error) {
|
func (d *Datastore) ListHostsInLabel(filter fleet.TeamFilter, lid uint, opt fleet.HostListOptions) ([]*fleet.Host, error) {
|
||||||
sql := fmt.Sprintf(`
|
sql := fmt.Sprintf(`
|
||||||
SELECT h.*
|
SELECT h.*, (SELECT name FROM teams t WHERE t.id = h.team_id) AS team_name
|
||||||
FROM label_membership lm
|
FROM label_membership lm
|
||||||
JOIN hosts h
|
JOIN hosts h
|
||||||
ON lm.host_id = h.id
|
ON lm.host_id = h.id
|
||||||
|
|
@ -429,7 +429,7 @@ func (d *Datastore) ListUniqueHostsInLabels(filter fleet.TeamFilter, labels []ui
|
||||||
}
|
}
|
||||||
|
|
||||||
sqlStatement := fmt.Sprintf(`
|
sqlStatement := fmt.Sprintf(`
|
||||||
SELECT DISTINCT h.*
|
SELECT DISTINCT h.*, (SELECT name FROM teams t WHERE t.id = h.team_id) AS team_name
|
||||||
FROM label_membership lm
|
FROM label_membership lm
|
||||||
JOIN hosts h
|
JOIN hosts h
|
||||||
ON lm.host_id = h.id
|
ON lm.host_id = h.id
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue