-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
angular, dotnet upgrades, db speed improvements (#109)
* no tracking (cherry picked from commit 3b2d903) * package upgrades (cherry picked from commit 95a69b2) * improve stats query * remove debug * rename front end app * rename app * correct dist folder * fix logging out * icons aligned, mobile response * this too * hook searching back up * handle slow internet better * try tracking * downgrade ef * image compression * set temp folder to config folder * optimize filters query * upgraded to dotnet7, reworked statistics query * fix windows build, fix migrate * get rid of rest of fx styling * more mobile responsive * move images to another table * fix logger * add cleanup vacuum * outside transaction * fix images in queries * loading icon styling * added pwa * add push notifications * generate keys on startup if missing * turn service worker off locally
- Loading branch information
Showing
281 changed files
with
7,595 additions
and
692 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,5 +21,7 @@ | |
**/obj | ||
**/secrets.dev.yaml | ||
**/values.dev.yaml | ||
**/.angular | ||
**/config | ||
LICENSE | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
OpenAlprWebhookProcessor/Alerts/WebPush/GetWebPushClientRequestHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using OpenAlprWebhookProcessor.Data; | ||
using System.Threading.Tasks; | ||
using System.Threading; | ||
using Microsoft.EntityFrameworkCore; | ||
using OpenAlprWebhookProcessor.WebPushSubscriptions.VapidKeys; | ||
|
||
namespace OpenAlprWebhookProcessor.Alerts.WebPush | ||
{ | ||
public class GetWebPushClientRequestHandler | ||
{ | ||
private readonly ProcessorContext _processorContext; | ||
|
||
public GetWebPushClientRequestHandler(ProcessorContext processorContext) | ||
{ | ||
_processorContext = processorContext; | ||
} | ||
|
||
public async Task<WebPushRequest> HandleAsync(CancellationToken cancellationToken) | ||
{ | ||
var client = await _processorContext.WebPushSettings.FirstOrDefaultAsync(cancellationToken); | ||
|
||
if (client == null) | ||
{ | ||
client = VapidKeyHelper.AddVapidKeys(_processorContext); | ||
} | ||
|
||
return new WebPushRequest() | ||
{ | ||
IsEnabled = client.IsEnabled, | ||
EmailAddress = client.Subject, | ||
PublicKey = client.PublicKey, | ||
PrivateKey = client.PrivateKey, | ||
}; | ||
} | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
OpenAlprWebhookProcessor/Alerts/WebPush/TestPushoverClientRequestHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using Microsoft.EntityFrameworkCore; | ||
using OpenAlprWebhookProcessor.Data; | ||
using OpenAlprWebhookProcessor.WebPushSubscriptions; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace OpenAlprWebhookProcessor.Alerts.WebPush | ||
{ | ||
public class TestWebPushClientRequestHandler | ||
{ | ||
private readonly ProcessorContext _processorContext; | ||
|
||
private readonly IAlertClient _alertClient; | ||
|
||
public TestWebPushClientRequestHandler(ProcessorContext processorContext, | ||
IEnumerable<IAlertClient> alertClients) | ||
{ | ||
_processorContext = processorContext; | ||
_alertClient = alertClients.First(x => x is WebPushNotificationProducer); | ||
} | ||
|
||
public async Task HandleAsync(CancellationToken cancellationToken) | ||
{ | ||
var testPlateGroup = await _processorContext.PlateGroups | ||
.Include(x => x.PlateImage) | ||
.Where(x => x.PlateImage != null) | ||
.FirstOrDefaultAsync(cancellationToken); | ||
|
||
await _alertClient.VerifyCredentialsAsync(cancellationToken); | ||
|
||
await _alertClient.SendAlertAsync(new Alert() | ||
{ | ||
Description = "was seen on " + DateTimeOffset.Now.ToString("g"), | ||
Id = testPlateGroup.Id, | ||
PlateNumber = testPlateGroup.BestNumber, | ||
StrictMatch = false, | ||
}, | ||
testPlateGroup.PlateImage.Jpeg, | ||
cancellationToken); | ||
} | ||
} | ||
} |
Oops, something went wrong.