├── .gitignore ├── LICENSE ├── LogDashboard.sln ├── LogDashboard.sln.DotSettings.user ├── README.md ├── logo.png ├── samples ├── CustomLogModel │ ├── ApplicationLogModel.cs │ ├── CustomLogModel.csproj │ ├── NLog.config │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Startup.cs │ ├── appsettings.Development.json │ └── appsettings.json ├── DatabaseSource │ ├── Controllers │ │ └── HomeController.cs │ ├── CustomLogModel.cs │ ├── DatabaseSource.csproj │ ├── Models │ │ └── ErrorViewModel.cs │ ├── NLog.config │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Startup.cs │ ├── Views │ │ ├── Home │ │ │ ├── Index.cshtml │ │ │ └── Privacy.cshtml │ │ ├── Shared │ │ │ ├── Error.cshtml │ │ │ ├── _CookieConsentPartial.cshtml │ │ │ ├── _Layout.cshtml │ │ │ └── _ValidationScriptsPartial.cshtml │ │ ├── _ViewImports.cshtml │ │ └── _ViewStart.cshtml │ ├── appsettings.Development.json │ ├── appsettings.json │ └── wwwroot │ │ ├── css │ │ └── site.css │ │ ├── favicon.ico │ │ ├── js │ │ └── site.js │ │ └── lib │ │ ├── bootstrap │ │ ├── LICENSE │ │ └── dist │ │ │ ├── css │ │ │ ├── bootstrap-grid.css │ │ │ ├── bootstrap-grid.css.map │ │ │ ├── bootstrap-grid.min.css │ │ │ ├── bootstrap-grid.min.css.map │ │ │ ├── bootstrap-reboot.css │ │ │ ├── bootstrap-reboot.css.map │ │ │ ├── bootstrap-reboot.min.css │ │ │ ├── bootstrap-reboot.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ │ └── js │ │ │ ├── bootstrap.bundle.js │ │ │ ├── bootstrap.bundle.js.map │ │ │ ├── bootstrap.bundle.min.js │ │ │ ├── bootstrap.bundle.min.js.map │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.js.map │ │ │ ├── bootstrap.min.js │ │ │ └── bootstrap.min.js.map │ │ ├── jquery-validation-unobtrusive │ │ ├── LICENSE.txt │ │ ├── jquery.validate.unobtrusive.js │ │ └── jquery.validate.unobtrusive.min.js │ │ ├── jquery-validation │ │ ├── LICENSE.md │ │ └── dist │ │ │ ├── additional-methods.js │ │ │ ├── additional-methods.min.js │ │ │ ├── jquery.validate.js │ │ │ └── jquery.validate.min.js │ │ └── jquery │ │ ├── LICENSE.txt │ │ └── dist │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ └── jquery.min.map ├── DotNetCoreEmptyUseNlog │ ├── DotNetCoreEmptyUseNlog.csproj │ ├── DotNetCoreEmptyUseNlog.csproj.user │ ├── NLog.config │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Startup.cs │ ├── appsettings.Development.json │ └── appsettings.json ├── MySqlDatabase │ ├── CustomLogModel.cs │ ├── MySqlDatabase.csproj │ ├── NLog.config │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Startup.cs │ ├── appsettings.Development.json │ └── appsettings.json ├── NfxAspNetMvc │ ├── App_Start │ │ ├── BundleConfig.cs │ │ ├── FilterConfig.cs │ │ └── RouteConfig.cs │ ├── Content │ │ ├── Site.css │ │ ├── bootstrap-grid.css │ │ ├── bootstrap-grid.css.map │ │ ├── bootstrap-grid.min.css │ │ ├── bootstrap-grid.min.css.map │ │ ├── bootstrap-reboot.css │ │ ├── bootstrap-reboot.css.map │ │ ├── bootstrap-reboot.min.css │ │ ├── bootstrap-reboot.min.css.map │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.css.map │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap-theme.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ ├── Controllers │ │ └── HomeController.cs │ ├── Global.asax │ ├── Global.asax.cs │ ├── NLog.config │ ├── NfxAspNetMvc.csproj │ ├── NfxAspNetMvc.csproj.user │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Scripts │ │ ├── README.md │ │ ├── bootstrap.bundle.js │ │ ├── bootstrap.bundle.js.map │ │ ├── bootstrap.bundle.min.js │ │ ├── bootstrap.bundle.min.js.map │ │ ├── bootstrap.js │ │ ├── bootstrap.js.map │ │ ├── bootstrap.min.js │ │ ├── bootstrap.min.js.map │ │ ├── esm │ │ │ ├── popper-utils.js │ │ │ ├── popper-utils.js.map │ │ │ ├── popper-utils.min.js │ │ │ ├── popper-utils.min.js.map │ │ │ ├── popper.js │ │ │ ├── popper.js.map │ │ │ ├── popper.min.js │ │ │ └── popper.min.js.map │ │ ├── index.d.ts │ │ ├── jquery-3.4.1.intellisense.js │ │ ├── jquery-3.4.1.js │ │ ├── jquery-3.4.1.min.js │ │ ├── jquery-3.4.1.min.map │ │ ├── jquery-3.4.1.slim.js │ │ ├── jquery-3.4.1.slim.min.js │ │ ├── jquery-3.4.1.slim.min.map │ │ ├── jquery.validate-vsdoc.js │ │ ├── jquery.validate.js │ │ ├── jquery.validate.min.js │ │ ├── jquery.validate.unobtrusive.js │ │ ├── jquery.validate.unobtrusive.min.js │ │ ├── modernizr-2.8.3.js │ │ ├── popper-utils.js │ │ ├── popper-utils.js.map │ │ ├── popper-utils.min.js │ │ ├── popper-utils.min.js.map │ │ ├── popper.js │ │ ├── popper.js.map │ │ ├── popper.min.js │ │ ├── popper.min.js.map │ │ └── umd │ │ │ ├── popper-utils.js │ │ │ ├── popper-utils.js.map │ │ │ ├── popper-utils.min.js │ │ │ ├── popper-utils.min.js.map │ │ │ ├── popper.js │ │ │ ├── popper.js.map │ │ │ ├── popper.min.js │ │ │ └── popper.min.js.map │ ├── Startup.cs │ ├── Views │ │ ├── Home │ │ │ ├── About.cshtml │ │ │ ├── Contact.cshtml │ │ │ └── Index.cshtml │ │ ├── Shared │ │ │ ├── Error.cshtml │ │ │ └── _Layout.cshtml │ │ ├── Web.config │ │ └── _ViewStart.cshtml │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Web.config │ ├── favicon.ico │ └── packages.config ├── NfxAspnetCore │ ├── Controllers │ │ └── HomeController.cs │ ├── Models │ │ └── ErrorViewModel.cs │ ├── NfxAspnetCore.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Startup.cs │ ├── Views │ │ ├── Home │ │ │ ├── Index.cshtml │ │ │ └── Privacy.cshtml │ │ ├── Shared │ │ │ ├── Error.cshtml │ │ │ ├── _CookieConsentPartial.cshtml │ │ │ ├── _Layout.cshtml │ │ │ └── _ValidationScriptsPartial.cshtml │ │ ├── _ViewImports.cshtml │ │ └── _ViewStart.cshtml │ ├── app.config │ ├── appsettings.Development.json │ ├── appsettings.json │ └── wwwroot │ │ ├── css │ │ └── site.css │ │ ├── favicon.ico │ │ ├── js │ │ └── site.js │ │ └── lib │ │ ├── bootstrap │ │ ├── LICENSE │ │ └── dist │ │ │ ├── css │ │ │ ├── bootstrap-grid.css │ │ │ ├── bootstrap-grid.css.map │ │ │ ├── bootstrap-grid.min.css │ │ │ ├── bootstrap-grid.min.css.map │ │ │ ├── bootstrap-reboot.css │ │ │ ├── bootstrap-reboot.css.map │ │ │ ├── bootstrap-reboot.min.css │ │ │ ├── bootstrap-reboot.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ │ └── js │ │ │ ├── bootstrap.bundle.js │ │ │ ├── bootstrap.bundle.js.map │ │ │ ├── bootstrap.bundle.min.js │ │ │ ├── bootstrap.bundle.min.js.map │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.js.map │ │ │ ├── bootstrap.min.js │ │ │ └── bootstrap.min.js.map │ │ ├── jquery-validation-unobtrusive │ │ ├── LICENSE.txt │ │ ├── jquery.validate.unobtrusive.js │ │ └── jquery.validate.unobtrusive.min.js │ │ ├── jquery-validation │ │ ├── LICENSE.md │ │ └── dist │ │ │ ├── additional-methods.js │ │ │ ├── additional-methods.min.js │ │ │ ├── jquery.validate.js │ │ │ └── jquery.validate.min.js │ │ └── jquery │ │ ├── LICENSE.txt │ │ └── dist │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ └── jquery.min.map ├── RequestTracking │ ├── NLog.config │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── RequestTracking.csproj │ ├── Startup.cs │ ├── appsettings.Development.json │ └── appsettings.json ├── StructuredLog │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Startup.cs │ ├── StructuredLog.csproj │ ├── appsettings.Development.json │ └── appsettings.json ├── UseAuthorization │ ├── Areas │ │ └── Identity │ │ │ └── Pages │ │ │ └── _ViewStart.cshtml │ ├── Data │ │ ├── ApplicationDbContext.cs │ │ └── Migrations │ │ │ ├── 00000000000000_CreateIdentitySchema.Designer.cs │ │ │ ├── 00000000000000_CreateIdentitySchema.cs │ │ │ └── ApplicationDbContextModelSnapshot.cs │ ├── Pages │ │ ├── Error.cshtml │ │ ├── Error.cshtml.cs │ │ ├── Index.cshtml │ │ ├── Index.cshtml.cs │ │ ├── Privacy.cshtml │ │ ├── Privacy.cshtml.cs │ │ ├── Shared │ │ │ ├── _Layout.cshtml │ │ │ ├── _LoginPartial.cshtml │ │ │ └── _ValidationScriptsPartial.cshtml │ │ ├── _ViewImports.cshtml │ │ └── _ViewStart.cshtml │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── SimpleAuthFilter.cs │ ├── Startup.cs │ ├── UseAuthorization.csproj │ ├── appsettings.Development.json │ ├── appsettings.json │ └── wwwroot │ │ ├── css │ │ └── site.css │ │ ├── favicon.ico │ │ ├── js │ │ └── site.js │ │ └── lib │ │ ├── bootstrap │ │ ├── LICENSE │ │ └── dist │ │ │ ├── css │ │ │ ├── bootstrap-grid.css │ │ │ ├── bootstrap-grid.css.map │ │ │ ├── bootstrap-grid.min.css │ │ │ ├── bootstrap-grid.min.css.map │ │ │ ├── bootstrap-reboot.css │ │ │ ├── bootstrap-reboot.css.map │ │ │ ├── bootstrap-reboot.min.css │ │ │ ├── bootstrap-reboot.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ │ └── js │ │ │ ├── bootstrap.bundle.js │ │ │ ├── bootstrap.bundle.js.map │ │ │ ├── bootstrap.bundle.min.js │ │ │ ├── bootstrap.bundle.min.js.map │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.js.map │ │ │ ├── bootstrap.min.js │ │ │ └── bootstrap.min.js.map │ │ ├── jquery-validation-unobtrusive │ │ ├── LICENSE.txt │ │ ├── jquery.validate.unobtrusive.js │ │ └── jquery.validate.unobtrusive.min.js │ │ ├── jquery-validation │ │ ├── LICENSE.md │ │ └── dist │ │ │ ├── additional-methods.js │ │ │ ├── additional-methods.min.js │ │ │ ├── jquery.validate.js │ │ │ └── jquery.validate.min.js │ │ └── jquery │ │ ├── LICENSE.txt │ │ └── dist │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ └── jquery.min.map ├── UseLog4net │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Startup.cs │ ├── UseLog4net.csproj │ ├── UseLog4net.csproj.user │ ├── appsettings.Development.json │ ├── appsettings.json │ └── log4net.config ├── UseSerilog │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Startup.cs │ ├── UseSerilog.csproj │ ├── appsettings.Development.json │ └── appsettings.json └── abpvnext │ ├── .gitattributes │ ├── .gitignore │ ├── BootStore.sln │ ├── BootStore.sln.DotSettings │ ├── common.props │ ├── src │ ├── BootStore.Application.Contracts │ │ ├── BootStore.Application.Contracts.csproj │ │ ├── BootStoreApplicationContractsModule.cs │ │ └── Permissions │ │ │ ├── BootStorePermissionDefinitionProvider.cs │ │ │ └── BootStorePermissions.cs │ ├── BootStore.Application │ │ ├── BootStore.Application.csproj │ │ ├── BootStoreAppService.cs │ │ ├── BootStoreApplicationAutoMapperProfile.cs │ │ └── BootStoreApplicationModule.cs │ ├── BootStore.DbMigrator │ │ ├── BootStore.DbMigrator.csproj │ │ ├── BootStoreDbMigratorModule.cs │ │ ├── Program.cs │ │ └── appsettings.json │ ├── BootStore.Domain.Shared │ │ ├── BootStore.Domain.Shared.csproj │ │ ├── BootStoreDomainErrorCodes.cs │ │ ├── BootStoreDomainSharedModule.cs │ │ ├── Localization │ │ │ ├── BootStore │ │ │ │ ├── cs.json │ │ │ │ ├── en.json │ │ │ │ ├── pl.json │ │ │ │ ├── pt-BR.json │ │ │ │ ├── tr.json │ │ │ │ ├── vi.json │ │ │ │ └── zh-Hans.json │ │ │ └── BootStoreResource.cs │ │ └── MultiTenancy │ │ │ └── MultiTenancyConsts.cs │ ├── BootStore.Domain │ │ ├── BootStore.Domain.csproj │ │ ├── BootStoreConsts.cs │ │ ├── BootStoreDomainModule.cs │ │ ├── Data │ │ │ ├── BootStoreDbMigrationService.cs │ │ │ ├── IBootStoreDbSchemaMigrator.cs │ │ │ └── NullBootStoreDbSchemaMigrator.cs │ │ ├── IdentityServer │ │ │ └── IdentityServerDataSeedContributor.cs │ │ ├── Settings │ │ │ ├── BootStoreSettingDefinitionProvider.cs │ │ │ └── BootStoreSettings.cs │ │ └── Users │ │ │ └── AppUser.cs │ ├── BootStore.EntityFrameworkCore.DbMigrations │ │ ├── BootStore.EntityFrameworkCore.DbMigrations.csproj │ │ ├── EntityFrameworkCore │ │ │ ├── BootStoreEntityFrameworkCoreDbMigrationsModule.cs │ │ │ ├── BootStoreMigrationsDbContext.cs │ │ │ ├── BootStoreMigrationsDbContextFactory.cs │ │ │ └── EntityFrameworkCoreBootStoreDbSchemaMigrator.cs │ │ └── Migrations │ │ │ ├── 20191022082740_Initial.Designer.cs │ │ │ ├── 20191022082740_Initial.cs │ │ │ └── BootStoreMigrationsDbContextModelSnapshot.cs │ ├── BootStore.EntityFrameworkCore │ │ ├── BootStore.EntityFrameworkCore.csproj │ │ └── EntityFrameworkCore │ │ │ ├── BootStoreDbContext.cs │ │ │ ├── BootStoreDbContextModelCreatingExtensions.cs │ │ │ └── BootStoreEntityFrameworkCoreModule.cs │ ├── BootStore.HttpApi.Client │ │ ├── BootStore.HttpApi.Client.csproj │ │ └── BootStoreHttpApiClientModule.cs │ ├── BootStore.HttpApi │ │ ├── BootStore.HttpApi.csproj │ │ ├── BootStoreHttpApiModule.cs │ │ ├── Controllers │ │ │ ├── BootStoreController.cs │ │ │ └── TestController.cs │ │ └── Models │ │ │ └── Test │ │ │ └── TestModel.cs │ └── BootStore.Web │ │ ├── BootStore.Web.csproj │ │ ├── BootStoreBrandingProvider.cs │ │ ├── BootStoreWebAutoMapperProfile.cs │ │ ├── BootStoreWebModule.cs │ │ ├── Menus │ │ └── BootStoreMenuContributor.cs │ │ ├── Pages │ │ ├── BootStorePage.cs │ │ ├── BootStorePageModel.cs │ │ ├── Index.cshtml │ │ ├── Index.cshtml.cs │ │ ├── Index.css │ │ ├── Index.js │ │ └── _ViewImports.cshtml │ │ ├── Program.cs │ │ ├── Properties │ │ └── launchSettings.json │ │ ├── Startup.cs │ │ ├── Views │ │ └── _ViewImports.cshtml │ │ ├── abp.resourcemapping.js │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── gulpfile.js │ │ ├── package.json │ │ ├── tempkey.rsa │ │ └── yarn.lock │ └── test │ ├── BootStore.Application.Tests │ ├── BootStore.Application.Tests.csproj │ ├── BootStoreApplicationTestBase.cs │ ├── BootStoreApplicationTestModule.cs │ └── Samples │ │ └── SampleAppServiceTests.cs │ ├── BootStore.Domain.Tests │ ├── BootStore.Domain.Tests.csproj │ ├── BootStoreDomainTestBase.cs │ ├── BootStoreDomainTestModule.cs │ └── Samples │ │ └── SampleDomainTests.cs │ ├── BootStore.EntityFrameworkCore.Tests │ ├── BootStore.EntityFrameworkCore.Tests.csproj │ └── EntityFrameworkCore │ │ ├── BootStoreEntityFrameworkCoreTestBase.cs │ │ ├── BootStoreEntityFrameworkCoreTestModule.cs │ │ └── Samples │ │ └── SampleRepositoryTests.cs │ ├── BootStore.HttpApi.Client.ConsoleTestApp │ ├── BootStore.HttpApi.Client.ConsoleTestApp.csproj │ ├── BootStoreConsoleApiClientModule.cs │ ├── ClientDemoService.cs │ ├── Program.cs │ └── appsettings.json │ ├── BootStore.TestBase │ ├── BootStore.TestBase.csproj │ ├── BootStoreTestBase.cs │ ├── BootStoreTestBaseModule.cs │ ├── BootStoreTestDataSeedContributor.cs │ └── Security │ │ └── FakeCurrentPrincipalAccessor.cs │ └── BootStore.Web.Tests │ ├── BootStore.Web.Tests.csproj │ ├── BootStoreWebTestBase.cs │ ├── BootStoreWebTestModule.cs │ ├── BootStoreWebTestStartup.cs │ ├── Pages │ └── Index_Tests.cs │ ├── WebContentDirectoryFinder.cs │ └── xunit.runner.json ├── src └── LogDashboard │ ├── Authorization │ ├── AuthorizationFilterHelper.cs │ ├── AuthorizeHelper.cs │ ├── Filters │ │ ├── LogDashboardBasicAuthFilter.cs │ │ └── LogdashboardRoleAuthorizeFilter.cs │ └── ILogDashboardAuthorizationFilter.cs │ ├── Cache │ ├── ILogDashboardCacheManager.cs │ └── InMemoryLogDashboardCacheManager.cs │ ├── EmbeddedFiles │ └── LogDashboardEmbeddedFiles.cs │ ├── Extensions │ ├── EnumerableExtensions.cs │ ├── ExpressionExtensions.cs │ ├── Html.cs │ ├── JsonExtensions.cs │ ├── LogDashboardOptionsExtensions.cs │ ├── LogModelExtensions.cs │ └── StringArrayExtensions.cs │ ├── Handle │ ├── DashboardHandle.cs │ ├── ILogDashboardHandle.cs │ ├── LogChart │ │ ├── DayLogChart.cs │ │ ├── HourChart.cs │ │ ├── ILogChart.cs │ │ ├── LogChartFactory.cs │ │ ├── MonthLogChart.cs │ │ └── WeekLogChart.cs │ └── LogDashboardHandleBase.cs │ ├── Ioc │ └── IocManager.cs │ ├── LogDashboard.csproj │ ├── LogDashboardApplicationBuilderExtensions.cs │ ├── LogDashboardBuilder │ ├── DefaultLogDashboardBuilder.cs │ └── ILogDashboardBuilder.cs │ ├── LogDashboardConsts.cs │ ├── LogDashboardContext.cs │ ├── LogDashboardMiddleware.cs │ ├── LogDashboardOptions.cs │ ├── LogDashboardServiceCollectionExtensions.cs │ ├── Models │ ├── DashboardModel.cs │ ├── GetChartDataInput.cs │ ├── GetLogChartsOutput.cs │ ├── ILogModel.cs │ ├── IRequestTraceLogModel.cs │ ├── LogLevel.cs │ ├── LogModel.cs │ ├── LogModelInput.cs │ ├── PageedResultModel.cs │ ├── RequestTraceLogModel.cs │ ├── SearchLogModel.cs │ └── SearchlogInput.cs │ ├── Repository │ ├── Dapper │ │ ├── DapperEvaluator.cs │ │ ├── DapperExpressionExtensions.cs │ │ ├── DapperExpressionVisitor.cs │ │ ├── DapperRepository.cs │ │ ├── DapperUnitOfWork.cs │ │ └── LogModelMapper.cs │ ├── File │ │ ├── FileRepository.cs │ │ └── FileUnitOfWork.cs │ ├── IRepository.cs │ ├── IUnitOfWork.cs │ └── RepositoryExtensions.cs │ ├── Route │ ├── LogDashboardRoute.cs │ ├── LogDashboardRoutes.cs │ └── RouteCollection.cs │ ├── StackTrace │ ├── StackTraceFormatter.cs │ └── StackTraceParser.cs │ ├── Views │ ├── Dashboard │ │ ├── BasicLog.cshtml │ │ ├── BasicLog.generated.cs │ │ ├── Home.cshtml │ │ ├── Home.generated.cs │ │ ├── LogInfo.cshtml │ │ ├── LogInfo.generated.cs │ │ ├── LogList.cshtml │ │ ├── LogList.generated.cs │ │ ├── TraceLogList.cshtml │ │ └── TraceLogList.generated.cs │ ├── HtmlString.cs │ ├── RazorPage.cs │ ├── _layout.cshtml │ └── _layout.generated.cs │ ├── css │ ├── bootstrap.min.css │ ├── font-awesome.min.css │ ├── simple-line-icons.css │ ├── styles.css │ └── tempusdominus-bootstrap-4.min.css │ ├── font │ ├── Simple-Line-Icons.woff2 │ └── fontawesome-webfont.woff2 │ └── js │ ├── Chart.min.js │ ├── basicLog.js │ ├── bootstrap.min.js │ ├── home.js │ ├── jquery.min.js │ ├── log.js │ ├── moment.min.js │ ├── spin.min.js │ └── tempusdominus-bootstrap-4.js └── test ├── NetCoreEmptyTest ├── NLog.config ├── NetCoreEmptyTest.csproj ├── NetCoreEmptyTest.csproj.user ├── Program.cs ├── Properties │ ├── PublishProfiles │ │ ├── FolderProfile.pubxml │ │ └── FolderProfile.pubxml.user │ └── launchSettings.json ├── Startup.cs └── obj │ └── Debug │ └── netcoreapp2.0 │ └── NetCoreEmptyTest.AssemblyInfo.cs ├── aspnetcore2.1 ├── NLog.config ├── Program.cs ├── Properties │ └── launchSettings.json ├── Startup.cs └── aspnetcore2.1.csproj └── aspnetcore2.2 ├── NLog.config ├── Program.cs ├── Properties └── launchSettings.json ├── Startup.cs ├── appsettings.Development.json ├── appsettings.json └── aspnetcore2.2.csproj /.gitignore: -------------------------------------------------------------------------------- 1 |  2 | *.tmp 3 | *.log 4 | *.vspscc 5 | *.vssscc 6 | .builds 7 | 8 | # Visual C++ cache files 9 | ipch/ 10 | *.aps 11 | *.ncb 12 | *.opensdf 13 | *.sdf 14 | 15 | # Visual Studio profiler 16 | *.psess 17 | *.vsp 18 | *.vspx 19 | 20 | # Guidance Automation Toolkit 21 | *.gpState 22 | 23 | # ReSharper is a .NET coding add-in 24 | _ReSharper* 25 | 26 | # NCrunch 27 | *.ncrunch* 28 | .*crunch*.local.xml 29 | 30 | # Installshield output folder 31 | [Ee]xpress 32 | 33 | 34 | # Click-Once directory 35 | publish 36 | 37 | # Publish Web Output 38 | *.Publish.xml 39 | 40 | # NuGet Packages Directory 41 | packages 42 | 43 | # Windows Azure Build Output 44 | csx 45 | *.build.csdef 46 | 47 | # Windows Store app package directory 48 | AppPackages/ 49 | 50 | # Others 51 | .vs 52 | [Bb]in 53 | [Oo]bj 54 | .vs 55 | sql 56 | TestResults 57 | [Tt]est[Rr]esult* 58 | *.Cache 59 | ClientBin 60 | [Ss]tyle[Cc]op.* 61 | ~$* 62 | *.dbmdl 63 | Generated_Code #added for RIA/Silverlight projects 64 | 65 | # Backup & report files from converting an old project file to a newer 66 | # Visual Studio version. Backup files are not needed, because we have git ;-) 67 | _UpgradeReport_Files/ 68 | Backup*/ 69 | UpgradeLog*.XML 70 | src/.vs/config/applicationhost.config 71 | 72 | # GitLink 73 | !GitLink.exe 74 | !nuget.exe 75 | !SQLite.Interop.dll 76 | /tools 77 | /samples/CustomLogModel 78 | 79 | samples/abpvnext/src/BootStore.Web/wwwroot/libs/ 80 | 81 | .idea/ 82 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 LiangShiWei 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realLiangshiwei/LogDashboard/75fe55e9ee845a7524724bea149490e0d61b649e/logo.png -------------------------------------------------------------------------------- /samples/CustomLogModel/ApplicationLogModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using LogDashboard.Models; 6 | 7 | namespace CustomLogModel 8 | { 9 | public class ApplicationLogModel : LogModel 10 | { 11 | public string Application { get; set; } 12 | 13 | public string RequestMethod { get; set; } 14 | 15 | public string MachineName { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/CustomLogModel/CustomLogModel.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.0 5 | InProcess 6 | 7.3 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Always 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /samples/CustomLogModel/NLog.config: -------------------------------------------------------------------------------- 1 |  2 | 7 | 8 | 11 | 12 | 13 | 17 | 18 | 19 | 21 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /samples/CustomLogModel/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Hosting; 10 | using Microsoft.Extensions.Logging; 11 | using NLog; 12 | using NLog.Web; 13 | 14 | namespace CustomLogModel 15 | { 16 | public class Program 17 | { 18 | public static void Main(string[] args) 19 | { 20 | CreateHostBuilder(args).Build().Run(); 21 | } 22 | 23 | public static IHostBuilder CreateHostBuilder(string[] args) => 24 | Host.CreateDefaultBuilder(args) 25 | .ConfigureWebHostDefaults(webBuilder=> 26 | { 27 | webBuilder.UseStartup() 28 | .ConfigureLogging(logging => 29 | { 30 | logging.ClearProviders(); 31 | logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Information); 32 | }) 33 | .UseNLog(); 34 | }); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /samples/CustomLogModel/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:31886", 7 | "sslPort": 44322 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "CustomLogModel": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /samples/CustomLogModel/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/CustomLogModel/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /samples/DatabaseSource/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Mvc; 7 | using DatabaseSource.Models; 8 | 9 | namespace DatabaseSource.Controllers 10 | { 11 | public class HomeController : Controller 12 | { 13 | public IActionResult Index() 14 | { 15 | return View(); 16 | } 17 | 18 | public IActionResult Privacy() 19 | { 20 | return View(); 21 | } 22 | 23 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 24 | public IActionResult Error() 25 | { 26 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /samples/DatabaseSource/CustomLogModel.cs: -------------------------------------------------------------------------------- 1 | using LogDashboard.Models; 2 | 3 | namespace DatabaseSource 4 | { 5 | public class CustomLogModel : LogModel, IRequestTraceLogModel 6 | { 7 | public string TraceIdentifier { get; set; } 8 | 9 | public string MachineName { get; set; } 10 | 11 | public string Callsite { get; set; } 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /samples/DatabaseSource/DatabaseSource.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.0 5 | InProcess 6 | 7.3 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | Always 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /samples/DatabaseSource/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DatabaseSource.Models 4 | { 5 | public class ErrorViewModel 6 | { 7 | public string RequestId { get; set; } 8 | 9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 10 | } 11 | } -------------------------------------------------------------------------------- /samples/DatabaseSource/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | using NLog; 11 | using NLog.Web; 12 | using LogLevel = Microsoft.Extensions.Logging.LogLevel; 13 | 14 | namespace DatabaseSource 15 | { 16 | public class Program 17 | { 18 | public static void Main(string[] args) 19 | { 20 | CreateWebHostBuilder(args).Build().Run(); 21 | } 22 | 23 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 24 | WebHost.CreateDefaultBuilder(args) 25 | .UseStartup() 26 | .ConfigureLogging(logging => 27 | { 28 | logging.ClearProviders(); 29 | logging.SetMinimumLevel(LogLevel.Information); 30 | }) 31 | .UseNLog(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /samples/DatabaseSource/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:65353", 7 | "sslPort": 44321 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "DatabaseSource": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /samples/DatabaseSource/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |
6 |

Welcome

7 |

Learn about building Web apps with ASP.NET Core.

8 |
9 | -------------------------------------------------------------------------------- /samples/DatabaseSource/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /samples/DatabaseSource/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /samples/DatabaseSource/Views/Shared/_CookieConsentPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Http.Features 2 | 3 | @{ 4 | var consentFeature = Context.Features.Get(); 5 | var showBanner = !consentFeature?.CanTrack ?? false; 6 | var cookieString = consentFeature?.CreateConsentCookie(); 7 | } 8 | 9 | @if (showBanner) 10 | { 11 | 17 | 25 | } 26 | -------------------------------------------------------------------------------- /samples/DatabaseSource/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /samples/DatabaseSource/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using DatabaseSource 2 | @using DatabaseSource.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /samples/DatabaseSource/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /samples/DatabaseSource/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/DatabaseSource/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "DefaultConnection": "Server=.;Database=log;Trusted_Connection=True;MultipleActiveResultSets=true" 4 | }, 5 | "Logging": { 6 | "LogLevel": { 7 | "Default": "Warning" 8 | } 9 | }, 10 | "AllowedHosts": "*" 11 | } 12 | -------------------------------------------------------------------------------- /samples/DatabaseSource/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | 4 | a.navbar-brand { 5 | white-space: normal; 6 | text-align: center; 7 | word-break: break-all; 8 | } 9 | 10 | /* Sticky footer styles 11 | -------------------------------------------------- */ 12 | html { 13 | font-size: 14px; 14 | } 15 | @media (min-width: 768px) { 16 | html { 17 | font-size: 16px; 18 | } 19 | } 20 | 21 | .border-top { 22 | border-top: 1px solid #e5e5e5; 23 | } 24 | .border-bottom { 25 | border-bottom: 1px solid #e5e5e5; 26 | } 27 | 28 | .box-shadow { 29 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 30 | } 31 | 32 | button.accept-policy { 33 | font-size: 1rem; 34 | line-height: inherit; 35 | } 36 | 37 | /* Sticky footer styles 38 | -------------------------------------------------- */ 39 | html { 40 | position: relative; 41 | min-height: 100%; 42 | } 43 | 44 | body { 45 | /* Margin bottom by footer height */ 46 | margin-bottom: 60px; 47 | } 48 | .footer { 49 | position: absolute; 50 | bottom: 0; 51 | width: 100%; 52 | white-space: nowrap; 53 | /* Set the fixed height of the footer here */ 54 | height: 60px; 55 | line-height: 60px; /* Vertically center the text there */ 56 | } 57 | -------------------------------------------------------------------------------- /samples/DatabaseSource/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realLiangshiwei/LogDashboard/75fe55e9ee845a7524724bea149490e0d61b649e/samples/DatabaseSource/wwwroot/favicon.ico -------------------------------------------------------------------------------- /samples/DatabaseSource/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /samples/DatabaseSource/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2018 Twitter, Inc. 4 | Copyright (c) 2011-2018 The Bootstrap Authors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /samples/DatabaseSource/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /samples/DatabaseSource/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /samples/DotNetCoreEmptyUseNlog/DotNetCoreEmptyUseNlog.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.0 5 | InProcess 6 | 7.3 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Always 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /samples/DotNetCoreEmptyUseNlog/DotNetCoreEmptyUseNlog.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ProjectDebugger 5 | 6 | 7 | DotNetCoreEmpty 8 | 9 | -------------------------------------------------------------------------------- /samples/DotNetCoreEmptyUseNlog/NLog.config: -------------------------------------------------------------------------------- 1 |  2 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /samples/DotNetCoreEmptyUseNlog/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetCoreEmpty; 3 | using Microsoft.AspNetCore; 4 | using Microsoft.AspNetCore.Hosting; 5 | using Microsoft.Extensions.Logging; 6 | using NLog.Web; 7 | 8 | namespace DotNetCoreEmptyUseNlog 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | // NLog: setup the logger first to catch all errors 15 | var logger = NLogBuilder.ConfigureNLog("NLog.config").GetCurrentClassLogger(); 16 | try 17 | { 18 | logger.Debug("init main"); 19 | CreateWebHostBuilder(args).Run(); 20 | } 21 | catch (Exception ex) 22 | { 23 | //NLog: catch setup errors 24 | logger.Error(ex, "Stopped program because of exception"); 25 | throw; 26 | } 27 | finally 28 | { 29 | // Ensure to flush and stop internal timers/threads before application-exit (Avoid segmentation fault on Linux) 30 | NLog.LogManager.Shutdown(); 31 | } 32 | } 33 | 34 | public static IWebHost CreateWebHostBuilder(string[] args) => 35 | WebHost.CreateDefaultBuilder(args) 36 | .UseStartup() 37 | .ConfigureLogging(logging => 38 | { 39 | logging.ClearProviders(); 40 | logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Information); 41 | }) 42 | .UseNLog() 43 | .Build(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /samples/DotNetCoreEmptyUseNlog/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:45052", 7 | "sslPort": 44379 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "DotNetCoreEmpty": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /samples/DotNetCoreEmptyUseNlog/Startup.cs: -------------------------------------------------------------------------------- 1 | using DotNetCoreEmptyUseNlog; 2 | using LogDashboard; 3 | using Microsoft.AspNetCore.Builder; 4 | using Microsoft.AspNetCore.Hosting; 5 | using Microsoft.AspNetCore.Http; 6 | using Microsoft.Extensions.DependencyInjection; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace DotNetCoreEmpty 11 | { 12 | public class Startup 13 | { 14 | // This method gets called by the runtime. Use this method to add services to the container. 15 | // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 16 | public void ConfigureServices(IServiceCollection services) 17 | { 18 | services.AddLogDashboard(opt => { }); 19 | 20 | } 21 | 22 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 23 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 24 | { 25 | 26 | // 静态文件中间件 27 | app.UseStaticFiles(); 28 | 29 | if (env.IsDevelopment()) 30 | { 31 | app.UseDeveloperExceptionPage(); 32 | } 33 | 34 | app.UseLogDashboard(); 35 | 36 | app.Run(async (context) => 37 | { 38 | await context.Response.WriteAsync("Hello World!"); 39 | }); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /samples/DotNetCoreEmptyUseNlog/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/DotNetCoreEmptyUseNlog/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /samples/MySqlDatabase/CustomLogModel.cs: -------------------------------------------------------------------------------- 1 | using LogDashboard.Models; 2 | 3 | namespace MySqlDatabase 4 | { 5 | public class CustomLogModel : LogModel, IRequestTraceLogModel 6 | { 7 | public string TraceIdentifier { get; set; } 8 | 9 | public string MachineName { get; set; } 10 | 11 | public string Callsite { get; set; } 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /samples/MySqlDatabase/MySqlDatabase.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.2 5 | InProcess 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /samples/MySqlDatabase/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | using NLog.Web; 11 | 12 | namespace MySqlDatabase 13 | { 14 | public class Program 15 | { 16 | public static void Main(string[] args) 17 | { 18 | CreateWebHostBuilder(args).Build().Run(); 19 | } 20 | 21 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 22 | WebHost.CreateDefaultBuilder(args) 23 | .UseStartup().UseNLog(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /samples/MySqlDatabase/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:30161", 7 | "sslPort": 44332 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "MySqlDatabase": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /samples/MySqlDatabase/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/MySqlDatabase/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "DefaultConnection": "Server=127.0.0.1;Database=log;uid=root;pwd=123456;port=3306;" 4 | }, 5 | "Logging": { 6 | "LogLevel": { 7 | "Default": "Warning" 8 | } 9 | }, 10 | "AllowedHosts": "*" 11 | } -------------------------------------------------------------------------------- /samples/NfxAspNetMvc/App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Optimization; 3 | 4 | namespace NfxAspNetMvc 5 | { 6 | public class BundleConfig 7 | { 8 | // 有关捆绑的详细信息,请访问 https://go.microsoft.com/fwlink/?LinkId=301862 9 | public static void RegisterBundles(BundleCollection bundles) 10 | { 11 | bundles.Add(new ScriptBundle("~/bundles/jquery").Include( 12 | "~/Scripts/jquery-{version}.js")); 13 | 14 | bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( 15 | "~/Scripts/jquery.validate*")); 16 | 17 | // 使用要用于开发和学习的 Modernizr 的开发版本。然后,当你做好 18 | // 生产准备就绪,请使用 https://modernizr.com 上的生成工具仅选择所需的测试。 19 | bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( 20 | "~/Scripts/modernizr-*")); 21 | 22 | bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( 23 | "~/Scripts/bootstrap.js")); 24 | 25 | bundles.Add(new StyleBundle("~/Content/css").Include( 26 | "~/Content/bootstrap.css", 27 | "~/Content/site.css")); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /samples/NfxAspNetMvc/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace NfxAspNetMvc 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/NfxAspNetMvc/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace NfxAspNetMvc 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /samples/NfxAspNetMvc/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Override the default bootstrap behavior where horizontal description lists 13 | will truncate terms that are too long to fit in the left column 14 | */ 15 | .dl-horizontal dt { 16 | white-space: normal; 17 | } 18 | 19 | /* Set width on the form input elements since they're 100% wide by default */ 20 | input, 21 | select, 22 | textarea { 23 | max-width: 280px; 24 | } 25 | -------------------------------------------------------------------------------- /samples/NfxAspNetMvc/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using NLog; 7 | 8 | namespace NfxAspNetMvc.Controllers 9 | { 10 | public class HomeController : Controller 11 | { 12 | public ActionResult Index() 13 | { 14 | //var logger = logger 15 | var logger = LogManager.GetCurrentClassLogger(); 16 | logger.Info("HomeController index action"); 17 | return View(); 18 | } 19 | 20 | public ActionResult About() 21 | { 22 | ViewBag.Message = "Your application description page."; 23 | 24 | return View(); 25 | } 26 | 27 | public ActionResult Contact() 28 | { 29 | ViewBag.Message = "Your contact page."; 30 | 31 | return View(); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /samples/NfxAspNetMvc/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="NfxAspNetMvc.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /samples/NfxAspNetMvc/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Optimization; 7 | using System.Web.Routing; 8 | 9 | namespace NfxAspNetMvc 10 | { 11 | public class MvcApplication : System.Web.HttpApplication 12 | { 13 | protected void Application_Start() 14 | { 15 | AreaRegistration.RegisterAllAreas(); 16 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 17 | RouteConfig.RegisterRoutes(RouteTable.Routes); 18 | BundleConfig.RegisterBundles(BundleTable.Bundles); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/NfxAspNetMvc/NLog.config: -------------------------------------------------------------------------------- 1 |  2 | 7 | 8 | 11 | 12 | 13 | 17 | 18 | 19 | 21 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /samples/NfxAspNetMvc/NfxAspNetMvc.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | true 5 | 6 | 7 | 8 | 9 | 10 | 11 | Debug|Any CPU 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | CurrentPage 20 | True 21 | False 22 | False 23 | False 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | True 33 | True 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /samples/NfxAspNetMvc/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的常规信息是通过以下项进行控制的 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("NfxAspNetMvc")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("NfxAspNetMvc")] 13 | [assembly: AssemblyCopyright("版权所有(C) 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 将使此程序集中的类型 18 | // 对 COM 组件不可见。如果需要 19 | // 从 COM 访问此程序集中的某个类型,请针对该类型将 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于 typelib 的 ID 23 | [assembly: Guid("016dbf02-53b0-4c68-ad72-3b3940e9c965")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 内部版本号 30 | // 修订版本 31 | // 32 | // 你可以指定所有值,也可以让修订版本和内部版本号采用默认值, 33 | // 方法是按如下所示使用 "*": 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /samples/NfxAspNetMvc/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using LogDashboard; 3 | using LogDashboard.Extensions; 4 | using Microsoft.Owin; 5 | using Owin; 6 | 7 | [assembly: OwinStartup(typeof(NfxAspNetMvc.Startup))] 8 | 9 | namespace NfxAspNetMvc 10 | { 11 | public class Startup 12 | { 13 | public void Configuration(IAppBuilder app) 14 | { 15 | app.MapLogDashboard(typeof(Startup).Assembly, opt => 16 | { 17 | opt.SetRootPath(AppContext.BaseDirectory); 18 | }); 19 | 20 | // 有关如何配置应用程序的详细信息,请访问 https://go.microsoft.com/fwlink/?LinkID=316888 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /samples/NfxAspNetMvc/Views/Home/About.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "About"; 3 | } 4 |

@ViewBag.Title.

5 |

@ViewBag.Message

6 | 7 |

Use this area to provide additional information.

8 | -------------------------------------------------------------------------------- /samples/NfxAspNetMvc/Views/Home/Contact.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Contact"; 3 | } 4 |

@ViewBag.Title.

5 |

@ViewBag.Message

6 | 7 |
8 | One Microsoft Way
9 | Redmond, WA 98052-6399
10 | P: 11 | 425.555.0100 12 |
13 | 14 |
15 | Support: Support@example.com
16 | Marketing: Marketing@example.com 17 |
-------------------------------------------------------------------------------- /samples/NfxAspNetMvc/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Home Page"; 3 | } 4 | 5 |
6 |

ASP.NET

7 |

ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.

8 |

Learn more »

9 |
10 | 11 |
12 |
13 |

Getting started

14 |

15 | ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that 16 | enables a clean separation of concerns and gives you full control over markup 17 | for enjoyable, agile development. 18 |

19 |

Learn more »

20 |
21 |
22 |

Get more libraries

23 |

NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.

24 |

Learn more »

25 |
26 |
27 |

Web Hosting

28 |

You can easily find a web hosting company that offers the right mix of features and price for your applications.

29 |

Learn more »

30 |
31 |
-------------------------------------------------------------------------------- /samples/NfxAspNetMvc/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 错误 7 | 8 | 9 |
10 |

错误。

11 |

处理你的请求时出错。

12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /samples/NfxAspNetMvc/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /samples/NfxAspNetMvc/Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /samples/NfxAspNetMvc/Web.Release.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /samples/NfxAspNetMvc/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realLiangshiwei/LogDashboard/75fe55e9ee845a7524724bea149490e0d61b649e/samples/NfxAspNetMvc/favicon.ico -------------------------------------------------------------------------------- /samples/NfxAspnetCore/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Mvc; 7 | using NfxAspnetCore.Models; 8 | 9 | namespace NfxAspnetCore.Controllers 10 | { 11 | public class HomeController : Controller 12 | { 13 | public IActionResult Index() 14 | { 15 | return View(); 16 | } 17 | 18 | public IActionResult Privacy() 19 | { 20 | return View(); 21 | } 22 | 23 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 24 | public IActionResult Error() 25 | { 26 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /samples/NfxAspnetCore/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NfxAspnetCore.Models 4 | { 5 | public class ErrorViewModel 6 | { 7 | public string RequestId { get; set; } 8 | 9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 10 | } 11 | } -------------------------------------------------------------------------------- /samples/NfxAspnetCore/NfxAspnetCore.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net461 5 | full 6 | 7.3 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /samples/NfxAspnetCore/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace NfxAspnetCore 12 | { 13 | public class Program 14 | { 15 | public static void Main(string[] args) 16 | { 17 | CreateWebHostBuilder(args).Build().Run(); 18 | } 19 | 20 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 21 | WebHost.CreateDefaultBuilder(args) 22 | .UseStartup(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /samples/NfxAspnetCore/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:63000", 7 | "sslPort": 44372 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "NfxAspnetCore": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /samples/NfxAspnetCore/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |
6 |

Welcome

7 |

Learn about building Web apps with ASP.NET Core.

8 |
9 | -------------------------------------------------------------------------------- /samples/NfxAspnetCore/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /samples/NfxAspnetCore/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /samples/NfxAspnetCore/Views/Shared/_CookieConsentPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Http.Features 2 | 3 | @{ 4 | var consentFeature = Context.Features.Get(); 5 | var showBanner = !consentFeature?.CanTrack ?? false; 6 | var cookieString = consentFeature?.CreateConsentCookie(); 7 | } 8 | 9 | @if (showBanner) 10 | { 11 | 17 | 25 | } 26 | -------------------------------------------------------------------------------- /samples/NfxAspnetCore/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /samples/NfxAspnetCore/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using NfxAspnetCore 2 | @using NfxAspnetCore.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /samples/NfxAspnetCore/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /samples/NfxAspnetCore/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /samples/NfxAspnetCore/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/NfxAspnetCore/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /samples/NfxAspnetCore/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | 4 | a.navbar-brand { 5 | white-space: normal; 6 | text-align: center; 7 | word-break: break-all; 8 | } 9 | 10 | /* Sticky footer styles 11 | -------------------------------------------------- */ 12 | html { 13 | font-size: 14px; 14 | } 15 | @media (min-width: 768px) { 16 | html { 17 | font-size: 16px; 18 | } 19 | } 20 | 21 | .border-top { 22 | border-top: 1px solid #e5e5e5; 23 | } 24 | .border-bottom { 25 | border-bottom: 1px solid #e5e5e5; 26 | } 27 | 28 | .box-shadow { 29 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 30 | } 31 | 32 | button.accept-policy { 33 | font-size: 1rem; 34 | line-height: inherit; 35 | } 36 | 37 | /* Sticky footer styles 38 | -------------------------------------------------- */ 39 | html { 40 | position: relative; 41 | min-height: 100%; 42 | } 43 | 44 | body { 45 | /* Margin bottom by footer height */ 46 | margin-bottom: 60px; 47 | } 48 | .footer { 49 | position: absolute; 50 | bottom: 0; 51 | width: 100%; 52 | white-space: nowrap; 53 | /* Set the fixed height of the footer here */ 54 | height: 60px; 55 | line-height: 60px; /* Vertically center the text there */ 56 | } 57 | -------------------------------------------------------------------------------- /samples/NfxAspnetCore/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realLiangshiwei/LogDashboard/75fe55e9ee845a7524724bea149490e0d61b649e/samples/NfxAspnetCore/wwwroot/favicon.ico -------------------------------------------------------------------------------- /samples/NfxAspnetCore/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /samples/NfxAspnetCore/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2018 Twitter, Inc. 4 | Copyright (c) 2011-2018 The Bootstrap Authors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /samples/NfxAspnetCore/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /samples/NfxAspnetCore/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /samples/RequestTracking/NLog.config: -------------------------------------------------------------------------------- 1 |  2 | 7 | 8 | 9 | 10 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /samples/RequestTracking/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | using NLog.Web; 4 | 5 | namespace RequestTracking 6 | { 7 | public class Program 8 | { 9 | public static void Main(string[] args) 10 | { 11 | CreateWebHostBuilder(args).Build().Run(); 12 | } 13 | 14 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 15 | WebHost.CreateDefaultBuilder(args) 16 | .UseStartup() 17 | .UseNLog(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /samples/RequestTracking/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:59044", 7 | "sslPort": 44344 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "RequestTracking": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /samples/RequestTracking/RequestTracking.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.0 5 | InProcess 6 | 7.3 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Always 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /samples/RequestTracking/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/RequestTracking/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /samples/StructuredLog/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace StructuredLog 12 | { 13 | public class Program 14 | { 15 | public static void Main(string[] args) 16 | { 17 | CreateWebHostBuilder(args).Build().Run(); 18 | } 19 | 20 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 21 | WebHost.CreateDefaultBuilder(args) 22 | .UseStartup(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /samples/StructuredLog/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:55117", 7 | "sslPort": 44319 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "StructuredLog": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /samples/StructuredLog/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.AspNetCore.Http; 8 | using Microsoft.Extensions.DependencyInjection; 9 | using Microsoft.Extensions.Hosting; 10 | 11 | namespace StructuredLog 12 | { 13 | public class Startup 14 | { 15 | // This method gets called by the runtime. Use this method to add services to the container. 16 | // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 17 | public void ConfigureServices(IServiceCollection services) 18 | { 19 | } 20 | 21 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 22 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 23 | { 24 | if (env.IsDevelopment()) 25 | { 26 | app.UseDeveloperExceptionPage(); 27 | } 28 | 29 | app.Run(async (context) => 30 | { 31 | await context.Response.WriteAsync("Hello World!"); 32 | }); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /samples/StructuredLog/StructuredLog.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.0 5 | InProcess 6 | 7.3 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /samples/StructuredLog/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/StructuredLog/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /samples/UseAuthorization/Areas/Identity/Pages/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "/Pages/Shared/_Layout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /samples/UseAuthorization/Data/ApplicationDbContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using Microsoft.AspNetCore.Identity.EntityFrameworkCore; 5 | using Microsoft.EntityFrameworkCore; 6 | 7 | namespace UseAuthorization.Data 8 | { 9 | public class ApplicationDbContext : IdentityDbContext 10 | { 11 | public ApplicationDbContext(DbContextOptions options) 12 | : base(options) 13 | { 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/UseAuthorization/Pages/Error.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model ErrorModel 3 | @{ 4 | ViewData["Title"] = "Error"; 5 | } 6 | 7 |

Error.

8 |

An error occurred while processing your request.

9 | 10 | @if (Model.ShowRequestId) 11 | { 12 |

13 | Request ID: @Model.RequestId 14 |

15 | } 16 | 17 |

Development Mode

18 |

19 | Swapping to the Development environment displays detailed information about the error that occurred. 20 |

21 |

22 | The Development environment shouldn't be enabled for deployed applications. 23 | It can result in displaying sensitive information from exceptions to end users. 24 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 25 | and restarting the app. 26 |

27 | -------------------------------------------------------------------------------- /samples/UseAuthorization/Pages/Error.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Mvc; 7 | using Microsoft.AspNetCore.Mvc.RazorPages; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace UseAuthorization.Pages 11 | { 12 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 13 | public class ErrorModel : PageModel 14 | { 15 | public string RequestId { get; set; } 16 | 17 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 18 | 19 | private readonly ILogger _logger; 20 | 21 | public ErrorModel(ILogger logger) 22 | { 23 | _logger = logger; 24 | } 25 | 26 | public void OnGet() 27 | { 28 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /samples/UseAuthorization/Pages/Index.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model IndexModel 3 | @{ 4 | ViewData["Title"] = "Home page"; 5 | } 6 | 7 |
8 |

Welcome

9 |

Learn about building Web apps with ASP.NET Core.

10 |
11 | -------------------------------------------------------------------------------- /samples/UseAuthorization/Pages/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Mvc.RazorPages; 7 | using Microsoft.Extensions.Logging; 8 | 9 | namespace UseAuthorization.Pages 10 | { 11 | public class IndexModel : PageModel 12 | { 13 | private readonly ILogger _logger; 14 | 15 | public IndexModel(ILogger logger) 16 | { 17 | _logger = logger; 18 | } 19 | 20 | public void OnGet() 21 | { 22 | 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /samples/UseAuthorization/Pages/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model PrivacyModel 3 | @{ 4 | ViewData["Title"] = "Privacy Policy"; 5 | } 6 |

@ViewData["Title"]

7 | 8 |

Use this page to detail your site's privacy policy.

9 | -------------------------------------------------------------------------------- /samples/UseAuthorization/Pages/Privacy.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Mvc.RazorPages; 7 | using Microsoft.Extensions.Logging; 8 | 9 | namespace UseAuthorization.Pages 10 | { 11 | public class PrivacyModel : PageModel 12 | { 13 | private readonly ILogger _logger; 14 | 15 | public PrivacyModel(ILogger logger) 16 | { 17 | _logger = logger; 18 | } 19 | 20 | public void OnGet() 21 | { 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /samples/UseAuthorization/Pages/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Identity 2 | @inject SignInManager SignInManager 3 | @inject UserManager UserManager 4 | 5 | 27 | -------------------------------------------------------------------------------- /samples/UseAuthorization/Pages/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /samples/UseAuthorization/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Identity 2 | @using UseAuthorization 3 | @using UseAuthorization.Data 4 | @namespace UseAuthorization.Pages 5 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 6 | -------------------------------------------------------------------------------- /samples/UseAuthorization/Pages/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /samples/UseAuthorization/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace UseAuthorization 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /samples/UseAuthorization/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:60610", 7 | "sslPort": 44312 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "UseAuthorization": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /samples/UseAuthorization/SimpleAuthFilter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using LogDashboard; 6 | using LogDashboard.Authorization; 7 | 8 | namespace UseAuthorization 9 | { 10 | public class SimpleAuthFilter : ILogDashboardAuthorizationFilter 11 | { 12 | public bool Authorization(LogDashboardContext context) 13 | { 14 | return context.HttpContext.User.Identity.IsAuthenticated; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/UseAuthorization/UseAuthorization.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.0 5 | aspnet-UseAuthorization-44AF40F4-416B-45D7-96C9-BA52AF40588E 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /samples/UseAuthorization/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/UseAuthorization/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "DefaultConnection": "Server=.;Database=aspnet-UseAuthorization;Trusted_Connection=True;MultipleActiveResultSets=true" 4 | }, 5 | "Logging": { 6 | "LogLevel": { 7 | "Default": "Information", 8 | "Microsoft": "Warning", 9 | "Microsoft.Hosting.Lifetime": "Information" 10 | } 11 | }, 12 | "AllowedHosts": "*" 13 | } 14 | -------------------------------------------------------------------------------- /samples/UseAuthorization/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | 4 | a.navbar-brand { 5 | white-space: normal; 6 | text-align: center; 7 | word-break: break-all; 8 | } 9 | 10 | /* Provide sufficient contrast against white background */ 11 | a { 12 | color: #0366d6; 13 | } 14 | 15 | .btn-primary { 16 | color: #fff; 17 | background-color: #1b6ec2; 18 | border-color: #1861ac; 19 | } 20 | 21 | .nav-pills .nav-link.active, .nav-pills .show > .nav-link { 22 | color: #fff; 23 | background-color: #1b6ec2; 24 | border-color: #1861ac; 25 | } 26 | 27 | /* Sticky footer styles 28 | -------------------------------------------------- */ 29 | html { 30 | font-size: 14px; 31 | } 32 | @media (min-width: 768px) { 33 | html { 34 | font-size: 16px; 35 | } 36 | } 37 | 38 | .border-top { 39 | border-top: 1px solid #e5e5e5; 40 | } 41 | .border-bottom { 42 | border-bottom: 1px solid #e5e5e5; 43 | } 44 | 45 | .box-shadow { 46 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 47 | } 48 | 49 | button.accept-policy { 50 | font-size: 1rem; 51 | line-height: inherit; 52 | } 53 | 54 | /* Sticky footer styles 55 | -------------------------------------------------- */ 56 | html { 57 | position: relative; 58 | min-height: 100%; 59 | } 60 | 61 | body { 62 | /* Margin bottom by footer height */ 63 | margin-bottom: 60px; 64 | } 65 | .footer { 66 | position: absolute; 67 | bottom: 0; 68 | width: 100%; 69 | white-space: nowrap; 70 | line-height: 60px; /* Vertically center the text there */ 71 | } 72 | -------------------------------------------------------------------------------- /samples/UseAuthorization/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realLiangshiwei/LogDashboard/75fe55e9ee845a7524724bea149490e0d61b649e/samples/UseAuthorization/wwwroot/favicon.ico -------------------------------------------------------------------------------- /samples/UseAuthorization/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your Javascript code. 5 | -------------------------------------------------------------------------------- /samples/UseAuthorization/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2018 Twitter, Inc. 4 | Copyright (c) 2011-2018 The Bootstrap Authors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /samples/UseAuthorization/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /samples/UseAuthorization/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /samples/UseLog4net/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace UseLog4net 12 | { 13 | public class Program 14 | { 15 | public static void Main(string[] args) 16 | { 17 | CreateWebHostBuilder(args).Build().Run(); 18 | } 19 | 20 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 21 | WebHost.CreateDefaultBuilder(args) 22 | .UseStartup(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /samples/UseLog4net/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:52824", 7 | "sslPort": 44325 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "UseLog4net": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /samples/UseLog4net/UseLog4net.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.0 5 | InProcess 6 | 7.3 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Always 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /samples/UseLog4net/UseLog4net.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ProjectDebugger 5 | 6 | 7 | IIS Express 8 | 9 | 10 | ProjectDebugger 11 | 12 | -------------------------------------------------------------------------------- /samples/UseLog4net/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/UseLog4net/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /samples/UseLog4net/log4net.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/UseSerilog/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.AspNetCore; 3 | using Microsoft.AspNetCore.Hosting; 4 | using Serilog; 5 | using Serilog.Events; 6 | 7 | namespace UseSerilog 8 | { 9 | public class Program 10 | { 11 | public static void Main(string[] args) 12 | { 13 | Log.Logger = new LoggerConfiguration() 14 | .MinimumLevel.Debug() 15 | .MinimumLevel.Override("Microsoft", LogEventLevel.Information) 16 | .Enrich.FromLogContext() 17 | .WriteTo.File($"{AppContext.BaseDirectory}Log/.log", rollingInterval:RollingInterval.Day,outputTemplate: "{Timestamp:HH:mm} || {Level} || {SourceContext:l} || {Message} || {Exception} ||end {NewLine}") 18 | .CreateLogger(); 19 | 20 | CreateWebHostBuilder(args).Build().Run(); 21 | } 22 | 23 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 24 | WebHost.CreateDefaultBuilder(args) 25 | .UseSerilog() 26 | .UseStartup(); 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /samples/UseSerilog/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:51349", 7 | "sslPort": 44370 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "UseSerilog": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /samples/UseSerilog/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using LogDashboard; 6 | using Microsoft.AspNetCore.Builder; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.AspNetCore.Http; 9 | using Microsoft.Extensions.DependencyInjection; 10 | using Microsoft.Extensions.Hosting; 11 | using Microsoft.Extensions.Logging; 12 | 13 | namespace UseSerilog 14 | { 15 | public class Startup 16 | { 17 | // This method gets called by the runtime. Use this method to add services to the container. 18 | // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 19 | public void ConfigureServices(IServiceCollection services) 20 | { 21 | services.AddLogDashboard(); 22 | } 23 | 24 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 25 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 26 | { 27 | if (env.IsDevelopment()) 28 | { 29 | app.UseDeveloperExceptionPage(); 30 | } 31 | 32 | app.UseLogDashboard(); 33 | 34 | app.Run(async (context) => 35 | { 36 | var logger = app.ApplicationServices.GetRequiredService>(); 37 | logger.LogInformation("Hello World"); 38 | await context.Response.WriteAsync("Hello World!"); 39 | }); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /samples/UseSerilog/UseSerilog.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.0 5 | InProcess 6 | 7.3 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /samples/UseSerilog/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/UseSerilog/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /samples/abpvnext/.gitattributes: -------------------------------------------------------------------------------- 1 | **/wwwroot/libs/** linguist-vendored 2 | -------------------------------------------------------------------------------- /samples/abpvnext/common.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | latest 4 | 1.0.0 5 | $(NoWarn);CS1591 6 | 7 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Application.Contracts/BootStore.Application.Contracts.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | netstandard2.0 7 | BootStore 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Application.Contracts/BootStoreApplicationContractsModule.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.Account; 2 | using Volo.Abp.FeatureManagement; 3 | using Volo.Abp.Identity; 4 | using Volo.Abp.Modularity; 5 | using Volo.Abp.PermissionManagement; 6 | using Volo.Abp.TenantManagement; 7 | 8 | namespace BootStore 9 | { 10 | [DependsOn( 11 | typeof(BootStoreDomainSharedModule), 12 | typeof(AbpAccountApplicationContractsModule), 13 | typeof(AbpFeatureManagementApplicationContractsModule), 14 | typeof(AbpIdentityApplicationContractsModule), 15 | typeof(AbpPermissionManagementApplicationContractsModule), 16 | typeof(AbpTenantManagementApplicationContractsModule) 17 | )] 18 | public class BootStoreApplicationContractsModule : AbpModule 19 | { 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Application.Contracts/Permissions/BootStorePermissionDefinitionProvider.cs: -------------------------------------------------------------------------------- 1 | using BootStore.Localization; 2 | using Volo.Abp.Authorization.Permissions; 3 | using Volo.Abp.Localization; 4 | 5 | namespace BootStore.Permissions 6 | { 7 | public class BootStorePermissionDefinitionProvider : PermissionDefinitionProvider 8 | { 9 | public override void Define(IPermissionDefinitionContext context) 10 | { 11 | var myGroup = context.AddGroup(BootStorePermissions.GroupName); 12 | 13 | //Define your own permissions here. Example: 14 | //myGroup.AddPermission(BootStorePermissions.MyPermission1, L("Permission:MyPermission1")); 15 | } 16 | 17 | private static LocalizableString L(string name) 18 | { 19 | return LocalizableString.Create(name); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Application.Contracts/Permissions/BootStorePermissions.cs: -------------------------------------------------------------------------------- 1 | namespace BootStore.Permissions 2 | { 3 | public static class BootStorePermissions 4 | { 5 | public const string GroupName = "BootStore"; 6 | 7 | //Add your own permission names. Example: 8 | //public const string MyPermission1 = GroupName + ".MyPermission1"; 9 | } 10 | } -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Application/BootStore.Application.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | netcoreapp3.0 7 | BootStore 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Application/BootStoreAppService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using BootStore.Localization; 5 | using Volo.Abp.Application.Services; 6 | 7 | namespace BootStore 8 | { 9 | /* Inherit your application services from this class. 10 | */ 11 | public abstract class BootStoreAppService : ApplicationService 12 | { 13 | protected BootStoreAppService() 14 | { 15 | LocalizationResource = typeof(BootStoreResource); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Application/BootStoreApplicationAutoMapperProfile.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | 3 | namespace BootStore 4 | { 5 | public class BootStoreApplicationAutoMapperProfile : Profile 6 | { 7 | public BootStoreApplicationAutoMapperProfile() 8 | { 9 | /* You can configure your AutoMapper mapping configuration here. 10 | * Alternatively, you can split your mapping configurations 11 | * into multiple profile classes for a better organization. */ 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Application/BootStoreApplicationModule.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.Account; 2 | using Volo.Abp.AutoMapper; 3 | using Volo.Abp.FeatureManagement; 4 | using Volo.Abp.Identity; 5 | using Volo.Abp.Modularity; 6 | using Volo.Abp.PermissionManagement; 7 | using Volo.Abp.TenantManagement; 8 | 9 | namespace BootStore 10 | { 11 | [DependsOn( 12 | typeof(BootStoreDomainModule), 13 | typeof(AbpAccountApplicationModule), 14 | typeof(BootStoreApplicationContractsModule), 15 | typeof(AbpIdentityApplicationModule), 16 | typeof(AbpPermissionManagementApplicationModule), 17 | typeof(AbpTenantManagementApplicationModule), 18 | typeof(AbpFeatureManagementApplicationModule) 19 | )] 20 | public class BootStoreApplicationModule : AbpModule 21 | { 22 | public override void ConfigureServices(ServiceConfigurationContext context) 23 | { 24 | Configure(options => 25 | { 26 | options.AddMaps(); 27 | }); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.DbMigrator/BootStore.DbMigrator.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exe 7 | netcoreapp3.0 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | PreserveNewest 17 | Always 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.DbMigrator/BootStoreDbMigratorModule.cs: -------------------------------------------------------------------------------- 1 | using BootStore.EntityFrameworkCore; 2 | using Volo.Abp.Autofac; 3 | using Volo.Abp.BackgroundJobs; 4 | using Volo.Abp.Modularity; 5 | 6 | namespace BootStore.DbMigrator 7 | { 8 | [DependsOn( 9 | typeof(AbpAutofacModule), 10 | typeof(BootStoreEntityFrameworkCoreDbMigrationsModule), 11 | typeof(BootStoreApplicationContractsModule) 12 | )] 13 | public class BootStoreDbMigratorModule : AbpModule 14 | { 15 | public override void ConfigureServices(ServiceConfigurationContext context) 16 | { 17 | Configure(options => options.IsJobExecutionEnabled = false); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.DbMigrator/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "Default": "Server=localhost;Database=BootStore;Trusted_Connection=True;MultipleActiveResultSets=true" 4 | }, 5 | "IdentityServer": { 6 | "Clients": { 7 | "BootStore_Web": { 8 | "ClientId": "BootStore_Web", 9 | "ClientSecret": "1q2w3e*", 10 | "RootUrl": "https://localhost:44383" 11 | }, 12 | "BootStore_App": { 13 | "ClientId": "BootStore_App", 14 | "ClientSecret": "1q2w3e*" 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Domain.Shared/BootStore.Domain.Shared.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | netstandard2.0 7 | BootStore 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Domain.Shared/BootStoreDomainErrorCodes.cs: -------------------------------------------------------------------------------- 1 | namespace BootStore 2 | { 3 | public static class BootStoreDomainErrorCodes 4 | { 5 | /* You can add your business exception error codes here, as constants */ 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Domain.Shared/Localization/BootStore/cs.json: -------------------------------------------------------------------------------- 1 | { 2 | "culture": "cs", 3 | "texts": { 4 | "Menu:Home": "Úvod", 5 | "Welcome": "Vítejte", 6 | "LongWelcomeMessage": "Vítejte v aplikaci. Toto je startovací projekt založený na ABP frameworku. Pro více informací, navštivte abp.io." 7 | } 8 | } -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Domain.Shared/Localization/BootStore/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "culture": "en", 3 | "texts": { 4 | "Menu:Home": "Home", 5 | "Welcome": "Welcome", 6 | "LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io." 7 | } 8 | } -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Domain.Shared/Localization/BootStore/pl.json: -------------------------------------------------------------------------------- 1 | { 2 | "culture": "pl", 3 | "texts": { 4 | "Menu:Home": "Home", 5 | "Welcome": "Witaj", 6 | "LongWelcomeMessage": "Witaj w aplikacji. To jest inicjalny projekt bazujący na ABP framework. Po więcej informacji odwiedź stronę abp.io." 7 | } 8 | } -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Domain.Shared/Localization/BootStore/pt-BR.json: -------------------------------------------------------------------------------- 1 | { 2 | "culture": "pt-BR", 3 | "texts": { 4 | "Menu:Home": "Principal", 5 | "Welcome": "Seja bem-vindo!", 6 | "LongWelcomeMessage": "Bem-vindo a esta aplicação. Este é um projeto inicial baseado no ABP framework. Para mais informações, visite abp.io." 7 | } 8 | } -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Domain.Shared/Localization/BootStore/tr.json: -------------------------------------------------------------------------------- 1 | { 2 | "culture": "tr", 3 | "texts": { 4 | "Menu:Home": "Ana sayfa", 5 | "Welcome": "Hoşgeldiniz", 6 | "LongWelcomeMessage": "Uygulamaya hoşgeldiniz. Bu, ABP framework'ü üzerine bina edilmiş bir başlangıç projesidir. Daha fazla bilgi için abp.io adresini ziyaret edebilirsiniz." 7 | } 8 | } -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Domain.Shared/Localization/BootStore/vi.json: -------------------------------------------------------------------------------- 1 | { 2 | "culture": "vi", 3 | "texts": { 4 | "Menu:Home": "Trang chủ", 5 | "Welcome": "Chào mừng bạn", 6 | "LongWelcomeMessage": "Chào mừng bạn đến ứng dụng. Đây là một dự án khởi nghiệp dựa trên khung ABP. Để biết thêm thông tin, hãy truy cập abp.io." 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Domain.Shared/Localization/BootStore/zh-Hans.json: -------------------------------------------------------------------------------- 1 | { 2 | "culture": "zh-Hans", 3 | "texts": { 4 | "Menu:Home": "首页", 5 | "Welcome": "欢迎", 6 | "LongWelcomeMessage": "欢迎来到该应用程序. 这是一个基于ABP框架的启动项目. 有关更多信息, 请访问 cn.abp.io." 7 | } 8 | } -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Domain.Shared/Localization/BootStoreResource.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.Localization; 2 | 3 | namespace BootStore.Localization 4 | { 5 | [LocalizationResourceName("BootStore")] 6 | public class BootStoreResource 7 | { 8 | 9 | } 10 | } -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs: -------------------------------------------------------------------------------- 1 | namespace BootStore.MultiTenancy 2 | { 3 | public static class MultiTenancyConsts 4 | { 5 | /* Enable/disable multi-tenancy easily in a single point. 6 | * If you will never need to multi-tenancy, you can remove 7 | * related modules and code parts, including this file. 8 | */ 9 | public const bool IsEnabled = true; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Domain/BootStore.Domain.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | netcoreapp3.0 7 | BootStore 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Domain/BootStoreConsts.cs: -------------------------------------------------------------------------------- 1 | namespace BootStore 2 | { 3 | public static class BootStoreConsts 4 | { 5 | public const string DbTablePrefix = "App"; 6 | 7 | public const string DbSchema = null; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Domain/BootStoreDomainModule.cs: -------------------------------------------------------------------------------- 1 | using BootStore.MultiTenancy; 2 | using Volo.Abp.AuditLogging; 3 | using Volo.Abp.BackgroundJobs; 4 | using Volo.Abp.FeatureManagement; 5 | using Volo.Abp.Identity; 6 | using Volo.Abp.IdentityServer; 7 | using Volo.Abp.Modularity; 8 | using Volo.Abp.MultiTenancy; 9 | using Volo.Abp.PermissionManagement.Identity; 10 | using Volo.Abp.PermissionManagement.IdentityServer; 11 | using Volo.Abp.SettingManagement; 12 | using Volo.Abp.TenantManagement; 13 | 14 | namespace BootStore 15 | { 16 | [DependsOn( 17 | typeof(BootStoreDomainSharedModule), 18 | typeof(AbpAuditLoggingDomainModule), 19 | typeof(AbpBackgroundJobsDomainModule), 20 | typeof(AbpFeatureManagementDomainModule), 21 | typeof(AbpIdentityDomainModule), 22 | typeof(AbpPermissionManagementDomainIdentityModule), 23 | typeof(AbpIdentityServerDomainModule), 24 | typeof(AbpPermissionManagementDomainIdentityServerModule), 25 | typeof(AbpSettingManagementDomainModule), 26 | typeof(AbpTenantManagementDomainModule) 27 | )] 28 | public class BootStoreDomainModule : AbpModule 29 | { 30 | public override void ConfigureServices(ServiceConfigurationContext context) 31 | { 32 | Configure(options => 33 | { 34 | options.IsEnabled = MultiTenancyConsts.IsEnabled; 35 | }); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Domain/Data/BootStoreDbMigrationService.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Microsoft.Extensions.Logging; 3 | using Microsoft.Extensions.Logging.Abstractions; 4 | using Volo.Abp.Data; 5 | using Volo.Abp.DependencyInjection; 6 | 7 | namespace BootStore.Data 8 | { 9 | public class BootStoreDbMigrationService : ITransientDependency 10 | { 11 | public ILogger Logger { get; set; } 12 | 13 | private readonly IDataSeeder _dataSeeder; 14 | private readonly IBootStoreDbSchemaMigrator _dbSchemaMigrator; 15 | 16 | public BootStoreDbMigrationService( 17 | IDataSeeder dataSeeder, 18 | IBootStoreDbSchemaMigrator dbSchemaMigrator) 19 | { 20 | _dataSeeder = dataSeeder; 21 | _dbSchemaMigrator = dbSchemaMigrator; 22 | 23 | Logger = NullLogger.Instance; 24 | } 25 | 26 | public async Task MigrateAsync() 27 | { 28 | Logger.LogInformation("Started database migrations..."); 29 | 30 | Logger.LogInformation("Migrating database schema..."); 31 | await _dbSchemaMigrator.MigrateAsync(); 32 | 33 | Logger.LogInformation("Executing database seed..."); 34 | await _dataSeeder.SeedAsync(); 35 | 36 | Logger.LogInformation("Successfully completed database migrations."); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Domain/Data/IBootStoreDbSchemaMigrator.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace BootStore.Data 4 | { 5 | public interface IBootStoreDbSchemaMigrator 6 | { 7 | Task MigrateAsync(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Domain/Data/NullBootStoreDbSchemaMigrator.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Volo.Abp.DependencyInjection; 3 | 4 | namespace BootStore.Data 5 | { 6 | /* This is used if database provider does't define 7 | * IBootStoreDbSchemaMigrator implementation. 8 | */ 9 | public class NullBootStoreDbSchemaMigrator : IBootStoreDbSchemaMigrator, ITransientDependency 10 | { 11 | public Task MigrateAsync() 12 | { 13 | return Task.CompletedTask; 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Domain/Settings/BootStoreSettingDefinitionProvider.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.Settings; 2 | 3 | namespace BootStore.Settings 4 | { 5 | public class BootStoreSettingDefinitionProvider : SettingDefinitionProvider 6 | { 7 | public override void Define(ISettingDefinitionContext context) 8 | { 9 | //Define your own settings here. Example: 10 | //context.Add(new SettingDefinition(BootStoreSettings.MySetting1)); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Domain/Settings/BootStoreSettings.cs: -------------------------------------------------------------------------------- 1 | namespace BootStore.Settings 2 | { 3 | public static class BootStoreSettings 4 | { 5 | private const string Prefix = "BootStore"; 6 | 7 | //Add your own setting names here. Example: 8 | //public const string MySetting1 = Prefix + ".MySetting1"; 9 | } 10 | } -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.EntityFrameworkCore.DbMigrations/BootStore.EntityFrameworkCore.DbMigrations.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | netcoreapp3.0 7 | BootStore 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/BootStoreEntityFrameworkCoreDbMigrationsModule.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using Volo.Abp.Modularity; 3 | 4 | namespace BootStore.EntityFrameworkCore 5 | { 6 | [DependsOn( 7 | typeof(BootStoreEntityFrameworkCoreModule) 8 | )] 9 | public class BootStoreEntityFrameworkCoreDbMigrationsModule : AbpModule 10 | { 11 | public override void ConfigureServices(ServiceConfigurationContext context) 12 | { 13 | context.Services.AddAbpDbContext(); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/BootStoreMigrationsDbContextFactory.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Design; 4 | using Microsoft.Extensions.Configuration; 5 | 6 | namespace BootStore.EntityFrameworkCore 7 | { 8 | /* This class is needed for EF Core console commands 9 | * (like Add-Migration and Update-Database commands) */ 10 | public class BootStoreMigrationsDbContextFactory : IDesignTimeDbContextFactory 11 | { 12 | public BootStoreMigrationsDbContext CreateDbContext(string[] args) 13 | { 14 | var configuration = BuildConfiguration(); 15 | 16 | var builder = new DbContextOptionsBuilder() 17 | .UseSqlServer(configuration.GetConnectionString("Default")); 18 | 19 | return new BootStoreMigrationsDbContext(builder.Options); 20 | } 21 | 22 | private static IConfigurationRoot BuildConfiguration() 23 | { 24 | var builder = new ConfigurationBuilder() 25 | .SetBasePath(Directory.GetCurrentDirectory()) 26 | .AddJsonFile("appsettings.json", optional: false); 27 | 28 | return builder.Build(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/EntityFrameworkCoreBootStoreDbSchemaMigrator.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Microsoft.EntityFrameworkCore; 3 | using BootStore.Data; 4 | using Volo.Abp.DependencyInjection; 5 | 6 | namespace BootStore.EntityFrameworkCore 7 | { 8 | [Dependency(ReplaceServices = true)] 9 | public class EntityFrameworkCoreBootStoreDbSchemaMigrator 10 | : IBootStoreDbSchemaMigrator, ITransientDependency 11 | { 12 | private readonly BootStoreMigrationsDbContext _dbContext; 13 | 14 | public EntityFrameworkCoreBootStoreDbSchemaMigrator(BootStoreMigrationsDbContext dbContext) 15 | { 16 | _dbContext = dbContext; 17 | } 18 | 19 | public async Task MigrateAsync() 20 | { 21 | await _dbContext.Database.MigrateAsync(); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.EntityFrameworkCore/BootStore.EntityFrameworkCore.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | netcoreapp3.0 7 | BootStore 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.EntityFrameworkCore/EntityFrameworkCore/BootStoreDbContextModelCreatingExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 3 | using Volo.Abp; 4 | using Volo.Abp.Users; 5 | 6 | namespace BootStore.EntityFrameworkCore 7 | { 8 | public static class BootStoreDbContextModelCreatingExtensions 9 | { 10 | public static void ConfigureBootStore(this ModelBuilder builder) 11 | { 12 | Check.NotNull(builder, nameof(builder)); 13 | 14 | /* Configure your own tables/entities inside here */ 15 | 16 | //builder.Entity(b => 17 | //{ 18 | // b.ToTable(BootStoreConsts.DbTablePrefix + "YourEntities", BootStoreConsts.DbSchema); 19 | 20 | // //... 21 | //}); 22 | } 23 | 24 | public static void ConfigureCustomUserProperties(this EntityTypeBuilder b) 25 | where TUser: class, IUser 26 | { 27 | //b.Property(nameof(AppUser.MyProperty))... 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.HttpApi.Client/BootStore.HttpApi.Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | netcoreapp3.0 7 | BootStore 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.HttpApi.Client/BootStoreHttpApiClientModule.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using Volo.Abp.Account; 3 | using Volo.Abp.FeatureManagement; 4 | using Volo.Abp.Identity; 5 | using Volo.Abp.Modularity; 6 | using Volo.Abp.PermissionManagement; 7 | using Volo.Abp.TenantManagement; 8 | 9 | namespace BootStore 10 | { 11 | [DependsOn( 12 | typeof(BootStoreApplicationContractsModule), 13 | typeof(AbpAccountHttpApiClientModule), 14 | typeof(AbpIdentityHttpApiClientModule), 15 | typeof(AbpPermissionManagementHttpApiClientModule), 16 | typeof(AbpTenantManagementHttpApiClientModule), 17 | typeof(AbpFeatureManagementHttpApiClientModule) 18 | )] 19 | public class BootStoreHttpApiClientModule : AbpModule 20 | { 21 | public const string RemoteServiceName = "Default"; 22 | 23 | public override void ConfigureServices(ServiceConfigurationContext context) 24 | { 25 | context.Services.AddHttpClientProxies( 26 | typeof(BootStoreApplicationContractsModule).Assembly, 27 | RemoteServiceName 28 | ); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.HttpApi/BootStore.HttpApi.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | netcoreapp3.0 7 | BootStore 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.HttpApi/BootStoreHttpApiModule.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.Account; 2 | using Volo.Abp.FeatureManagement; 3 | using Volo.Abp.Identity; 4 | using Volo.Abp.Modularity; 5 | using Volo.Abp.PermissionManagement.HttpApi; 6 | using Volo.Abp.TenantManagement; 7 | 8 | namespace BootStore 9 | { 10 | [DependsOn( 11 | typeof(BootStoreApplicationContractsModule), 12 | typeof(AbpAccountHttpApiModule), 13 | typeof(AbpIdentityHttpApiModule), 14 | typeof(AbpPermissionManagementHttpApiModule), 15 | typeof(AbpTenantManagementHttpApiModule), 16 | typeof(AbpFeatureManagementHttpApiModule) 17 | )] 18 | public class BootStoreHttpApiModule : AbpModule 19 | { 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.HttpApi/Controllers/BootStoreController.cs: -------------------------------------------------------------------------------- 1 | using BootStore.Localization; 2 | using Volo.Abp.AspNetCore.Mvc; 3 | 4 | namespace BootStore.Controllers 5 | { 6 | /* Inherit your controllers from this class. 7 | */ 8 | public abstract class BootStoreController : AbpController 9 | { 10 | protected BootStoreController() 11 | { 12 | LocalizationResource = typeof(BootStoreResource); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.HttpApi/Controllers/TestController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using BootStore.Models.Test; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace BootStore.Controllers 8 | { 9 | [Route("api/test")] 10 | public class TestController : BootStoreController 11 | { 12 | public TestController() 13 | { 14 | 15 | } 16 | 17 | [HttpGet] 18 | [Route("")] 19 | public async Task> GetAsync() 20 | { 21 | return new List 22 | { 23 | new TestModel {Name = "John", BirthDate = new DateTime(1942, 11, 18)}, 24 | new TestModel {Name = "Adams", BirthDate = new DateTime(1997, 05, 24)} 25 | }; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.HttpApi/Models/Test/TestModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BootStore.Models.Test 4 | { 5 | public class TestModel 6 | { 7 | public string Name { get; set; } 8 | 9 | public DateTime BirthDate { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Web/BootStoreBrandingProvider.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Components; 2 | using Volo.Abp.DependencyInjection; 3 | 4 | namespace BootStore.Web 5 | { 6 | [Dependency(ReplaceServices = true)] 7 | public class BootStoreBrandingProvider : DefaultBrandingProvider 8 | { 9 | public override string AppName => "BootStore"; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Web/BootStoreWebAutoMapperProfile.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | 3 | namespace BootStore.Web 4 | { 5 | public class BootStoreWebAutoMapperProfile : Profile 6 | { 7 | public BootStoreWebAutoMapperProfile() 8 | { 9 | //Define your AutoMapper configuration here for the Web project. 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Web/Menus/BootStoreMenuContributor.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Microsoft.Extensions.DependencyInjection; 3 | using Microsoft.Extensions.Localization; 4 | using BootStore.Localization; 5 | using BootStore.MultiTenancy; 6 | using Volo.Abp.TenantManagement.Web.Navigation; 7 | using Volo.Abp.UI.Navigation; 8 | 9 | namespace BootStore.Web.Menus 10 | { 11 | public class BootStoreMenuContributor : IMenuContributor 12 | { 13 | public async Task ConfigureMenuAsync(MenuConfigurationContext context) 14 | { 15 | if (context.Menu.Name == StandardMenus.Main) 16 | { 17 | await ConfigureMainMenuAsync(context); 18 | } 19 | } 20 | 21 | private async Task ConfigureMainMenuAsync(MenuConfigurationContext context) 22 | { 23 | if (!MultiTenancyConsts.IsEnabled) 24 | { 25 | var administration = context.Menu.GetAdministration(); 26 | administration.TryRemoveMenuItem(TenantManagementMenuNames.GroupName); 27 | } 28 | 29 | var l = context.ServiceProvider.GetRequiredService>(); 30 | 31 | context.Menu.Items.Insert(0, new ApplicationMenuItem("BootStore.Home", l["Menu:Home"], "/")); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Web/Pages/BootStorePage.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc.Localization; 2 | using Microsoft.AspNetCore.Mvc.Razor.Internal; 3 | using BootStore.Localization; 4 | using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; 5 | 6 | namespace BootStore.Web.Pages 7 | { 8 | /* Inherit your UI Pages from this class. To do that, add this line to your Pages (.cshtml files under the Page folder): 9 | * @inherits BootStore.Web.Pages.BootStorePage 10 | */ 11 | public abstract class BootStorePage : AbpPage 12 | { 13 | [RazorInject] 14 | public IHtmlLocalizer L { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Web/Pages/BootStorePageModel.cs: -------------------------------------------------------------------------------- 1 | using BootStore.Localization; 2 | using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; 3 | 4 | namespace BootStore.Web.Pages 5 | { 6 | /* Inherit your PageModel classes from this class. 7 | */ 8 | public abstract class BootStorePageModel : AbpPageModel 9 | { 10 | protected BootStorePageModel() 11 | { 12 | LocalizationResourceType = typeof(BootStoreResource); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Web/Pages/Index.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @inherits BootStore.Web.Pages.BootStorePage 3 | @model BootStore.Web.Pages.IndexModel 4 | @section styles { 5 | 6 | 7 | 8 | } 9 | @section scripts { 10 | 11 | 12 | 13 | } 14 |
15 |

@L["Welcome"]

16 |
17 |
18 |

@L["LongWelcomeMessage"]

19 |
20 |
21 |
22 | abp.io 23 | @if (!CurrentUser.IsAuthenticated) 24 | { 25 | @L["Login"] 26 | } 27 |
-------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Web/Pages/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | namespace BootStore.Web.Pages 2 | { 3 | public class IndexModel : BootStorePageModel 4 | { 5 | public void OnGet() 6 | { 7 | 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Web/Pages/Index.css: -------------------------------------------------------------------------------- 1 | body { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Web/Pages/Index.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | abp.log.debug('Index.js initialized!'); 3 | }); -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Web/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 2 | @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI 3 | @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap 4 | @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Web/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "https://localhost:44383/", 7 | "sslPort": 44383 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "BootStore.Web": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "https://localhost:44383/" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Web/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Builder; 2 | using Microsoft.Extensions.DependencyInjection; 3 | 4 | namespace BootStore.Web 5 | { 6 | public class Startup 7 | { 8 | public void ConfigureServices(IServiceCollection services) 9 | { 10 | services.AddApplication(); 11 | } 12 | 13 | public void Configure(IApplicationBuilder app) 14 | { 15 | app.InitializeApplication(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Web/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 2 | @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI 3 | @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap 4 | @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Web/abp.resourcemapping.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | aliases: { 3 | 4 | }, 5 | mappings: { 6 | 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Web/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Web/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "App": { 3 | "SelfUrl": "https://localhost:44383" 4 | }, 5 | "ConnectionStrings": { 6 | "Default": "Server=localhost;Database=BootStore;Trusted_Connection=True;MultipleActiveResultSets=true" 7 | }, 8 | "AuthServer": { 9 | "Authority": "https://localhost:44383" 10 | }, 11 | "IdentityServer": { 12 | "Clients": { 13 | "BootStore_App": { 14 | "ClientId": "BootStore_App" 15 | } 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Web/gulpfile.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var gulp = require("gulp"), 4 | path = require('path'), 5 | copyResources = require('./node_modules/@abp/aspnetcore.mvc.ui/gulp/copy-resources.js'); 6 | 7 | exports.default = function(){ 8 | return copyResources(path.resolve('./')); 9 | }; -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "name": "my-app", 4 | "private": true, 5 | "dependencies": { 6 | "@abp/aspnetcore.mvc.ui.theme.basic": "^1.0.2" 7 | } 8 | } -------------------------------------------------------------------------------- /samples/abpvnext/src/BootStore.Web/tempkey.rsa: -------------------------------------------------------------------------------- 1 | {"KeyId":"ac0d2edf3c04d13cd95cc41b9b33ab03","Parameters":{"D":"FFymEWbX3XBT5YnTngOKwtz3XKsyaQbyDvvw9jbmkdvLKUmrb1hkmylqVYwU/3G1u79rrD8AZXJDoYVLegyZymK/iNeePMLI4i5vScF7PdQXn/g6CvQ8j3J60YYyfDWuxjBH8nCEUIfQIv14BpcH6CWi1BVZUbnbWcpe2ji8D5I3FHOZpvksQztst5eE836ODdN9jgk35kgrdUQ14MEFHA6m6fAzvFI1csFxD3Kwej4rI8RYZ0WYLkndz9ID88+v9VxqI8+wN6wR6tIOR510uT1FI5wONBVBUzgeZ6cCEpg0jC9tgqcP03gMDpmE7vKp34ExxH/iOWyhQ0gAxHOVlQ==","DP":"qSQfNZvEkepgY12d+uwTbRoOp+0g1CBiMU9kqyoIB56hAUnzENSCDzunjLRrvDLFPgXiUcoccskyVRnKKOGPOqPE6VjgzBrdLgA/hBf8hPg0GnTVoPyLxR9G6GsGUKsAYVn8G7cnK5wXzK4jCjsflkfxCzFfdASJ/+sa5QPWZMM=","DQ":"u+56T1+rhMvlurid9kBS2Ypfm4vOiNAXLD9kGz2wx8Ob0yYlWo55kn11qPs6Ej9bnQIY3N+TY2tXMamfhAhntoHaKrFjOpCmlHZ0GAeQOJVuWSlFvu/NBoxfjZzcUCNua22oJjy++wSdkkLLGEqau62byaQoSSqUxUzwL36RexM=","Exponent":"AQAB","InverseQ":"E+uq9g6D5LjUk+M7gtt0srnT8duwu8P83AgFqjtGOnSCy71omSboxb4zC9bGq/WaEFauFBwqxbkXwFyXuYNfIelfmSERulU9jgf0+KH6QmFdtjrJ5UO7VArqET1WUquwiDvOyO8udCxi8RRAiM5G3dTzIs5JTalGhlKEZSAgPtQ=","Modulus":"rgHACxzqvuE72RF/NdDTLsIEy3F/n6P4lkgrER60FU8uRNwSmAMRxvxYOaE3Ot/krRYcw2+MP8ewR1VBXywXVT1zuACA3SacMHJYmZQ2UkuwsD9bmpjvqoMhR/hjsI74jTzKpclHtEu7D7WYDZaIPAEIs/8+5H/z1mXVfgACaeaQt3C0OhwXSOPPDP71VKGfoFucXYED1keZ0PKxYAlhiHOe7cnSlfJseujwD2Rhyq8mUhe6aEMTYBjuruWgpfvnSOARAqu5vwzK35KpAirHwa1DJSZyanNMFdlLkVNKWUKEqd6PwRneiHacmaaDF6oQQstuSbf9cuJeSMbKh7WVQQ==","P":"0CJDit2NHk0Z1bN5ZVIYZRUYbrAI2bEOafAKqfffcA/Os7yXsY14Ye4pSpDxfdZGcPGRL04HPkJsogFtyI7k4ujrvsC66I5cg45+BhBMM0zyLJ7LZkD2HGwX2+a/xrXhhIIOnGWWy2zzW3dkayRhi1bR9krfTA5uBw1LX9qZ3Yc=","Q":"1gZITAaB+r0+PgOfyDCeVzSnTyQuKSkgbUkIgQP9jQZa6edrbAXogdJipxmUTrW7JaxifG1z9ubK+TOqhjZHqT4gd8U8Bh7jCBizZNVe60pez1OtNGpEOW2N+ZrXBSMNcV8PFaMg/B+fcaX+i7NWpTqmztR/V0DGXmD+XosuaPc="}} -------------------------------------------------------------------------------- /samples/abpvnext/test/BootStore.Application.Tests/BootStore.Application.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | netcoreapp3.0 7 | BootStore 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /samples/abpvnext/test/BootStore.Application.Tests/BootStoreApplicationTestBase.cs: -------------------------------------------------------------------------------- 1 | namespace BootStore 2 | { 3 | public abstract class BootStoreApplicationTestBase : BootStoreTestBase 4 | { 5 | 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /samples/abpvnext/test/BootStore.Application.Tests/BootStoreApplicationTestModule.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.Modularity; 2 | 3 | namespace BootStore 4 | { 5 | [DependsOn( 6 | typeof(BootStoreApplicationModule), 7 | typeof(BootStoreDomainTestModule) 8 | )] 9 | public class BootStoreApplicationTestModule : AbpModule 10 | { 11 | 12 | } 13 | } -------------------------------------------------------------------------------- /samples/abpvnext/test/BootStore.Application.Tests/Samples/SampleAppServiceTests.cs: -------------------------------------------------------------------------------- 1 | using Shouldly; 2 | using System.Threading.Tasks; 3 | using Volo.Abp.Identity; 4 | using Xunit; 5 | 6 | namespace BootStore.Samples 7 | { 8 | /* This is just an example test class. 9 | * Normally, you don't test code of the modules you are using 10 | * (like IIdentityUserAppService here). 11 | * Only test your own application services. 12 | */ 13 | public class SampleAppServiceTests : BootStoreApplicationTestBase 14 | { 15 | private readonly IIdentityUserAppService _userAppService; 16 | 17 | public SampleAppServiceTests() 18 | { 19 | _userAppService = GetRequiredService(); 20 | } 21 | 22 | [Fact] 23 | public async Task Initial_Data_Should_Contain_Admin_User() 24 | { 25 | //Act 26 | var result = await _userAppService.GetListAsync(new GetIdentityUsersInput()); 27 | 28 | //Assert 29 | result.TotalCount.ShouldBeGreaterThan(0); 30 | result.Items.ShouldContain(u => u.UserName == "admin"); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /samples/abpvnext/test/BootStore.Domain.Tests/BootStore.Domain.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | netcoreapp3.0 7 | BootStore 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/abpvnext/test/BootStore.Domain.Tests/BootStoreDomainTestBase.cs: -------------------------------------------------------------------------------- 1 | namespace BootStore 2 | { 3 | public abstract class BootStoreDomainTestBase : BootStoreTestBase 4 | { 5 | 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /samples/abpvnext/test/BootStore.Domain.Tests/BootStoreDomainTestModule.cs: -------------------------------------------------------------------------------- 1 | using BootStore.EntityFrameworkCore; 2 | using Volo.Abp.Modularity; 3 | 4 | namespace BootStore 5 | { 6 | [DependsOn( 7 | typeof(BootStoreEntityFrameworkCoreTestModule) 8 | )] 9 | public class BootStoreDomainTestModule : AbpModule 10 | { 11 | 12 | } 13 | } -------------------------------------------------------------------------------- /samples/abpvnext/test/BootStore.EntityFrameworkCore.Tests/BootStore.EntityFrameworkCore.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | netcoreapp3.0 7 | BootStore 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /samples/abpvnext/test/BootStore.EntityFrameworkCore.Tests/EntityFrameworkCore/BootStoreEntityFrameworkCoreTestBase.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp; 2 | 3 | namespace BootStore.EntityFrameworkCore 4 | { 5 | public abstract class BootStoreEntityFrameworkCoreTestBase : BootStoreTestBase 6 | { 7 | 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/abpvnext/test/BootStore.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using BootStore.Users; 3 | using Shouldly; 4 | using System; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using Volo.Abp.Domain.Repositories; 8 | using Xunit; 9 | 10 | namespace BootStore.EntityFrameworkCore.Samples 11 | { 12 | /* This is just an example test class. 13 | * Normally, you don't test ABP framework code 14 | * (like default AppUser repository IRepository here). 15 | * Only test your custom repository methods. 16 | */ 17 | public class SampleRepositoryTests : BootStoreEntityFrameworkCoreTestBase 18 | { 19 | private readonly IRepository _appUserRepository; 20 | 21 | public SampleRepositoryTests() 22 | { 23 | _appUserRepository = GetRequiredService>(); 24 | } 25 | 26 | [Fact] 27 | public async Task Should_Query_AppUser() 28 | { 29 | /* Need to manually start Unit Of Work because 30 | * FirstOrDefaultAsync should be executed while db connection / context is available. 31 | */ 32 | await WithUnitOfWorkAsync(async () => 33 | { 34 | //Act 35 | var adminUser = await _appUserRepository 36 | .Where(u => u.UserName == "admin") 37 | .FirstOrDefaultAsync(); 38 | 39 | //Assert 40 | adminUser.ShouldNotBeNull(); 41 | }); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /samples/abpvnext/test/BootStore.HttpApi.Client.ConsoleTestApp/BootStore.HttpApi.Client.ConsoleTestApp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | PreserveNewest 15 | Always 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /samples/abpvnext/test/BootStore.HttpApi.Client.ConsoleTestApp/BootStoreConsoleApiClientModule.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.Http.Client.IdentityModel; 2 | using Volo.Abp.Modularity; 3 | 4 | namespace BootStore.HttpApi.Client.ConsoleTestApp 5 | { 6 | [DependsOn( 7 | typeof(BootStoreHttpApiClientModule), 8 | typeof(AbpHttpClientIdentityModelModule) 9 | )] 10 | public class BootStoreConsoleApiClientModule : AbpModule 11 | { 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /samples/abpvnext/test/BootStore.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using Volo.Abp.DependencyInjection; 4 | using Volo.Abp.Identity; 5 | 6 | namespace BootStore.HttpApi.Client.ConsoleTestApp 7 | { 8 | public class ClientDemoService : ITransientDependency 9 | { 10 | private readonly IProfileAppService _profileAppService; 11 | 12 | public ClientDemoService(IProfileAppService profileAppService) 13 | { 14 | _profileAppService = profileAppService; 15 | } 16 | 17 | public async Task RunAsync() 18 | { 19 | var output = await _profileAppService.GetAsync(); 20 | Console.WriteLine($"UserName : {output.UserName}"); 21 | Console.WriteLine($"Email : {output.Email}"); 22 | Console.WriteLine($"Name : {output.Name}"); 23 | Console.WriteLine($"Surname : {output.Surname}"); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /samples/abpvnext/test/BootStore.HttpApi.Client.ConsoleTestApp/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.Extensions.DependencyInjection; 3 | using Volo.Abp; 4 | using Volo.Abp.Threading; 5 | 6 | namespace BootStore.HttpApi.Client.ConsoleTestApp 7 | { 8 | class Program 9 | { 10 | static void Main(string[] args) 11 | { 12 | using (var application = AbpApplicationFactory.Create()) 13 | { 14 | application.Initialize(); 15 | 16 | var demo = application.ServiceProvider.GetRequiredService(); 17 | AsyncHelper.RunSync(() => demo.RunAsync()); 18 | 19 | Console.WriteLine("Press ENTER to stop application..."); 20 | Console.ReadLine(); 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /samples/abpvnext/test/BootStore.HttpApi.Client.ConsoleTestApp/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "RemoteServices": { 3 | "Default": { 4 | "BaseUrl": "https://localhost:44383" 5 | } 6 | }, 7 | "IdentityClients": { 8 | "Default": { 9 | "GrantType": "password", 10 | "ClientId": "BootStore_App", 11 | "ClientSecret": "1q2w3e*", 12 | "UserName": "admin", 13 | "UserPassword": "1q2w3E*", 14 | "Authority": "https://localhost:44383", 15 | "Scope": "BootStore" 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /samples/abpvnext/test/BootStore.TestBase/BootStore.TestBase.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | netcoreapp3.0 7 | BootStore 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /samples/abpvnext/test/BootStore.TestBase/BootStoreTestBaseModule.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using Volo.Abp; 3 | using Volo.Abp.Authorization; 4 | using Volo.Abp.Autofac; 5 | using Volo.Abp.BackgroundJobs; 6 | using Volo.Abp.Data; 7 | using Volo.Abp.Modularity; 8 | using Volo.Abp.Threading; 9 | 10 | namespace BootStore 11 | { 12 | [DependsOn( 13 | typeof(AbpAutofacModule), 14 | typeof(AbpTestBaseModule), 15 | typeof(AbpAuthorizationModule), 16 | typeof(BootStoreDomainModule) 17 | )] 18 | public class BootStoreTestBaseModule : AbpModule 19 | { 20 | public override void ConfigureServices(ServiceConfigurationContext context) 21 | { 22 | Configure(options => 23 | { 24 | options.IsJobExecutionEnabled = false; 25 | }); 26 | 27 | context.Services.AddAlwaysAllowAuthorization(); 28 | } 29 | 30 | public override void OnApplicationInitialization(ApplicationInitializationContext context) 31 | { 32 | SeedTestData(context); 33 | } 34 | 35 | private static void SeedTestData(ApplicationInitializationContext context) 36 | { 37 | AsyncHelper.RunSync(async () => 38 | { 39 | using (var scope = context.ServiceProvider.CreateScope()) 40 | { 41 | await scope.ServiceProvider 42 | .GetRequiredService() 43 | .SeedAsync(); 44 | } 45 | }); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /samples/abpvnext/test/BootStore.TestBase/BootStoreTestDataSeedContributor.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Volo.Abp.Data; 3 | using Volo.Abp.DependencyInjection; 4 | 5 | namespace BootStore 6 | { 7 | public class BootStoreTestDataSeedContributor : IDataSeedContributor, ITransientDependency 8 | { 9 | public Task SeedAsync(DataSeedContext context) 10 | { 11 | /* Seed additional test data... */ 12 | 13 | return Task.CompletedTask; 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /samples/abpvnext/test/BootStore.TestBase/Security/FakeCurrentPrincipalAccessor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Security.Claims; 3 | using Volo.Abp.DependencyInjection; 4 | using Volo.Abp.Security.Claims; 5 | 6 | namespace BootStore.Security 7 | { 8 | [Dependency(ReplaceServices = true)] 9 | public class FakeCurrentPrincipalAccessor : ICurrentPrincipalAccessor, ISingletonDependency 10 | { 11 | public ClaimsPrincipal Principal => GetPrincipal(); 12 | private ClaimsPrincipal _principal; 13 | 14 | private ClaimsPrincipal GetPrincipal() 15 | { 16 | if (_principal == null) 17 | { 18 | lock (this) 19 | { 20 | if (_principal == null) 21 | { 22 | _principal = new ClaimsPrincipal( 23 | new ClaimsIdentity( 24 | new List 25 | { 26 | new Claim(AbpClaimTypes.UserId,"2e701e62-0953-4dd3-910b-dc6cc93ccb0d"), 27 | new Claim(AbpClaimTypes.UserName,"admin"), 28 | new Claim(AbpClaimTypes.Email,"admin@abp.io") 29 | } 30 | ) 31 | ); 32 | } 33 | } 34 | } 35 | 36 | return _principal; 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /samples/abpvnext/test/BootStore.Web.Tests/BootStoreWebTestStartup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.AspNetCore.Builder; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using Microsoft.Extensions.Logging; 5 | using Volo.Abp; 6 | 7 | namespace BootStore 8 | { 9 | public class BootStoreWebTestStartup 10 | { 11 | public void ConfigureServices(IServiceCollection services) 12 | { 13 | services.AddApplication(); 14 | } 15 | 16 | public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) 17 | { 18 | app.InitializeApplication(); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /samples/abpvnext/test/BootStore.Web.Tests/Pages/Index_Tests.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Shouldly; 3 | using Xunit; 4 | 5 | namespace BootStore.Pages 6 | { 7 | public class Index_Tests : BootStoreWebTestBase 8 | { 9 | [Fact] 10 | public async Task Welcome_Page() 11 | { 12 | var response = await GetResponseAsStringAsync("/"); 13 | response.ShouldNotBeNull(); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/abpvnext/test/BootStore.Web.Tests/xunit.runner.json: -------------------------------------------------------------------------------- 1 | { 2 | "shadowCopy": false 3 | } -------------------------------------------------------------------------------- /src/LogDashboard/Authorization/AuthorizationFilterHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | 4 | namespace LogDashboard.Authorization 5 | { 6 | public class AuthorizationFilterHelper 7 | { 8 | public static bool Authorization(List filters, LogDashboardContext context) 9 | { 10 | if (filters.Count == 0) 11 | return true; 12 | return filters.All(x => x.Authorization(context)); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/LogDashboard/Authorization/Filters/LogdashboardRoleAuthorizeFilter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace LogDashboard.Authorization.Filters 7 | { 8 | public class LogDashboardRoleAuthorizeFilter : ILogDashboardAuthorizationFilter 9 | { 10 | public List RoleNames { get; set; } 11 | 12 | public LogDashboardRoleAuthorizeFilter(List roleNames) 13 | { 14 | RoleNames = roleNames; 15 | } 16 | public bool Authorization(LogDashboardContext context) 17 | { 18 | return RoleNames.Any(roleName => context.HttpContext.User.IsInRole(roleName)); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/LogDashboard/Authorization/ILogDashboardAuthorizationFilter.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace LogDashboard.Authorization 4 | { 5 | public interface ILogDashboardAuthorizationFilter 6 | { 7 | bool Authorization(LogDashboardContext context); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/LogDashboard/Cache/ILogDashboardCacheManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using LogDashboard.Models; 4 | 5 | namespace LogDashboard.Cache 6 | { 7 | public interface ILogDashboardCacheManager where T : class, ILogModel 8 | { 9 | Task SetCache(string key, List logs); 10 | 11 | Task ClearCache(string key); 12 | 13 | Task> GetCache(string key); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/LogDashboard/Cache/InMemoryLogDashboardCacheManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Concurrent; 3 | using System.Collections.Generic; 4 | using System.Diagnostics; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | using LogDashboard.Models; 8 | 9 | namespace LogDashboard.Cache 10 | { 11 | public class InMemoryLogDashboardCacheManager : ILogDashboardCacheManager where T : class, ILogModel 12 | { 13 | private readonly ConcurrentDictionary> _caches; 14 | 15 | private Timer _timer; 16 | 17 | private readonly LogDashboardOptions _options; 18 | 19 | public InMemoryLogDashboardCacheManager(LogDashboardOptions options) 20 | { 21 | _options = options; 22 | this._caches = new ConcurrentDictionary>(); 23 | } 24 | 25 | public Task SetCache(string key, List logs) 26 | { 27 | _timer ??= new Timer(async (e) => await ClearCache(LogDashboardConsts.LogDashboardLogsCache), null, 28 | _options.CacheExpires, 29 | _options.CacheExpires); 30 | _caches.AddOrUpdate(key, logs, (k, v) => logs); 31 | return Task.CompletedTask; 32 | 33 | } 34 | 35 | public Task ClearCache(string key) 36 | { 37 | _caches.TryRemove(key, out List val); 38 | _timer?.Dispose(); 39 | _timer = null; 40 | return Task.CompletedTask; 41 | } 42 | 43 | 44 | public Task> GetCache(string key) 45 | { 46 | return Task.FromResult(_caches.GetOrAdd(key, add => new List())); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/LogDashboard/Extensions/JsonExtensions.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace LogDashboard.Extensions 4 | { 5 | public static class JsonExtensions 6 | { 7 | public static string ToJsonString(this object obj) 8 | { 9 | return JsonConvert.SerializeObject(obj); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/LogDashboard/Extensions/LogDashboardOptionsExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace LogDashboard.Extensions 2 | { 3 | public static class LogDashboardOptionsExtensions 4 | { 5 | /// 6 | /// 设置根目录 7 | /// 8 | /// LogDashboardOptions 9 | /// 日志根目录哦 10 | public static void SetRootPath(this LogDashboardOptions options,string rootPath) 11 | { 12 | options.RootPath=rootPath; 13 | } 14 | 15 | /// 16 | /// 设置分隔符 17 | /// 18 | /// LogDashboardOptions 19 | /// 分隔符 20 | /// 结束分隔符 21 | public static void SetDelimiter(this LogDashboardOptions options,string startDelimiter="||",string endDelimiter="||end") 22 | { 23 | options.FileEndDelimiter=startDelimiter; 24 | options.FileFieldDelimiter=endDelimiter; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/LogDashboard/Extensions/LogModelExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace LogDashboard.Extensions 4 | { 5 | public static class LogModelExtensions 6 | { 7 | private static readonly Dictionary LevelDict; 8 | 9 | static LogModelExtensions() 10 | { 11 | LevelDict = new Dictionary() 12 | { 13 | { "INFORMATION","INFO"}, 14 | { "INF","INFO" }, 15 | { "ERR","ERROR" }, 16 | { "DEB","DEBUG" }, 17 | { "WARNING","WARN"}, 18 | { "WAR" ,"WARN" }, 19 | { "FAT","FATAL" } 20 | }; 21 | } 22 | 23 | public static void AddLevelFormat(string key, string value) 24 | { 25 | LevelDict.Add(key, value); 26 | } 27 | 28 | public static string FormatLevel(this string level) 29 | { 30 | if (level == null || !LevelDict.ContainsKey(level)) 31 | { 32 | return level; 33 | } 34 | return LevelDict[level]; 35 | 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/LogDashboard/Extensions/StringArrayExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace LogDashboard.Extensions 2 | { 3 | public static class StringArrayExtensions 4 | { 5 | public static string TryGetValue(this string[] array, int index) 6 | { 7 | try 8 | { 9 | return array[index].Trim(); 10 | } 11 | catch 12 | { 13 | return null; 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/LogDashboard/Handle/ILogDashboardHandle.cs: -------------------------------------------------------------------------------- 1 | namespace LogDashboard.Handle 2 | { 3 | public interface ILogDashboardHandle 4 | { 5 | LogDashboardContext Context { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/LogDashboard/Handle/LogChart/ILogChart.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using LogDashboard.Models; 3 | using LogDashboard.Repository; 4 | 5 | namespace LogDashboard.Handle.LogChart 6 | { 7 | public interface ILogChart 8 | { 9 | Task GetCharts(IRepository repository) where T : class, ILogModel; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/LogDashboard/Handle/LogChart/LogChartFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using LogDashboard.Models; 5 | 6 | namespace LogDashboard.Handle.LogChart 7 | { 8 | public class LogChartFactory 9 | { 10 | private static readonly Dictionary LogChartDict; 11 | 12 | static LogChartFactory() 13 | { 14 | LogChartDict = new Dictionary 15 | { 16 | { ChartDataType.Hour,typeof(HourChart)}, 17 | { ChartDataType.Week,typeof(WeekLogChart)}, 18 | { ChartDataType.Day,typeof(DayLogChart)}, 19 | { ChartDataType.Month,typeof(MonthLogChart)} 20 | }; 21 | } 22 | 23 | public static ILogChart GetLogChart(ChartDataType type) 24 | { 25 | return (ILogChart)Activator.CreateInstance(LogChartDict[type]); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/LogDashboard/Ioc/IocManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace LogDashboard.Ioc 4 | { 5 | public class IocManager 6 | { 7 | public static IServiceProvider Container { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/LogDashboard/LogDashboardApplicationBuilderExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Builder; 2 | 3 | namespace LogDashboard 4 | { 5 | public static class LogDashboardApplicationBuilderExtensions 6 | { 7 | public static IApplicationBuilder UseLogDashboard( 8 | this IApplicationBuilder builder, string pathMatch = "/LogDashboard") 9 | { 10 | return builder.Map(pathMatch, app => { app.UseMiddleware(); }); 11 | } 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/LogDashboard/LogDashboardBuilder/DefaultLogDashboardBuilder.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | 3 | namespace LogDashboard.LogDashboardBuilder 4 | { 5 | public class DefaultLogDashboardBuilder : ILogDashboardBuilder 6 | { 7 | public DefaultLogDashboardBuilder(IServiceCollection services) 8 | { 9 | Services = services; 10 | } 11 | 12 | public IServiceCollection Services { get; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/LogDashboard/LogDashboardBuilder/ILogDashboardBuilder.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | 3 | namespace LogDashboard.LogDashboardBuilder 4 | { 5 | public interface ILogDashboardBuilder 6 | { 7 | IServiceCollection Services { get; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/LogDashboard/LogDashboardConsts.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace LogDashboard 6 | { 7 | public class LogDashboardConsts 8 | { 9 | public const string Root = "LogDashboard"; 10 | 11 | public const string HandleNameSpace = "LogDashboard.Handle."; 12 | 13 | public const string LogDashboardLogsCache = "LogDashboardLogsCache"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/LogDashboard/LogDashboardContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.AspNetCore.Http; 3 | using LogDashboard.Route; 4 | 5 | namespace LogDashboard 6 | { 7 | public class LogDashboardContext 8 | { 9 | 10 | public HttpContext HttpContext { get; } 11 | 12 | public LogDashboardRoute Route { get; } 13 | 14 | public LogDashboardOptions Options { get; } 15 | 16 | 17 | public static LogDashboardOptions StaticOptions { get; set; } 18 | 19 | 20 | public LogDashboardContext(HttpContext httpContext, LogDashboardRoute route, LogDashboardOptions options) 21 | { 22 | StaticOptions = options; 23 | Route = route ?? throw new ArgumentNullException(nameof(route)); 24 | HttpContext = httpContext ?? throw new ArgumentNullException(nameof(httpContext)); 25 | Options = options; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/LogDashboard/Models/DashboardModel.cs: -------------------------------------------------------------------------------- 1 | namespace LogDashboard.Models 2 | { 3 | public class DashboardModel 4 | { 5 | public string DashboardMapPath { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/LogDashboard/Models/GetChartDataInput.cs: -------------------------------------------------------------------------------- 1 | namespace LogDashboard.Models 2 | { 3 | public class GetChartDataInput 4 | { 5 | public ChartDataType ChartDataType { get; set; } 6 | } 7 | 8 | public enum ChartDataType 9 | { 10 | Hour = 1, 11 | Day = 2, 12 | Week = 3, 13 | Month = 4 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/LogDashboard/Models/GetLogChartsOutput.cs: -------------------------------------------------------------------------------- 1 | namespace LogDashboard.Models 2 | { 3 | public class GetLogChartsOutput 4 | { 5 | public GetLogChartsOutput(int length) 6 | { 7 | All = new int[length]; 8 | Error = new int[length]; 9 | Warn = new int[length]; 10 | Debug = new int[length]; 11 | Fatal = new int[length]; 12 | Info = new int[length]; 13 | Trace = new int[length]; 14 | } 15 | 16 | public int[] All { get; set; } 17 | 18 | public int[] Error { get; set; } 19 | 20 | public int[] Warn { get; set; } 21 | 22 | public int[] Debug { get; set; } 23 | 24 | public int[] Fatal { get; set; } 25 | 26 | public int[] Info { get; set; } 27 | 28 | public int[] Trace { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/LogDashboard/Models/ILogModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace LogDashboard.Models 4 | { 5 | public interface ILogModel 6 | { 7 | int Id { get; set; } 8 | 9 | DateTime LongDate { get; set; } 10 | 11 | string Level { get; set; } 12 | 13 | string Logger { get; set; } 14 | 15 | string Message { get; set; } 16 | 17 | string Exception { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/LogDashboard/Models/IRequestTraceLogModel.cs: -------------------------------------------------------------------------------- 1 | using LogDashboard.Models; 2 | 3 | namespace LogDashboard.Models 4 | { 5 | public interface IRequestTraceLogModel : ILogModel 6 | { 7 | string TraceIdentifier { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/LogDashboard/Models/LogLevel.cs: -------------------------------------------------------------------------------- 1 | namespace LogDashboard.Models 2 | { 3 | public class LogLevelConst 4 | { 5 | public const string Info = "INFO"; 6 | public const string Error = "ERROR"; 7 | public const string Debug = "DEBUG"; 8 | public const string Trace = "TRACE"; 9 | public const string Warn = "WARN"; 10 | public const string Fatal = "FATAL"; 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/LogDashboard/Models/LogModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DapperExtensions.Mapper; 3 | 4 | namespace LogDashboard.Models 5 | { 6 | 7 | public class LogModel : ILogModel 8 | { 9 | public int Id { get; set; } 10 | 11 | public DateTime LongDate { get; set; } 12 | 13 | public string Level { get; set; } 14 | 15 | public string Message { get; set; } 16 | 17 | public string Logger { get; set; } 18 | 19 | public string Exception { get; set; } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/LogDashboard/Models/LogModelInput.cs: -------------------------------------------------------------------------------- 1 | namespace LogDashboard.Models 2 | { 3 | public class LogModelInput 4 | { 5 | public int Id { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/LogDashboard/Models/PageedResultModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace LogDashboard.Models 4 | { 5 | public class PagedResultModel where T : class, ILogModel 6 | { 7 | public PagedResultModel(int totalCount, IEnumerable list) 8 | { 9 | TotalCount = totalCount; 10 | List = list; 11 | } 12 | 13 | public int TotalCount { get; set; } 14 | 15 | public IEnumerable List { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/LogDashboard/Models/RequestTraceLogModel.cs: -------------------------------------------------------------------------------- 1 | namespace LogDashboard.Models 2 | { 3 | public class RequestTraceLogModel : LogModel, IRequestTraceLogModel 4 | { 5 | public string TraceIdentifier { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/LogDashboard/Models/SearchLogModel.cs: -------------------------------------------------------------------------------- 1 | namespace LogDashboard.Models 2 | { 3 | public class SearchLogModel 4 | { 5 | public string Page { get; set; } 6 | 7 | 8 | public string Html { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/LogDashboard/Models/SearchlogInput.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace LogDashboard.Models 4 | { 5 | public class SearchLogInput 6 | { 7 | public bool All { get; set; } 8 | 9 | public bool Unique { get; set; } 10 | 11 | public DateTime? StartTime { get; set; } 12 | 13 | public DateTime? EndTime { get; set; } 14 | 15 | public bool ToDay { get; set; } 16 | 17 | public string Level { get; set; } 18 | 19 | public bool Hour { get; set; } 20 | 21 | public int Page { get; set; } 22 | 23 | public int PageSize { get; set; } 24 | 25 | public string Message { get; set; } 26 | 27 | public SearchLogInput() 28 | { 29 | Page = 1; 30 | PageSize = 10; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/LogDashboard/Repository/Dapper/DapperExpressionExtensions.cs: -------------------------------------------------------------------------------- 1 | using DapperExtensions; 2 | using LogDashboard.Models; 3 | using System; 4 | using System.Linq.Expressions; 5 | 6 | namespace LogDashboard.Repository.Dapper 7 | { 8 | internal static class DapperExpressionExtensions 9 | { 10 | 11 | public static IPredicate ToPredicateGroup(this Expression> expression) where T : class, ILogModel 12 | { 13 | if (expression == null) 14 | { 15 | throw new ArgumentNullException(nameof(expression)); 16 | } 17 | 18 | var dev = new DapperExpressionVisitor(); 19 | 20 | IPredicate pg = dev.Process(expression); 21 | 22 | return pg; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/LogDashboard/Repository/Dapper/DapperUnitOfWork.cs: -------------------------------------------------------------------------------- 1 | using System.Data.Common; 2 | using System.Threading.Tasks; 3 | 4 | namespace LogDashboard.Repository.Dapper 5 | { 6 | public class DapperUnitOfWork : IUnitOfWork 7 | { 8 | private readonly DbConnection _conn; 9 | 10 | public DapperUnitOfWork(DbConnection conn) 11 | { 12 | _conn = conn; 13 | } 14 | 15 | public async Task Open() 16 | { 17 | await _conn.OpenAsync(); 18 | } 19 | 20 | public void Close() 21 | { 22 | _conn.Close(); 23 | } 24 | 25 | public DbConnection GetConnection() 26 | { 27 | return _conn; 28 | } 29 | 30 | public void Dispose() 31 | { 32 | Close(); 33 | _conn?.Dispose(); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/LogDashboard/Repository/Dapper/LogModelMapper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DapperExtensions.Mapper; 3 | 4 | namespace LogDashboard.Repository.Dapper 5 | { 6 | [Serializable] 7 | public sealed class LogModelMapper : ClassMapper where T : class 8 | { 9 | 10 | public LogModelMapper() 11 | { 12 | Table(LogDashboardContext.StaticOptions.LogTableName); 13 | AutoMap(); 14 | } 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/LogDashboard/Repository/IRepository.cs: -------------------------------------------------------------------------------- 1 | using LogDashboard.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq.Expressions; 5 | using System.Threading.Tasks; 6 | using DapperExtensions; 7 | 8 | namespace LogDashboard.Repository 9 | { 10 | public interface IRepository where T : class, ILogModel 11 | { 12 | Task> RequestTraceAsync(T model); 13 | 14 | Task<(int Count, List ids)> UniqueCountAsync(Expression> predicate = null); 15 | 16 | Task FirstOrDefaultAsync(Expression> predicate = null); 17 | 18 | Task> GetListAsync(Expression> predicate = null); 19 | 20 | Task CountAsync(Expression> predicate = null); 21 | 22 | Task> GetPageListAsync(int page, int size, Expression> predicate = null, 23 | Sort[] sorts = null, List uniqueIds = null); 24 | 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/LogDashboard/Repository/IUnitOfWork.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace LogDashboard.Repository 5 | { 6 | public interface IUnitOfWork :IDisposable 7 | { 8 | Task Open(); 9 | 10 | void Close(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/LogDashboard/Repository/RepositoryExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Linq.Expressions; 5 | 6 | namespace LogDashboard.Repository 7 | { 8 | public static class RepositoryExtensions 9 | { 10 | public static IEnumerable WhereIf(this IEnumerable enumerable, bool exec, 11 | Expression> expression) 12 | { 13 | return exec ? enumerable.Where(expression.Compile()) : enumerable; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/LogDashboard/Route/LogDashboardRoute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using LogDashboard.Views; 3 | 4 | namespace LogDashboard.Route 5 | { 6 | public class LogDashboardRoute 7 | { 8 | public LogDashboardRoute(string key, Type view) 9 | { 10 | HtmlView = true; 11 | Key = key; 12 | View = view; 13 | 14 | } 15 | 16 | public LogDashboardRoute() 17 | { 18 | 19 | } 20 | 21 | public string Key { get; set; } 22 | 23 | public Type View { get; set; } 24 | 25 | public string Handle { get; set; } 26 | 27 | public string Action { get; set; } 28 | 29 | public bool HtmlView { get; set; } 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/LogDashboard/Route/LogDashboardRoutes.cs: -------------------------------------------------------------------------------- 1 | using LogDashboard.Views.Dashboard; 2 | 3 | namespace LogDashboard.Route 4 | { 5 | public static class LogDashboardRoutes 6 | { 7 | public static RouteCollection Routes { get; } 8 | 9 | static LogDashboardRoutes() 10 | { 11 | Routes = new RouteCollection(); 12 | 13 | Routes.AddRoute(new LogDashboardRoute("/Dashboard/Home", typeof(Home))); 14 | 15 | Routes.AddRoute(new LogDashboardRoute("/Dashboard/SearchLog", typeof(LogList))); 16 | 17 | Routes.AddRoute(new LogDashboardRoute("/Dashboard/BasicLog", typeof(BasicLog))); 18 | 19 | Routes.AddRoute(new LogDashboardRoute("/Dashboard/ErrorLog", typeof(LogList))); 20 | 21 | Routes.AddRoute(new LogDashboardRoute("/Dashboard/LogInfo", typeof(LogInfo))); 22 | 23 | Routes.AddRoute(new LogDashboardRoute 24 | { 25 | Key = "/Dashboard/GetException", 26 | HtmlView = false 27 | }); 28 | 29 | Routes.AddRoute(new LogDashboardRoute 30 | { 31 | Key = "/Dashboard/RequestTrace", 32 | HtmlView = false 33 | }); 34 | 35 | Routes.AddRoute(new LogDashboardRoute 36 | { 37 | Key = "/Dashboard/GetLogChart", 38 | HtmlView = false 39 | }); 40 | 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/LogDashboard/Views/HtmlString.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | using System.Text.Encodings.Web; 6 | 7 | namespace LogDashboard.Views 8 | { 9 | public class HtmlString 10 | { 11 | private readonly string _value; 12 | 13 | public HtmlString(string value) 14 | { 15 | _value = value; 16 | } 17 | 18 | public void WriteTo(TextWriter writer, HtmlEncoder encoder) 19 | { 20 | if (writer == null) 21 | throw new ArgumentNullException(nameof(writer)); 22 | if (encoder == null) 23 | throw new ArgumentNullException(nameof(encoder)); 24 | writer.Write(this._value); 25 | } 26 | 27 | public override string ToString() 28 | { 29 | return _value; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/LogDashboard/font/Simple-Line-Icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realLiangshiwei/LogDashboard/75fe55e9ee845a7524724bea149490e0d61b649e/src/LogDashboard/font/Simple-Line-Icons.woff2 -------------------------------------------------------------------------------- /src/LogDashboard/font/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realLiangshiwei/LogDashboard/75fe55e9ee845a7524724bea149490e0d61b649e/src/LogDashboard/font/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /src/LogDashboard/js/basicLog.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | $('#StartTime').datetimepicker({ 3 | locale: 'zh-cn', 4 | Default: 'yyyy-MM-dd HH:mm:ss' 5 | }); 6 | $('#EndTime').datetimepicker({ 7 | locale: 'zh-cn', 8 | Default: 'yyyy-MM-dd HH:mm:ss' 9 | }); 10 | setCheckbox("All", "all"); 11 | setCheckbox("Today", "today"); 12 | setCheckbox("Unique", "unique"); 13 | setCheckbox("Hour", "hour"); 14 | }); 15 | 16 | function setCheckbox(str, id) { 17 | var val = getQueryString(str); 18 | if (val) { 19 | $("#" + id).prop("checked", true); 20 | searchInput[str] = val; 21 | } 22 | } -------------------------------------------------------------------------------- /test/NetCoreEmptyTest/NLog.config: -------------------------------------------------------------------------------- 1 |  2 | 7 | 8 | 11 | 12 | 13 | 17 | 18 | 19 | 21 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /test/NetCoreEmptyTest/NetCoreEmptyTest.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.0 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Always 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /test/NetCoreEmptyTest/NetCoreEmptyTest.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ProjectDebugger 5 | 6 | 7 | NetCoreEmptyTest 8 | FolderProfile 9 | 10 | -------------------------------------------------------------------------------- /test/NetCoreEmptyTest/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.AspNetCore; 3 | using Microsoft.AspNetCore.Hosting; 4 | using Microsoft.Extensions.Logging; 5 | using NLog.Web; 6 | 7 | namespace NetCoreEmptyTest 8 | { 9 | public class Program 10 | { 11 | public static void Main(string[] args) 12 | { 13 | // NLog: setup the logger first to catch all errors 14 | var logger = NLog.Web.NLogBuilder.ConfigureNLog("NLog.config").GetCurrentClassLogger(); 15 | try 16 | { 17 | logger.Debug("init main"); 18 | CreateWebHostBuilder(args).Run(); 19 | } 20 | catch (Exception ex) 21 | { 22 | //NLog: catch setup errors 23 | logger.Error(ex, "Stopped program because of exception"); 24 | throw; 25 | } 26 | finally 27 | { 28 | // Ensure to flush and stop internal timers/threads before application-exit (Avoid segmentation fault on Linux) 29 | NLog.LogManager.Shutdown(); 30 | } 31 | 32 | CreateWebHostBuilder(args).Run(); 33 | } 34 | 35 | public static IWebHost CreateWebHostBuilder(string[] args) => 36 | WebHost.CreateDefaultBuilder(args) 37 | .UseStartup() 38 | .ConfigureLogging(logging => 39 | { 40 | logging.ClearProviders(); 41 | logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Information); 42 | }) 43 | .UseNLog() 44 | .Build(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /test/NetCoreEmptyTest/Properties/PublishProfiles/FolderProfile.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | FileSystem 9 | FileSystem 10 | Release 11 | Any CPU 12 | 13 | True 14 | False 15 | 8f92e7ee-9679-49a7-9ab1-65f5b7c905a4 16 | C:\Users\admin\Desktop\bb 17 | False 18 | 19 | -------------------------------------------------------------------------------- /test/NetCoreEmptyTest/Properties/PublishProfiles/FolderProfile.pubxml.user: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | <_PublishTargetUrl>C:\Users\admin\Desktop\bb 10 | 11 | -------------------------------------------------------------------------------- /test/NetCoreEmptyTest/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:50660/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "NetCoreEmptyTest": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:50661/" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /test/NetCoreEmptyTest/Startup.cs: -------------------------------------------------------------------------------- 1 | using LogDashboard; 2 | using LogDashboard.Authorization.Filters; 3 | using Microsoft.AspNetCore.Builder; 4 | using Microsoft.AspNetCore.Hosting; 5 | using Microsoft.AspNetCore.Http; 6 | using Microsoft.Extensions.DependencyInjection; 7 | using Microsoft.Extensions.Hosting; 8 | 9 | namespace NetCoreEmptyTest 10 | { 11 | public class Startup 12 | { 13 | public void ConfigureServices(IServiceCollection services) 14 | { 15 | services.AddLogDashboard(opt=>opt.AddAuthorizationFilter(new LogDashboardBasicAuthFilter("admin","admin"))); 16 | } 17 | 18 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 19 | { 20 | // 静态文件中间件 21 | app.UseStaticFiles(); 22 | 23 | if (env.IsDevelopment()) 24 | { 25 | app.UseDeveloperExceptionPage(); 26 | } 27 | 28 | app.UseLogDashboard(); 29 | 30 | app.Run(async (context) => 31 | { 32 | await context.Response.WriteAsync("Hello World!"); 33 | }); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /test/NetCoreEmptyTest/obj/Debug/netcoreapp2.0/NetCoreEmptyTest.AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Reflection; 13 | 14 | [assembly: System.Reflection.AssemblyCompanyAttribute("NetCoreEmptyTest")] 15 | [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] 16 | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] 17 | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] 18 | [assembly: System.Reflection.AssemblyProductAttribute("NetCoreEmptyTest")] 19 | [assembly: System.Reflection.AssemblyTitleAttribute("NetCoreEmptyTest")] 20 | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] 21 | 22 | // 由 MSBuild WriteCodeFragment 类生成。 23 | 24 | -------------------------------------------------------------------------------- /test/aspnetcore2.1/NLog.config: -------------------------------------------------------------------------------- 1 |  2 | 7 | 8 | 11 | 12 | 13 | 17 | 18 | 19 | 21 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /test/aspnetcore2.1/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | using NLog.Web; 11 | 12 | namespace aspnetcore2._1 13 | { 14 | public class Program 15 | { 16 | public static void Main(string[] args) 17 | { 18 | CreateWebHostBuilder(args).Build().Run(); 19 | } 20 | 21 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 22 | WebHost.CreateDefaultBuilder(args) 23 | .UseStartup().UseNLog(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/aspnetcore2.1/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:21450", 7 | "sslPort": 44322 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "aspnetcore2._1": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /test/aspnetcore2.1/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using LogDashboard; 6 | using Microsoft.AspNetCore.Authorization; 7 | using Microsoft.AspNetCore.Builder; 8 | using Microsoft.AspNetCore.Hosting; 9 | using Microsoft.AspNetCore.Http; 10 | using Microsoft.Extensions.DependencyInjection; 11 | 12 | namespace aspnetcore2._1 13 | { 14 | public class Startup 15 | { 16 | // This method gets called by the runtime. Use this method to add services to the container. 17 | // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 18 | public void ConfigureServices(IServiceCollection services) 19 | { 20 | services.AddLogDashboard(); 21 | 22 | } 23 | 24 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 25 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 26 | { 27 | if (env.IsDevelopment()) 28 | { 29 | app.UseDeveloperExceptionPage(); 30 | } 31 | 32 | app.UseLogDashboard(); 33 | 34 | app.Run(async (context) => 35 | { 36 | await context.Response.WriteAsync("Hello World!"); 37 | }); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /test/aspnetcore2.1/aspnetcore2.1.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Always 24 | true 25 | PreserveNewest 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /test/aspnetcore2.2/NLog.config: -------------------------------------------------------------------------------- 1 |  2 | 7 | 8 | 11 | 12 | 13 | 17 | 18 | 19 | 21 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /test/aspnetcore2.2/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | using NLog.Web; 11 | 12 | namespace aspnetcore2._2 13 | { 14 | public class Program 15 | { 16 | public static void Main(string[] args) 17 | { 18 | CreateWebHostBuilder(args).Build().Run(); 19 | } 20 | 21 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 22 | WebHost.CreateDefaultBuilder(args) 23 | .UseStartup().UseNLog(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/aspnetcore2.2/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:21881", 7 | "sslPort": 44305 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "aspnetcore2._2": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /test/aspnetcore2.2/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using LogDashboard; 6 | using Microsoft.AspNetCore.Builder; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.AspNetCore.Http; 9 | using Microsoft.Extensions.DependencyInjection; 10 | 11 | namespace aspnetcore2._2 12 | { 13 | public class Startup 14 | { 15 | // This method gets called by the runtime. Use this method to add services to the container. 16 | // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 17 | public void ConfigureServices(IServiceCollection services) 18 | { 19 | services.AddLogDashboard(); 20 | } 21 | 22 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 23 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 24 | { 25 | if (env.IsDevelopment()) 26 | { 27 | app.UseDeveloperExceptionPage(); 28 | } 29 | 30 | app.UseLogDashboard(); 31 | 32 | app.Run(async (context) => 33 | { 34 | await context.Response.WriteAsync("Hello World!"); 35 | }); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /test/aspnetcore2.2/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/aspnetcore2.2/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /test/aspnetcore2.2/aspnetcore2.2.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.2 5 | InProcess 6 | aspnetcore2._2 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | Always 22 | 23 | 24 | 25 | 26 | --------------------------------------------------------------------------------