Skip to content

Commit

Permalink
Merge pull request #97 from jovandeginste/prepare-multi-stats
Browse files Browse the repository at this point in the history
Prepare code for showing different statistic ranges
  • Loading branch information
jovandeginste authored Apr 13, 2024
2 parents d2d03a9 + 36ced7b commit 6a69273
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
Binary file added docs/login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions pkg/database/statistics.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ func (sc *StatConfig) GetSince() string {
}

func (u *User) GetDefaultStatistics() (*Statistics, error) {
return u.GetStatisticsFor("-1 year", "month")
}

func (u *User) GetStatisticsFor(since, per string) (*Statistics, error) {
return u.GetStatistics(StatConfig{
Since: "-1 year",
Per: "month",
Since: since,
Per: per,
})
}

Expand Down
25 changes: 25 additions & 0 deletions screenshots.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { browser } from "k6/experimental/browser";

export const options = {
scenarios: {
browser: {
executor: "shared-iterations",
options: {
browser: {
type: "chromium",
},
},
},
},
};

export default async function () {
const page = browser.newPage();

try {
await page.goto("http://localhost:8080");
page.screenshot({ path: "docs/login.png" });
} finally {
page.close();
}
}
1 change: 0 additions & 1 deletion views/user/user_statistics.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ <h3 class="{{ IconFor `max-speed` }}">{{ i18n "Max speed" }}</h3>
unit: "month",
tooltipFormat: "MMM yyyy",
},
min: new Date(new Date().setFullYear(new Date().getFullYear() - 1)),
};

speedChartOptions = {
Expand Down

0 comments on commit 6a69273

Please sign in to comment.