Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ManifestDirectoryInfo and ManifestFileInfo #6841

Merged
merged 1 commit into from
Dec 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -31,7 +30,6 @@ public class IndexModel : VirtualFileExplorerPageModel

protected IVirtualFileProvider VirtualFileProvider { get; }


public IndexModel(IVirtualFileProvider virtualFileProvider)
{
VirtualFileProvider = virtualFileProvider;
Expand Down Expand Up @@ -67,16 +65,26 @@ private void SetViewModel(IEnumerable<IFileInfo> 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 =$"<a href='{Url.Content("~/")}VirtualFileExplorer?path={fileInfo.PhysicalPath}'>{fileInfo.Name}</a>";
fileInfoViewModel.FileName =$"<a href='{Url.Content("~/")}VirtualFileExplorer?path={filePath}'>{fileInfo.Name}</a>";
}
else
{
fileInfoViewModel.FilePath = ((EmbeddedResourceFileInfo) fileInfo).VirtualPath;
if (fileInfo is EmbeddedResourceFileInfo embeddedResourceFileInfo)
{
fileInfoViewModel.FilePath = embeddedResourceFileInfo.VirtualPath;
}
else
{
fileInfoViewModel.FilePath = filePath;
}

}

FileInfoList.Add(fileInfoViewModel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
{
public static class VirtualFileExplorerConsts
{
public static string[] AllowFileInfoTypes = new[] {"VirtualDirectoryFileInfo", "EmbeddedResourceFileInfo"};
public static readonly string[] AllowFileInfoTypes = {"VirtualDirectoryFileInfo", "EmbeddedResourceFileInfo", "ManifestDirectoryInfo" , "ManifestFileInfo"};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
<IsPackable>true</IsPackable>
<OutputType>Library</OutputType>
</PropertyGroup>
Expand All @@ -18,14 +19,12 @@
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Pages\**\*.cshtml" />
<EmbeddedResource Include="Pages\**\*.css" />
<EmbeddedResource Include="Pages\**\*.js" />
<EmbeddedResource Include="Components\**\*.js" />
<EmbeddedResource Include="Components\**\*.css" />
<EmbeddedResource Include="wwwroot\**\*.*" />
<EmbeddedResource Include="Localization\**\*.json" />
<Content Remove="Pages\**\*.cshtml" />
<Content Remove="Pages\**\*.css" />
<Content Remove="Pages\**\*.js" />
<Content Remove="wwwroot\**\*.*" />
Expand All @@ -34,4 +33,8 @@
<Content Remove="Localization\**\*.json" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="$(MicrosoftPackageVersion)" />
</ItemGroup>

</Project>