From 5228cf9aa91ba4854560af00880ff4e5d8649111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Wed, 22 Nov 2017 14:20:17 +0300 Subject: [PATCH] Changed on virtual file provider. --- .../Blogging/AbpDeskMongoBlogModule.cs | 2 +- src/AbpDesk/Web_PlugIns/AbpDesk.MongoBlog.dll | Bin 15360 -> 15360 bytes .../AbpAccountWebModule.cs | 2 +- ...lFileSystemApplicationBuilderExtensions.cs | 3 ++- .../AbpAspNetCoreMvcUiBootstrapModule.cs | 2 +- .../Views/Shared/_AppLayout.cshtml | 2 +- ...olo.Abp.AspNetCore.Mvc.UI.Bootstrap.csproj | 2 +- .../views/shared}/_AppLayout.css | 0 .../AbpAspNetCoreMvcUiModule.cs | 2 +- .../AspNetCoreVirtualFileProvider.cs | 16 ++++++++++++++-- .../AbpIdentityWebModule.cs | 2 +- 11 files changed, 23 insertions(+), 10 deletions(-) rename src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/{Views/Shared => wwwroot/views/shared}/_AppLayout.css (100%) diff --git a/src/AbpDesk/AbpDesk.MongoBlog/AbpDesk/Blogging/AbpDeskMongoBlogModule.cs b/src/AbpDesk/AbpDesk.MongoBlog/AbpDesk/Blogging/AbpDeskMongoBlogModule.cs index eeebda22af..eb3d63d733 100644 --- a/src/AbpDesk/AbpDesk.MongoBlog/AbpDesk/Blogging/AbpDeskMongoBlogModule.cs +++ b/src/AbpDesk/AbpDesk.MongoBlog/AbpDesk/Blogging/AbpDeskMongoBlogModule.cs @@ -36,7 +36,7 @@ namespace AbpDesk.Blogging options.FileSets.Add( new EmbeddedFileSet( - "/", + "/wwwroot/", GetType().Assembly, "wwwroot" //TODO: This is not tested yet! ) diff --git a/src/AbpDesk/Web_PlugIns/AbpDesk.MongoBlog.dll b/src/AbpDesk/Web_PlugIns/AbpDesk.MongoBlog.dll index ae3224578ddfe3ee7420f4a7910daa8d65c0b09a..6426ca7db286326e2006a991a7a39f917f60a8b5 100644 GIT binary patch delta 240 zcmZpuXsDRb!NT|<@6^VgG!{mc$)8zV8Pz6RvZnG{F*6is@GvlFtFacjOGb3=CWvT0mlvs(8^fkWjuT0|OgWNTO&1SV$ZpBw2I@EF_H( zk}7%w7Lo)CaS1VKI0B8+WiMjdEWv(5PE=T*p&Sg081jLzgh8KyfpIdk+H--gKNsoT ziIjKi%L{A0dDv_2=09pPcv$)^=KP#I!`MV1N{#VFu4A~<@+A&OZQg4dZ@y!!!T|u3 C7eSo> delta 240 zcmZpuXsDRb!P2m}=EugKG!{mY$)8zV8C51*vZnG{Ff$Zr@GvlFtFacjOkT}u#Aq@3 z9;*VQ-{k+S+mkwgvP>Gb3=CWvT0mlvs(8^9kWjuT0|OgWNTO&RSV$ZpBw2I{EF_H( zk}7%y7Lo)CaS1VKI0B8+WiMjbEWv(5PMBGrfq}oA0R)Q}@`12~VKS@Qb0G!>#oh%Q zvpOa?b|%_h@lH9uZ}T6u89Xc#{>|u~Jj2*T;9zy}-SQ+g&kpuC_REU4RBXOutik~R D#9l&| diff --git a/src/Volo.Abp.Account.Web/AbpAccountWebModule.cs b/src/Volo.Abp.Account.Web/AbpAccountWebModule.cs index 54146dd1ca..86821b802d 100644 --- a/src/Volo.Abp.Account.Web/AbpAccountWebModule.cs +++ b/src/Volo.Abp.Account.Web/AbpAccountWebModule.cs @@ -37,7 +37,7 @@ namespace Volo.Abp.Account.Web options.FileSets.Add( new EmbeddedFileSet( - "/", + "/wwwroot/", GetType().GetTypeInfo().Assembly, "Volo.Abp.Account.Web.wwwroot" ) diff --git a/src/Volo.Abp.AspNetCore.EmbeddedFiles/Microsoft/AspNetCore/Builder/VirtualFileSystemApplicationBuilderExtensions.cs b/src/Volo.Abp.AspNetCore.EmbeddedFiles/Microsoft/AspNetCore/Builder/VirtualFileSystemApplicationBuilderExtensions.cs index ed17232d91..b5b2bc603e 100644 --- a/src/Volo.Abp.AspNetCore.EmbeddedFiles/Microsoft/AspNetCore/Builder/VirtualFileSystemApplicationBuilderExtensions.cs +++ b/src/Volo.Abp.AspNetCore.EmbeddedFiles/Microsoft/AspNetCore/Builder/VirtualFileSystemApplicationBuilderExtensions.cs @@ -10,7 +10,8 @@ namespace Microsoft.AspNetCore.Builder new StaticFileOptions { FileProvider = new AspNetCoreVirtualFileProvider( - app.ApplicationServices + app.ApplicationServices, + "/wwwroot" ) } ); diff --git a/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/AbpAspNetCoreMvcUiBootstrapModule.cs b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/AbpAspNetCoreMvcUiBootstrapModule.cs index a460915b82..eb26848c2d 100644 --- a/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/AbpAspNetCoreMvcUiBootstrapModule.cs +++ b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/AbpAspNetCoreMvcUiBootstrapModule.cs @@ -19,7 +19,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap { options.FileSets.Add( new EmbeddedFileSet( - "/", + "/wwwroot/", GetType().GetTypeInfo().Assembly, "Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.wwwroot" ) diff --git a/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Views/Shared/_AppLayout.cshtml b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Views/Shared/_AppLayout.cshtml index b8231d799e..7f97198e2b 100644 --- a/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Views/Shared/_AppLayout.cshtml +++ b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Views/Shared/_AppLayout.cshtml @@ -14,7 +14,7 @@ - + @RenderSection("styles", false) diff --git a/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.csproj b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.csproj index de6144f615..f1770f0305 100644 --- a/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.csproj +++ b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Views/Shared/_AppLayout.css b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/wwwroot/views/shared/_AppLayout.css similarity index 100% rename from src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/Views/Shared/_AppLayout.css rename to src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/wwwroot/views/shared/_AppLayout.css diff --git a/src/Volo.Abp.AspNetCore.Mvc.UI/AbpAspNetCoreMvcUiModule.cs b/src/Volo.Abp.AspNetCore.Mvc.UI/AbpAspNetCoreMvcUiModule.cs index 7e342cfee2..5be312b7d8 100644 --- a/src/Volo.Abp.AspNetCore.Mvc.UI/AbpAspNetCoreMvcUiModule.cs +++ b/src/Volo.Abp.AspNetCore.Mvc.UI/AbpAspNetCoreMvcUiModule.cs @@ -27,7 +27,7 @@ namespace Volo.Abp.AspNetCore.Mvc options.FileSets.Add( new EmbeddedFileSet( - "/", + "/wwwroot/", GetType().GetTypeInfo().Assembly, "Volo.Abp.AspNetCore.Mvc.wwwroot" ) diff --git a/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/VirtualFileSystem/AspNetCoreVirtualFileProvider.cs b/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/VirtualFileSystem/AspNetCoreVirtualFileProvider.cs index 97c7294cdf..a00fb58f69 100644 --- a/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/VirtualFileSystem/AspNetCoreVirtualFileProvider.cs +++ b/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/VirtualFileSystem/AspNetCoreVirtualFileProvider.cs @@ -1,4 +1,5 @@ using System; +using System.IO; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Options; @@ -13,11 +14,12 @@ namespace Volo.Abp.AspNetCore.VirtualFileSystem private readonly Lazy _virtualFileProvider; private readonly Lazy _options; private readonly IObjectAccessor _serviceProviderAccessor; + private readonly string _contentPath; - public AspNetCoreVirtualFileProvider(IServiceProvider serviceProvider) + public AspNetCoreVirtualFileProvider(IServiceProvider serviceProvider, string contentPath = null) : this(new ObjectAccessor(serviceProvider)) { - + _contentPath = contentPath; } public AspNetCoreVirtualFileProvider(IObjectAccessor serviceProviderAccessor) @@ -37,6 +39,11 @@ namespace Volo.Abp.AspNetCore.VirtualFileSystem public IFileInfo GetFileInfo(string subpath) { + if (_contentPath != null) + { + subpath = _contentPath + subpath; + } + //TODO: Ignore files in _options.Value.IgnoredFileExtensions if (!IsInitialized()) @@ -49,6 +56,11 @@ namespace Volo.Abp.AspNetCore.VirtualFileSystem public IDirectoryContents GetDirectoryContents(string subpath) { + if (_contentPath != null) + { + subpath = _contentPath + subpath; + } + //TODO: Ignore files in _options.Value.IgnoredFileExtensions if (!IsInitialized()) diff --git a/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs b/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs index 552bc50f60..676837ca85 100644 --- a/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs +++ b/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs @@ -43,7 +43,7 @@ namespace Volo.Abp.Identity.Web options.FileSets.Add( new EmbeddedFileSet( - "/", + "/wwwroot/", GetType().Assembly, "Volo.Abp.Identity.Web.wwwroot" )