Skip to content
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
6 changes: 3 additions & 3 deletions server/Components/App.razor
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
<!-- End Google Tag Manager -->
<base href="/" />
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
<link href="css/site.css" rel="stylesheet" />
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet'>
<link href="css/site.css" rel="stylesheet" />
<script src="./Script/JsInteropHelper.js"></script>
<link href="_content/Syncfusion.Blazor.Themes/bootstrap4.css" rel="stylesheet" />
<script src="_content/Syncfusion.Blazor.Core/scripts/syncfusion-blazor.min.js" type="text/javascript"></script>
<script src="_content/Syncfusion.Blazor.SfPdfViewer/scripts/syncfusion-blazor-sfpdfviewer.min.js" type="text/javascript"></script>
<link rel="icon" type="image/x-icon" href="favicon.ico">
<script src="_content/Syncfusion.Blazor.WordProcessor/scripts/syncfusion-blazor-documenteditor.min.js" type="text/javascript"></script>
<script src="./Script/JsInteropHelper.js"></script>
<HeadOutlet @rendermode="@InteractiveServer" />

</head>
Expand Down
24 changes: 12 additions & 12 deletions server/DocumentExplorer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.Blazor.ImageEditor" Version="*" />
<PackageReference Include="Syncfusion.Blazor.Navigations" Version="*" />
<PackageReference Include="Syncfusion.Blazor.Inputs" Version="*" />
<PackageReference Include="Syncfusion.Blazor.FileManager" Version="*" />
<PackageReference Include="Syncfusion.Blazor.Buttons" Version="*" />
<PackageReference Include="Syncfusion.Blazor.Popups" Version="*" />
<PackageReference Include="Syncfusion.Blazor.SfPdfViewer" Version="*" />
<PackageReference Include="Syncfusion.Blazor.Themes" Version="*" />
<PackageReference Include="Syncfusion.Blazor.WordProcessor" Version="*" />
<PackageReference Include="Syncfusion.DocIORenderer.Net.Core" Version="*" />
<PackageReference Include="Syncfusion.Licensing" Version="*" />
<PackageReference Include="Syncfusion.PresentationRenderer.Net.Core" Version="*" />
<PackageReference Include="Syncfusion.Blazor.ImageEditor" Version="31.1.17" />
<PackageReference Include="Syncfusion.Blazor.Navigations" Version="31.1.17" />
<PackageReference Include="Syncfusion.Blazor.Inputs" Version="31.1.17" />
<PackageReference Include="Syncfusion.Blazor.FileManager" Version="31.1.17" />
<PackageReference Include="Syncfusion.Blazor.Buttons" Version="31.1.17" />
<PackageReference Include="Syncfusion.Blazor.Popups" Version="31.1.17" />
<PackageReference Include="Syncfusion.Blazor.SfPdfViewer" Version="31.1.17" />
<PackageReference Include="Syncfusion.Blazor.Themes" Version="31.1.17" />
<PackageReference Include="Syncfusion.Blazor.WordProcessor" Version="31.1.17" />
<PackageReference Include="Syncfusion.DocIORenderer.Net.Core" Version="31.1.17" />
<PackageReference Include="Syncfusion.Licensing" Version="31.1.17" />
<PackageReference Include="Syncfusion.PresentationRenderer.Net.Core" Version="31.1.17" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.0" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="3.116.1" />
Expand Down
148 changes: 132 additions & 16 deletions server/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</ToolbarItem>
<ToolbarItem Align="@ItemAlign.Left">
<Template>
<h1 class="e-header-title" title="Document Explorer">Document Explorer</h1>
<h1 class="e-header-title" title="Document Explorer">Document Explorer</h1>
</Template>
</ToolbarItem>
<ToolbarItem Align="@ItemAlign.Right" Id="User" OnClick="ToolbarClick" CssClass="@(_popupVisibility == "e-hide-popup" ? "e-user-icon" : "e-user-icon select-highlight")">
Expand All @@ -52,7 +52,7 @@
<div id="LayoutContent" class="e-mainLayout-content">
@*sidebar content*@
<SfSidebar @ref="_sidebar" Animate="false" @bind-IsOpen="SidebarToggle" Target=".e-mainLayout-content" MediaQuery="(min-width: 600px)" Width="260px" Type=SidebarType.Over EnableGestures="false"
OnClose="SidebarClose" OnOpen="SidebarOpen">
OnClose="SidebarClose" OnOpen="SidebarOpen">
<ChildContent>
@*user icon for resolution < 600px*@
<div class="e-card e-side-card">
Expand Down Expand Up @@ -102,19 +102,33 @@
@*file manager*@
<SfFileManager @ref="_fileManager" TValue="FileManagerDirectoryContent" Height="100%" ShowThumbnail="@(Field!="Trash")" PopupTarget="BODY" ShowTooltip =false>
<FileManagerAjaxSettings Url=@(NavigationManager.BaseUri + "api/"+ (Field=="Shared"?"SharedFiles":(Field=="Trash"?"Trash":"FileManager"))+"/FileOperations")
GetImageUrl=@(NavigationManager.BaseUri + "api/"+(Field=="Shared"?"SharedFiles":(Field=="Trash"?"Trash":"FileManager"))+"/GetImage")
DownloadUrl=@(NavigationManager.BaseUri + "api/"+(Field=="Shared"?"SharedFiles":(Field=="Trash"?"Trash":"FileManager"))+"/Download")
UploadUrl=@(NavigationManager.BaseUri + "api/"+(Field=="Shared"?"SharedFiles":(Field=="Trash"?"Trash":"FileManager"))+"/Upload")>
GetImageUrl=@(NavigationManager.BaseUri + "api/"+(Field=="Shared"?"SharedFiles":(Field=="Trash"?"Trash":"FileManager"))+"/GetImage")
DownloadUrl=@(NavigationManager.BaseUri + "api/"+(Field=="Shared"?"SharedFiles":(Field=="Trash"?"Trash":"FileManager"))+"/Download")
UploadUrl=@(NavigationManager.BaseUri + "api/"+(Field=="Shared"?"SharedFiles":(Field=="Trash"?"Trash":"FileManager"))+"/Upload")>
</FileManagerAjaxSettings>
<FileManagerToolbarSettings Items="@_toolItems"></FileManagerToolbarSettings>
<FileManagerToolbarSettings ToolbarItems="@_toolItems"></FileManagerToolbarSettings>
<FileManagerContextMenuSettings File="@_fileMenu" Folder="@_folderMenu" Layout="@_layoutMenu"></FileManagerContextMenuSettings>
<FileManagerNavigationPaneSettings Visible="false"></FileManagerNavigationPaneSettings>
<FileManagerUploadSettings UploadMode="UploadMode.HttpClient"></FileManagerUploadSettings>
<FileManagerEvents OnSend="BeforeSend" TValue="FileManagerDirectoryContent" ToolbarItemClicked="UploadClick" ToolbarCreated="ToolbarCreate" MenuOpened="MenuOpen" OnMenuClick="MenuClick"
OnFileOpen="FileOpen" OnFileLoad="FileLoad" BeforePopupOpen="PopupBefore" BeforeImageLoad="ImageLoadBefore" PopupClosed="PopupClosed"></FileManagerEvents>
OnFileOpen="FileOpen" OnFileLoad="FileLoad" BeforePopupOpen="PopupBefore" BeforeImageLoad="ImageLoadBefore" PopupClosed="PopupClosed"></FileManagerEvents>
</SfFileManager>
<div id="file-overlay" class="e-file-overlay @_fileOverlayDisplay"></div>
</div>
</div>
<div class="notification-container">
<SfButton IconCss="@(IsContentVisible ? "e-icons e-chevron-up" : "e-icons e-chevron-down")" Content="Note"
IconPosition="IconPosition.Right" OnClick="ToggleContent">
</SfButton>
@if (IsContentVisible)
{
<div class="notification-content">
File Manager, PDF Viewer, Word Editing, Spreadsheet Editor portions are used and it requires
Essential Studio UI Edition, PDF Viewer SDK, DOCX Editor SDK and Spreadsheet Editor SDK
licenses.
</div>
}
</div>
</div>
@*popup containing user options like profile, sign out/in*@
<div id="user-Popup" class="e-notch e-icons e-user-Popup @_popupVisibility">
Expand Down Expand Up @@ -153,6 +167,70 @@
</SfDialog>

</div>
<style>
.notification-container {
position: fixed;
bottom: 10px;
left: 50%;
transform: translateX(-50%);
z-index: 1000;
display: flex;
flex-direction: column;
align-items: center;
}

.notification-container button {
background-color: #e0e0e0 !important;
color: #000 !important;
border: 1px solid #ccc !important;
border-radius: 13px !important;
padding: 2px 12px !important;
font-size: 14px !important;
cursor: pointer !important;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.notification-container button:hover {
background-color: #d5d5d5 !important;
}

.notification-content {
background-color: #e0e0e0 !important;
border: 1px solid #ccc;
border-radius: 8px;
padding: 8px;
font-size: 14px;
color: #333;
margin-top: 5px;
white-space: normal;
min-width: 100vw;
text-align: center;
}

@@media
(max-width: 600px) {
.notification-content {
font-size: 13px;
padding: 8px 8px;
}
}

@@media
(min-width: 601px) and (max-width: 999px) {
.notification-content {
font-size: 15px;
padding: 10px 20px;
}
}

@@media
(min-width: 1000px) {
.notification-content {
font-size: 16px;
padding: 12px 32px;
}
}
</style>
@code {
public string _currentImageUrl { get; set; }
public string _imageFileName { get; set; }
Expand All @@ -178,6 +256,8 @@
private string OverlayStyle { get; set; } = "overlayShow";
private string _fileName = "";

private bool IsContentVisible = true;

private List<OptionsDataModel> _optionsData = new List<OptionsDataModel>() {
new OptionsDataModel(){Name= "All Files", Id= "1", Select= true, Icon= "sf-icon-Allfiles"},
new OptionsDataModel(){Name= "Recent Files", Id= "2", Select= false, Icon= "sf-icon-RecentFiles" },
Expand All @@ -197,11 +277,6 @@
//private string[] SelectedItems { get; set; }
private bool _treeSelectFlag = false;
private string _treeNode = "1";
private string[] _toolItems = new string[] {
#if !Publish
"Upload",
#endif
"Delete", "Download", "Rename", "SortBy", "Refresh", "Selection", "View", "Details" };
private string[] _fileMenu = new string[] { "Open", "|", "Delete", "Download", "Rename", "|", "Details" };
private string[] _folderMenu = new string[] { "Open", "|", "Delete", "Download", "Rename", "|", "Details" };
private string[] _layoutMenu = new string[] { "SortBy", "View", "Refresh", "|", "NewFolder",
Expand All @@ -210,10 +285,25 @@
#endif
"|", "Details", "SelectAll" };
private bool isImageOpen = false;
public List<ToolBarItemModel> _toolItems = new List<ToolBarItemModel>();



protected override void OnInitialized()
{
_fileOverlayDisplay = "e-file-show-overlay";

string[] _toolItemsIn = new string[] {
#if !Publish
"Upload",
#endif
"Delete", "Download", "Rename", "SortBy", "Refresh", "Selection", "View", "Details"
};

foreach (var item in _toolItemsIn)
{
_toolItems.Add(new ToolBarItemModel() { Name = item });
}
Path = "/";
if (QueryHelpers.ParseQuery(NavigationManager.ToAbsoluteUri(NavigationManager.Uri).Query).TryGetValue("path", out var pathparam))
{
Expand Down Expand Up @@ -274,7 +364,13 @@
{
//Recent Files
case "2":
_toolItems = new string[] { "Download", "Rename", "SortBy", "Refresh", "Selection", "View", "Details" };
_toolItems.Clear();

string[] _toolItemsIn = new string[] { "Download", "Rename", "SortBy", "Refresh", "Selection", "View", "Details" };
foreach (var item in _toolItemsIn)
{
_toolItems.Add(new ToolBarItemModel() { Name = item });
}
_fileMenu = new string[] { "Open", "|", "Delete", "Download", "Rename", "|", "Details" };
_folderMenu = new string[] { "Open", "|", "Delete", "Download", "Rename", "|", "Details" };
_layoutMenu = new string[] { "SortBy", "View", "Refresh", "|", "NewFolder",
Expand All @@ -286,15 +382,25 @@
break;
//Shared With Me
case "3":
_toolItems = new string[] { "Download", "SortBy", "Refresh", "Selection", "View", "Details" };
_toolItems.Clear();
_toolItemsIn = new string[] { "Download", "SortBy", "Refresh", "Selection", "View", "Details" };
foreach (var item in _toolItemsIn)
{
_toolItems.Add(new ToolBarItemModel() { Name = item });
}
_fileMenu = new string[] { "Open", "|", "Download", "|", "Details" };
_folderMenu = new string[] { "Open", "|", "Download", "|", "Details" };
_layoutMenu = new string[] { "SortBy", "|", "View", "|", "Refresh", "|", "Details", "|", "SelectAll" };
Field = "Shared";
break;
//Trash
case "4":
_toolItems = new string[] { "Delete", "SortBy", "Refresh", "Selection", "View", "Details" };
_toolItems.Clear();
_toolItemsIn = new string[] { "Delete", "SortBy", "Refresh", "Selection", "View", "Details" };
foreach (var item in _toolItemsIn)
{
_toolItems.Add(new ToolBarItemModel() { Name = item });
}
_fileMenu = new string[] { "Delete", "|", "Details", "|", "Restore", "EmptyTrash", "|", "SelectAll" };
_folderMenu = new string[] { "Download", "|", "Details", "|", "Restore", "EmptyTrash", "|", "SelectAll" };
_layoutMenu = new string[] { "SortBy", "View", "Refresh", "|", "Details", "SelectAll", "|", "Restore", "EmptyTrash" };
Expand All @@ -306,11 +412,16 @@
break;
//All Files
default:
_toolItems = new string[] {
_toolItems.Clear();
_toolItemsIn = new string[] {
#if !Publish
"Upload",
#endif
"Delete", "Download", "Rename", "SortBy", "Refresh", "Selection", "View", "Details" };
foreach (var item in _toolItemsIn)
{
_toolItems.Add(new ToolBarItemModel() { Name = item });
}
_fileMenu = new string[] { "Open", "|", "Delete", "Download", "Rename", "|", "Details" };
_folderMenu = new string[] { "Open", "|", "Delete", "Download", "Rename", "|", "Details" };
_layoutMenu = new string[] { "SortBy", "View", "Refresh", "|", "NewFolder",
Expand Down Expand Up @@ -369,6 +480,11 @@
break;
}
}

private void ToggleContent()
{
IsContentVisible = !IsContentVisible;
}
private async void NewClick()
{
await _fileManager.CreateFolderAsync();
Expand Down Expand Up @@ -407,7 +523,7 @@
isImageOpen = false;
}
}
private async void PopupOpened(PopupOpenCloseEventArgs args)

Check warning on line 526 in server/Pages/Index.razor

View workflow job for this annotation

GitHub Actions / build

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
// await JSRuntime.InvokeVoidAsync("setDialogDrag", args.Element.ID);
}
Expand All @@ -415,7 +531,7 @@
{
_dialogCount--;
}
private async void MenuOpen(MenuOpenEventArgs<FileManagerDirectoryContent> args)

Check warning on line 534 in server/Pages/Index.razor

View workflow job for this annotation

GitHub Actions / build

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{

if ((Field != "Shared") && (Field != "Trash"))
Expand All @@ -439,7 +555,7 @@
}
}
}
private async void MenuClick(MenuClickEventArgs<FileManagerDirectoryContent> args)

Check warning on line 558 in server/Pages/Index.razor

View workflow job for this annotation

GitHub Actions / build

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
if (args.Item.Id == _fileManager.ID + "_cm_restore")
{
Expand Down Expand Up @@ -564,7 +680,7 @@
else
{
//revertToIconPreview
var iconCss = "";

Check warning on line 683 in server/Pages/Index.razor

View workflow job for this annotation

GitHub Actions / build

The variable 'iconCss' is assigned but its value is never used
switch (fileDetails["type"])
{
case Constants.Docx:
Expand Down
2 changes: 1 addition & 1 deletion server/Pages/ZipViewer.razor
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
OverlayStyle = "overlayHide";
if (args.Action == "read")
{
string AjaxSettingsString = JsonConvert.SerializeObject(args.AjaxSettings);
string AjaxSettingsString = JsonConvert.SerializeObject(args.HttpClientInstance);
Dictionary<string, dynamic> AjaxSettings = JsonConvert.DeserializeObject<Dictionary<string, dynamic>>(AjaxSettingsString);
string dataString = AjaxSettings["data"];
Dictionary<string, dynamic> data = JsonConvert.DeserializeObject<Dictionary<string, dynamic>>(dataString);
Expand All @@ -107,7 +107,7 @@
//args.AjaxSettings = JsonConvert.DeserializeObject<object>(returnString);
}
}
private void FileOpen(Syncfusion.Blazor.FileManager.FileOpenEventArgs<FileManagerDirectoryContent?> args)

Check warning on line 110 in server/Pages/ZipViewer.razor

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.
{
string dataString = JsonConvert.SerializeObject(args.FileDetails);
Dictionary<string, dynamic> fileDetails = JsonConvert.DeserializeObject<Dictionary<string, dynamic>>(dataString);
Expand Down
Loading