-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from linkdotnet/feature/refactor-visit-page-count
Feature/refactor visit page count
- Loading branch information
Showing
11 changed files
with
160 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
LinkDotNet.Blog.Web/Shared/Admin/Dashboard/DateRangeSelector.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<div class="col-1"> | ||
<p>Since: </p> | ||
</div> | ||
<div class="col-2"> | ||
<select @onchange="RaiseDateTimeSpanChanged"> | ||
@foreach (var (title, time) in options) | ||
{ | ||
<option value="@time">@title</option> | ||
} | ||
</select> | ||
</div> | ||
@code { | ||
[Parameter] | ||
public EventCallback<DateTime> DateTimeSpanChanged { get; set; } | ||
|
||
private readonly Dictionary<string, DateTime> options = new() | ||
{ | ||
{ "Beginning of time", DateTime.MinValue }, | ||
{ "Last 90 Days", DateTime.UtcNow.AddDays(-90) }, | ||
{ "Last 30 Days", DateTime.UtcNow.AddDays(-30) }, | ||
{ "Last 7 Days", DateTime.UtcNow.AddDays(-7) }, | ||
{ "Since Today", DateTime.UtcNow.Date }, | ||
}; | ||
|
||
private async Task RaiseDateTimeSpanChanged(ChangeEventArgs args) | ||
{ | ||
await DateTimeSpanChanged.InvokeAsync(DateTime.Parse(args.Value!.ToString())); | ||
} | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
LinkDotNet.Blog.Web/Shared/Admin/Dashboard/VisitCountPageData.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace LinkDotNet.Blog.Web.Shared.Admin.Dashboard | ||
{ | ||
public record VisitCountPageData | ||
{ | ||
public string Id { get; init; } | ||
|
||
public string Title { get; init; } | ||
|
||
public int Likes { get; init; } | ||
|
||
public int ClickCount { get; init; } | ||
} | ||
} |
Oops, something went wrong.