webdav portal statistic added
This commit is contained in:
parent
a882072b02
commit
d82dfbfb56
11 changed files with 87 additions and 6 deletions
|
@ -17,8 +17,9 @@ namespace WebsitePanel.WebDav.Core
|
|||
DateTime CreationDate { get; }
|
||||
string CreatorDisplayName { get; }
|
||||
string DisplayName { get; }
|
||||
bool IsRootItem { get; set; }
|
||||
Uri Href { get; }
|
||||
ItemType ItemType { get; }
|
||||
ItemType ItemType { get;}
|
||||
DateTime LastModified { get; }
|
||||
Property[] Properties { get; }
|
||||
|
||||
|
@ -73,6 +74,8 @@ namespace WebsitePanel.WebDav.Core
|
|||
}
|
||||
}
|
||||
|
||||
public bool IsRootItem { get; set; }
|
||||
|
||||
public Uri Href
|
||||
{
|
||||
get { return _href; }
|
||||
|
|
|
@ -7,6 +7,7 @@ namespace WebsitePanel.WebDav.Core
|
|||
public interface IItemContent
|
||||
{
|
||||
long ContentLength { get; }
|
||||
long AllocatedSpace { get; set; }
|
||||
string ContentType { get; }
|
||||
|
||||
void Download(string filename);
|
||||
|
|
|
@ -64,6 +64,7 @@ namespace WebsitePanel.WebDav.Core
|
|||
public long ContentLength
|
||||
{
|
||||
get { return _contentLength; }
|
||||
set { _contentLength = value; }
|
||||
}
|
||||
|
||||
public string ContentType
|
||||
|
@ -250,14 +251,19 @@ namespace WebsitePanel.WebDav.Core
|
|||
}
|
||||
}
|
||||
|
||||
public long AllocatedSpace { get; set; }
|
||||
public bool IsRootItem { get; set; }
|
||||
|
||||
public Uri Href
|
||||
{
|
||||
get { return _href; }
|
||||
set { SetHref(value.ToString(), new Uri(value.Scheme + "://" + value.Host + value.Segments[0] + value.Segments[1])); }
|
||||
}
|
||||
|
||||
public ItemType ItemType
|
||||
{
|
||||
get { return _itemType; }
|
||||
set { _itemType = value; }
|
||||
}
|
||||
|
||||
public DateTime LastModified
|
||||
|
|
|
@ -42,7 +42,25 @@ namespace WebsitePanel.WebDav.Core.Managers
|
|||
|
||||
if (string.IsNullOrWhiteSpace(pathPart))
|
||||
{
|
||||
children = ConnectToWebDavServer().Select(x => new WebDavHierarchyItem { Href = new Uri(x.Url), ItemType = ItemType.Folder }).ToArray();
|
||||
var resources = ConnectToWebDavServer().Select(x => new WebDavResource { Href = new Uri(x.Url), ItemType = ItemType.Folder }).ToArray();
|
||||
|
||||
var items = WSP.Services.EnterpriseStorage.GetEnterpriseFolders(WspContext.User.ItemId);
|
||||
|
||||
foreach (var resource in resources)
|
||||
{
|
||||
var folder = items.FirstOrDefault(x => x.Name == resource.DisplayName);
|
||||
|
||||
if (folder == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
resource.ContentLength = folder.Size;
|
||||
resource.AllocatedSpace = folder.FRSMQuotaMB;
|
||||
resource.IsRootItem = true;
|
||||
}
|
||||
|
||||
children = resources;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue