Skip to content

Commit

Permalink
Merge pull request #254 from Blazam-App/Beta-Nightly
Browse files Browse the repository at this point in the history
Beta nightly
  • Loading branch information
jacobsen9026 authored Feb 28, 2024
2 parents 20d2381 + 45b6453 commit 7a7b998
Show file tree
Hide file tree
Showing 126 changed files with 25,734 additions and 931 deletions.
6 changes: 3 additions & 3 deletions BLAZAM.Tests/BLAZAM.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="coverlet.collector" Version="6.0.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
4 changes: 3 additions & 1 deletion BLAZAM.Tests/FileSystem/FileSystemBaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ public class JobTests
public void Constructor_ThrowsArgumentException_WhenPathIsNull()
{
// Arrange
string path = null;
string? path = null;

// Act and Assert
#pragma warning disable CS8604 // Possible null reference argument.
Assert.Throws<ArgumentException>(() => new FileSystemBase(path));
#pragma warning restore CS8604 // Possible null reference argument.
}

[Fact]
Expand Down
27 changes: 14 additions & 13 deletions BLAZAM/App.razor
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@

@inject IHttpContextAccessor context
@inject IHttpContextAccessor context
@inject IApplicationUserStateService userStateService
@inject ICurrentUserStateService currentUser
@inject ICurrentUserStateService currentUser
<CascadingAuthenticationState>



<ErrorBoundary>

<ChildContent>
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
Expand Down Expand Up @@ -73,21 +72,23 @@
try
{
var userTheme = currentUser.State?.Preferences?.Theme;
switch (userTheme)
if (userTheme != null)
{
case "Blue":
default:
var matchingTheme = ApplicationTheme.Themes.FirstOrDefault(at => at.Name == userTheme);
if (matchingTheme != null)
{
activeTheme = matchingTheme;
}
else
{
activeTheme = new BlueTheme();
break;
case "Red":
activeTheme = new RedTheme();
break;


}

}
darkMode = currentUser.State?.Preferences?.DarkMode == true;
}
catch(Exception ex)
catch (Exception ex)
{
Loggers.SystemLogger.Error("Error while fetching user theme: {@Error}", ex);
}
Expand Down
145 changes: 0 additions & 145 deletions BLAZAM/BLAZAM - Backup.csproj

This file was deleted.

32 changes: 12 additions & 20 deletions BLAZAM/BLAZAM.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<ServerGarbageCollection>false</ServerGarbageCollection>
<AssemblyVersion>0.8.9</AssemblyVersion>
<Version>2024.02.15.0147</Version>
<Version>2024.02.27.2343</Version>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<RootNamespace>BLAZAM</RootNamespace>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
Expand Down Expand Up @@ -50,31 +50,23 @@
</Content>
</ItemGroup>





<ItemGroup>
<None Include="..\BLAZAMGui\UI\Settings\ProcessCPUUsage.razor" Link="ProcessCPUUsage.razor" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="BlazorTemplater" Version="1.5.1" />
<PackageReference Include="Cassia" Version="2.0.0.60" />
<PackageReference Include="Core.System.Configuration.Install" Version="1.1.0" />
<PackageReference Include="DuoUniversal" Version="1.2.2" />
<PackageReference Include="MailKit" Version="4.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.26" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Negotiate" Version="6.0.26" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.26" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.26" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.15" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="7.0.15" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.15" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.15" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.15" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.15">
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.27" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Negotiate" Version="6.0.27" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.27" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.27" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.16" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="7.0.16" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.16" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.16" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.16" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.16">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -87,7 +79,7 @@
<PackageReference Include="MudBlazor.Markdown" Version="0.1.3" />
<PackageReference Include="MudBlazor.ThemeManager" Version="1.0.8" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Octokit" Version="9.1.2" />
<PackageReference Include="Octokit" Version="10.0.0" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="SixLabors.ImageSharp.Web" Version="3.1.0" />
Expand Down
7 changes: 6 additions & 1 deletion BLAZAM/Middleware/UserStateMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ public Task Invoke(HttpContext httpContext, ICurrentUserStateService currentUser
{

}
currentUserStateService.State = userStateService.GetUserState(httpContext.User);
var state = userStateService.GetUserState(httpContext.User);
if (state != null)
{
currentUserStateService.State = state;

}
if (httpContext.Connection != null && httpContext.Connection.RemoteIpAddress != null && currentUserStateService.State != null && currentUserStateService.State.IPAddress != httpContext.Connection.RemoteIpAddress)
currentUserStateService.State.IPAddress = httpContext.Connection.RemoteIpAddress;
}
Expand Down
2 changes: 1 addition & 1 deletion BLAZAM/Pages/Browse/Browse.razor
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
protected override void OnInitialized()
{
base.OnInitialized();
Monitor.OnDirectoryConnectionChanged += (async (status)=> {await InvokeAsync(StateHasChanged); });
//Monitor.OnDirectoryConnectionChanged += (async (status)=> {await InvokeAsync(StateHasChanged); });
}
}
12 changes: 12 additions & 0 deletions BLAZAM/Pages/Browse/ViewDirectoryEntry.razor
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@inject IStringLocalizer<AppLocalization> AppLocalization
<CascadingValue Value="ChangeHistoryModal">
@switch (DirectoryEntry.ObjectType)
{
case ActiveDirectoryObjectType.User:
Expand All @@ -16,8 +18,18 @@
<ViewPrinter DirectoryEntry="DirectoryEntry" />
break;
}
</CascadingValue>
<AppModal Title=@AppLocalization["Change History"] @ref=@ChangeHistoryModal Options=@(new DialogOptions(){FullWidth=true,MaxWidth=MaxWidth.ExtraExtraLarge})>
@if (ChangeHistoryModal?.IsShown == true)
{
<ChangeHistoryModalContent Model="DirectoryEntry" />
}
</AppModal>


@code {
[Parameter]
public IDirectoryEntryAdapter? DirectoryEntry { get; set; }

protected AppModal ChangeHistoryModal{ get; set; }
}
8 changes: 7 additions & 1 deletion BLAZAM/Pages/Computers/ViewComputer.razor
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
OnRename="@(()=>{RenameModal?.Show();})"
OnResetPassword="@(()=>{ChangePasswordModal?.Show();})"
OnToggleEditMode="ToggleEditMode"
OnUnlock="@Unlock" />
OnUnlock="@Unlock"
OnShowHistory="@(()=>{ChangeHistoryModal.Show();})"/>
<MudOverlay Visible="SavingChanges" DarkBackground="false" Absolute="true">

</MudOverlay>
Expand Down Expand Up @@ -310,4 +311,9 @@

}
}
public override void Dispose()
{
base.Dispose();
Computer?.Dispose();
}
}
21 changes: 16 additions & 5 deletions BLAZAM/Pages/Home.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
@using BLAZAM.Gui.Helper
@using BLAZAM.Gui.UI.Outputs.Jobs;
@{
string testValue="";
Type valueType =testValue.GetType();
string testValue = "";
Type valueType = testValue.GetType();
}
<AppPageTitle>@AppLocalization["Home"]</AppPageTitle>

@if (MOTD.HasValue && MOTD.Value.ToString() != "")
@if (MOTD.HasValue && MOTD.Value.ToString() != "")
{
<MudAlert Class="mb-6" ShowCloseIcon=false Elevation="3">

Expand All @@ -19,7 +19,10 @@

</MudAlert>
}
<CurrentUserDashboardWidgets/>


<CurrentUserDashboardWidgets />


@if (ApplicationInfo.InDebugMode)
{
Expand Down Expand Up @@ -47,7 +50,15 @@
{
IJob job = new Job("Test Job");
IJob job2 = new Job("Nested Job");
IJobStep step1 = new JobStep("Regular Step Passes", (step) => { Task.Delay(2000).Wait(); return true; });
IJobStep step1 = new JobStep("Regular Step Passes", (step) =>
{
for (int x = 1; x < 6; x++)
{
Task.Delay(400).Wait();
step.Progress = (x / 5.0) * 100.0;
}
return true;
});
IJobStep step2 = new JobStep("Regular Step Fails", (step) => { Task.Delay(2000).Wait(); return false; });
IJobStep step3 = new JobStep("Regular Step Throws", (step) => { Task.Delay(2000).Wait(); throw new ApplicationException("Test exception"); return false; });
IJobStep step4 = new JobStep("Nested Step Passes", (step) => { Task.Delay(2000).Wait(); return true; });
Expand Down
Loading

0 comments on commit 7a7b998

Please sign in to comment.