diff --git a/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/AbpVirtualFileExplorerWebModule.cs b/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/AbpVirtualFileExplorerWebModule.cs index f49628aa452..41c007e06df 100644 --- a/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/AbpVirtualFileExplorerWebModule.cs +++ b/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/AbpVirtualFileExplorerWebModule.cs @@ -1,4 +1,5 @@ using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.FileProviders.Physical; using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap; using Volo.Abp.AspNetCore.Mvc.UI.Bundling; using Volo.Abp.AspNetCore.Mvc.UI.Packages.Prismjs; diff --git a/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Pages/VirtualFileExplorer/Index.cshtml.cs b/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Pages/VirtualFileExplorer/Index.cshtml.cs index b450531cc81..14f9fc581f8 100644 --- a/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Pages/VirtualFileExplorer/Index.cshtml.cs +++ b/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Pages/VirtualFileExplorer/Index.cshtml.cs @@ -1,10 +1,9 @@ +using System; using System.Collections.Generic; using System.Linq; using System.Text; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.FileProviders; -using NUglify.Helpers; using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Pagination; using Volo.Abp.VirtualFileExplorer.Web.Models; using Volo.Abp.VirtualFileSystem; @@ -31,7 +30,6 @@ public class IndexModel : VirtualFileExplorerPageModel protected IVirtualFileProvider VirtualFileProvider { get; } - public IndexModel(IVirtualFileProvider virtualFileProvider) { VirtualFileProvider = virtualFileProvider; @@ -67,16 +65,26 @@ private void SetViewModel(IEnumerable fileInfos) LastUpdateTime = fileInfo.LastModified.LocalDateTime }; + var filePath = fileInfo.PhysicalPath ?? $"{Path.EnsureEndsWith('/')}{fileInfo.Name}";; + if (fileInfo.IsDirectory) { fileInfoViewModel.Icon = "fas fa-folder"; fileInfoViewModel.FileType = "folder"; fileInfoViewModel.Length = "/"; - fileInfoViewModel.FileName =$"{fileInfo.Name}"; + fileInfoViewModel.FileName =$"{fileInfo.Name}"; } else { - fileInfoViewModel.FilePath = ((EmbeddedResourceFileInfo) fileInfo).VirtualPath; + if (fileInfo is EmbeddedResourceFileInfo embeddedResourceFileInfo) + { + fileInfoViewModel.FilePath = embeddedResourceFileInfo.VirtualPath; + } + else + { + fileInfoViewModel.FilePath = filePath; + } + } FileInfoList.Add(fileInfoViewModel); diff --git a/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/VirtualFileExplorerConsts.cs b/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/VirtualFileExplorerConsts.cs index a05020b7647..08a5916a0a2 100644 --- a/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/VirtualFileExplorerConsts.cs +++ b/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/VirtualFileExplorerConsts.cs @@ -2,6 +2,6 @@ { public static class VirtualFileExplorerConsts { - public static string[] AllowFileInfoTypes = new[] {"VirtualDirectoryFileInfo", "EmbeddedResourceFileInfo"}; + public static readonly string[] AllowFileInfoTypes = {"VirtualDirectoryFileInfo", "EmbeddedResourceFileInfo", "ManifestDirectoryInfo" , "ManifestFileInfo"}; } } diff --git a/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Volo.Abp.VirtualFileExplorer.Web.csproj b/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Volo.Abp.VirtualFileExplorer.Web.csproj index d41cec81c13..cfe69554ac4 100644 --- a/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Volo.Abp.VirtualFileExplorer.Web.csproj +++ b/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Volo.Abp.VirtualFileExplorer.Web.csproj @@ -9,6 +9,7 @@ false false false + true true Library @@ -18,14 +19,12 @@ - - @@ -34,4 +33,8 @@ + + + +