webdav portal web.config file added to ignore
This commit is contained in:
parent
ef0115a1ab
commit
2ec10f6988
4 changed files with 17 additions and 3 deletions
|
@ -1,14 +1,19 @@
|
|||
namespace WebsitePanel.WebDavPortal.Config.Entities
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace WebsitePanel.WebDavPortal.Config.Entities
|
||||
{
|
||||
public class ElementsRendering : AbstractConfigCollection
|
||||
{
|
||||
public int DefaultCount { get; private set; }
|
||||
public int AddElementsCount { get; private set; }
|
||||
public List<string> ElementsToIgnore { get; private set; }
|
||||
|
||||
public ElementsRendering()
|
||||
{
|
||||
DefaultCount = ConfigSection.ElementsRendering.DefaultCount;
|
||||
AddElementsCount = ConfigSection.ElementsRendering.AddElementsCount;
|
||||
ElementsToIgnore = ConfigSection.ElementsRendering.ElementsToIgnore.Split(',').ToList();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -41,7 +41,8 @@ namespace WebsitePanel.WebDavPortal.Controllers
|
|||
try
|
||||
{
|
||||
webDavManager.OpenFolder(pathPart);
|
||||
IEnumerable<IHierarchyItem> children = webDavManager.GetChildren();
|
||||
IEnumerable<IHierarchyItem> children = webDavManager.GetChildren().Where(x => !WebDavAppConfigManager.Instance.ElementsRendering.ElementsToIgnore.Contains(x.DisplayName.Trim('/')));
|
||||
|
||||
var model = new ModelForWebDav { Items = children.Take(WebDavAppConfigManager.Instance.ElementsRendering.DefaultCount), UrlSuffix = pathPart };
|
||||
Session[WebDavAppConfigManager.Instance.SessionKeys.ResourseRenderCount] = WebDavAppConfigManager.Instance.ElementsRendering.DefaultCount;
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<webDavExplorerConfigurationSettings>
|
||||
<!--<userDomain value=""/>-->
|
||||
<applicationName value="WebDAV Explorer"/>
|
||||
<elementsRendering defaultCount="20" addElementsCount="20"/>
|
||||
<elementsRendering defaultCount="20" addElementsCount="20" elementsToIgnoreKey="web.config"/>
|
||||
<websitePanelConstantUser login="serveradmin" password="HtR7J8dtBhovYLigXNtVutxqpvaE48Z+FBIokWZlR/g=" />
|
||||
<sessionKeys>
|
||||
<add key="AccountInfoSessionKey" value="AccountInfo"/>
|
||||
|
|
|
@ -6,6 +6,7 @@ namespace WebsitePanel.WebDavPortal.WebConfigSections
|
|||
{
|
||||
private const string DefaultCountKey = "defaultCount";
|
||||
private const string AddElementsCountKey = "addElementsCount";
|
||||
private const string ElementsToIgnoreKey = "elementsToIgnoreKey";
|
||||
|
||||
[ConfigurationProperty(DefaultCountKey, IsKey = true, IsRequired = true, DefaultValue = 30)]
|
||||
public int DefaultCount
|
||||
|
@ -20,5 +21,12 @@ namespace WebsitePanel.WebDavPortal.WebConfigSections
|
|||
get { return (int)this[AddElementsCountKey]; }
|
||||
set { this[AddElementsCountKey] = value; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty(ElementsToIgnoreKey, IsKey = true, IsRequired = true, DefaultValue = "")]
|
||||
public string ElementsToIgnore
|
||||
{
|
||||
get { return (string)this[ElementsToIgnoreKey]; }
|
||||
set { this[ElementsToIgnoreKey] = value; }
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue