no need to clear on connection anymore

This commit is contained in:
Fabricio 2018-12-02 14:36:30 -02:00
parent a1d03ff264
commit 6577238fca
2 changed files with 0 additions and 8 deletions

View file

@ -276,10 +276,6 @@ const dashboardHTML = `
}
const evt = new EventSource(<<.DashboardConnPath>>);
evt.addEventListener('connected', e => {
$scope.selectedItem = {};
$scope.$apply();
});
evt.addEventListener('captures', e => {
$scope.items = JSON.parse(e.data);
if (!$scope.items.find(i => i.id == $scope.selectedItem.id)) {

View file

@ -58,10 +58,6 @@ func NewDashboardConnHandler(list *CaptureList) http.HandlerFunc {
}
rw.Header().Set("Content-Type", "text/event-stream")
rw.Header().Set("Cache-Control", "no-cache")
fmt.Fprintf(rw, "event: connected\ndata: %s\n\n", "clear")
rw.(http.Flusher).Flush()
for {
jsn, _ := json.Marshal(list.ItemsAsMetadata())
fmt.Fprintf(rw, "event: captures\ndata: %s\n\n", jsn)