Compare commits

..

29 Commits

Author SHA1 Message Date
5360cb1f49 removed Mac Catalyst target framework from project configuration
All checks were successful
Restart Docker Container on Production / build (pull_request) Successful in 5m40s
2025-10-04 16:26:11 +02:00
f322fb4173 removed building angular app from ci-cd
All checks were successful
Restart Docker Container on Production / build (pull_request) Successful in 3m9s
2024-09-26 12:33:43 +02:00
f185b54902 umbau auf enviroment appsettings
All checks were successful
Restart Docker Container on Production / build (pull_request) Successful in 3m0s
2024-09-26 10:21:01 +02:00
2b74f17012 umbau auf enviroment appsettings
All checks were successful
Restart Docker Container on Production / build (pull_request) Successful in 3m4s
2024-09-25 10:57:23 +02:00
18fd6d6f59 umbau auf enviroment appsettings
All checks were successful
Restart Docker Container on Production / build (pull_request) Successful in 3m2s
2024-09-24 23:13:52 +02:00
c7f81e2172 umbau auf enviroment appsettings
All checks were successful
Restart Docker Container on Production / build (pull_request) Successful in 3m27s
2024-09-24 22:53:19 +02:00
20f9454f80 umbau auf enviroment appsettings
All checks were successful
Restart Docker Container on Production / build (pull_request) Successful in 4m31s
2024-09-24 22:31:15 +02:00
aa03b6ae83 umbau auf enviroment appsettings
All checks were successful
Restart Docker Container on Production / build (pull_request) Successful in 3m13s
2024-09-24 14:57:27 +02:00
eaadb96157 badge for switch implemented
All checks were successful
Restart Docker Container on Production / build (pull_request) Successful in 3m29s
2024-09-23 13:40:00 +02:00
5076367282 read backend api url from environment variables
All checks were successful
Restart Docker Container on Production / build (pull_request) Successful in 3m35s
2024-09-23 12:46:09 +02:00
b8781215ae fix dockerfile
All checks were successful
Restart Docker Container on Production / build (pull_request) Successful in 40s
2024-09-22 15:29:34 +02:00
6246bc4824 fix dockerfile
Some checks failed
Restart Docker Container on Production / build (pull_request) Failing after 4m27s
2024-09-22 15:17:28 +02:00
534af4073b fix dockerfile
All checks were successful
Restart Docker Container on Production / build (pull_request) Successful in 4m25s
2024-09-22 15:08:05 +02:00
9ecc0ecfc4 fix dockerfile
All checks were successful
Restart Docker Container on Production / build (pull_request) Successful in 3m56s
2024-09-22 14:03:18 +02:00
174a1e7b13 fix dockerfile
All checks were successful
Restart Docker Container on Production / build (pull_request) Successful in 4m45s
2024-09-22 13:42:44 +02:00
0f2d4e39c8 fix dockerfile
All checks were successful
Restart Docker Container on Production / build (pull_request) Successful in 3m47s
2024-09-22 13:26:23 +02:00
e118407c7a fix dockerfile
All checks were successful
Restart Docker Container on Production / build (pull_request) Successful in 4m6s
2024-09-22 13:17:09 +02:00
6501bfeb64 fix dockerfile
All checks were successful
Restart Docker Container on Production / build (pull_request) Successful in 4m48s
2024-09-21 13:20:19 +02:00
52d6820351 fix dockerfile
All checks were successful
Restart Docker Container on Production / build (pull_request) Successful in 3m57s
2024-09-21 13:14:28 +02:00
c534b3ba78 fix dockerfile
All checks were successful
Restart Docker Container on Production / build (pull_request) Successful in 31s
2024-09-21 12:16:55 +02:00
95d5d4c39c fix dockerfile
Some checks failed
Restart Docker Container on Production / build (pull_request) Failing after 41s
2024-09-20 22:45:11 +02:00
70ec3e822e fix dockerfile
Some checks failed
Restart Docker Container on Production / build (pull_request) Failing after 27s
2024-09-20 10:38:50 +02:00
9122ddd117 fix dockerfile
Some checks failed
Restart Docker Container on Production / build (pull_request) Failing after 8s
2024-09-20 10:38:14 +02:00
d00b71d43a fix dockerfile
Some checks failed
Restart Docker Container on Production / build (pull_request) Failing after 9s
2024-09-20 10:33:28 +02:00
ed03b80e6a fix dockerfile
Some checks failed
Restart Docker Container on Production / build (pull_request) Failing after 53s
2024-09-20 10:25:59 +02:00
576940ae1c fix dockerfile
Some checks failed
Restart Docker Container on Production / build (pull_request) Failing after 7s
2024-09-20 10:21:33 +02:00
e10e7f3c85 fix dockerfile
Some checks failed
Restart Docker Container on Production / build (pull_request) Failing after 1m46s
2024-09-20 10:16:02 +02:00
d7e614fbd6 fix yml file for test env
Some checks failed
Restart Docker Container on Production / build (pull_request) Failing after 9s
2024-09-20 10:13:24 +02:00
eecf5eb4c6 build script for maui apk adjusted
Some checks failed
Restart Docker Container on Production / build (pull_request) Failing after 6s
2024-09-20 09:01:27 +02:00
45 changed files with 485 additions and 286 deletions

View File

@ -15,22 +15,16 @@ jobs:
with:
registry: git.wohlleben.dev
username: ${{ gitea.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
password: ${{ vars.REGISTRY_TOKEN }}
- name: Restart all Docker Container on Production
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.STRATO_VPS_HOST_ADDRESS }}
username: ${{ secrets.STRATO_VPS_USER_NAME }}
key: ${{ secrets.STRATO_VPS_ROOT_USER_SSH_KEY }}
host: ${{ vars.STRATO_VPS_HOST_ADDRESS }}
username: ${{ vars.STRATO_VPS_USER_NAME }}
key: ${{ vars.STRATO_VPS_ROOT_USER_SSH_KEY }}
script: |
docker pull git.wohlleben.dev/itob/rbl-feeder-app:latest
docker pull git.wohlleben.dev/itob/rbl-feeder-api:latest
docker pull git.wohlleben.dev/itob/rbl-feeder-worker:latest
docker pull git.wohlleben.dev/itob/rbl-feeder-monitoring:latest
docker stop rbl-feeder-app rbl-feeder-api rbl-feeder-worker rbl-feeder-monitoring
docker rm rbl-feeder-app rbl-feeder-api rbl-feeder-worker rbl-feeder-monitoring
docker run --init -d --name rbl-feeder-app -p 8000:80 --restart=always git.wohlleben.dev/itob/rbl-feeder-app:latest
docker run --init -d --name rbl-feeder-api -p 8001:8080 -e DatabaseName=rblfeeder -e ConnectionUri=${{ secrets.DB_CONNECTION_URI_PROD_ENV }} --restart=always git.wohlleben.dev/itob/rbl-feeder-api:latest
docker run --init -d --name rbl-feeder-monitoring -p 8002:8080 -e HostAddress=https://rbl.wohlleben.dev -e DatabaseName=rblfeeder -e ConnectionUri=${{ secrets.DB_CONNECTION_URI_PROD_ENV }} git.wohlleben.dev/itob/rbl-feeder-monitoring:latest
docker run --init -d --name rbl-feeder-worker -e HostAddress=https://rblnews.de -e DatabaseName=rblfeeder -e ConnectionUri=${{ secrets.DB_CONNECTION_URI_PROD_ENV }} --restart=always git.wohlleben.dev/itob/rbl-feeder-worker:latest
docker pull git.wohlleben.dev/itob/rbl-news-webapp:latest
docker stop rbl-news-webapp
docker rm rbl-news-webapp
docker run --init -d --name rbl-news-webapp -p 8000:8080 -e ASPNETCORE_ENVIRONMENT=Production --restart=always git.wohlleben.dev/itob/rbl-news-webapp:latest
docker system prune -af

View File

@ -22,7 +22,7 @@ jobs:
with:
registry: git.wohlleben.dev
username: ${{ gitea.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
password: ${{ vars.REGISTRY_TOKEN }}
- name: Build and push WebApp container image
run: |
TODAY=$(date +'%Y-%m-%d')
@ -32,12 +32,12 @@ jobs:
- name: Restart all Docker Container on Test Environment
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.DOCKER_VM_HOST_ADDRESS }}
username: ${{ secrets.DOCKER_VM_HOST_ROOT_USERNAME }}
key: ${{ secrets.DOCKER_VM_SSH_USER_ROOT }}
host: ${{ vars.SRV02_DOCKER_VM_HOST_ADDRESS }}
username: ${{ vars.SRV02_DOCKER_VM_USER_NAME }}
key: ${{ vars.SRV02_DOCKER_VM_ROOT_USER_SSH_KEY }}
script: |
docker pull git.wohlleben.dev/itob/rbl-news-webapp:latest
docker stop rbl-news-webapp
docker rm rbl-news-webapp
docker run --init -d --name rbl-news-webapp -p 8000:80 --restart=always git.wohlleben.dev/itob/rbl-news-webapp:latest
docker run --init -d --name rbl-news-webapp -p 8000:8080 -e ASPNETCORE_ENVIRONMENT=Test --restart=always git.wohlleben.dev/itob/rbl-news-webapp:latest
docker system prune -af

View File

@ -4,6 +4,14 @@
<selectionStates>
<SelectionState runConfigName="RBLNews.Maui">
<option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2024-09-25T07:14:40.138909900Z">
<Target type="DEFAULT_BOOT">
<handle>
<DeviceId pluginId="LocalEmulator" identifier="path=C:\Users\tobia\.android\avd\pixel_5_-_api_34.avd" />
</handle>
</Target>
</DropdownSelection>
<DialogSelection />
</SelectionState>
</selectionStates>
</component>

View File

@ -3,12 +3,13 @@ WORKDIR /app
EXPOSE 80
EXPOSE 8080
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["../../RBLNews.Web/RBLNews.Shared.csproj", "RBLNews.Shared/"]
RUN dotnet restore "RBLFeeder/RBLNews.Web.csproj"
COPY ["../../RBLNews.Web/RBLNews.Web.csproj", "RBLNews.Web/"]
COPY ["../../RBLNews.Shared/RBLNews.Shared.csproj", "RBLNews.Shared/"]
RUN dotnet nuget add source --name itob https://git.wohlleben.dev/api/packages/itob/nuget/index.json
RUN dotnet restore "RBLNews.Web/RBLNews.Web.csproj"
COPY . .
WORKDIR "/src/RBLNews.Web"
RUN dotnet build "RBLNews.Web.csproj" -c $BUILD_CONFIGURATION -o /app/build

View File

@ -1,2 +1,7 @@
cd..
$location = Get-Location
if(!$location.Path.Contains("RBLNews.Web"))
{
cd ../RBLNews.Maui
}
dotnet publish -c Release -r android-arm64 -p:PackageFormat=Apk -f net8.0-android34.0 --sc true

View File

@ -1,4 +1,6 @@
using Microsoft.Maui.Controls.PlatformConfiguration;
using Microsoft.Maui;
using Microsoft.Maui.Controls;
using RBLNews.Shared.Services;
namespace RBLNews.Maui

View File

@ -1,4 +1,8 @@
using RBLNews.Shared.Components.Pages;
using System;
using Microsoft.Maui.Controls;
using RBLNews.Shared.Components.Pages;
namespace RBLNews.Maui
{

View File

@ -1,7 +1,17 @@
using CommunityToolkit.Maui;
using System.Reflection;
using CommunityToolkit.Maui;
using CommunityToolkit.Maui.Markup;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Maui.Controls.Hosting;
using Microsoft.Maui.Hosting;
using RBLNews.Maui.Services;
using RBLNews.Shared.Models;
using RBLNews.Shared.Services;
using RBLNews.Shared.Services.Contracts;
namespace RBLNews.Maui
{
@ -22,7 +32,7 @@ namespace RBLNews.Maui
builder.Services.AddMauiBlazorWebView();
builder.Services.AddBlazorBootstrap();
builder.Services.AddSingleton<IConfigService, ConfigService>();
builder.Services.AddSingleton<IFeedDataService, FeedDataService>();
builder.Services.AddSingleton<AppLifecycleService>();
@ -31,7 +41,23 @@ namespace RBLNews.Maui
builder.Logging.AddDebug();
#endif
return builder.Build();
Stream? appSettingFile = Assembly.GetExecutingAssembly().GetManifestResourceStream($"appsettings.json");
if (appSettingFile != null)
{
IConfiguration configuration = new ConfigurationManager().AddJsonStream(appSettingFile).Build();
builder.Configuration.AddConfiguration(configuration);
}
MauiApp app = builder.Build();
AppSettingsModel? appSettings = app.Configuration.GetSection("App").Get<AppSettingsModel>();
if (string.IsNullOrEmpty(appSettings?.BackendApiUrl))
{
throw new Exception($"can't instantiate services, due to parameters are null. backendApiUrl: '{appSettings?.BackendApiUrl}'");
}
return app;
}
}
}

View File

@ -1,44 +0,0 @@
using CommunityToolkit.Maui;
using CommunityToolkit.Maui.Markup;
using Microsoft.Extensions.Logging;
using RBLNews.Shared.Services;
namespace RBLNews.Maui
{
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseMauiCommunityToolkit()
.UseMauiCommunityToolkitMarkup()
.ConfigureFonts(fonts =>
{
//fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("NanumMyeongjo-Regular.ttf", "NanumMyeongjoRegular");
});
builder.Services.AddMauiBlazorWebView();
<<<<<<< HEAD
#if DEBUG
builder.Services.AddBlazorWebViewDeveloperTools();
builder.Logging.AddDebug();
=======
builder.Services.AddBlazorBootstrap();
builder.Services.AddSingleton<IFeedDataService, FeedDataService>();
builder.Services.AddSingleton<AppLifecycleService>();
#if DEBUG
builder.Services.AddBlazorWebViewDeveloperTools();
builder.Logging.AddDebug();
>>>>>>> css_bootstrap_blazor
#endif
return builder.Build();
}
}
}

View File

@ -2,7 +2,10 @@
"profiles": {
"Windows Machine": {
"commandName": "MsixPackage",
"nativeDebugging": false
"nativeDebugging": false,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

View File

@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFrameworks>net8.0-maccatalyst;net8.0-android34.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
@ -31,7 +30,6 @@
<ApplicationVersion>1</ApplicationVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">31.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
@ -68,17 +66,39 @@
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>
<ItemGroup>
<Content Remove="appsettings.Development.json" />
<Content Remove="appsettings.json" />
<Content Remove="appsettings.Production.json" />
<Content Remove="appsettings.Test.json" />
</ItemGroup>
<ItemGroup>
<None Remove="Resources\Fonts\NanumMyeongjo-Regular.ttf" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="appsettings.Development.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="appsettings.Production.json" />
<EmbeddedResource Include="appsettings.Test.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Blazor.Bootstrap" Version="3.0.0" />
<PackageReference Include="CommunityToolkit.Maui" Version="9.0.3" />
<PackageReference Include="CommunityToolkit.Maui.Markup" Version="4.1.0" />
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.90" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.90" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="8.0.90" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
</ItemGroup>
@ -87,7 +107,7 @@
</ItemGroup>
<ItemGroup>
<Folder Include="IaC\" />
<Folder Include="obj\" />
</ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties XamarinHotReloadDebuggerTimeoutExceptionRBLNewsMauiHideInfoBar="True" /></VisualStudio></ProjectExtensions>

View File

@ -0,0 +1,20 @@
using Microsoft.Extensions.Configuration;
using RBLNews.Shared.Models;
using RBLNews.Shared.Services.Contracts;
namespace RBLNews.Maui.Services;
public class ConfigService : IConfigService
{
public AppSettingsModel? AppSettings { get; }
public ConfigService(IConfiguration configuration)
{
this.AppSettings = configuration.GetSection("App").Get<AppSettingsModel>();
if(this.AppSettings == null)
{
throw new NullReferenceException("App settings not found");
}
}
}

View File

@ -0,0 +1,11 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"App": {
"BackendApiUrl": "https://localhost:5147"
}
}

View File

@ -0,0 +1,12 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"App": {
"BackendApiUrl": "https://rblnews.de"
}
}

View File

@ -0,0 +1,12 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"App": {
"BackendApiUrl": "https://rbl.wohlleben.dev"
}
}

View File

@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}

View File

@ -1,3 +0,0 @@
<div class="my-component">
This component is defined in the <strong>RBLNews.Shared</strong> library.
</div>

View File

@ -1,6 +0,0 @@
.my-component {
border: 2px dashed red;
padding: 1em;
margin: 1em 0;
background-image: url('background.png');
}

View File

@ -1,33 +1,33 @@
@using RBLFeederCommon.Enums
@using RBLNews.Shared.Models
<div class="swb-container">
<Switch Class="mt-2" Value="this._filter" Label="@this.Text" ValueExpression="() => this._filter" ValueChanged="SwitchChanged"/>
<span class="swb-badge">@(this.Count)</span>
</div>
@code {
private bool _filter = true;
[Parameter]
public RssFeedSources Source { get; set; }
[Parameter] public RssFeedSources Source { get; set; }
[Parameter]
public string Text { get; set; } = "";
[Parameter] public string Text { get; set; } = "";
[Parameter]
public bool ShowCount { get; set; }
[Parameter] public bool ShowCount { get; set; }
[Parameter]
public int Count { get; set; }
[Parameter] public int Count { get; set; }
[Parameter] public EventCallback<FilterFeedEventArg> OnFilterChanged { get; set; }
[Parameter]
public EventCallback<FilterFeedEventArg> OnFilterChanged { get; set; }
Task SwitchChanged(bool value)
{
this._filter = value;
OnFilterChanged.InvokeAsync(new FilterFeedEventArg
OnFilterChanged.InvokeAsync(
new FilterFeedEventArg
{
Source = this.Source,
Value = value
@ -36,4 +36,5 @@
return Task.CompletedTask;
}
}

View File

@ -0,0 +1 @@


View File

@ -37,9 +37,9 @@ else
<section id="feeds-list">
@foreach (FeedGroupVM feedGrp in FeedGroups)
{
<h1>
<h2>
<Icon Name="IconName.Calendar2Event"/> @feedGrp.PublishDate.ToLocalTime().ToString("dd.MM.yyyy")
</h1>
</h2>
@foreach (FeedVM feed in feedGrp.Feeds)
{
<div class="col-xs-12 col-sm-12 col-md-9 col-lg-7 col-xl-5">
@ -60,7 +60,7 @@ else
@* </ul> *@
<CardFooter>
@GetRssSourceName((RssFeedSources)@feed.Source) | @feed.PubDate?.ToLocalTime()
@GetRssSourceName((RssFeedSources)@feed.Source) | @feed.PubDate?.ToLocalTime().ToString("dd.MM.yyyy HH:mm")
</CardFooter>
</Card>

View File

@ -0,0 +1,6 @@
namespace RBLNews.Shared.Models;
public class AppSettingsModel
{
public string BackendApiUrl { get; set; }
}

View File

@ -6,6 +6,22 @@
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<Content Remove="wwwroot\appsettings.Development.json" />
<Content Remove="wwwroot\appsettings.json" />
<Content Remove="wwwroot\appsettings.Production.json" />
<Content Remove="wwwroot\appsettings.Test.json" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="wwwroot\appsettings.Development.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="wwwroot\appsettings.Test.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<SupportedPlatform Include="browser" />
@ -20,4 +36,20 @@
<PackageReference Include="RBLFeederCommon" Version="1.0.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="obj\" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="wwwroot\appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="wwwroot\appsettings.Production.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
</Project>

View File

@ -1,26 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<SupportedPlatform Include="browser" />
</ItemGroup>
<ItemGroup>
<<<<<<< HEAD
=======
<PackageReference Include="Blazor.Bootstrap" Version="3.0.0" />
<PackageReference Include="CommunityToolkit.Maui" Version="9.0.3" />
<PackageReference Include="CommunityToolkit.Maui.Markup" Version="4.1.0" />
>>>>>>> css_bootstrap_blazor
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.8" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="RBLFeederCommon" Version="1.0.0" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,8 @@
using RBLNews.Shared.Models;
namespace RBLNews.Shared.Services.Contracts;
public interface IConfigService
{
AppSettingsModel? AppSettings { get; }
}

View File

@ -0,0 +1,6 @@
namespace RBLNews.Shared.Services;
public class EnvironmentVariablesService
{
public string? RblApiUrl => Environment.GetEnvironmentVariable("RblApiUrl");
}

View File

@ -2,6 +2,8 @@
using System.Net.Http.Json;
using RBLFeederCommon.Models.RssFeed;
using RBLNews.Shared.Services.Contracts;
namespace RBLNews.Shared.Services
{
public interface IFeedDataService
@ -15,15 +17,22 @@ namespace RBLNews.Shared.Services
public class FeedDataService : IFeedDataService
{
private readonly IConfigService _configService;
private static readonly HttpClient httpClient = new();
public RssVM Feeds { get; private set; }
public Action DataChanged { get; set; }
public FeedDataService(IConfigService configService)
{
this._configService = configService;
}
public async Task LoadFeeds()
{
Feeds = await httpClient.GetFromJsonAsync<RssVM>("https://rblnews.de/api/feeds") ?? new RssVM();
Feeds = await httpClient.GetFromJsonAsync<RssVM>($"{this._configService.AppSettings.BackendApiUrl}/feeds") ?? new RssVM();
DataChanged.Invoke();
}
}

View File

@ -1,4 +0,0 @@
@* ANT CSS DESIGN IMPORT -------------------- *@
@using AntDesign
@using Microsoft.AspNetCore.Components.Web

View File

@ -1 +0,0 @@
@using Microsoft.AspNetCore.Components.Web

View File

@ -1,4 +0,0 @@
@* ANT CSS DESIGN IMPORT -------------------- *@
@using BlazorBootstrap;
@using Microsoft.AspNetCore.Components.Web

View File

@ -1,8 +0,0 @@
<<<<<<< HEAD
@using Microsoft.AspNetCore.Components.Web
=======
@* ANT CSS DESIGN IMPORT -------------------- *@
@using BlazorBootstrap;
@using Microsoft.AspNetCore.Components.Web
>>>>>>> css_bootstrap_blazor

View File

@ -0,0 +1,11 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"App": {
"BackendApiUrl": "https://localhost:5147"
}
}

View File

@ -0,0 +1,12 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"App": {
"BackendApiUrl": "https://rblnews.de"
}
}

View File

@ -0,0 +1,12 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"App": {
"BackendApiUrl": "https://rbl.wohlleben.dev"
}
}

View File

@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}

View File

@ -3,6 +3,10 @@ rot: #DD0741
schrift: #4b4b4b
*/
body {
color: #4b4b4b;
}
@font-face {
font-family: "Nanum Myeongjo", serif !important;
font-weight: 400;
@ -13,6 +17,13 @@ schrift: #4b4b4b
#feeds-page {
color: #4b4b4b;
}
#feeds-list {
margin-top: 15px;
}
#filter {
margin-top: 15px;
}
.card {
color: #4b4b4b;
@ -31,11 +42,12 @@ schrift: #4b4b4b
font-size: 0.8em;
}
nav .container-fluid {
.container-fluid {
padding-right: 0 !important;
padding-left: 0 !important;
}
nav .top-row {
height: 1.8rem;
background-color: rgb(221, 7, 65);
@ -59,21 +71,20 @@ nav .top-row {
/*}*/
.btn-primary {
color: #fff;
color: #eee;
background-color: #f75581;
border-color: #DD0741;
}
.btn-primary:hover {
color: inherit;
background-color: inherit;
border-color: inherit;
border-color: #4b4b4b;
}
.btn-outline-primary {
color: #f75581;
color: #4b4b4b;
background-color: #fff;
border-color: #DD0741;
border-color: #4b4b4b;
}
.btn-outline-primary:hover {
@ -107,7 +118,6 @@ nav .top-row {
}
.navbar-brand {
font-size: 1.1rem;
}
@ -189,8 +199,6 @@ nav .top-row {
}
.loading {
position: absolute;
top: 45%;
@ -263,6 +271,26 @@ nav .top-row {
}
}
.swb-container {
position: relative;
padding-top: 10px;
}
.swb-badge {
position: absolute;
top: -5px;
/*height:20px;*/
min-width: 20px;
z-index: 999;
background-color: #DD0741;
display: inline-block;
margin: 8px 2px;
border-radius: 18px;
text-align: center;
font-size: 0.7em;
color: #eee;
}
/*html, body {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;

View File

@ -1,33 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base href="/" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" rel="stylesheet" />
@* <link href="_content/RBLNews.Shared/blazor.bootstrap.css" rel="stylesheet" /> *@
@* <link rel="stylesheet" href="_content/RBLNews.Shared/css/bootstrap/bootstrap.min.css" /> *@
@* <link rel="stylesheet" href="RBLNews.Web.styles.css" /> *@
<link rel="stylesheet" href="_content/RBLNews.Shared/css/app.css" />
<HeadOutlet @rendermode="InteractiveServer" />
</head>
<body>
<Routes @rendermode="InteractiveServer" />
<<<<<<< HEAD
=======
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
<!-- Add chart.js reference if chart components are used in your application. -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.0.1/chart.umd.js" integrity="sha512-gQhCDsnnnUfaRzD8k1L5llCCV6O9HN09zClIzzeJ8OJ9MpGmIlCxm+pdCkqTwqJ4JcjbojFr79rl2F1mzcoLMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<!-- Add chartjs-plugin-datalabels.min.js reference if chart components with data label feature is used in your application. -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-plugin-datalabels/2.2.0/chartjs-plugin-datalabels.min.js" integrity="sha512-JPcRR8yFa8mmCsfrw4TNte1ZvF1e3+1SdGMslZvmrzDYxS69J7J49vkFL8u6u8PlPJK+H3voElBtUCzaXj+6ig==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<!-- Add sortable.js reference if SortableList component is used in your application. -->
<script src="https://cdn.jsdelivr.net/npm/sortablejs@latest/Sortable.min.js"></script>
>>>>>>> css_bootstrap_blazor
<script src="_framework/blazor.web.js"></script>
</body>
</html>

View File

@ -1,5 +1,8 @@
using RBLNews.Shared.Models;
using RBLNews.Shared.Services;
using RBLNews.Shared.Services.Contracts;
using RBLNews.Web.Components;
using RBLNews.Web.Services;
var builder = WebApplication.CreateBuilder(args);
@ -8,19 +11,31 @@ builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
builder.Services.AddBlazorBootstrap();
builder.Services.AddSingleton<IConfigService, ConfigService>();
builder.Services.AddSingleton<IFeedDataService, FeedDataService>();
builder.Services.AddSingleton<AppLifecycleService>();
// required for production
builder.WebHost.UseStaticWebAssets();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error", createScopeForErrors: true);
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
AppSettingsModel? appSettings = app.Configuration.GetSection("App").Get<AppSettingsModel>();
if (string.IsNullOrEmpty(appSettings?.BackendApiUrl))
{
throw new Exception($"can't instantiate services, due to paramters are null. backendApiUrl: '{appSettings?.BackendApiUrl}'");
}
app.UseHttpsRedirection();
app.UseStaticFiles();

View File

@ -1,36 +0,0 @@
using RBLNews.Shared.Services;
using RBLNews.Web.Components;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
<<<<<<< HEAD
=======
builder.Services.AddBlazorBootstrap();
builder.Services.AddSingleton<IFeedDataService, FeedDataService>();
builder.Services.AddSingleton<AppLifecycleService>();
>>>>>>> css_bootstrap_blazor
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error", createScopeForErrors: true);
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseAntiforgery();
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode()
.AddAdditionalAssemblies(typeof(RBLNews.Shared._Imports).Assembly);
app.Run();

View File

@ -18,15 +18,33 @@
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"https (DEV)": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchBrowser": false,
"applicationUrl": "https://localhost:7158;http://localhost:5289",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https (TEST)": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"applicationUrl": "https://localhost:7158;http://localhost:5289",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Test"
}
},
"https (PROD)": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"applicationUrl": "https://localhost:7158;http://localhost:5289",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Production"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,

View File

@ -7,6 +7,28 @@
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>
<ItemGroup>
<Content Remove="appsettings.Development.json" />
<Content Remove="appsettings.json" />
<Content Remove="appsettings.Production.json" />
<Content Remove="appsettings.Test.json" />
</ItemGroup>
<ItemGroup>
<Content Include="appsettings.Development.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="appsettings.Production.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="appsettings.Test.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RBLNews.Shared\RBLNews.Shared.csproj" />
</ItemGroup>
@ -21,4 +43,8 @@
</Content>
</ItemGroup>
<ItemGroup>
<Folder Include="obj\" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,16 @@
using RBLNews.Shared.Models;
using RBLNews.Shared.Services.Contracts;
namespace RBLNews.Web.Services;
public class ConfigService : IConfigService
{
public AppSettingsModel? AppSettings { get; }
public ConfigService(IConfiguration configuration)
{
AppSettings = configuration.GetSection("App").Get<AppSettingsModel>();
if(this.AppSettings == null)
throw new NullReferenceException("App settings not found");
}
}

View File

@ -4,5 +4,8 @@
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"App": {
"BackendApiUrl": "https://localhost:7127"
}
}

View File

@ -0,0 +1,12 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"App": {
"BackendApiUrl": "https://rblnews.de/api"
}
}

View File

@ -0,0 +1,12 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"App": {
"BackendApiUrl": "https://rbl.wohlleben.dev/api"
}
}