mirror of
https://github.com/hmaxnl/SharpRSS.git
synced 2025-01-18 21:04:21 +01:00
Compare commits
No commits in common. "69eeb5c44e7892b725017d7ee6af5901868694df" and "5bb96a48eeebc5bb8ec1edfa0fc76daf6e619282" have entirely different histories.
69eeb5c44e
...
5bb96a48ee
|
@ -9,18 +9,12 @@
|
||||||
<link rel="stylesheet" href="app.css"/>
|
<link rel="stylesheet" href="app.css"/>
|
||||||
<link rel="stylesheet" href="SharpRSS.Blazor.styles.css"/>
|
<link rel="stylesheet" href="SharpRSS.Blazor.styles.css"/>
|
||||||
<link rel="icon" type="image/png" href="favicon.png"/>
|
<link rel="icon" type="image/png" href="favicon.png"/>
|
||||||
@*MudBlazor*@
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" />
|
|
||||||
<link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" />
|
|
||||||
<HeadOutlet/>
|
<HeadOutlet/>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
@*Rendermode to 'InteractiveServer' or else MudBlazor will not work with interactivity*@
|
<Routes/>
|
||||||
<Routes @rendermode="InteractiveServer"/>
|
|
||||||
<script src="_framework/blazor.web.js"></script>
|
<script src="_framework/blazor.web.js"></script>
|
||||||
@*MudBlazor*@
|
|
||||||
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
|
@ -1,29 +0,0 @@
|
||||||
@inherits LayoutComponentBase
|
|
||||||
@layout BaseLayout
|
|
||||||
|
|
||||||
<CascadingValue Value="this">
|
|
||||||
<MudAppBar Color="Color.Primary">
|
|
||||||
<MudIconButton Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" Edge="Edge.Start" OnClick="@((e) => ToggleDrawerOpen())" />
|
|
||||||
<MudText Typo="Typo.h6">@AppText</MudText>
|
|
||||||
<MudSpacer/>
|
|
||||||
<MudTooltip Text="Go to the source code on GitHub">
|
|
||||||
<MudIconButton Icon="@Icons.Custom.Brands.GitHub" Href="https://github.com/hmaxnl/SharpRSS" Target="_blank"/>
|
|
||||||
</MudTooltip>
|
|
||||||
<MudTooltip Text="@(BaseLayout.DarkTheme ? "Toggle to light mode" : "Toggle to dark mode")">
|
|
||||||
<MudToggleIconButton @bind-Toggled="@BaseLayout.DarkTheme" Color="Color.Dark" ToggledColor="Color.Warning" Icon="@Icons.Material.Filled.DarkMode" ToggledIcon="@Icons.Material.Filled.LightMode"/>
|
|
||||||
</MudTooltip>
|
|
||||||
</MudAppBar>
|
|
||||||
@Body
|
|
||||||
</CascadingValue>
|
|
||||||
|
|
||||||
@code {
|
|
||||||
[CascadingParameter]
|
|
||||||
public BaseLayout BaseLayout { get; set; } = null!;
|
|
||||||
public bool DrawerOpen { get; set; } = true;
|
|
||||||
public string AppText { get; set; } = "SharpRSS";
|
|
||||||
|
|
||||||
private void ToggleDrawerOpen()
|
|
||||||
{
|
|
||||||
DrawerOpen = !DrawerOpen;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,46 +0,0 @@
|
||||||
@inherits LayoutComponentBase
|
|
||||||
|
|
||||||
<MudThemeProvider @ref="@_themeProvider" Theme="@MudTheme" IsDarkMode="@DarkTheme"/>
|
|
||||||
<MudDialogProvider/>
|
|
||||||
<MudSnackbarProvider/>
|
|
||||||
|
|
||||||
<CascadingValue Value="this">
|
|
||||||
<MudLayout>
|
|
||||||
<MudMainContent>
|
|
||||||
@Body
|
|
||||||
</MudMainContent>
|
|
||||||
</MudLayout>
|
|
||||||
</CascadingValue>
|
|
||||||
|
|
||||||
@code {
|
|
||||||
public readonly MudTheme MudTheme = new MudTheme();
|
|
||||||
private MudThemeProvider? _themeProvider;
|
|
||||||
private bool _isDarkTheme = true;
|
|
||||||
|
|
||||||
public event EventHandler<bool>? OnDarkThemeChanged;
|
|
||||||
|
|
||||||
public bool DarkTheme
|
|
||||||
{
|
|
||||||
get => _isDarkTheme;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_isDarkTheme = value;
|
|
||||||
ThemeChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void ThemeChanged()
|
|
||||||
{
|
|
||||||
//TODO: Update user settings
|
|
||||||
StateHasChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
|
||||||
{
|
|
||||||
if (firstRender && _themeProvider != null)
|
|
||||||
{
|
|
||||||
DarkTheme = await _themeProvider.GetSystemPreference();
|
|
||||||
_themeProvider.IsDarkModeChanged = EventCallback.Factory.Create<bool>(this, x => OnDarkThemeChanged?.Invoke(this, x));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
@inherits LayoutComponentBase
|
|
||||||
@layout BaseLayout
|
|
||||||
|
|
||||||
@Body
|
|
||||||
|
|
||||||
@code {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,18 +1,23 @@
|
||||||
@inherits LayoutComponentBase
|
@inherits LayoutComponentBase
|
||||||
@layout ApplicationLayout
|
|
||||||
|
|
||||||
<PageTitle>SharpRSS</PageTitle>
|
<div class="page">
|
||||||
|
<div class="sidebar">
|
||||||
|
<NavMenu/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<MudDrawer @bind-Open="@ApplicationLayout.DrawerOpen" ClipMode="DrawerClipMode.Always">
|
<main>
|
||||||
<MudNavMenu>
|
<div class="top-row px-4">
|
||||||
<MudNavLink Match="NavLinkMatch.All" Icon="@Icons.Material.Filled.Home" Href="/">Home</MudNavLink>
|
<a href="https://learn.microsoft.com/aspnet/core/" target="_blank">About</a>
|
||||||
</MudNavMenu>
|
</div>
|
||||||
<MudSpacer/>
|
|
||||||
</MudDrawer>
|
|
||||||
@Body
|
|
||||||
|
|
||||||
@code
|
<article class="content px-4">
|
||||||
{
|
@Body
|
||||||
[CascadingParameter]
|
</article>
|
||||||
public ApplicationLayout ApplicationLayout { get; set; } = null!;
|
</main>
|
||||||
}
|
</div>
|
||||||
|
|
||||||
|
<div id="blazor-error-ui">
|
||||||
|
An unhandled error has occurred.
|
||||||
|
<a href="" class="reload">Reload</a>
|
||||||
|
<a class="dismiss">🗙</a>
|
||||||
|
</div>
|
20
SharpRSS.Blazor/Components/Pages/Counter.razor
Normal file
20
SharpRSS.Blazor/Components/Pages/Counter.razor
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
@page "/counter"
|
||||||
|
@rendermode InteractiveServer
|
||||||
|
|
||||||
|
<PageTitle>Counter</PageTitle>
|
||||||
|
|
||||||
|
<h1>Counter</h1>
|
||||||
|
|
||||||
|
<p role="status">Current count: @currentCount</p>
|
||||||
|
|
||||||
|
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
private int currentCount = 0;
|
||||||
|
|
||||||
|
private void IncrementCount()
|
||||||
|
{
|
||||||
|
currentCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -2,6 +2,6 @@
|
||||||
|
|
||||||
<PageTitle>Home</PageTitle>
|
<PageTitle>Home</PageTitle>
|
||||||
|
|
||||||
<MudText Typo="Typo.h4">Mud text!</MudText>
|
<h1>Hello, world!</h1>
|
||||||
|
|
||||||
Welcome to your new app.
|
Welcome to your new app.
|
67
SharpRSS.Blazor/Components/Pages/Weather.razor
Normal file
67
SharpRSS.Blazor/Components/Pages/Weather.razor
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
@page "/weather"
|
||||||
|
@attribute [StreamRendering]
|
||||||
|
|
||||||
|
<PageTitle>Weather</PageTitle>
|
||||||
|
|
||||||
|
<h1>Weather</h1>
|
||||||
|
|
||||||
|
<p>This component demonstrates showing data.</p>
|
||||||
|
|
||||||
|
@if (forecasts == null)
|
||||||
|
{
|
||||||
|
<p>
|
||||||
|
<em>Loading...</em>
|
||||||
|
</p>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Date</th>
|
||||||
|
<th>Temp. (C)</th>
|
||||||
|
<th>Temp. (F)</th>
|
||||||
|
<th>Summary</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach (var forecast in forecasts)
|
||||||
|
{
|
||||||
|
<tr>
|
||||||
|
<td>@forecast.Date.ToShortDateString()</td>
|
||||||
|
<td>@forecast.TemperatureC</td>
|
||||||
|
<td>@forecast.TemperatureF</td>
|
||||||
|
<td>@forecast.Summary</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
}
|
||||||
|
|
||||||
|
@code {
|
||||||
|
private WeatherForecast[]? forecasts;
|
||||||
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
// Simulate asynchronous loading to demonstrate streaming rendering
|
||||||
|
await Task.Delay(500);
|
||||||
|
|
||||||
|
var startDate = DateOnly.FromDateTime(DateTime.Now);
|
||||||
|
var summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" };
|
||||||
|
forecasts = Enumerable.Range(1, 5).Select(index => new WeatherForecast
|
||||||
|
{
|
||||||
|
Date = startDate.AddDays(index),
|
||||||
|
TemperatureC = Random.Shared.Next(-20, 55),
|
||||||
|
Summary = summaries[Random.Shared.Next(summaries.Length)]
|
||||||
|
}).ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
private class WeatherForecast
|
||||||
|
{
|
||||||
|
public DateOnly Date { get; set; }
|
||||||
|
public int TemperatureC { get; set; }
|
||||||
|
public string? Summary { get; set; }
|
||||||
|
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -6,9 +6,5 @@
|
||||||
@using static Microsoft.AspNetCore.Components.Web.RenderMode
|
@using static Microsoft.AspNetCore.Components.Web.RenderMode
|
||||||
@using Microsoft.AspNetCore.Components.Web.Virtualization
|
@using Microsoft.AspNetCore.Components.Web.Virtualization
|
||||||
@using Microsoft.JSInterop
|
@using Microsoft.JSInterop
|
||||||
@*SharpRSS*@
|
|
||||||
@using SharpRSS.Blazor
|
@using SharpRSS.Blazor
|
||||||
@using SharpRSS.Blazor.Components
|
@using SharpRSS.Blazor.Components
|
||||||
@*MudBlazor*@
|
|
||||||
@using MudBlazor
|
|
||||||
@using MudBlazor.Components
|
|
|
@ -1,5 +1,4 @@
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using MudBlazor.Services;
|
|
||||||
using SharpRSS.Blazor.Components;
|
using SharpRSS.Blazor.Components;
|
||||||
using SharpRSS.Business;
|
using SharpRSS.Business;
|
||||||
using SharpRSS.Data;
|
using SharpRSS.Data;
|
||||||
|
@ -11,7 +10,6 @@ builder.UseSRSS();
|
||||||
// Add services to the container.
|
// Add services to the container.
|
||||||
builder.Services.AddRazorComponents()
|
builder.Services.AddRazorComponents()
|
||||||
.AddInteractiveServerComponents();
|
.AddInteractiveServerComponents();
|
||||||
builder.Services.AddMudServices();
|
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,4 @@
|
||||||
<ProjectReference Include="..\SharpRSS.Core\SharpRSS.Core.csproj" />
|
<ProjectReference Include="..\SharpRSS.Core\SharpRSS.Core.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="MudBlazor" Version="6.20.0" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -14,9 +14,4 @@
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.6" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Domains\" />
|
|
||||||
<Folder Include="Repositories\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -24,10 +24,9 @@ git push
|
||||||
git config --global status.submoduleSummary true
|
git config --global status.submoduleSummary true
|
||||||
|
|
||||||
|
|
||||||
## Update submodule if submodule has changed
|
## Update all submoduels
|
||||||
git submodule update --remote --merge
|
git submodule update --remote --merge
|
||||||
|
|
||||||
git commit -m "Submodule updated!"
|
|
||||||
|
|
||||||
## Remove submodule
|
## Remove submodule
|
||||||
git rm <path-to-submodule>
|
git rm <path-to-submodule>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user