feature: online services push notifications

This commit is contained in:
Gary Sharp
2025-01-01 19:23:18 +11:00
parent 4006bdbcc6
commit 296f7a13fd
19 changed files with 667 additions and 271 deletions
+7
View File
@@ -3,6 +3,7 @@ using Disco.Services;
using Disco.Services.Interop.DiscoServices;
using System;
using System.Linq;
using System.Threading;
namespace Disco.Web
{
@@ -86,6 +87,10 @@ namespace Disco.Web
DiscoApplication.DocumentDropBoxMonitor.Start();
DiscoApplication.DocumentDropBoxMonitor.ScheduleCurrentFiles(10000); // 10 Second Delay
// Connect to Online Services
if (Database.DiscoConfiguration.IsActivated)
ThreadPool.QueueUserWorkItem(async _ => await OnlineServicesConnect.StartAsync());
}
public static void InitializeUpdateEnvironment(DiscoDataContext Database, Version PreviousVersion)
@@ -110,6 +115,8 @@ namespace Disco.Web
public static void DisposeEnvironment()
{
ThreadPool.QueueUserWorkItem(async _ => await OnlineServicesConnect.StopAsync());
if (DiscoApplication.DocumentDropBoxMonitor != null)
DiscoApplication.DocumentDropBoxMonitor.Dispose();
@@ -4,7 +4,7 @@ namespace Disco.Web.Areas.Config.Models.SystemConfig
{
public class ActivateModel
{
public string CallbackUrl { get; set; }
public Uri CallbackUrl { get; set; }
public Guid DeploymentId { get; set; }
public Guid CorrelationId { get; set; }
public string UserId { get; set; }
@@ -120,6 +120,7 @@ namespace Disco.Web.Areas.Config.Models.SystemConfig
public bool IsActivated { get; set; }
public DateTime? ActivatedOn { get; set; }
public string ActivatedBy { get; set; }
public string OnlineServicesState { get; set; }
public ScheduledTaskStatus UpdateRunningStatus { get; set; }
public DateTime? UpdateNextScheduled { get; set; }
@@ -152,6 +153,7 @@ namespace Disco.Web.Areas.Config.Models.SystemConfig
IsActivated = config.IsActivated,
ActivatedBy = config.ActivatedBy,
ActivatedOn = config.ActivatedOn,
OnlineServicesState = OnlineServicesConnect.State,
UpdateLatestResponse = config.UpdateLastCheckResponse,
UpdateRunningStatus = UpdateQueryTask.RunningStatus,
UpdateNextScheduled = UpdateQueryTask.NextScheduled,
@@ -80,6 +80,26 @@
@if (Model.IsActivated)
{
@CommonHelpers.FriendlyDate(Model.ActivatedOn) <span>by @Model.ActivatedBy</span>
switch (Model.OnlineServicesState)
{
case "Disconnected":
<div class="info-box error">
<p class="fa-p"><i class="fa fa-globe"></i> Disconnected from Online Services</p>
</div>
break;
case "Connected":
<div class="info-box success">
<p class="fa-p"><i class="fa fa-globe"></i> Connected to Online Services</p>
</div>
break;
case "Connecting":
case "Reconnecting":
<div class="info-box warning">
<p class="fa-p"><i class="fa fa-globe"></i> @Model.OnlineServicesState to Online Services</p>
</div>
break;
}
}
else
{
File diff suppressed because it is too large Load Diff
+9 -1
View File
@@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
@@ -101,6 +101,14 @@
<assemblyIdentity name="System.Reactive.PlatformServices" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.5.0" newVersion="2.2.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.3" newVersion="4.1.1.3" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>