Skip to content

Commit

Permalink
feat: add ui backup module (list of backups by date and version, down…
Browse files Browse the repository at this point in the history
…load backup, clear all) and refact dependencies
  • Loading branch information
nicolae-lupei committed Mar 16, 2020
1 parent 97a9142 commit 643741b
Show file tree
Hide file tree
Showing 27 changed files with 526 additions and 501 deletions.
1 change: 1 addition & 0 deletions GR.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=Foreing/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=formeo/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=fullfillment/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Gres/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Gtin/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Indrivo/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ISODMS/@EntryIndexedValue">True</s:Boolean>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
using GR.Core.Helpers.ModelBinders.ModelBinderProviders;
using GR.Core.Razor.Extensions;
using GR.Localization.Abstractions.Extensions;
using GR.Localization.Abstractions.Models;
using GR.Localization.Abstractions.Models.Config;
using GR.Notifications.Abstractions.Extensions;
using GR.Notifications.Hub.Hubs;
using GR.PageRender.Abstractions.Extensions;
using GR.WebApplication.Helpers;
using GR.WebApplication.Helpers.AppConfigurations;
using Microsoft.AspNetCore.Builder;
Expand Down Expand Up @@ -180,9 +178,6 @@ public static IGearAppBuilder UseGearWebApp(this IApplicationBuilder app, Action
app.UseExceptionHandler("/Home/Error");
}

//-----------------------Custom url redirection Usage-------------------------------------
if (configuration.UseCustomUrlRewrite) app.UseUrlRewriteModule();

//----------------------------------Origin Cors Usage-------------------------------------
if (configuration.UseDefaultCorsConfiguration) app.UseConfiguredCors();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ public class GearAppBuilderConfig
/// </summary>
public IConfiguration Configuration { get; set; }

/// <summary>
/// Use dynamic pages url rewrite
/// </summary>
public virtual bool UseCustomUrlRewrite { get; set; } = true;

/// <summary>
/// Use default cors
/// </summary>
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
Expand Down Expand Up @@ -30,9 +29,9 @@ namespace GR.Backup.Abstractions.BackgroundServices
/// <summary>
/// Inject backup service
/// </summary>
private readonly IBackupService<T> _backupService;
private readonly IBackupService _backupService;

public BackupTimeService(ILogger<BackupTimeService<T>> logger, IOptions<T> options, IBackupService<T> backupService)
public BackupTimeService(ILogger<BackupTimeService<T>> logger, IOptions<T> options, IBackupService backupService)
{
_logger = logger;
_backupService = backupService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using GR.Backup.Abstractions.Models;
using GR.Core.Extensions;

namespace GR.Backup.Abstractions.Extensions
{
Expand All @@ -13,15 +14,26 @@ public static class ServiceCollectionExtensions
/// <param name="services"></param>
/// <param name="configuration"></param>
/// <returns></returns>
public static IServiceCollection RegisterDatabaseBackupRunnerModule<TRunner, TBackupSettings, TBackupService>(this IServiceCollection services, IConfiguration configuration)
where TRunner : class, IHostedService
public static IServiceCollection RegisterDatabaseBackupRunnerModule<TBackupSettings, TBackupService>(this IServiceCollection services, IConfiguration configuration)
where TBackupSettings : BackupSettings
where TBackupService : class, IBackupService<TBackupSettings>
where TBackupService : class, IBackupService
{
services.AddTransient<IBackupService<TBackupSettings>, TBackupService>();
services.AddGearSingleton<IBackupService, TBackupService>();

services.Configure<TBackupSettings>(configuration.GetSection(nameof(BackupSettings)));
return services;
}

//Run background service for backup database
/// <summary>
/// Register auto backup runner
/// </summary>
/// <typeparam name="TRunner"></typeparam>
/// <param name="services"></param>
/// <returns></returns>
public static IServiceCollection RegisterDatabaseBackgroundService<TRunner>(this IServiceCollection services)
where TRunner : class, IHostedService
{
//Register background service for backup database
services.AddHostedService<TRunner>();
return services;
}
Expand Down
Loading

0 comments on commit 643741b

Please sign in to comment.