mirror of
https://github.com/hmaxnl/SharpRSS.git
synced 2025-01-18 21:04:21 +01:00
Inplementing bootstrapper & updated 'ToolQit'
This commit is contained in:
parent
3351abad20
commit
cc28ebf6ac
2
ToolQit
2
ToolQit
|
@ -1 +1 @@
|
|||
Subproject commit d2d3f1b864d8eb424063735d721c1b310c9ab0df
|
||||
Subproject commit 49ec417fbaa33042d32a392dd2c432c386a7c5bf
|
29
WebSharpRSS/Bootstrapper.cs
Normal file
29
WebSharpRSS/Bootstrapper.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using Serilog;
|
||||
using Serilog.Formatting.Json;
|
||||
using ToolQit;
|
||||
using ToolQit.Containers;
|
||||
|
||||
namespace WebSharpRSS
|
||||
{
|
||||
public static class Bootstrapper
|
||||
{
|
||||
public static void SetContainerDefaults(this DataContainer dataCon)
|
||||
{
|
||||
dataCon.Set("FaviconResolveUrl", "https://icons.duckduckgo.com/ip3/{0}.ico");
|
||||
dataCon.Set("LogPath", Path.Combine(Environment.CurrentDirectory, "logs", "log_.json"));
|
||||
}
|
||||
|
||||
private static LoggerConfiguration? _configuration;
|
||||
public static void SetupLogging()
|
||||
{
|
||||
if (_configuration != null) return;
|
||||
_configuration = new LoggerConfiguration()
|
||||
.WriteTo.Console()
|
||||
.WriteTo.File(new JsonFormatter(), Caretaker.Settings.GetString("LogPath"), rollingInterval: RollingInterval.Day)
|
||||
.MinimumLevel.Verbose();
|
||||
Log.Logger = _configuration.CreateLogger();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,24 +1,7 @@
|
|||
@page "/"
|
||||
@inject RssService _rssService
|
||||
|
||||
@*<MudGrid Style="margin-left: 5px; margin-top: 5px">
|
||||
@for (int i = 0; i < 10; i++)
|
||||
{
|
||||
<MudCard Style="margin: 3px">
|
||||
<MudCardMedia Image="https://mudblazor.com/images/door.jpg" Height="200" />
|
||||
<MudCardContent>
|
||||
<MudText Typo="Typo.h5">Old Paint</MudText>
|
||||
<MudText Typo="Typo.body2">Old paint found on a stone house door.</MudText>
|
||||
<MudText Typo="Typo.body2">This photo was taken in a small village in Istra Croatia.</MudText>
|
||||
</MudCardContent>
|
||||
<MudCardActions>
|
||||
<MudButton Variant="Variant.Text" Color="Color.Primary">Share</MudButton>
|
||||
<MudButton Variant="Variant.Text" Color="Color.Primary">Learn More</MudButton>
|
||||
</MudCardActions>
|
||||
</MudCard>
|
||||
}
|
||||
|
||||
</MudGrid>*@
|
||||
|
||||
@code {
|
||||
|
||||
|
|
|
@ -3,7 +3,13 @@ using Microsoft.Extensions.DependencyInjection;
|
|||
using Microsoft.Extensions.Hosting;
|
||||
using MudBlazor;
|
||||
using MudBlazor.Services;
|
||||
using Serilog;
|
||||
using SharpRss;
|
||||
using ToolQit;
|
||||
using WebSharpRSS;
|
||||
|
||||
Caretaker.Settings.SetContainerDefaults();
|
||||
Bootstrapper.SetupLogging();
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
builder.Services.AddRazorPages();
|
||||
|
@ -11,6 +17,7 @@ builder.Services.AddServerSideBlazor();
|
|||
builder.Services.AddTransient<RssService>();
|
||||
builder.Services.AddMudServices(config =>
|
||||
{
|
||||
Log.Debug("Configuring MudServices");
|
||||
config.SnackbarConfiguration.PositionClass = Defaults.Classes.Position.BottomRight;
|
||||
config.SnackbarConfiguration.PreventDuplicates = true;
|
||||
config.SnackbarConfiguration.ShowCloseIcon = true;
|
||||
|
|
4
WebSharpRSS/Settings.json
Normal file
4
WebSharpRSS/Settings.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"FaviconResolveUrl": "https://icons.duckduckgo.com/ip3/{0}.ico",
|
||||
"LogPath": "/home/max/GitHub/SharpRSS/WebSharpRSS/logs/log_.json"
|
||||
}
|
4
WebSharpRSS/defaults.json
Normal file
4
WebSharpRSS/defaults.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"FaviconResolveUrl": "https://icons.duckduckgo.com/ip3/{0}.ico",
|
||||
"LogPath": "/home/max/GitHub/SharpRSS/WebSharpRSS/logs/log_.json"
|
||||
}
|
Loading…
Reference in New Issue
Block a user