File tree Expand file tree Collapse file tree 2 files changed +55
-22
lines changed
LinkDotNet.Blog.Web/Shared/Admin/Dashboard Expand file tree Collapse file tree 2 files changed +55
-22
lines changed Original file line number Diff line number Diff line change
1
+ <div class =" col-1" >
2
+ <p >Since: </p >
3
+ </div >
4
+ <div class =" col-2" >
5
+ <select @onchange =" RaiseDateTimeSpanChanged" >
6
+ @foreach ( var (title , time ) in options )
7
+ {
8
+ <option value =" @time" >@title </option >
9
+ }
10
+ </select >
11
+ </div >
12
+ @code {
13
+ [Parameter ]
14
+ public EventCallback <DateTime > DateTimeSpanChanged { get ; set ; }
15
+
16
+ private readonly Dictionary <string , DateTime > options = new ()
17
+ {
18
+ { " Beginning of time" , DateTime .MinValue },
19
+ { " Last 90 Days" , DateTime .UtcNow .AddDays (- 90 ) },
20
+ { " Last 30 Days" , DateTime .UtcNow .AddDays (- 30 ) },
21
+ { " Last 7 Days" , DateTime .UtcNow .AddDays (- 7 ) },
22
+ { " Since Today" , DateTime .UtcNow .Date },
23
+ };
24
+
25
+ private void RaiseDateTimeSpanChanged (ChangeEventArgs args )
26
+ {
27
+ Console .WriteLine (args .Value );
28
+ }
29
+
30
+ }
Original file line number Diff line number Diff line change 8
8
<div class =" card" >
9
9
<div class =" card-header" >Blog Post Visit Counts</div >
10
10
<div class =" card-body" >
11
- <table class =" table table-striped table-hover " >
12
- <tbody >
13
- <tr >
14
- <th >Title</ th >
15
- <th >Clicks</ th >
16
- <th >Likes </th >
17
- </ tr >
18
- @if ( visitData != null )
19
- {
20
- @foreach ( var date in visitData )
11
+ <div class =" row " >
12
+ <DateRangeSelector ></ DateRangeSelector >
13
+ <table class = " table table-striped table-hover " >
14
+ <tbody >
15
+ <tr >
16
+ <th >Title </th >
17
+ < th >Clicks</ th >
18
+ < th >Likes</ th >
19
+ </ tr >
20
+ @if ( visitData != null )
21
21
{
22
- <tr >
23
- <td ><a href =" blogPost/@date.Id" >@date.Title </a ></td >
24
- <td >@date.ClickCount </td >
25
- <td >@date.Likes </td >
26
- </tr >
22
+ @foreach ( var date in visitData )
23
+ {
24
+ <tr >
25
+ <td ><a href =" blogPost/@date.Id" >@date.Title </a ></td >
26
+ <td >@date.ClickCount </td >
27
+ <td >@date.Likes </td >
28
+ </tr >
29
+ }
27
30
}
28
- }
29
- else
30
- {
31
- < Loading ></ Loading >
32
- }
33
- </tbody >
34
- </table >
31
+ else
32
+ {
33
+ < Loading ></ Loading >
34
+ }
35
+ </ tbody >
36
+ </table >
37
+ </div >
35
38
</div >
36
39
</div >
37
40
You can’t perform that action at this time.
0 commit comments