Skip to content

Commit

Permalink
Improve behavior of Active Directory installation page
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Jacobsen Work committed Oct 5, 2023
1 parent 7de022f commit 165ebc2
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 12 deletions.
2 changes: 1 addition & 1 deletion 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.2</AssemblyVersion>
<Version>2023.10.05.1238</Version>
<Version>2023.10.05.1505</Version>
<RootNamespace>BLAZAM</RootNamespace>
<GenerateDocumentationFile>False</GenerateDocumentationFile>

Expand Down
7 changes: 4 additions & 3 deletions BLAZAM/Pages/Install/ADirectory.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@
@{
}
<div>
<DirectorySettings />
<DirectorySettings SettingsSaved="@(()=>{directoryStatusPanel.ResetStatus();})" />

<ActiveDirectoryStatusPanel DirectoryConnected="@(()=>{disableNext=false;})"/>
<ActiveDirectoryStatusPanel @ref=directoryStatusPanel DirectoryConnected="@(()=>{disableNext=false;})"/>
<br/>
<br/>
<MudButton Color="Color.Success" @onclick="ShowNext" Disabled="@disableNext">Proceed</MudButton>
</div>

@code {
#nullable disable warnings
#nullable disable warnings
[Parameter]
public EventCallback StepCompleted { get; set; }

ActiveDirectoryStatusPanel directoryStatusPanel;
ADSettings currentSettings;

bool disableNext = true;
Expand Down
1 change: 1 addition & 0 deletions BLAZAMActiveDirectory/ActiveDirectoryContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ public void Dispose()
connection.SessionOptions.SecureSocketLayer = ConnectionSettings.UseTLS;
connection.SessionOptions.PingWaitTimeout = TimeSpan.FromSeconds(5);
connection.SessionOptions.SendTimeout = TimeSpan.FromSeconds(5);

//connection.SessionOptions.FastConcurrentBind();
connection.Credential = new NetworkCredential(loginReq.Username, loginReq.SecurePassword);

Expand Down
23 changes: 20 additions & 3 deletions BLAZAMGui/UI/Settings/ActiveDirectoryStatusPanel.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
<MudCardHeader>
Active Directory Connection Status
</MudCardHeader>
@if (showProgress)
{
<MudStack Row=true>
<MudProgressLinear Indeterminate=true />

</MudStack>
}

<MudStack Row=true>
Server Port Open
<StatusCheck Status="_portStatus" />
Expand Down Expand Up @@ -59,7 +66,7 @@
</MudCard>

@code {
#nullable disable warnings
#nullable disable warnings

[Parameter]
public EventCallback DirectoryConnected { get; set; }
Expand All @@ -77,10 +84,19 @@

}

public void ResetStatus()
{
Directory = DirectoryFactory.CreateActiveDirectoryContext();
Directory.ConnectAsync();
_portStatus = false;
_credStatus = false;
_encryptedStatus = false;
showProgress = true;
StateHasChanged();
}



private async void UpdateStatus(object? state)
public async void UpdateStatus(object? state)
{
await Task.Run(async () =>
{
Expand All @@ -89,6 +105,7 @@
_monitoring = true;
while (_monitoring == true)
{

if (Directory.Status == DirectoryConnectionStatus.Connecting)
{
showProgress = true;
Expand Down
7 changes: 4 additions & 3 deletions BLAZAMGui/UI/Settings/DirectorySettings.razor
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
</MudForm>
@code {

#nullable disable warnings
#nullable disable warnings
ADSettings settings = new ADSettings();
bool _insert;

Expand Down Expand Up @@ -163,7 +163,7 @@
}
protected override async void Save()
{

if (!settings.Password.Equals(passwordInDb))
{
settings.Password = settings.Password.Encrypt();
Expand All @@ -176,7 +176,8 @@
}
await AuditLogger.System.SettingsChanged("Active Directory", settings.GetChanges(originalSettings));
base.Save();

SettingsSaved.InvokeAsync();


}

Expand Down
6 changes: 4 additions & 2 deletions BLAZAMGui/UI/Settings/SettingsComponents.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace BLAZAM.Gui.UI.Settings
{
public partial class SettingsComponents:ValidatedForm
public partial class SettingsComponents : ValidatedForm
{
protected object? originalSettings;

Expand All @@ -13,8 +13,10 @@ protected override Task OnInitializedAsync()
//TODO do we need this save
protected void Save(IEnumerable<EntityEntry> changedEntries)
{

base.Save();
}
[Parameter]
public EventCallback SettingsSaved { get; set; }
}
}

0 comments on commit 165ebc2

Please sign in to comment.