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/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/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/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/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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/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/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/UseAuthorization/Pages/Shared/_LoginPartial.cshtml:
--------------------------------------------------------------------------------
1 | @using Microsoft.AspNetCore.Identity
2 | @inject SignInManager SignInManager
3 | @inject UserManager UserManager
4 |
5 |
27 |
--------------------------------------------------------------------------------
/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.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/NfxAspNetMvc/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
12 | Use this space to summarize your privacy and cookie use policy.
Learn More .
13 |
14 | Accept
15 |
16 |
17 |
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 |
12 | Use this space to summarize your privacy and cookie use policy.
Learn More .
13 |
14 | Accept
15 |
16 |
17 |
25 | }
26 |
--------------------------------------------------------------------------------
/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/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/NfxAspNetMvc/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/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/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/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/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/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/DatabaseSource/Views/Shared/_ValidationScriptsPartial.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
12 |
18 |
19 |
--------------------------------------------------------------------------------
/samples/NfxAspnetCore/Views/Shared/_ValidationScriptsPartial.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
12 |
18 |
19 |
--------------------------------------------------------------------------------
/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/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/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/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/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/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.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.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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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/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/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/NfxAspNetMvc/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/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/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/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/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 |
--------------------------------------------------------------------------------
/.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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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/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/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/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/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/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/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/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.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/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/samples/RequestTracking/Startup.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using LogDashboard;
3 | using LogDashboard.Models;
4 | using Microsoft.AspNetCore.Builder;
5 | using Microsoft.AspNetCore.Hosting;
6 | using Microsoft.AspNetCore.Http;
7 | using Microsoft.Extensions.DependencyInjection;
8 | using Microsoft.Extensions.Hosting;
9 | using Microsoft.Extensions.Logging;
10 |
11 | namespace RequestTracking
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(opt =>
20 | {
21 | opt.CustomLogModel();
22 | });
23 | }
24 |
25 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
26 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
27 | {
28 |
29 | var log = app.ApplicationServices.GetService>();
30 |
31 | if (env.IsDevelopment())
32 | {
33 | app.UseDeveloperExceptionPage();
34 | }
35 | app.UseLogDashboard();
36 | app.Run(async (context) =>
37 | {
38 | log.LogInformation("before write Hello world");
39 |
40 | await context.Response.WriteAsync("Hello World!");
41 |
42 | log.LogInformation("after write Hello world");
43 | });
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------