diff --git a/misc/docs/images/dashboard_admin_custom.png b/misc/docs/images/dashboard_admin_custom.png index 6897b4b..0169a66 100644 Binary files a/misc/docs/images/dashboard_admin_custom.png and b/misc/docs/images/dashboard_admin_custom.png differ diff --git a/misc/docs/images/dashboard_anonymous_custom.png b/misc/docs/images/dashboard_anonymous_custom.png index 8ef4d27..cf34c38 100644 Binary files a/misc/docs/images/dashboard_anonymous_custom.png and b/misc/docs/images/dashboard_anonymous_custom.png differ diff --git a/src/LanBackup.WebApp/ClientApp/app/components/app/app.component.css b/src/LanBackup.WebApp/ClientApp/app/components/app/app.component.css index 48b2036..5dc964c 100644 --- a/src/LanBackup.WebApp/ClientApp/app/components/app/app.component.css +++ b/src/LanBackup.WebApp/ClientApp/app/components/app/app.component.css @@ -71,3 +71,31 @@ body { top:45%; position:relative; } + + + +.statusIcon{ + width: 10px; + height: 10px; + border:1px solid #444; + margin-top: 3px; +} +/*idle*/ +.statusIcon_0 { + background-color: lightgray; +} + +/*starting*/ +.statusIcon_1 { + background-color: lightgreen; +} + +/*copy folders files*/ +.statusIcon_2, .statusIcon_3{ + background-color: forestgreen; +} + +/*error*/ +.statusIcon_4 { + background-color: firebrick; +} \ No newline at end of file diff --git a/src/LanBackup.WebApp/ClientApp/app/components/dashboard/dashboard.component.html b/src/LanBackup.WebApp/ClientApp/app/components/dashboard/dashboard.component.html index ad33faa..5c9d3ac 100644 --- a/src/LanBackup.WebApp/ClientApp/app/components/dashboard/dashboard.component.html +++ b/src/LanBackup.WebApp/ClientApp/app/components/dashboard/dashboard.component.html @@ -26,10 +26,10 @@
| Computer IP | -Config ID | +Computer IP | +Config ID | - | Status | +Status | Progress | Last Report |
|---|---|---|---|---|---|---|---|---|
| {{agent.ip}} | {{agent.configurationId ? agent.configurationId : '---'}} | -{{agent.statusType}} | +{{agent.statusDescription}} |
diff --git a/src/LanBackup.WebApp/Models/Telemetry/ITelemetryLogger.cs b/src/LanBackup.WebApp/Models/Telemetry/ITelemetryLogger.cs
index 69eb7bd..a6379a7 100644
--- a/src/LanBackup.WebApp/Models/Telemetry/ITelemetryLogger.cs
+++ b/src/LanBackup.WebApp/Models/Telemetry/ITelemetryLogger.cs
@@ -6,5 +6,7 @@ namespace LanBackup.WebApp.Models.Telemetry
{
void TrackException(Exception ex);
void TrackEvent(string v);
+
+ bool IsEnabled { get; set; }
}
}
diff --git a/src/LanBackup.WebApp/Models/Telemetry/TelemetryLogger.cs b/src/LanBackup.WebApp/Models/Telemetry/TelemetryLogger.cs
index 2092111..ebf8ebf 100644
--- a/src/LanBackup.WebApp/Models/Telemetry/TelemetryLogger.cs
+++ b/src/LanBackup.WebApp/Models/Telemetry/TelemetryLogger.cs
@@ -7,19 +7,36 @@ namespace LanBackup.WebApp.Models.Telemetry
{
private TelemetryClient _telemetryClient;
+ private bool isEnabled;
+ public bool IsEnabled
+ {
+ get
+ {
+ return isEnabled;
+ }
+
+ set
+ {
+ isEnabled = value;
+ }
+ }
+
public TelemetryLogger(TelemetryClient telemetryClient)
{
this._telemetryClient = telemetryClient;
+ this.IsEnabled = telemetryClient.IsEnabled();
}
public void TrackEvent(string eventmsg)
{
- this._telemetryClient.TrackEvent(eventmsg);
+ if(this.IsEnabled)
+ this._telemetryClient.TrackEvent(eventmsg);
}
public void TrackException(Exception ex)
{
- this._telemetryClient.TrackException(ex);
+ if(this.IsEnabled)
+ this._telemetryClient.TrackException(ex);
}
}
diff --git a/src/LanBackup.WebApp/Startup.cs b/src/LanBackup.WebApp/Startup.cs
index f820c0c..ff3ee8b 100644
--- a/src/LanBackup.WebApp/Startup.cs
+++ b/src/LanBackup.WebApp/Startup.cs
@@ -7,7 +7,6 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using LanBackup.WebApp.Data;
-using Microsoft.EntityFrameworkCore;
using LanBackup.DataCore;
using LanBackup.WebApp.Models;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
@@ -21,11 +20,9 @@ using LanBackup.WebApp.Hubs;
using LanBackup.WebApp.Middleware;
using System.Linq;
using AutoMapper;
-using LanBackup.ModelsCore;
-using LanBackup.WebApp.Models.DTO;
using LanBackup.WebApp.Controllers;
-using Microsoft.AspNetCore.Http;
using LanBackup.WebApp.Models.Telemetry;
+using Microsoft.ApplicationInsights.Extensibility;
namespace LanBackup.WebApp
{
@@ -33,6 +30,7 @@ namespace LanBackup.WebApp
{
public const string AuthenticationSchemeName = "MyAuthScheme";
+ private bool isApplicationInsightEnabled = false;
public Startup(IHostingEnvironment env)
{
@@ -52,6 +50,8 @@ namespace LanBackup.WebApp
builder.AddEnvironmentVariables();
Configuration = builder.Build();
+ this.isApplicationInsightEnabled = Configuration.GetSection("AppSettings").GetValue |