Skip to content

Commit

Permalink
Merge pull request #35 from bytedreamer/develop
Browse files Browse the repository at this point in the history
v0.2.3 Pre-Release
  • Loading branch information
bytedreamer authored Oct 16, 2023
2 parents fd6e818 + 2f39241 commit 68a446b
Show file tree
Hide file tree
Showing 19 changed files with 490 additions and 84 deletions.
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ variables:
- name: minor
value: 2
- name: patch
value: 2
value: 3
- name: AssemblyVersion
value: $(major).$(minor).$(patch)

Expand Down
6 changes: 5 additions & 1 deletion src/Aporta.Core/Services/AccessService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ private async Task ProcessAccessRequest(AccessCredentialReceivedEventArgs eventA
{
await OpenDoor(eventArgs.Access, matchingDoorStrike, 3);
}
else
{
await eventArgs.Access.AccessDeniedNotification();
}
}
catch (Exception exception)
{
Expand Down Expand Up @@ -216,7 +220,7 @@ async Task ControlStrike()
var openDoorTasks = new[]
{
Task.Run(ControlStrike),
Task.Run(access.Beep)
Task.Run(access.AccessGrantedNotification)
};

await Task.WhenAll(openDoorTasks);
Expand Down
4 changes: 3 additions & 1 deletion src/Aporta.Extensions/Endpoint/IAccess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ namespace Aporta.Extensions.Endpoint;

public interface IAccess : IEndpoint
{
Task Beep();
Task AccessGrantedNotification();

Task AccessDeniedNotification();
}
1 change: 1 addition & 0 deletions src/Aporta.WebClient/Pages/Index.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@page "/"

<Heading Size="HeadingSize.Is1">Home</Heading>
<Divider />

<Card Margin="Margin.Is4.OnY">
<CardTitle Margin="Margin.Is4.OnX">
Expand Down
4 changes: 3 additions & 1 deletion src/Aporta.WebClient/Pages/Monitoring.razor
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
@page "/monitoring"

@using System.Text.Json

@using Microsoft.AspNetCore.SignalR.Client

@using Aporta.Shared.Models
@using Aporta.Shared.Calls
@using Aporta.Shared.Messaging
@using System.Text.Json

@inject HttpClient Http
@inject NavigationManager NavigationManager

<Heading Size="HeadingSize.Is1">Monitoring</Heading>
<Divider />

@if (_outputs == null)
{
Expand Down
1 change: 1 addition & 0 deletions src/Aporta.WebClient/Pages/configuration/Doors.razor
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@inject NavigationManager NavigationManager

<Heading Size="HeadingSize.Is1">Doors</Heading>
<Divider />

@if (_doors == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
else
{
<Heading Size="HeadingSize.Is1">@_extension.Name Driver Configuration</Heading>
<Divider />

@if (_extension.Id == Guid.Parse("D3C5DE68-E019-48D6-AB58-76F4B15CD0D5"))
{
<Aporta.Drivers.OSDP.WebClient.Configuration @bind-ExtensionId="_extension.Id" @bind-RawConfiguration="_extension.Configuration"/>
Expand Down
1 change: 1 addition & 0 deletions src/Aporta.WebClient/Pages/configuration/Drivers.razor
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@implements IDisposable

<Heading Size="HeadingSize.Is1">Drivers</Heading>
<Divider />

@if (_extensions == null)
{
Expand Down
1 change: 1 addition & 0 deletions src/Aporta.WebClient/Pages/configuration/Inputs.razor
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@inject NavigationManager NavigationManager

<Heading Size="HeadingSize.Is1">Inputs</Heading>
<Divider />

@if (_inputs == null)
{
Expand Down
1 change: 1 addition & 0 deletions src/Aporta.WebClient/Pages/configuration/Outputs.razor
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@inject NavigationManager NavigationManager

<Heading Size="HeadingSize.Is1">Outputs</Heading>
<Divider />

@if (_outputs == null)
{
Expand Down
62 changes: 59 additions & 3 deletions src/Aporta.WebClient/Pages/configuration/People.razor
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
@inject NavigationManager NavigationManager

<Heading Size="HeadingSize.Is1">People</Heading>
<Divider />

@if (_people == null)
{
Expand Down Expand Up @@ -41,7 +42,7 @@ else
@foreach (var person in _people.OrderBy(person => person.FirstName))
{
<TableRow>
<TableRowCell>
<TableRowCell Clicked="@(async () => await ShowDetails(person))">
@if (person.Enabled)
{
<Tooltip Text="Enabled" Inline="true">
Expand All @@ -61,10 +62,10 @@ else
</Tooltip>
}
</TableRowCell>
<TableRowHeader>
<TableRowHeader Clicked="@(async () => await ShowDetails(person))">
@person.FirstName
</TableRowHeader>
<TableRowHeader>
<TableRowHeader Clicked="@(async () => await ShowDetails(person))">
@person.LastName
</TableRowHeader>
<TableRowCell TextAlignment="TextAlignment.End">
Expand Down Expand Up @@ -174,6 +175,50 @@ else
</ModalFooter>
</ModalContent>
</Modal>

<Modal @ref="_personDetailsModal">
<ModalContent Size="ModalSize.Default" Centered="true">
<ModalHeader>
<ModalTitle>
Person details
</ModalTitle>
<CloseButton Clicked="@_enrollModal.Hide"/>
</ModalHeader>
<ModalBody>

<Table Striped="true" Narrow="true" ThemeContrast="ThemeContrast.Light">
<TableHeader>
<TableRow>
<TableHeaderCell>Description</TableHeaderCell>
<TableHeaderCell>Value</TableHeaderCell>
</TableRow>
</TableHeader>
<TableBody>
<TableRow>
<TableRowCell>
Badge is enrolled
</TableRowCell>
<TableRowCell>
@PersonIsEnrolled(_detailsPerson.Id)
</TableRowCell>
</TableRow>
<TableRow>
<TableRowCell>
Person is enabled
</TableRowCell>
<TableRowCell>
@_detailsPerson.Enabled
</TableRowCell>
</TableRow>
</TableBody>
</Table>

</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@_personDetailsModal.Hide">Close</Button>
</ModalFooter>
</ModalContent>
</Modal>
}

<Snackbar @ref="_snackbar" Color="@_snackbarColor">
Expand All @@ -193,6 +238,7 @@ else
private List<Credential> _assigned;
private Person _addPerson;
private Person _enrollPerson;
private Person _detailsPerson;
private int _enrollCredentialId;

private readonly List<Tuple<Credential, Event, EventData>> _availableCredentialsForEnrollment = new();
Expand All @@ -204,6 +250,8 @@ else

private Modal _enrollModal;

private Modal _personDetailsModal;

private Snackbar _snackbar;
private SnackbarColor _snackbarColor;
private string _snackbarMessage = string.Empty;
Expand Down Expand Up @@ -300,6 +348,13 @@ else
}
await _snackbar.Show();
}

private async Task ShowDetails(Person person)
{
_detailsPerson = person;

await _personDetailsModal.Show();
}

private async Task ShowEnroll(Person person)
{
Expand Down Expand Up @@ -361,4 +416,5 @@ else
{
return _assigned.Any(credential => credential.AssignedPersonId == personId);
}

}
11 changes: 10 additions & 1 deletion src/Drivers/Aporta.Drivers.OSDP.Shared/Actions/ActionType.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
using Aporta.Shared.Models;

namespace Aporta.Drivers.OSDP.Shared.Actions;

public enum ActionType
{
[Description("Add Serial Bus")]
AddBus,
[Description("Remove Serial Bus")]
RemoveBus,
[Description("Add/Update OSDP Device")]
AddUpdateDevice,
[Description("Remove OSDP Device")]
RemoveDevice,
AvailablePorts
[Description("Rescan Available Ports")]
AvailablePorts,
[Description("Clear OSDP Device Identity")]
ClearDeviceIdentity
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@
<LangVersion>default</LangVersion>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\Aporta.Shared\Aporta.Shared.csproj" />
</ItemGroup>

</Project>
13 changes: 13 additions & 0 deletions src/Drivers/Aporta.Drivers.OSDP.Shared/Device.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,28 @@ public class Device

public bool RequireSecurity { get; set; }

public bool IdentityNotMatched { get; set; }

public bool CheckedCapabilities { get; set; }

public bool IsConnected { get; set; }

public Identification Identification { get; set; }

public List<Input> Inputs { get; } = new();
public List<Output> Outputs { get; } = new();
public List<Reader> Readers { get; } = new();
}

public class Identification
{
public string VendorCode { get; init; }

public int SerialNumber { get; init; }

public string FirmwareVersion { get; init; }
}

public class Input
{
public string Name { get; init; }
Expand Down
Loading

0 comments on commit 68a446b

Please sign in to comment.