From cc39ae5f93703d656cd350825d6f3b2e8907e938 Mon Sep 17 00:00:00 2001 From: Vladimir Kiselev Date: Tue, 4 May 2021 11:24:18 +0300 Subject: [PATCH] #13 #14 #15 Cache time increased + styling of links, add brs --- ...onsComponent.razor => PostsComponent.razor} | 14 +++++++------- Client/Components/_Imports.razor | 1 + Client/Pages/Index.razor | 18 +++--------------- Client/Pages/Photostocks.razor | 5 +++-- Client/Pages/PlaylistsEdit.razor | 2 ++ Client/Pages/StyleCountChart.razor | 4 +++- Client/Shared/MainLayout.razor | 4 ++-- .../ConsolePhotostocksController.cs | 4 ++-- Server/Controllers/PlaylistsController.cs | 4 ++-- Server/Controllers/PostedTracksController.cs | 4 ++-- Server/Controllers/PostsController.cs | 4 ++-- 11 files changed, 29 insertions(+), 35 deletions(-) rename Client/Components/{ActionsComponent.razor => PostsComponent.razor} (89%) create mode 100644 Client/Components/_Imports.razor diff --git a/Client/Components/ActionsComponent.razor b/Client/Components/PostsComponent.razor similarity index 89% rename from Client/Components/ActionsComponent.razor rename to Client/Components/PostsComponent.razor index 48d6f3a..e8904d7 100644 --- a/Client/Components/ActionsComponent.razor +++ b/Client/Components/PostsComponent.razor @@ -7,14 +7,13 @@ @using System.Linq; @using System.Threading; -@using HVMDash.Client.Components @inject HttpClient Http -

Actions

+

Posts

Latest Posts
-@*Start*@ + @* xs=12 @@ -35,8 +34,7 @@ @msg @date.ToString("dd.MM.yyy HH:mm") - - + @* *@ @@ -45,14 +43,14 @@ @foreach (var attachment in post.PostedTracks) { - @* @attachment.Trackname*@ @attachment.Trackname
}
+ @* - *@ + *@ @**@ @@ -80,6 +78,8 @@ xs=3
*@
+
+
@code { private IEnumerable Posts = new List(); diff --git a/Client/Components/_Imports.razor b/Client/Components/_Imports.razor new file mode 100644 index 0000000..06f74c1 --- /dev/null +++ b/Client/Components/_Imports.razor @@ -0,0 +1 @@ +@using System.Net.Http \ No newline at end of file diff --git a/Client/Pages/Index.razor b/Client/Pages/Index.razor index 05fd465..0e24504 100644 --- a/Client/Pages/Index.razor +++ b/Client/Pages/Index.razor @@ -1,10 +1,7 @@ @page "/" -@using HVMDash.Client.Components +@using HVMDash.Client.Components @using HVMDash.Shared -@using vkaudioposter_ef.parser; -@using System.Net.Http.Json -@using System.Collections.Generic; -@using System.Linq; + @inject HttpClient Http @inject StateContainer StateContainer @@ -12,21 +9,12 @@

Dashboard

- -@**@ - - + @code{ - protected override async Task OnInitializedAsync() { - //var Playlists = await Http.GetFromJsonAsync>("Playlists"); - //var PostedTracks = await Http.GetFromJsonAsync>("PostedTracks"); - - //StateContainer.PostedTracks = PostedTracks; - //StateContainer.Playlists = Playlists; } diff --git a/Client/Pages/Photostocks.razor b/Client/Pages/Photostocks.razor index cc37316..21a12e3 100644 --- a/Client/Pages/Photostocks.razor +++ b/Client/Pages/Photostocks.razor @@ -43,8 +43,7 @@ else
- + Photostocks @@ -103,6 +102,8 @@ else } +
+
@code { private IEnumerable photostocks = new List(); diff --git a/Client/Pages/PlaylistsEdit.razor b/Client/Pages/PlaylistsEdit.razor index 4aeb08e..5fbb356 100644 --- a/Client/Pages/PlaylistsEdit.razor +++ b/Client/Pages/PlaylistsEdit.razor @@ -112,6 +112,8 @@ else } +
+
@code { MudMessageBox mbox { get; set; } diff --git a/Client/Pages/StyleCountChart.razor b/Client/Pages/StyleCountChart.razor index 104a55e..c2377fd 100644 --- a/Client/Pages/StyleCountChart.razor +++ b/Client/Pages/StyleCountChart.razor @@ -5,7 +5,7 @@ @using System.Net.Http.Json @using System.Collections.Generic; @using System.Linq; -@using System.Threading; +@using System.Threading; @using HVMDash.Client.Components @@ -21,6 +21,8 @@
+
+
@code { diff --git a/Client/Shared/MainLayout.razor b/Client/Shared/MainLayout.razor index d6138f5..e707fd8 100644 --- a/Client/Shared/MainLayout.razor +++ b/Client/Shared/MainLayout.razor @@ -6,7 +6,7 @@ - About + About @@ -132,7 +132,7 @@ TextSecondary = "rgba(255,255,255, 0.50)", ActionDefault = "#adadb1", ActionDisabled = "rgba(255,255,255, 0.26)", - ActionDisabledBackground = "rgba(255,255,255, 0.12)" + ActionDisabledBackground = "rgba(255,255,255, 0.12)", } }; } \ No newline at end of file diff --git a/Server/Controllers/ConsolePhotostocksController.cs b/Server/Controllers/ConsolePhotostocksController.cs index 39f52d6..43a57d0 100644 --- a/Server/Controllers/ConsolePhotostocksController.cs +++ b/Server/Controllers/ConsolePhotostocksController.cs @@ -22,9 +22,9 @@ public class ConsolePhotostocksController : ControllerBase private readonly MemoryCacheEntryOptions cacheExpiryOptions = new MemoryCacheEntryOptions { - AbsoluteExpiration = DateTime.Now.AddMinutes(5), + AbsoluteExpiration = DateTime.Now.AddDays(7), Priority = CacheItemPriority.High, - SlidingExpiration = TimeSpan.FromMinutes(2) + SlidingExpiration = TimeSpan.FromDays(3) }; public ConsolePhotostocksController(IMemoryCache memoryCache, ConsolePhotostockContext context) diff --git a/Server/Controllers/PlaylistsController.cs b/Server/Controllers/PlaylistsController.cs index bf3cb93..6af389b 100644 --- a/Server/Controllers/PlaylistsController.cs +++ b/Server/Controllers/PlaylistsController.cs @@ -24,9 +24,9 @@ public class PlaylistsController : ControllerBase private readonly MemoryCacheEntryOptions cacheExpiryOptions = new MemoryCacheEntryOptions { - AbsoluteExpiration = DateTime.Now.AddMinutes(5), + AbsoluteExpiration = DateTime.Now.AddDays(7), Priority = CacheItemPriority.High, - SlidingExpiration = TimeSpan.FromMinutes(2) + SlidingExpiration = TimeSpan.FromDays(3) }; public PlaylistsController(IMemoryCache memoryCache, PlaylistContext context) diff --git a/Server/Controllers/PostedTracksController.cs b/Server/Controllers/PostedTracksController.cs index 842f1ed..4e53f14 100644 --- a/Server/Controllers/PostedTracksController.cs +++ b/Server/Controllers/PostedTracksController.cs @@ -22,9 +22,9 @@ public class PostedTracksController : ControllerBase private readonly string cacheKey = "LastPostedTracksList"; private readonly MemoryCacheEntryOptions cacheExpiryOptions = new MemoryCacheEntryOptions { - AbsoluteExpiration = DateTime.Now.AddMinutes(5), + AbsoluteExpiration = DateTime.Now.AddHours(2), Priority = CacheItemPriority.High, - SlidingExpiration = TimeSpan.FromMinutes(2) + SlidingExpiration = TimeSpan.FromMinutes(30) }; public PostedTracksController(IMemoryCache memoryCache, PostedTracksContext context) { diff --git a/Server/Controllers/PostsController.cs b/Server/Controllers/PostsController.cs index 8bf2eb3..6f9499b 100644 --- a/Server/Controllers/PostsController.cs +++ b/Server/Controllers/PostsController.cs @@ -23,9 +23,9 @@ public class PostsController : ControllerBase private readonly string cacheKey = "PostsList"; private readonly MemoryCacheEntryOptions cacheExpiryOptions = new MemoryCacheEntryOptions { - AbsoluteExpiration = DateTime.Now.AddMinutes(5), + AbsoluteExpiration = DateTime.Now.AddDays(1), Priority = CacheItemPriority.High, - SlidingExpiration = TimeSpan.FromMinutes(2) + SlidingExpiration = TimeSpan.FromHours(6) }; public PostsController(IMemoryCache memoryCache, PostContext context) {