Live: publish all dashboard changes to a single channel (#29474)

This commit is contained in:
Ryan McKinley 2020-12-01 07:56:56 -08:00 committed by GitHub
parent 546f569e0c
commit e0dee06252
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -48,7 +48,11 @@ func (h *DashboardHandler) publish(event dashboardEvent) error {
if err != nil {
return err
}
return h.Publisher("grafana/dashboard/"+event.UID, msg)
err = h.Publisher("grafana/dashboard/uid/"+event.UID, msg)
if err != nil {
return err
}
return h.Publisher("grafana/dashboard/changes", msg)
}
// DashboardSaved will broadcast to all connected dashboards

View File

@ -61,13 +61,11 @@ class DashboardWatcher {
this.channel = live.getChannel({
scope: LiveChannelScope.Grafana,
namespace: 'dashboard',
path: uid,
path: `uid/${uid}`,
});
this.channel.getStream().subscribe(this.observer);
this.uid = uid;
}
console.log('Watch', uid);
}
leave() {