Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
#13 #14 #15 Cache time increased + styling of links, add brs
Browse files Browse the repository at this point in the history
  • Loading branch information
rhiskey committed May 4, 2021
1 parent a0e933f commit cc39ae5
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
@using System.Linq;
@using System.Threading;

@using HVMDash.Client.Components

@inject HttpClient Http

<h3>Actions</h3>
<h3>Posts</h3>

<h5>Latest Posts</h5>
@*<MudButton OnClick="@OnClickStartEvent">Start</MudButton>*@

<MudGrid>
@*<MudItem xs="12">
<MudPaper Class="d-flex align-center justify-center mud-width-full py-8">xs=12</MudPaper>
Expand All @@ -35,8 +34,7 @@
<MudLink Href="@GetHasTagLink(msg)" Target="_blank" Typo="Typo.body1">@msg</MudLink>
<MudText Typo="Typo.body2">@date.ToString("dd.MM.yyy HH:mm")</MudText>
</CardHeaderContent>
<CardHeaderActions>
<MudIconButton Icon="@Icons.Material.Filled.Link" Color="Color.Default" Link="@GetPostLink(post.OwnerId, post.PostId)" Target="_blank"/>
<CardHeaderActions>
@* <MudIconButton Icon="@Icons.Material.Filled.Settings" Color="Color.Default" />*@
</CardHeaderActions>
</MudCardHeader>
Expand All @@ -45,14 +43,14 @@
<MudChipSet @bind-SelectedChip="selected" Filter="true" Mandatory="@mandatory">
@foreach (var attachment in post.PostedTracks)
{
@*<MudText Typo="Typo.body2"> @attachment.Trackname</MudText>*@
<MudChip Text="track" Color="Color.Primary">@attachment.Trackname</MudChip> <br/>
}
</MudChipSet>
</MudCardContent>
<MudCardActions>
<MudIconButton Icon="@Icons.Material.Filled.Link" Color="Color.Secondary" Link="@GetPostLink(post.OwnerId, post.PostId)" Target="_blank" />
@*<MudIconButton Icon="@Icons.Material.Filled.Favorite" Color="Color.Default" />
<MudIconButton Icon="@Icons.Material.Filled.Share" Color="Color.Default" />*@
<MudIconButton Icon="@Icons.Material.Filled.Share" Color="Color.Default" />*@
@*<audio autoplay controls><source src="/crooner2.mp3" /></audio>*@
</MudCardActions>
</MudCard>
Expand Down Expand Up @@ -80,6 +78,8 @@
<MudPaper Class="d-flex align-center justify-center mud-width-full py-8">xs=3</MudPaper>
</MudItem>*@
</MudGrid>
<br />
<br/>

@code {
private IEnumerable<Post> Posts = new List<Post>();
Expand Down
1 change: 1 addition & 0 deletions Client/Components/_Imports.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@using System.Net.Http
18 changes: 3 additions & 15 deletions Client/Pages/Index.razor
Original file line number Diff line number Diff line change
@@ -1,32 +1,20 @@
@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


<h1>Dashboard</h1>


@*<StyleCountChart/>*@

<ActionsComponent />
<PostsComponent />

@code{


protected override async Task OnInitializedAsync()
{
//var Playlists = await Http.GetFromJsonAsync<List<Playlist>>("Playlists");
//var PostedTracks = await Http.GetFromJsonAsync<List<PostedTrack>>("PostedTracks");
//StateContainer.PostedTracks = PostedTracks;
//StateContainer.Playlists = Playlists;

}

Expand Down
5 changes: 3 additions & 2 deletions Client/Pages/Photostocks.razor
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ else

<br />

<MudTable Items="@photostocks" Dense="@dense" Hover="@hover" ReadOnly="@ronly" Filter="new Func<ConsolePhotostock,bool>(FilterFunc)" @bind-SelectedItem="selectedItem" SortLabel="Sort By" CommitEditTooltip="Commit Edit" OnCommitEditClick="@OnCommitEditClick"
>
<MudTable Items="@photostocks" Dense="@dense" Hover="@hover" ReadOnly="@ronly" Filter="new Func<ConsolePhotostock,bool>(FilterFunc)" @bind-SelectedItem="selectedItem" SortLabel="Sort By" CommitEditTooltip="Commit Edit" OnCommitEditClick="@OnCommitEditClick">
<ToolBarContent>
<MudText Typo="Typo.h6">Photostocks</MudText>
<MudToolBarSpacer />
Expand Down Expand Up @@ -103,6 +102,8 @@ else
</YesButton>
</MudMessageBox>
}
<br />
<br />

@code {
private IEnumerable<ConsolePhotostock> photostocks = new List<ConsolePhotostock>();
Expand Down
2 changes: 2 additions & 0 deletions Client/Pages/PlaylistsEdit.razor
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ else
</YesButton>
</MudMessageBox>
}
<br />
<br />

@code {
MudMessageBox mbox { get; set; }
Expand Down
4 changes: 3 additions & 1 deletion Client/Pages/StyleCountChart.razor
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -21,6 +21,8 @@
<br />

<LastPostedTracks PostedTracks="PostedTracks" Playlists="Playlists" />
<br />
<br />

@code {

Expand Down
4 changes: 2 additions & 2 deletions Client/Shared/MainLayout.razor
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<MudAppBarSpacer />
<MudSwitch Checked="@SwitchRoleValue" CheckedChanged="@((bool t) => CheckedRoleChanged(t))" Color="Color.Warning" Label="@(SwitchRoleValue ? "Admin" : "User")"></MudSwitch>
<MudSwitch Checked="@SwitchThemeValue" CheckedChanged="@((bool t) => CheckedChanged(t))" Color="Color.Secondary" Label="@(SwitchThemeValue ? "Dark On" : "Dark Off")"></MudSwitch>
<MudLink Href="https://vk.com/hvmlabel" Target="_blank">About</MudLink>
<MudLink Href="https://vk.com/hvmlabel" Target="_blank" Color="Color.Secondary">About</MudLink>
</MudAppBar>
<MudSwipeArea OnSwipe="@OnSwipe" Style="width: 100%;">
<MudDrawer @bind-Open="@_drawerOpen" Elevation="1">
Expand Down Expand Up @@ -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)",
}
};
}
4 changes: 2 additions & 2 deletions Server/Controllers/ConsolePhotostocksController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions Server/Controllers/PlaylistsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions Server/Controllers/PostedTracksController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions Server/Controllers/PostsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit cc39ae5

Please sign in to comment.