Exemplo n.º 1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory,
                              IServerLogService serverlogservice, IHttpContextAccessor httpcontext, SignInManager <ApplicationUser> signinmanager)
        {
            loggerFactory.AddConsole(Configuration.GetSection("Logging"));
            loggerFactory.AddDebug();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseDatabaseErrorPage();
                app.UseBrowserLink();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            app.UseStaticFiles();

            app.UseIdentity();
            // Add external authentication middleware below. To configure them please see https://go.microsoft.com/fwlink/?LinkID=532715
            app.UseHangfireDashboard("/jobs", new DashboardOptions {
                Authorization = new[] { new HangfireAuthorizationFilter(signinmanager, httpcontext) }
            });
            app.UseHangfireServer(new BackgroundJobServerOptions(), null, new PostgreSqlStorage(Configuration.GetConnectionString("psqlConnection")));
            RecurringJob.AddOrUpdate <IServerLogService>(s => s.BuildServerLogDatabaseEntries(), Cron.Daily);
            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });
        }
Exemplo n.º 2
0
 public HomeController(IServerLogService serverlogservice, IServerLogRepository serverlogrepository,
                       IIPLocationRepository iplocationrepository, ISettingsRepository settingsrepository,
                       ISettingsService settingsservice)
 {
     this._serverlogservice     = serverlogservice;
     this._serverlogrepository  = serverlogrepository;
     this._iplocationrepository = iplocationrepository;
     this._settingsrepository   = settingsrepository;
     this._settingsservice      = settingsservice;
 }
Exemplo n.º 3
0
 public MainWindowViewModel(ICurrentVersionProvider currentVersionProvider, IMessenger messenger, IStateHandlerViewModel stateHandlerViewModel, ILanguageService languageService, IGrabberService grabberService, IStorageCleanerService storageCleanerService, IConfigurationService configurationService, IServerLogService serverLogService, ILogDumpService logDumpService)
 {
     this.StateHandlerViewModel  = stateHandlerViewModel;
     this._messenger             = messenger;
     this._languageService       = languageService;
     this._grabberService        = grabberService;
     this._storageCleanerService = storageCleanerService;
     this._configurationService  = configurationService;
     this._serverLogService      = serverLogService;
     this._logDumpService        = logDumpService;
     this.Version = currentVersionProvider.Version.ToString(3);
     messenger.Register <OnClosingProgramRequested>((object)this, new Action <OnClosingProgramRequested>(this.OnClosingProgramRequested));
     this.OnLanguageChanged((OnLanguageChanged)null);
     messenger.Register <OnLanguageChanged>((object)this, new Action <OnLanguageChanged>(this.OnLanguageChanged));
     messenger.Register <OnNewGrabSettings>((object)this, new Action <OnNewGrabSettings>(this.OnNewGrabSettings));
     messenger.Register <OnSuccessfulHealthCheck>((object)this, new Action <OnSuccessfulHealthCheck>(this.OnSuccessfulHealthCheck));
     messenger.Register <OnSuccessfulLogin>((object)this, new Action <OnSuccessfulLogin>(this.OnSuccessfulLogin));
 }
Exemplo n.º 4
0
 public ServerLogConsumer(IServerLogService service)
 {
     _service = service;
 }
Exemplo n.º 5
0
 public ServerLogApiController(IServerLogService serverLogService)
 {
     _serverLogService = serverLogService;
 }