Skip to content

Commit

Permalink
NOISSUE - Fix Default view Bug (#28)
Browse files Browse the repository at this point in the history
* Fix default filter logic in ServeUI method

The default filter logic in the ServeUI method has been fixed to include all filters (city, country, service, and version) when checking if the "From" and "To" filters are zero. This ensures that the default filter is applied correctly when all other filters are empty.

This commit addresses the following issue:
- The default filter logic was not correctly considering all filters when determining if the "From" and "To" filters are zero.

Signed-off-by: SammyOina <sammyoina@gmail.com>

* update web page image

Signed-off-by: SammyOina <sammyoina@gmail.com>

---------

Signed-off-by: SammyOina <sammyoina@gmail.com>
  • Loading branch information
SammyOina authored Jan 25, 2024
1 parent e42d1e3 commit c06f322
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
Binary file modified assets/images/website.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion service.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (ts *telemetryService) RetrieveSummary(ctx context.Context, filters Telemet
func (ts *telemetryService) ServeUI(ctx context.Context, filters TelemetryFilters) ([]byte, error) {
tmpl := template.Must(template.ParseFiles("./web/template/index.html"))

if filters.From.IsZero() && filters.To.IsZero() {
if filters.From.IsZero() && filters.To.IsZero() && filters.City == "" && filters.Country == "" && filters.Service == "" && filters.Version == "" {
filters.From = time.Now().Add(-time.Hour)
}

Expand Down

0 comments on commit c06f322

Please sign in to comment.