Compare commits
3 Commits
a3604d7333
...
005645de9c
| Author | SHA1 | Date |
|---|---|---|
|
|
005645de9c | |
|
|
71ffb4a2f6 | |
|
|
d1217700b4 |
File diff suppressed because one or more lines are too long
|
|
@ -29,6 +29,10 @@
|
||||||
<Reference Include="AyCode.Core">
|
<Reference Include="AyCode.Core">
|
||||||
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\$(Configuration)\net9.0\AyCode.Core.dll</HintPath>
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\$(Configuration)\net9.0\AyCode.Core.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<!-- FbLogItem : AcLogItemClient — a hub TLogItem-constraintjéhez kell a bázistípus assembly-je (a DLL-referencia nem tranzitív). -->
|
||||||
|
<Reference Include="AyCode.Entities">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\$(Configuration)\net9.0\AyCode.Entities.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="AyCode.Interfaces">
|
<Reference Include="AyCode.Interfaces">
|
||||||
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\$(Configuration)\net9.0\AyCode.Interfaces.dll</HintPath>
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\$(Configuration)\net9.0\AyCode.Interfaces.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,8 +1,11 @@
|
||||||
using AyCode.Services.Server.SignalRs;
|
using AyCode.Services.Server.SignalRs;
|
||||||
|
using FruitBank.Common.Loggers;
|
||||||
using FruitBank.Common.Server.Services.Loggers;
|
using FruitBank.Common.Server.Services.Loggers;
|
||||||
|
|
||||||
namespace FruitBank.Common.Server.Services.SignalRs;
|
namespace FruitBank.Common.Server.Services.SignalRs;
|
||||||
|
|
||||||
|
|
||||||
public class LoggerSignalRHub(LoggerToLoggerApiController logger) : AcLoggerSignalRHub<LoggerToLoggerApiController>(logger)
|
// LogItemClient: a kliens-writerrel (SignaRClientLogItemWriter : AcSignaRClientLogItemWriter<LogItemClient>) azonos
|
||||||
{ }
|
// wire-típus — a SignalR erre deserializál, AcBinary-nál a LogItemClient generált serializere fut.
|
||||||
|
public class LoggerSignalRHub(LoggerToLoggerApiController logger) : AcLoggerSignalRHub<LoggerToLoggerApiController, LogItemClient>(logger)
|
||||||
|
{ }
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -7,18 +7,20 @@ public static class FruitBankConstClient
|
||||||
{
|
{
|
||||||
public static string DefaultLocale = "en-US";
|
public static string DefaultLocale = "en-US";
|
||||||
|
|
||||||
//public static string BaseUrl = "https://localhost:59579"; //FrutiBank nop
|
// A nop szerver base URL-je. Induláskor a host tölti fel az appsettings "AyCode:Urls:BaseUrl"-ből
|
||||||
//public static string BaseUrl = "https://localhost:44372"; //FrutiBank nop
|
// (ld. Program.cs / MauiProgram.cs). Az fbHub ÉS a loggerHub is EBBŐL az egy értékből származik (+/fbHub, +/loggerHub).
|
||||||
public static string BaseUrl = "https://shop.fruitbank.hu"; //FrutiBank nop
|
// Default: null — ha nincs beállítva, az OLVASÁS exception-t dob, nem megy tovább csendben hiányzó/rossz URL-lel.
|
||||||
//public static string BaseUrl = "https://fruitbank.mangoweb.hu"; //FrutiBank nop test
|
// A környezet-váltás az appsettings-ben történik:
|
||||||
#if RELEASE
|
// dev: https://localhost:59579 | prod: https://shop.fruitbank.hu | test: https://fruitbank.mangoweb.hu | android: http://10.0.2.2:59579
|
||||||
//public static string BaseUrl = "https://shop.fruitbank.hu"; //FrutiBank nop
|
private static string? _baseUrl;
|
||||||
#endif
|
public static string BaseUrl
|
||||||
|
{
|
||||||
//public static string BaseUrl = "http://localhost:59579"; //FrutiBank nop
|
get => !string.IsNullOrWhiteSpace(_baseUrl)
|
||||||
//public static string BaseUrl = "http://10.0.2.2:59579"; //FrutiBank (android) nop
|
? _baseUrl
|
||||||
//public static string BaseUrl = "https://localhost:7144"; //HybridApp
|
: throw new InvalidOperationException("FruitBankConstClient.BaseUrl nincs beállítva — a host indulásakor hidratáld az appsettings 'AyCode:Urls:BaseUrl' értékéből (Program.cs / MauiProgram.cs).");
|
||||||
|
|
||||||
|
set => _baseUrl = value;
|
||||||
|
}
|
||||||
|
|
||||||
public static string DefaultHubName = "fbHub";
|
public static string DefaultHubName = "fbHub";
|
||||||
public static string LoggerHubName = "loggerHub";
|
public static string LoggerHubName = "loggerHub";
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
using AyCode.Core.Serializers.Attributes;
|
||||||
|
using AyCode.Entities.LogItems;
|
||||||
|
|
||||||
|
namespace FruitBank.Common.Loggers;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A FruitBank kliens↔szerver log-feltöltés wire-típusa (writer és loggerHub ugyanezt használja — szimmetrikus wire).
|
||||||
|
/// Az AcLogItemClient az AyCode.Entities generator-mentes rétegében él; itt, a FruitBank.Common-ban (ahol az
|
||||||
|
/// AcBinary source-generator fut) kap generált serializert — így a loggerHub AcBinary-protokollal mehet.
|
||||||
|
/// A generator az örökölt propertyket is felveszi (derived → base sorrend, runtime-kompatibilis).
|
||||||
|
/// Feature-ök kikapcsolva (false): kis, lapos POCO — id/ref/intern/metadata nem kell, a sorosítás így a leggyorsabb.
|
||||||
|
/// </summary>
|
||||||
|
[AcBinarySerializable(false)]
|
||||||
|
public class LogItemClient : AcLogItemClient
|
||||||
|
{
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,17 +1,38 @@
|
||||||
using AyCode.Core.Enums;
|
using AyCode.Core.Enums;
|
||||||
using AyCode.Core.Loggers;
|
using AyCode.Core.Loggers;
|
||||||
|
using AyCode.Core.Serializers.Binaries;
|
||||||
using AyCode.Services.Loggers;
|
using AyCode.Services.Loggers;
|
||||||
|
using AyCode.Services.SignalRs;
|
||||||
|
using Microsoft.Extensions.Logging.Abstractions;
|
||||||
|
|
||||||
namespace FruitBank.Common.Loggers
|
namespace FruitBank.Common.Loggers
|
||||||
{
|
{
|
||||||
public class SignaRClientLogItemWriter : AcSignaRClientLogItemWriter
|
/// <summary>
|
||||||
|
/// FruitBank log-feltöltő: LogItemClient wire-típussal, AcBinary-protokollon (egységes a fbHub-bal).
|
||||||
|
/// Cél: {BaseUrl}/loggerHub — a BaseUrl-t a host hidratálja az appsettings-ből.
|
||||||
|
/// </summary>
|
||||||
|
public class SignaRClientLogItemWriter : AcSignaRClientLogItemWriter<LogItemClient>
|
||||||
{
|
{
|
||||||
public SignaRClientLogItemWriter() : this(AppType.Web, LogLevel.Detail, null)
|
public SignaRClientLogItemWriter() : this(AppType.Web, LogLevel.Detail, null)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
public SignaRClientLogItemWriter(AppType appType, LogLevel logLevel, string? categoryName = null) : base($"{FruitBankConstClient.BaseUrl}/{FruitBankConstClient.LoggerHubName}", appType, logLevel, categoryName)
|
public SignaRClientLogItemWriter(AppType appType, LogLevel logLevel, string? categoryName = null)
|
||||||
|
: base($"{FruitBankConstClient.BaseUrl}/{FruitBankConstClient.LoggerHubName}", appType, logLevel, categoryName, CreateProtocolOptions())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
// ⚠️ VÉGTELEN-CIKLUS VESZÉLY — NE ADJ LOGGERT A PROTOKOLLNAK! ⚠️
|
||||||
|
// Ez a writer maga A log-feltöltő csatorna. Ha a protokoll loggert kapna (LoggerClient, ILogger, bármi,
|
||||||
|
// ami ebbe a writerbe torkollik), akkor minden feltöltés sorosítása ÚJABB log-sorokat termelne
|
||||||
|
// (Serialize start / WriteArgument / ...), amiket ez a writer megint felküldene → sorosítás → log → ...
|
||||||
|
// → robbanó visszacsatolás, a kliens másodpercek alatt megfullad.
|
||||||
|
// Ezért a Logger EXPLICIT NullLogger.Instance (nem null! — a null-t az AddAcBinaryProtocol ??= fallbackje
|
||||||
|
// a DI ILogger<AcBinaryHubProtocol>-jával pótolná, ami visszahozná a hurkot).
|
||||||
|
// Ugyanezért erre a hub-builderre AddAcDefaults/ConfigureLogging SOHA nem kerülhet.
|
||||||
|
private static AcBinaryHubProtocolOptions CreateProtocolOptions() => new()
|
||||||
|
{
|
||||||
|
ProtocolMode = BinaryProtocolMode.Bytes, // WASM-safe, ugyanaz, mint az fbHub-on
|
||||||
|
Logger = NullLogger.Instance, // süket logger — ld. a fenti figyelmeztetést
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,9 @@
|
||||||
<AfterColumnsTemplate Context="ctx">
|
<AfterColumnsTemplate Context="ctx">
|
||||||
@if (ctx.DataItem is not ShippingDocument && ctx.DataItem is not ShippingItem) return;
|
@if (ctx.DataItem is not ShippingDocument && ctx.DataItem is not ShippingItem) return;
|
||||||
|
|
||||||
@if (ctx is { DataItem: ShippingDocument doc, IsEditMode: false })
|
@* ShippingItems: not null — add után a kijelölt sor a szerver-válasz NYERS entitása lehet (relációk betöltése
|
||||||
|
nélkül, ShippingItems == null), amíg a grid-reload le nem cseréli; a tétel-táblázat addig nem renderelődik. *@
|
||||||
|
@if (ctx is { DataItem: ShippingDocument { ShippingItems: not null } doc, IsEditMode: false })
|
||||||
{
|
{
|
||||||
<table class="table table-sm table-bordered table-striped" style="margin-top: 35px;">
|
<table class="table table-sm table-bordered table-striped" style="margin-top: 35px;">
|
||||||
<colgroup>
|
<colgroup>
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,7 @@
|
||||||
|
|
||||||
},
|
},
|
||||||
"AcHubConnection": {
|
"AcHubConnection": {
|
||||||
"Url": "https://localhost:59579/fbHub",
|
// Az Url innen KIVÉVE: az fbHub és a loggerHub is az AyCode:Urls:BaseUrl-ből származik (kódban: +/fbHub, +/loggerHub).
|
||||||
//"Url": "https://shop.fruitbank.hu/fbHub",
|
|
||||||
"TransportMaxBufferSize": 30000000,
|
"TransportMaxBufferSize": 30000000,
|
||||||
"ApplicationMaxBufferSize": 30000000,
|
"ApplicationMaxBufferSize": 30000000,
|
||||||
"CloseTimeout": "00:00:10",
|
"CloseTimeout": "00:00:10",
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,11 @@ using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
||||||
|
|
||||||
|
// Hub-URL-ek EGY forrásból: az fbHub és a loggerHub is az AyCode:Urls:BaseUrl-ből származik.
|
||||||
|
// A loggerHub writer a FruitBankConstClient.BaseUrl-t olvassa, ezért induláskor onnan hidratáljuk.
|
||||||
|
FruitBankConstClient.BaseUrl = builder.Configuration["AyCode:Urls:BaseUrl"]
|
||||||
|
?? throw new InvalidOperationException("Hiányzik az 'AyCode:Urls:BaseUrl' az appsettings-ből — a hub-ok URL-je ebből származik.");
|
||||||
|
|
||||||
builder.Services.AddDevExpressBlazor(configure => configure.SizeMode = DevExpress.Blazor.SizeMode.Medium);
|
builder.Services.AddDevExpressBlazor(configure => configure.SizeMode = DevExpress.Blazor.SizeMode.Medium);
|
||||||
|
|
||||||
// Add device-specific services used by the FruitBankHybrid.Shared project
|
// Add device-specific services used by the FruitBankHybrid.Shared project
|
||||||
|
|
@ -32,7 +37,12 @@ builder.Services.AddSingleton<LoggedInModel>(sp => new LoggedInModel(sp.GetRequi
|
||||||
|
|
||||||
// Bind SignalR options from wwwroot/appsettings.json (loaded automatically by WebAssemblyHostBuilder) —
|
// Bind SignalR options from wwwroot/appsettings.json (loaded automatically by WebAssemblyHostBuilder) —
|
||||||
// single Configure call per options type, combining section Bind with runtime overrides.
|
// single Configure call per options type, combining section Bind with runtime overrides.
|
||||||
builder.Services.Configure<AcHubConnectionOptions>(opts => builder.Configuration.GetSection("AcHubConnection").Bind(opts));
|
builder.Services.Configure<AcHubConnectionOptions>(opts =>
|
||||||
|
{
|
||||||
|
builder.Configuration.GetSection("AcHubConnection").Bind(opts);
|
||||||
|
// Az fbHub URL a közös BaseUrl-ből (nem külön AcHubConnection:Url) — így nem tud eltérni a loggerHub-tól.
|
||||||
|
opts.Url = $"{FruitBankConstClient.BaseUrl}/{FruitBankConstClient.DefaultHubName}";
|
||||||
|
});
|
||||||
|
|
||||||
builder.Services.Configure<AcBinaryHubProtocolOptions>(opts =>
|
builder.Services.Configure<AcBinaryHubProtocolOptions>(opts =>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,7 @@
|
||||||
|
|
||||||
},
|
},
|
||||||
"AcHubConnection": {
|
"AcHubConnection": {
|
||||||
"Url": "https://localhost:59579/fbHub",
|
// Az Url innen KIVÉVE: az fbHub és a loggerHub is az AyCode:Urls:BaseUrl-ből származik (kódban: +/fbHub, +/loggerHub).
|
||||||
//"Url": "https://shop.fruitbank.hu/fbHub",
|
|
||||||
"TransportMaxBufferSize": 30000000,
|
"TransportMaxBufferSize": 30000000,
|
||||||
"ApplicationMaxBufferSize": 30000000,
|
"ApplicationMaxBufferSize": 30000000,
|
||||||
"CloseTimeout": "00:00:10",
|
"CloseTimeout": "00:00:10",
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,10 @@ using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
|
// Hub-URL-ek EGY forrásból: az fbHub és a loggerHub is az AyCode:Urls:BaseUrl-ből származik.
|
||||||
|
FruitBankConstClient.BaseUrl = builder.Configuration["AyCode:Urls:BaseUrl"]
|
||||||
|
?? throw new InvalidOperationException("Hiányzik az 'AyCode:Urls:BaseUrl' az appsettings-ből — a hub-ok URL-je ebből származik.");
|
||||||
|
|
||||||
builder.Services.AddRazorComponents().AddInteractiveWebAssemblyComponents();
|
builder.Services.AddRazorComponents().AddInteractiveWebAssemblyComponents();
|
||||||
builder.Services.AddDevExpressBlazor(configure => configure.SizeMode = DevExpress.Blazor.SizeMode.Medium);
|
builder.Services.AddDevExpressBlazor(configure => configure.SizeMode = DevExpress.Blazor.SizeMode.Medium);
|
||||||
builder.Services.AddMvc();
|
builder.Services.AddMvc();
|
||||||
|
|
@ -36,7 +40,12 @@ builder.Services.AddSingleton<LoggedInModel>(sp => new LoggedInModel(sp.GetRequi
|
||||||
|
|
||||||
// Bind SignalR options from appsettings.json — single Configure call per options type.
|
// Bind SignalR options from appsettings.json — single Configure call per options type.
|
||||||
// The lambda runs the appsettings Bind first, then any runtime overrides (e.g. the WASM safety net).
|
// The lambda runs the appsettings Bind first, then any runtime overrides (e.g. the WASM safety net).
|
||||||
builder.Services.Configure<AcHubConnectionOptions>(opts => builder.Configuration.GetSection("AcHubConnection").Bind(opts));
|
builder.Services.Configure<AcHubConnectionOptions>(opts =>
|
||||||
|
{
|
||||||
|
builder.Configuration.GetSection("AcHubConnection").Bind(opts);
|
||||||
|
// Az fbHub URL a közös BaseUrl-ből (nem külön AcHubConnection:Url) — így nem tud eltérni a loggerHub-tól.
|
||||||
|
opts.Url = $"{FruitBankConstClient.BaseUrl}/{FruitBankConstClient.DefaultHubName}";
|
||||||
|
});
|
||||||
|
|
||||||
builder.Services.Configure<AcBinaryHubProtocolOptions>(opts =>
|
builder.Services.Configure<AcBinaryHubProtocolOptions>(opts =>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,7 @@
|
||||||
|
|
||||||
},
|
},
|
||||||
"AcHubConnection": {
|
"AcHubConnection": {
|
||||||
"Url": "https://localhost:59579/fbHub",
|
// Az Url innen KIVÉVE: az fbHub és a loggerHub is az AyCode:Urls:BaseUrl-ből származik (kódban: +/fbHub, +/loggerHub).
|
||||||
//"Url": "https://shop.fruitbank.hu/fbHub",
|
|
||||||
"TransportMaxBufferSize": 30000000,
|
"TransportMaxBufferSize": 30000000,
|
||||||
"ApplicationMaxBufferSize": 30000000,
|
"ApplicationMaxBufferSize": 30000000,
|
||||||
"CloseTimeout": "00:00:10",
|
"CloseTimeout": "00:00:10",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using AyCode.Core.Enums;
|
using AyCode.Core.Enums;
|
||||||
using AyCode.Core.Loggers;
|
using AyCode.Core.Loggers;
|
||||||
using AyCode.Services.SignalRs;
|
using AyCode.Services.SignalRs;
|
||||||
|
using FruitBank.Common;
|
||||||
using FruitBank.Common.Loggers;
|
using FruitBank.Common.Loggers;
|
||||||
using FruitBank.Common.Models;
|
using FruitBank.Common.Models;
|
||||||
using FruitBank.Common.Services;
|
using FruitBank.Common.Services;
|
||||||
|
|
@ -46,6 +47,10 @@ namespace FruitBankHybrid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hub-URL-ek EGY forrásból: az fbHub és a loggerHub is az AyCode:Urls:BaseUrl-ből származik.
|
||||||
|
FruitBankConstClient.BaseUrl = builder.Configuration["AyCode:Urls:BaseUrl"]
|
||||||
|
?? throw new InvalidOperationException("Hiányzik az 'AyCode:Urls:BaseUrl' az appsettings-ből — a hub-ok URL-je ebből származik.");
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
builder.Services.AddSingleton<IAcLogWriterClientBase, BrowserConsoleLogWriter>();
|
builder.Services.AddSingleton<IAcLogWriterClientBase, BrowserConsoleLogWriter>();
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -59,7 +64,12 @@ namespace FruitBankHybrid
|
||||||
|
|
||||||
// Bind SignalR options from configuration.
|
// Bind SignalR options from configuration.
|
||||||
// Precedence: code default → appsettings.json (this line) → any later Configure<T> action.
|
// Precedence: code default → appsettings.json (this line) → any later Configure<T> action.
|
||||||
builder.Services.Configure<AcHubConnectionOptions>(builder.Configuration.GetSection("AcHubConnection"));
|
builder.Services.Configure<AcHubConnectionOptions>(opts =>
|
||||||
|
{
|
||||||
|
builder.Configuration.GetSection("AcHubConnection").Bind(opts);
|
||||||
|
// Az fbHub URL a közös BaseUrl-ből (nem külön AcHubConnection:Url) — így nem tud eltérni a loggerHub-tól.
|
||||||
|
opts.Url = $"{FruitBankConstClient.BaseUrl}/{FruitBankConstClient.DefaultHubName}";
|
||||||
|
});
|
||||||
builder.Services.Configure<AcBinaryHubProtocolOptions>(builder.Configuration.GetSection("AcBinaryHubProtocol"));
|
builder.Services.Configure<AcBinaryHubProtocolOptions>(builder.Configuration.GetSection("AcBinaryHubProtocol"));
|
||||||
|
|
||||||
// Add device-specific services used by the FruitBankHybrid.Shared project
|
// Add device-specific services used by the FruitBankHybrid.Shared project
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue