This commit is contained in:
erri120 2022-01-21 15:44:05 +01:00
parent 3a137db1d8
commit 9187fa2307
No known key found for this signature in database
GPG Key ID: 7FA9556C936B847C
3 changed files with 11 additions and 8 deletions

View File

@ -3,13 +3,11 @@ using System.Windows;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using NLog;
using NLog.Extensions.Logging;
using NLog.Targets;
using Wabbajack.App.Blazor.State;
using Wabbajack.App.Blazor.Utility;
using Wabbajack.Services.OSIntegrated;
using LogLevel = Microsoft.Extensions.Logging.LogLevel;
namespace Wabbajack.App.Blazor;
@ -34,12 +32,11 @@ public partial class App
{
FileName = "log.log"
};
var consoleTarget = new ConsoleTarget("console");
var uiTarget = new MemoryTarget("ui");
config.AddRuleForAllLevels(new NullTarget("blackhole"), "Microsoft.AspNetCore.Components.*", true);
var blackholeTarget = new NullTarget("blackhole");
config.AddRule(NLog.LogLevel.Trace, NLog.LogLevel.Debug, blackholeTarget, "Microsoft.AspNetCore.Components.*", true);
config.AddRuleForAllLevels(fileTarget);
config.AddRuleForAllLevels(consoleTarget);
config.AddRuleForAllLevels(uiTarget);

View File

@ -25,7 +25,7 @@ public partial class Configure
[Inject] private SystemParametersConstructor ParametersConstructor { get; set; } = default!;
[Inject] private IGameLocator GameLocator { get; set; } = default!;
[Inject] private SettingsManager SettingsManager { get; set; } = default!;
[Inject] private JSRuntime JSRuntime { get; set; } = default!;
[Inject] private IJSRuntime JSRuntime { get; set; } = default!;
private ModList? Modlist => StateContainer.Modlist;
@ -35,7 +35,6 @@ public partial class Configure
private string StatusText { get; set; } = string.Empty;
private InstallState InstallState => StateContainer.InstallState;
// private LoggerProvider.ILogMessage CurrentLog { get; set; }
private const string InstallSettingsPrefix = "install-settings-";

View File

@ -32,5 +32,12 @@
<div id="app"></div>
<script src="_framework/blazor.webview.js"></script>
<script>
async function setImageUsingStreaming(imageElementId, imageStream) {
const arrayBuffer = await imageStream.arrayBuffer();
const blob = new Blob([arrayBuffer]);
document.getElementById(imageElementId).src = URL.createObjectURL(blob);
}
</script>
</body>
</html>